diff options
author | kondou <kondou@ts.unde.re> | 2013-04-17 15:32:03 +0200 |
---|---|---|
committer | kondou <kondou@ts.unde.re> | 2013-07-21 13:55:25 +0200 |
commit | 05084e03a08206b736abd04522e10c97cd3f2fc3 (patch) | |
tree | 1352f5011a523db520ee0e899db8426ecc3fc68f /settings/js | |
parent | 94fcbc736e3500e0107d8e4f1ce5a2133fcdd8d8 (diff) | |
download | nextcloud-server-05084e03a08206b736abd04522e10c97cd3f2fc3.tar.gz nextcloud-server-05084e03a08206b736abd04522e10c97cd3f2fc3.zip |
Use !== and === in settings.
Diffstat (limited to 'settings/js')
-rw-r--r-- | settings/js/admin.js | 4 | ||||
-rw-r--r-- | settings/js/apps.js | 12 | ||||
-rw-r--r-- | settings/js/log.js | 2 | ||||
-rw-r--r-- | settings/js/users.js | 38 |
4 files changed, 28 insertions, 28 deletions
diff --git a/settings/js/admin.js b/settings/js/admin.js index ab218377fb3..f2d6f37a51a 100644 --- a/settings/js/admin.js +++ b/settings/js/admin.js @@ -8,7 +8,7 @@ $(document).ready(function(){ $('#backgroundjobs input').change(function(){ if($(this).attr('checked')){ var mode = $(this).val(); - if (mode == 'ajax' || mode == 'webcron' || mode == 'cron') { + if (mode === 'ajax' || mode === 'webcron' || mode === 'cron') { OC.AppConfig.setValue('core', 'backgroundjobs_mode', mode); } } @@ -19,7 +19,7 @@ $(document).ready(function(){ }); $('#shareAPI input').change(function() { - if ($(this).attr('type') == 'checkbox') { + if ($(this).attr('type') === 'checkbox') { if (this.checked) { var value = 'yes'; } else { diff --git a/settings/js/apps.js b/settings/js/apps.js index 1ee3372f893..0540d9b1c58 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -29,7 +29,7 @@ OC.Settings.Apps = OC.Settings.Apps || { page.find('span.author').text(app.author); page.find('span.licence').text(app.licence); - if (app.update != false) { + if (app.update !== false) { page.find('input.update').show(); page.find('input.update').data('appid', app.id); page.find('input.update').attr('value',t('settings', 'Update to {appversion}', {appversion:app.update})); @@ -41,7 +41,7 @@ OC.Settings.Apps = OC.Settings.Apps || { page.find('input.enable').val((app.active) ? t('settings', 'Disable') : t('settings', 'Enable')); page.find('input.enable').data('appid', app.id); page.find('input.enable').data('active', app.active); - if (app.internal == false) { + if (app.internal === false) { page.find('span.score').show(); page.find('p.appslink').show(); page.find('a').attr('href', 'http://apps.owncloud.com/content/show.php?content=' + app.id); @@ -60,7 +60,7 @@ OC.Settings.Apps = OC.Settings.Apps || { element.val(t('settings','Please wait....')); if(active) { $.post(OC.filePath('settings','ajax','disableapp.php'),{appid:appid},function(result) { - if(!result || result.status!='success') { + if(!result || result.status !== 'success') { OC.dialogs.alert('Error while disabling app', t('core', 'Error')); } else { @@ -72,7 +72,7 @@ OC.Settings.Apps = OC.Settings.Apps || { $('#leftcontent li[data-id="'+appid+'"]').removeClass('active'); } else { $.post(OC.filePath('settings','ajax','enableapp.php'),{appid:appid},function(result) { - if(!result || result.status!='success') { + if(!result || result.status !== 'success') { OC.dialogs.alert('Error while enabling app', t('core', 'Error')); } else { @@ -94,7 +94,7 @@ OC.Settings.Apps = OC.Settings.Apps || { console.log('updateApp:', appid, element); element.val(t('settings','Updating....')); $.post(OC.filePath('settings','ajax','updateapp.php'),{appid:appid},function(result) { - if(!result || result.status!='success') { + if(!result || result.status !== 'success') { OC.dialogs.alert(t('settings','Error while updating app'),t('settings','Error')); } else { @@ -171,7 +171,7 @@ $(document).ready(function(){ $(this).find('span.hidden').remove(); }); $('#leftcontent li').keydown(function(event) { - if (event.which == 13 || event.which == 32) { + if (event.which === 13 || event.which === 32) { $(event.target).click(); } return false; diff --git a/settings/js/log.js b/settings/js/log.js index 84f6d1aa5f3..1ef9b419cdb 100644 --- a/settings/js/log.js +++ b/settings/js/log.js @@ -19,7 +19,7 @@ OC.Log={ getMore:function(count){ count = count || 10; $.get(OC.filePath('settings','ajax','getlog.php'),{offset:OC.Log.loaded,count:count},function(result){ - if(result.status=='success'){ + if(result.status === 'success'){ OC.Log.addEntries(result.data); if(!result.remain){ $('#moreLog').hide(); diff --git a/settings/js/users.js b/settings/js/users.js index 5d890db65b8..6a8afc4ca36 100644 --- a/settings/js/users.js +++ b/settings/js/users.js @@ -67,7 +67,7 @@ var UserList = { async: false, data: { username: UserList.deleteUid }, success: function (result) { - if (result.status == 'success') { + if (result.status === 'success') { // Remove undo option, & remove user from table OC.Notification.hide(); $('tr').filterAttr('data-uid', UserList.deleteUid).remove(); @@ -97,7 +97,7 @@ var UserList = { } $.each(this.availableGroups, function (i, group) { groupsSelect.append($('<option value="' + escapeHTML(group) + '">' + escapeHTML(group) + '</option>')); - if (typeof subadminSelect !== 'undefined' && group != 'admin') { + if (typeof subadminSelect !== 'undefined' && group !== 'admin') { subadminSelect.append($('<option value="' + escapeHTML(group) + '">' + escapeHTML(group) + '</option>')); } }); @@ -107,7 +107,7 @@ var UserList = { tr.find('td.subadmins').append(subadminSelect); UserList.applyMultiplySelect(subadminSelect); } - if (tr.find('td.remove img').length == 0 && OC.currentUser != username) { + if (tr.find('td.remove img').length === 0 && OC.currentUser !== username) { var rm_img = $('<img class="svg action">').attr({ src: OC.imagePath('core', 'actions/delete') }); @@ -115,11 +115,11 @@ var UserList = { .attr({ href: '#', 'original-title': t('settings', 'Delete')}) .append(rm_img); tr.find('td.remove').append(rm_link); - } else if (OC.currentUser == username) { + } else if (OC.currentUser === username) { tr.find('td.remove a').remove(); } var quotaSelect = tr.find('select.quota-user'); - if (quota == 'default') { + if (quota === 'default') { quotaSelect.find('option').attr('selected', null); quotaSelect.find('option').first().attr('selected', 'selected'); quotaSelect.data('previous', 'default'); @@ -148,7 +148,7 @@ var UserList = { var tz = [], x = 0, y = -1, n = 0, i, j; while (i = (j = t.charAt(x++)).charCodeAt(0)) { - var m = (i == 46 || (i >=48 && i <= 57)); + var m = (i === 46 || (i >=48 && i <= 57)); if (m !== n) { tz[++y] = ""; n = m; @@ -164,7 +164,7 @@ var UserList = { for (x = 0; aa[x] && bb[x]; x++) { if (aa[x] !== bb[x]) { var c = Number(aa[x]), d = Number(bb[x]); - if (c == aa[x] && d == bb[x]) { + if (c === aa[x] && d === bb[x]) { return c - d; } else return (aa[x] > bb[x]) ? 1 : -1; } @@ -207,7 +207,7 @@ var UserList = { return true; } var tr = UserList.add(user.name, user.displayname, user.groups, user.subadmin, user.quota, false); - if (index == 9) { + if (index === 9) { $(tr).bind('inview', function (event, isInView, visiblePartX, visiblePartY) { $(this).unbind(event); UserList.update(); @@ -225,16 +225,16 @@ var UserList = { applyMultiplySelect: function (element) { var checked = []; var user = element.attr('data-username'); - if ($(element).attr('class') == 'groupsselect') { + if ($(element).attr('class') === 'groupsselect') { if (element.data('userGroups')) { checked = String(element.data('userGroups')).split(', '); } if (user) { var checkHandeler = function (group) { - if (user == OC.currentUser && group == 'admin') { + if (user === OC.currentUser && group === 'admin') { return false; } - if (!isadmin && checked.length == 1 && checked[0] == group) { + if (!isadmin && checked.length === 1 && checked[0] === group) { return false; } $.post( @@ -280,12 +280,12 @@ var UserList = { minWidth: 100 }); } - if ($(element).attr('class') == 'subadminsselect') { + if ($(element).attr('class') === 'subadminsselect') { if (element.data('subadmin')) { checked = String(element.data('subadmin')).split(', '); } var checkHandeler = function (group) { - if (group == 'admin') { + if (group === 'admin') { return false; } $.post( @@ -301,7 +301,7 @@ var UserList = { var addSubAdmin = function (group) { $('select[multiple]').each(function (index, element) { - if ($(element).find('option[value="' + group + '"]').length == 0) { + if ($(element).find('option[value="' + group + '"]').length === 0) { $(element).append('<option value="' + escapeHTML(group) + '">' + escapeHTML(group) + '</option>'); } }) @@ -349,7 +349,7 @@ $(document).ready(function () { img.parent().children('span').replaceWith(input); input.focus(); input.keypress(function (event) { - if (event.keyCode == 13) { + if (event.keyCode === 13) { if ($(this).val().length > 0) { var recoveryPasswordVal = $('input:password[id="recoveryPassword"]').val(); $.post( @@ -390,7 +390,7 @@ $(document).ready(function () { img.parent().children('span').replaceWith(input); input.focus(); input.keypress(function (event) { - if (event.keyCode == 13) { + if (event.keyCode === 13) { if ($(this).val().length > 0) { $.post( OC.filePath('settings', 'ajax', 'changedisplayname.php'), @@ -423,13 +423,13 @@ $(document).ready(function () { event.preventDefault(); var username = $('#newusername').val(); var password = $('#newuserpassword').val(); - if ($.trim(username) == '') { + if ($.trim(username) === '') { OC.dialogs.alert( t('settings', 'A valid username must be provided'), t('settings', 'Error creating user')); return false; } - if ($.trim(password) == '') { + if ($.trim(password) === '') { OC.dialogs.alert( t('settings', 'A valid password must be provided'), t('settings', 'Error creating user')); @@ -445,7 +445,7 @@ $(document).ready(function () { groups: groups }, function (result) { - if (result.status != 'success') { + if (result.status !== 'success') { OC.dialogs.alert(result.data.message, t('settings', 'Error creating user')); } else { |