Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
Fix various ESLint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Snape committed Oct 12, 2015
1 parent 19655c2 commit 02e0bbb
Show file tree
Hide file tree
Showing 73 changed files with 646 additions and 685 deletions.
50 changes: 25 additions & 25 deletions core/public/js/admin/admin.index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ midas.admin.initModulesConfigLinks = function () {
/** On assetstore add response */
midas.admin.assetstoreAddCallback = function (responseText, statusText, xhr, $form) {
'use strict';
$(".assetstoreLoading").hide();
$('.assetstoreLoading').hide();
if (responseText.error) {
$(".addAssetstoreFormError").html('Error: ' + responseText.error).show();
$('.addAssetstoreFormError').html('Error: ' + responseText.error).show();
}
else if (responseText.msg) {
$(document).trigger('hideCluetip');
Expand All @@ -41,25 +41,25 @@ midas.admin.assetstoreSubmit = function (formData, jqForm, options) {
// Add the type is the one in the main page (because it's hidden in the assetstore add page)
var assetstoretype = {};
assetstoretype.name = 'type';
assetstoretype.value = $("#importassetstoretype").val();
assetstoretype.value = $('#importassetstoretype').val();
formData.push(assetstoretype);
$(".assetstoreLoading").show();
$(".addAssetstoreFormError").html('').hide();
$('.assetstoreLoading').show();
$('.addAssetstoreFormError').html('').hide();
}; // end assetstoreBeforeSubmit

/** When the cancel is clicked in the new assetstore window */
midas.admin.newAssetstoreShow = function () {
'use strict';
var assetstoretype = $('select#importassetstoretype option:selected').val();
$('#assetstoretype').find('option:selected').removeAttr("selected");
$('#assetstoretype').find('option[value=' + assetstoretype + ']').attr("selected", "selected");
$('#assetstoretype').find('option:selected').removeAttr('selected');
$('#assetstoretype').find('option[value=' + assetstoretype + ']').attr('selected', 'selected');
}; // end function newAssetstoreShow

/** When the cancel is clicked in the new assetstore window */
midas.admin.newAssetstoreHide = function () {
'use strict';
$(document).trigger('hideCluetip');
}; // end function newAssetstoreHide
};

midas.admin.validateConfig = function (formData, jqForm, options) {};

Expand All @@ -70,7 +70,7 @@ midas.admin.successConfig = function (responseText, statusText, xhr, form) {
jsonResponse = $.parseJSON(responseText);
}
catch (e) {
midas.createNotice("An error occured. Please check the logs.", 4000, 'error');
midas.createNotice('An error occured. Please check the logs.', 4000, 'error');
return false;
}
if (jsonResponse === null) {
Expand All @@ -87,15 +87,15 @@ midas.admin.successConfig = function (responseText, statusText, xhr, form) {

$(document).ready(function () {
'use strict';
midas.admin.tabs = $("#tabsGeneric").tabs({});
$("#tabsGeneric").show();
midas.admin.tabs = $('#tabsGeneric').tabs({});
$('#tabsGeneric').show();
$('img.tabsLoading').hide();

$('.defaultAssetstoreLink').click(function () {
$.post(json.global.webroot + '/assetstore/defaultassetstore', {
submitDefaultAssetstore: true,
element: $(this).attr('element')
},
submitDefaultAssetstore: true,
element: $(this).attr('element')
},
function (data) {
var jsonResponse = $.parseJSON(data);
if (jsonResponse === null) {
Expand Down Expand Up @@ -126,9 +126,9 @@ $(document).ready(function () {
midas.showDialogWithContent('Remove Assetstore', html, false);

$('input.deleteAssetstoreYes').unbind('click').click(function () {
$("div.MainDialog").dialog('close');
$('div.MainDialog').dialog('close');
midas.ajaxSelectRequest = $.ajax({
type: "POST",
type: 'POST',
url: json.global.webroot + '/assetstore/delete',
data: {
assetstoreId: element
Expand All @@ -144,7 +144,7 @@ $(document).ready(function () {
});
});
$('input.deleteAssetstoreNo').unbind('click').click(function () {
$("div.MainDialog").dialog('close');
$('div.MainDialog').dialog('close');
});
});

Expand All @@ -163,7 +163,7 @@ $(document).ready(function () {

$('input#assetstoreSubmit').unbind('click').click(function () {
midas.ajaxSelectRequest = $.ajax({
type: "POST",
type: 'POST',
url: json.global.webroot + '/assetstore/edit',
data: {
assetstoreId: element,
Expand All @@ -184,7 +184,7 @@ $(document).ready(function () {
});
});
$('input.deleteAssetstoreNo').unbind('click').click(function () {
$("div.MainDialog").dialog('close');
$('div.MainDialog').dialog('close');
});
});

Expand Down Expand Up @@ -224,7 +224,7 @@ $(document).ready(function () {
modulename: l,
modulevalue: modulevalue
});
midas.createNotice("Dependancy: Enabling module " + l, 1500);
midas.createNotice('Dependancy: Enabling module ' + l, 1500);
}
$('input[module=' + l + ']').attr('checked', true);
}
Expand All @@ -248,7 +248,7 @@ $(document).ready(function () {
$.each(moduleDependencies, function (i, l) {
if (l != '') {
found = true;
midas.createNotice("Dependency: The module " + l + " requires " + mainModule + ". You must disable it first.", 4000, 'warning');
midas.createNotice('Dependency: The module ' + l + ' requires ' + mainModule + '. You must disable it first.', 4000, 'warning');
}
});
if (found) {
Expand All @@ -258,10 +258,10 @@ $(document).ready(function () {
}

$.post(json.global.webroot + '/admin/index', {
submitModule: true,
modulename: $(this).attr('module'),
modulevalue: modulevalue
},
submitModule: true,
modulename: $(this).attr('module'),
modulevalue: modulevalue
},
function (data) {
var jsonResponse = $.parseJSON(data);
if (jsonResponse === null) {
Expand Down
26 changes: 13 additions & 13 deletions core/public/js/admin/admin.migrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ function startMigrate() {
function migrateCallback(responseText, statusText, xhr, form) {
'use strict';
if (responseText.error) {
$(".viewNotice").html(responseText.error);
$(".viewNotice").fadeIn(100).delay(2000).fadeOut(300);
$('.viewNotice').html(responseText.error);
$('.viewNotice').fadeIn(100).delay(2000).fadeOut(300);
}
else if (responseText.message) {
$(".viewNotice").html(responseText.message);
$(".viewNotice").fadeIn(100).delay(2000).fadeOut(300);
$('.viewNotice').html(responseText.message);
$('.viewNotice').fadeIn(100).delay(2000).fadeOut(300);
}
}

Expand All @@ -55,26 +55,26 @@ function assetstoreSubmit(formData, jqForm, options) {
// Add the type is the one in the main page (because it's hidden in the assetstore add page)
var assetstoretype = {};
assetstoretype.name = 'type';
assetstoretype.value = $("#importassetstoretype").val();
assetstoretype.value = $('#importassetstoretype').val();
formData.push(assetstoretype);
$(".assetstoreLoading").show();
$('.assetstoreLoading').show();
} // end assetstoreBeforeSubmit

/** On assetstore add success */
function assetstoreAddCallback(responseText, statusText, xhr, $form) {
'use strict';
$(".assetstoreLoading").hide();
$('.assetstoreLoading').hide();
if (responseText.error) {
$(".viewNotice").html(responseText.error);
$(".viewNotice").fadeIn(100).delay(2000).fadeOut(100);
$('.viewNotice').html(responseText.error);
$('.viewNotice').fadeIn(100).delay(2000).fadeOut(100);
}
else if (responseText.msg) {
$(document).trigger('hideCluetip');

// It worked, we add the assetstore to the list and we select it by default
if (responseText.assetstore_id) {
$("#assetstore").append($("<option></option>").attr("value", responseText.assetstore_id).text(responseText.assetstore_name)
.attr("selected", "selected"));
$('#assetstore').append($('<option></option>').attr('value', responseText.assetstore_id).text(responseText.assetstore_name)
.attr('selected', 'selected'));

// Add to JSON
var newassetstore = {};
Expand All @@ -84,8 +84,8 @@ function assetstoreAddCallback(responseText, statusText, xhr, $form) {
assetstores.push(newassetstore);
}

$(".viewNotice").html(responseText.msg);
$(".viewNotice").fadeIn(100).delay(2000).fadeOut(100);
$('.viewNotice').html(responseText.msg);
$('.viewNotice').fadeIn(100).delay(2000).fadeOut(100);
}
} // end assetstoreAddCallback

Expand Down
6 changes: 2 additions & 4 deletions core/public/js/admin/admin.upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ $('#upgradeMIDAS').ajaxForm({
success: successUpgrade
});

function validateUpgrade(formData, jqForm, options) {

}
function validateUpgrade(formData, jqForm, options) {}

function successUpgrade(responseText, statusText, xhr, form) {
'use strict';
var jsonResponse;
try {
jsonResponse = $.parseJSON(responseText);
} catch (e) {
alert("An error occured. Please check the logs.");
alert('An error occured. Please check the logs.');
return false;
}
if (jsonResponse === null) {
Expand Down
10 changes: 5 additions & 5 deletions core/public/js/apikey/apikey.usertab.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ midas.apikey.successApiConfig = function (responseText, statusText, xhr, form) {
jsonResponse = $.parseJSON(responseText);
}
catch (e) {
midas.createNotice("An error occured. Please check the logs.", 4000, 'error');
midas.createNotice('An error occured. Please check the logs.', 4000, 'error');
return false;
}
if (jsonResponse === null) {
Expand All @@ -40,10 +40,10 @@ $(document).ready(function () {
$('a.deleteApiKeyLink').click(function () {
var obj = $(this);
$.post(json.global.webroot + '/apikey/usertab', {
deleteAPIKey: true,
element: $(this).attr('element'),
userId: $('#apiUserId').val()
},
deleteAPIKey: true,
element: $(this).attr('element'),
userId: $('#apiUserId').val()
},
function (data) {
var jsonResponse = $.parseJSON(data);
if (jsonResponse === null) {
Expand Down
16 changes: 8 additions & 8 deletions core/public/js/browse/browse.index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@ var midas = midas || {};
$(document).ready(
function () {
'use strict';
$("#browseTable").treeTable();
$("img.tableLoading").hide();
$("table#browseTable").show();
$('#browseTable').treeTable();
$('img.tableLoading').hide();
$('table#browseTable').show();

$('div.feedThumbnail img').fadeTo("slow", 0.4);
$('div.feedThumbnail img').fadeTo('slow', 0.4);
$('div.feedThumbnail img').mouseover(
function () {
$(this).fadeTo("fast", 1);
$(this).fadeTo('fast', 1);
});

$('div.feedThumbnail img').mouseout(
function () {
$(this).fadeTo("fast", 0.4);
$(this).fadeTo('fast', 0.4);
});

$('a.createCommunity').click(
function () {
if (json.global.logged) {
midas.loadDialog("createCommunity", "/community/create");
midas.loadDialog('createCommunity', '/community/create');
midas.showDialog(json.community.createCommunity, false);
}
else {
midas.createNotice(json.community.contentCreateLogin, 4000);
$("div.TopDynamicBar").show('blind');
$('div.TopDynamicBar').show('blind');
midas.loadAjaxDynamicBar('login', '/user/login');
}
});
Expand Down
19 changes: 10 additions & 9 deletions core/public/js/browse/browse.movecopy.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ midas.browse.moveCopyCallbackSelect = function (node) {
parent = null;
var classNames = current[0].className.split(' ');
for (var key in classNames) {
if (classNames[key].match("child-of-")) {
parent = $("#moveCopyTable #" + classNames[key].substring(9));
if (classNames[key].match('child-of-')) {
parent = $('#moveCopyTable #' + classNames[key].substring(9));
}
}
if (parent !== null) {
Expand All @@ -39,6 +39,7 @@ midas.browse.moveCopyCallbackSelect = function (node) {
id: node.attr('element')
};
$.post(json.global.webroot + '/browse/getmaxpolicy', params, function (retVal) {
'use strict';
var resp = $.parseJSON(retVal);
node.attr('policy', resp.policy);
midas.browse.checkMoveDestinationValid(node, resp.policy);
Expand Down Expand Up @@ -85,9 +86,9 @@ midas.browse.moveCopyCallbackCustomElements = function (node, elements, first) {
var padding = parseInt(node.find('td:first').css('padding-left').slice(0, -2));
var html = '';
$.each(elements.folders, function (index, value) {
html += "<tr id='" + id + "-" + i + "' class='parent child-of-" + id + "' ajax='" + value.folder_id + "'type='folder' element='" + value.folder_id + "'>";
html += " <td><span class='folder'>" + trimName(value.name, padding) + "</span></td>";
html += "</tr>";
html += '<tr id="' + id + '-' + i + '" class="parent child-of-' + id + '" ajax="' + value.folder_id + '"type="folder" element="' + value.folder_id + '">';
html += ' <td><span class="folder">' + trimName(value.name, padding) + '</span></td>';
html += '</tr>';
i++;
});
return html;
Expand All @@ -100,15 +101,15 @@ $(document).ready(function () {
return true;
});

$("#moveCopyTable").treeTable({
$('#moveCopyTable').treeTable({
callbackSelect: midas.browse.moveCopyCallbackSelect,
callbackCheckboxes: midas.browse.moveCopyCallbackCheckboxes,
callbackDblClick: midas.browse.moveCopyCallbackDblClick,
callbackCustomElements: midas.browse.moveCopyCallbackCustomElements,
pageLength: 99999 // do not page this table (preserves old functionality)
});
$("img.tableLoading").hide();
$("table#moveCopyTable").show();
$('img.tableLoading').hide();
$('table#moveCopyTable').show();

$('.uploadApplet').hide();

Expand All @@ -120,7 +121,7 @@ $(document).ready(function () {
$('#destinationId').val(destValue);
$('.destinationUpload').html(destHtml);
$('.destinationId').val(destValue);
$("div.MainDialog").dialog('close');
$('div.MainDialog').dialog('close');
$('.uploadApplet').show();
return false;
});
Expand Down
Loading

0 comments on commit 02e0bbb

Please sign in to comment.