diff --git a/.eslintrc b/.eslintrc index 023667f42e..abfaa76baf 100644 --- a/.eslintrc +++ b/.eslintrc @@ -98,7 +98,7 @@ "strict": "off", // "comma-dangle": "off", // "no-multi-spaces": "off", - "quotes": "off", + // "quotes": "off", // "keyword-spacing": "off", // "no-mixed-operators": "off", // "comma-spacing": "off", diff --git a/Gruntfile.js b/Gruntfile.js index 2e221df277..5e498affdb 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var fork = require('child_process').fork; var env = process.env; diff --git a/app.js b/app.js index 3cdd03b50c..31ae60bccf 100644 --- a/app.js +++ b/app.js @@ -17,7 +17,7 @@ along with this program. If not, see . */ -"use strict"; +'use strict'; var nconf = require('nconf'); nconf.argv().env('__'); diff --git a/install/databases.js b/install/databases.js index 08f5a2bafb..2540884096 100644 --- a/install/databases.js +++ b/install/databases.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var prompt = require('prompt'); diff --git a/install/web.js b/install/web.js index 1d5a755785..d1df6faae3 100644 --- a/install/web.js +++ b/install/web.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var winston = require('winston'); var express = require('express'); diff --git a/minifier.js b/minifier.js index 77b0151e02..d0e92752ca 100644 --- a/minifier.js +++ b/minifier.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var uglifyjs = require('uglify-js'); var async = require('async'); diff --git a/public/src/admin/admin.js b/public/src/admin/admin.js index 36fbb692f6..93b7755ac6 100644 --- a/public/src/admin/admin.js +++ b/public/src/admin/admin.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; (function () { var logoutTimer = 0; @@ -157,7 +157,7 @@ } function launchSnackbar(params) { - var message = (params.title ? "" + params.title + "" : '') + (params.message ? params.message : ''); + var message = (params.title ? '' + params.title + '' : '') + (params.message ? params.message : ''); require(['translator'], function (translator) { translator.translate(message, function (html) { diff --git a/public/src/admin/advanced/errors.js b/public/src/admin/advanced/errors.js index e8ec4b6acb..9113939b2a 100644 --- a/public/src/admin/advanced/errors.js +++ b/public/src/admin/advanced/errors.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/advanced/errors', ['Chart', 'translator'], function (Chart, translator) { @@ -41,13 +41,13 @@ define('admin/advanced/errors', ['Chart', 'translator'], function (Chart, transl labels: dailyLabels, datasets: [ { - label: "", - backgroundColor: "rgba(186,139,175,0.2)", - borderColor: "rgba(186,139,175,1)", - pointBackgroundColor: "rgba(186,139,175,1)", - pointHoverBackgroundColor: "#fff", - pointBorderColor: "#fff", - pointHoverBorderColor: "rgba(186,139,175,1)", + label: '', + backgroundColor: 'rgba(186,139,175,0.2)', + borderColor: 'rgba(186,139,175,1)', + pointBackgroundColor: 'rgba(186,139,175,1)', + pointHoverBackgroundColor: '#fff', + pointBorderColor: '#fff', + pointHoverBorderColor: 'rgba(186,139,175,1)', data: ajaxify.data.analytics['not-found'], }, ], @@ -56,13 +56,13 @@ define('admin/advanced/errors', ['Chart', 'translator'], function (Chart, transl labels: dailyLabels, datasets: [ { - label: "", - backgroundColor: "rgba(151,187,205,0.2)", - borderColor: "rgba(151,187,205,1)", - pointBackgroundColor: "rgba(151,187,205,1)", - pointHoverBackgroundColor: "#fff", - pointBorderColor: "#fff", - pointHoverBorderColor: "rgba(151,187,205,1)", + label: '', + backgroundColor: 'rgba(151,187,205,0.2)', + borderColor: 'rgba(151,187,205,1)', + pointBackgroundColor: 'rgba(151,187,205,1)', + pointHoverBackgroundColor: '#fff', + pointBorderColor: '#fff', + pointHoverBorderColor: 'rgba(151,187,205,1)', data: ajaxify.data.analytics.toobusy, }, ], diff --git a/public/src/admin/advanced/events.js b/public/src/admin/advanced/events.js index c1ad423ed8..92f660f707 100644 --- a/public/src/admin/advanced/events.js +++ b/public/src/admin/advanced/events.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/advanced/events', function () { diff --git a/public/src/admin/advanced/logs.js b/public/src/admin/advanced/logs.js index 478544b271..c0e9fee0f0 100644 --- a/public/src/admin/advanced/logs.js +++ b/public/src/admin/advanced/logs.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/advanced/logs', function () { diff --git a/public/src/admin/appearance/customise.js b/public/src/admin/appearance/customise.js index eeb8f7c518..026de7c204 100644 --- a/public/src/admin/appearance/customise.js +++ b/public/src/admin/appearance/customise.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/appearance/customise', ['admin/settings'], function (Settings) { @@ -9,11 +9,11 @@ define('admin/appearance/customise', ['admin/settings'], function (Settings) { $('#customCSS').text($('#customCSS-holder').val()); $('#customHTML').text($('#customHTML-holder').val()); - var customCSS = ace.edit("customCSS"); - var customHTML = ace.edit("customHTML"); + var customCSS = ace.edit('customCSS'); + var customHTML = ace.edit('customHTML'); - customCSS.setTheme("ace/theme/twilight"); - customCSS.getSession().setMode("ace/mode/css"); + customCSS.setTheme('ace/theme/twilight'); + customCSS.getSession().setMode('ace/mode/css'); customCSS.on('change', function (event) { app.flags = app.flags || {}; @@ -21,8 +21,8 @@ define('admin/appearance/customise', ['admin/settings'], function (Settings) { $('#customCSS-holder').val(customCSS.getValue()); }); - customHTML.setTheme("ace/theme/twilight"); - customHTML.getSession().setMode("ace/mode/html"); + customHTML.setTheme('ace/theme/twilight'); + customHTML.getSession().setMode('ace/mode/html'); customHTML.on('change', function (event) { app.flags = app.flags || {}; diff --git a/public/src/admin/appearance/skins.js b/public/src/admin/appearance/skins.js index d6cc31ea8a..f234cac414 100644 --- a/public/src/admin/appearance/skins.js +++ b/public/src/admin/appearance/skins.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/appearance/skins', ['translator'], function (translator) { diff --git a/public/src/admin/appearance/themes.js b/public/src/admin/appearance/themes.js index 434deb4cd2..95c3f896f0 100644 --- a/public/src/admin/appearance/themes.js +++ b/public/src/admin/appearance/themes.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/appearance/themes', ['translator'], function (translator) { diff --git a/public/src/admin/extend/plugins.js b/public/src/admin/extend/plugins.js index df43edf5f7..6d0a1b7de9 100644 --- a/public/src/admin/extend/plugins.js +++ b/public/src/admin/extend/plugins.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/extend/plugins', ['jqueryui', 'translator'], function (jqueryui, translator) { diff --git a/public/src/admin/extend/rewards.js b/public/src/admin/extend/rewards.js index 50b2adebf0..a605b87186 100644 --- a/public/src/admin/extend/rewards.js +++ b/public/src/admin/extend/rewards.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/extend/rewards', ['translator'], function (translator) { diff --git a/public/src/admin/extend/widgets.js b/public/src/admin/extend/widgets.js index 6923b0437d..d4356a1cb4 100644 --- a/public/src/admin/extend/widgets.js +++ b/public/src/admin/extend/widgets.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/extend/widgets', ['jqueryui'], function (jqueryui) { @@ -35,7 +35,7 @@ define('admin/extend/widgets', ['jqueryui'], function (jqueryui) { return $(e.target).parents('.widget-panel').clone(); }, distance: 10, - connectToSortable: ".widget-area", + connectToSortable: '.widget-area', }); $('#widgets .available-containers .containers > [data-container-html]') @@ -57,7 +57,7 @@ define('admin/extend/widgets', ['jqueryui'], function (jqueryui) { createDatePicker(ui.item); appendToggle(ui.item); }, - connectWith: "div", + connectWith: 'div', }).on('click', '.delete-widget', function () { var panel = $(this).parents('.widget-panel'); @@ -177,7 +177,7 @@ define('admin/extend/widgets', ['jqueryui'], function (jqueryui) { el.find('.panel-body .container-html').val(ui.draggable.attr('data-container-html')); el.find('.panel-body').removeClass('hidden'); }, - hoverClass: "panel-info", + hoverClass: 'panel-info', }) .children('.panel-heading') .append('
 
') diff --git a/public/src/admin/general/dashboard.js b/public/src/admin/general/dashboard.js index e01964b253..a6600ce93a 100644 --- a/public/src/admin/general/dashboard.js +++ b/public/src/admin/general/dashboard.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/general/dashboard', ['semver', 'Chart', 'translator'], function (semver, Chart, translator) { @@ -126,14 +126,14 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator'], function (s topics: null, }; - var topicColors = ["#bf616a", "#5B90BF", "#d08770", "#ebcb8b", "#a3be8c", "#96b5b4", "#8fa1b3", "#b48ead", "#ab7967", "#46BFBD"]; + var topicColors = ['#bf616a', '#5B90BF', '#d08770', '#ebcb8b', '#a3be8c', '#96b5b4', '#8fa1b3', '#b48ead', '#ab7967', '#46BFBD']; var usedTopicColors = []; // from chartjs.org function lighten(col, amt) { var usePound = false; - if (col[0] == "#") { + if (col[0] == '#') { col = col.slice(1); usePound = true; } @@ -155,7 +155,7 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator'], function (s if (g > 255) g = 255; else if (g < 0) g = 0; - return (usePound ? "#" : "") + (g | (b << 8) | (r << 16)).toString(16); + return (usePound ? '#' : '') + (g | (b << 8) | (r << 16)).toString(16); } function setupGraphs() { @@ -190,22 +190,22 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator'], function (s datasets: [ { label: translations[0], - backgroundColor: "rgba(220,220,220,0.2)", - borderColor: "rgba(220,220,220,1)", - pointBackgroundColor: "rgba(220,220,220,1)", - pointHoverBackgroundColor: "#fff", - pointBorderColor: "#fff", - pointHoverBorderColor: "rgba(220,220,220,1)", + backgroundColor: 'rgba(220,220,220,0.2)', + borderColor: 'rgba(220,220,220,1)', + pointBackgroundColor: 'rgba(220,220,220,1)', + pointHoverBackgroundColor: '#fff', + pointBorderColor: '#fff', + pointHoverBorderColor: 'rgba(220,220,220,1)', data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], }, { label: translations[1], - backgroundColor: "rgba(151,187,205,0.2)", - borderColor: "rgba(151,187,205,1)", - pointBackgroundColor: "rgba(151,187,205,1)", - pointHoverBackgroundColor: "#fff", - pointBorderColor: "#fff", - pointHoverBorderColor: "rgba(151,187,205,1)", + backgroundColor: 'rgba(151,187,205,0.2)', + borderColor: 'rgba(151,187,205,1)', + pointBackgroundColor: 'rgba(151,187,205,1)', + pointHoverBackgroundColor: '#fff', + pointBorderColor: '#fff', + pointHoverBorderColor: 'rgba(151,187,205,1)', data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], }, ], @@ -236,8 +236,8 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator'], function (s labels: translations.slice(2, 4), datasets: [{ data: [1, 1], - backgroundColor: ["#F7464A", "#46BFBD"], - hoverBackgroundColor: ["#FF5A5E", "#5AD3D1"], + backgroundColor: ['#F7464A', '#46BFBD'], + hoverBackgroundColor: ['#FF5A5E', '#5AD3D1'], }], }, options: { @@ -254,8 +254,8 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator'], function (s labels: translations.slice(4, 9), datasets: [{ data: [1, 1, 1, 1, 1], - backgroundColor: ["#F7464A", "#46BFBD", "#FDB45C", "#949FB1", "#9FB194"], - hoverBackgroundColor: ["#FF5A5E", "#5AD3D1", "#FFC870", "#A8B3C5", "#A8B3C5"], + backgroundColor: ['#F7464A', '#46BFBD', '#FDB45C', '#949FB1', '#9FB194'], + hoverBackgroundColor: ['#FF5A5E', '#5AD3D1', '#FFC870', '#A8B3C5', '#A8B3C5'], }], }, options: { @@ -375,7 +375,7 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator'], function (s function updateTopicsGraph(topics) { if (!Object.keys(topics).length) { topics = {0: { - title: "No users browsing", + title: 'No users browsing', value: 1, }}; } diff --git a/public/src/admin/general/homepage.js b/public/src/admin/general/homepage.js index 00626680b8..3d36460e3c 100644 --- a/public/src/admin/general/homepage.js +++ b/public/src/admin/general/homepage.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/general/homepage', ['admin/settings'], function (Settings) { diff --git a/public/src/admin/general/languages.js b/public/src/admin/general/languages.js index d0d270f5c2..05d3175b27 100644 --- a/public/src/admin/general/languages.js +++ b/public/src/admin/general/languages.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/general/languages', ['admin/settings'], function (Settings) { diff --git a/public/src/admin/general/navigation.js b/public/src/admin/general/navigation.js index 855b1d095e..ad9f5bc676 100644 --- a/public/src/admin/general/navigation.js +++ b/public/src/admin/general/navigation.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/general/navigation', ['translator', 'iconSelect', 'jqueryui'], function (translator, iconSelect, jqueryui) { diff --git a/public/src/admin/general/social.js b/public/src/admin/general/social.js index d1bbccefe4..49ee4e6ad0 100644 --- a/public/src/admin/general/social.js +++ b/public/src/admin/general/social.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/general/social', [], function () { diff --git a/public/src/admin/general/sounds.js b/public/src/admin/general/sounds.js index a3f25de5af..ae239034b9 100644 --- a/public/src/admin/general/sounds.js +++ b/public/src/admin/general/sounds.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/general/sounds', ['sounds', 'settings'], function (Sounds, Settings) { diff --git a/public/src/admin/manage/categories.js b/public/src/admin/manage/categories.js index 0e443c14e1..ea3d94d9df 100644 --- a/public/src/admin/manage/categories.js +++ b/public/src/admin/manage/categories.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/manage/categories', ['vendor/jquery/serializeObject/jquery.ba-serializeobject.min', 'translator'], function (serialize, translator) { @@ -197,7 +197,7 @@ define('admin/manage/categories', ['vendor/jquery/serializeObject/jquery.ba-seri animation: 150, handle: '.icon', dataIdAttr: 'data-cid', - ghostClass: "placeholder", + ghostClass: 'placeholder', onAdd: itemDidAdd, onEnd: itemDragDidEnd, }); diff --git a/public/src/admin/manage/category-analytics.js b/public/src/admin/manage/category-analytics.js index 3ae9416a1d..2df2683fcd 100644 --- a/public/src/admin/manage/category-analytics.js +++ b/public/src/admin/manage/category-analytics.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/manage/category-analytics', ['Chart'], function (Chart) { @@ -25,13 +25,13 @@ define('admin/manage/category-analytics', ['Chart'], function (Chart) { labels: hourlyLabels, datasets: [ { - label: "", - backgroundColor: "rgba(186,139,175,0.2)", - borderColor: "rgba(186,139,175,1)", - pointBackgroundColor: "rgba(186,139,175,1)", - pointHoverBackgroundColor: "#fff", - pointBorderColor: "#fff", - pointHoverBorderColor: "rgba(186,139,175,1)", + label: '', + backgroundColor: 'rgba(186,139,175,0.2)', + borderColor: 'rgba(186,139,175,1)', + pointBackgroundColor: 'rgba(186,139,175,1)', + pointHoverBackgroundColor: '#fff', + pointBorderColor: '#fff', + pointHoverBorderColor: 'rgba(186,139,175,1)', data: ajaxify.data.analytics['pageviews:hourly'], }, ], @@ -40,13 +40,13 @@ define('admin/manage/category-analytics', ['Chart'], function (Chart) { labels: dailyLabels, datasets: [ { - label: "", - backgroundColor: "rgba(151,187,205,0.2)", - borderColor: "rgba(151,187,205,1)", - pointBackgroundColor: "rgba(151,187,205,1)", - pointHoverBackgroundColor: "#fff", - pointBorderColor: "#fff", - pointHoverBorderColor: "rgba(151,187,205,1)", + label: '', + backgroundColor: 'rgba(151,187,205,0.2)', + borderColor: 'rgba(151,187,205,1)', + pointBackgroundColor: 'rgba(151,187,205,1)', + pointHoverBackgroundColor: '#fff', + pointBorderColor: '#fff', + pointHoverBorderColor: 'rgba(151,187,205,1)', data: ajaxify.data.analytics['pageviews:daily'], }, ], @@ -55,13 +55,13 @@ define('admin/manage/category-analytics', ['Chart'], function (Chart) { labels: dailyLabels.slice(-7), datasets: [ { - label: "", - backgroundColor: "rgba(171,70,66,0.2)", - borderColor: "rgba(171,70,66,1)", - pointBackgroundColor: "rgba(171,70,66,1)", - pointHoverBackgroundColor: "#fff", - pointBorderColor: "#fff", - pointHoverBorderColor: "rgba(171,70,66,1)", + label: '', + backgroundColor: 'rgba(171,70,66,0.2)', + borderColor: 'rgba(171,70,66,1)', + pointBackgroundColor: 'rgba(171,70,66,1)', + pointHoverBackgroundColor: '#fff', + pointBorderColor: '#fff', + pointHoverBorderColor: 'rgba(171,70,66,1)', data: ajaxify.data.analytics['topics:daily'], }, ], @@ -70,13 +70,13 @@ define('admin/manage/category-analytics', ['Chart'], function (Chart) { labels: dailyLabels.slice(-7), datasets: [ { - label: "", - backgroundColor: "rgba(161,181,108,0.2)", - borderColor: "rgba(161,181,108,1)", - pointBackgroundColor: "rgba(161,181,108,1)", - pointHoverBackgroundColor: "#fff", - pointBorderColor: "#fff", - pointHoverBorderColor: "rgba(161,181,108,1)", + label: '', + backgroundColor: 'rgba(161,181,108,0.2)', + borderColor: 'rgba(161,181,108,1)', + pointBackgroundColor: 'rgba(161,181,108,1)', + pointHoverBackgroundColor: '#fff', + pointBorderColor: '#fff', + pointHoverBorderColor: 'rgba(161,181,108,1)', data: ajaxify.data.analytics['posts:daily'], }, ], diff --git a/public/src/admin/manage/category.js b/public/src/admin/manage/category.js index d6e47a6807..efd87deae8 100644 --- a/public/src/admin/manage/category.js +++ b/public/src/admin/manage/category.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/manage/category', [ diff --git a/public/src/admin/manage/flags.js b/public/src/admin/manage/flags.js index 09b68ed560..45bfff7f70 100644 --- a/public/src/admin/manage/flags.js +++ b/public/src/admin/manage/flags.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/manage/flags', [ @@ -98,13 +98,13 @@ define('admin/manage/flags', [ labels: dailyLabels, datasets: [ { - label: "", - backgroundColor: "rgba(151,187,205,0.2)", - borderColor: "rgba(151,187,205,1)", - pointBackgroundColor: "rgba(151,187,205,1)", - pointHoverBackgroundColor: "#fff", - pointBorderColor: "#fff", - pointHoverBorderColor: "rgba(151,187,205,1)", + label: '', + backgroundColor: 'rgba(151,187,205,0.2)', + borderColor: 'rgba(151,187,205,1)', + pointBackgroundColor: 'rgba(151,187,205,1)', + pointHoverBackgroundColor: '#fff', + pointBorderColor: '#fff', + pointHoverBorderColor: 'rgba(151,187,205,1)', data: ajaxify.data.analytics, }, ], diff --git a/public/src/admin/manage/group.js b/public/src/admin/manage/group.js index 703c126171..19397dc9fd 100644 --- a/public/src/admin/manage/group.js +++ b/public/src/admin/manage/group.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/manage/group', [ @@ -93,8 +93,8 @@ define('admin/manage/group', [ username: userLabel.attr('data-username'), userslug: userLabel.attr('data-userslug'), picture: userLabel.attr('data-picture'), - "icon:bgColor": userLabel.attr('data-usericon-bgColor'), - "icon:text": userLabel.attr('data-usericon-text'), + 'icon:bgColor': userLabel.attr('data-usericon-bgColor'), + 'icon:text': userLabel.attr('data-usericon-text'), }; templates.parse('partials/groups/memberlist', 'members', {group: {isOwner: ajaxify.data.group.isOwner, members: [member]}}, function (html) { diff --git a/public/src/admin/manage/groups.js b/public/src/admin/manage/groups.js index 9f86c6a74d..90f46e82c3 100644 --- a/public/src/admin/manage/groups.js +++ b/public/src/admin/manage/groups.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/manage/groups', ['translator'], function (translator) { diff --git a/public/src/admin/manage/registration.js b/public/src/admin/manage/registration.js index f6918bd674..2b4d430325 100644 --- a/public/src/admin/manage/registration.js +++ b/public/src/admin/manage/registration.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/manage/registration', function () { diff --git a/public/src/admin/manage/tags.js b/public/src/admin/manage/tags.js index 6a157487c0..93846da70e 100644 --- a/public/src/admin/manage/tags.js +++ b/public/src/admin/manage/tags.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/manage/tags', [ @@ -93,8 +93,8 @@ define('admin/manage/tags', [ message: firstTag.find('.tag-modal').html(), buttons: { success: { - label: "Save", - className: "btn-primary save", + label: 'Save', + className: 'btn-primary save', callback: function () { var modal = $('.bootbox'); var bgColor = modal.find('[data-name="bgColor"]').val(); diff --git a/public/src/admin/manage/users.js b/public/src/admin/manage/users.js index e59cf28d5b..d5c0ec7ad9 100644 --- a/public/src/admin/manage/users.js +++ b/public/src/admin/manage/users.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/manage/users', ['translator'], function (translator) { diff --git a/public/src/admin/modules/colorpicker.js b/public/src/admin/modules/colorpicker.js index 99b6fe9ba3..c219df634f 100644 --- a/public/src/admin/modules/colorpicker.js +++ b/public/src/admin/modules/colorpicker.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/modules/colorpicker', function () { diff --git a/public/src/admin/modules/instance.js b/public/src/admin/modules/instance.js index 23c0a76124..a8b38062d9 100644 --- a/public/src/admin/modules/instance.js +++ b/public/src/admin/modules/instance.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/modules/instance', function () { diff --git a/public/src/admin/modules/search.js b/public/src/admin/modules/search.js index f47f5f4827..2449a27b2e 100644 --- a/public/src/admin/modules/search.js +++ b/public/src/admin/modules/search.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/modules/search', ['mousetrap'], function (mousetrap) { diff --git a/public/src/admin/modules/selectable.js b/public/src/admin/modules/selectable.js index 73f026023c..80df206333 100644 --- a/public/src/admin/modules/selectable.js +++ b/public/src/admin/modules/selectable.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/modules/selectable', ['jqueryui'], function (jqueryui) { diff --git a/public/src/admin/settings/email.js b/public/src/admin/settings/email.js index e4b02bebc1..ab989903d0 100644 --- a/public/src/admin/settings/email.js +++ b/public/src/admin/settings/email.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/settings/email', ['admin/settings'], function (settings) { @@ -30,10 +30,10 @@ define('admin/settings/email', ['admin/settings'], function (settings) { function configureEmailEditor() { $('#email-editor-selector').on('change', updateEmailEditor); - emailEditor = ace.edit("email-editor"); + emailEditor = ace.edit('email-editor'); emailEditor.$blockScrolling = Infinity; - emailEditor.setTheme("ace/theme/twilight"); - emailEditor.getSession().setMode("ace/mode/html"); + emailEditor.setTheme('ace/theme/twilight'); + emailEditor.getSession().setMode('ace/mode/html'); emailEditor.on('change', function () { var emailPath = $('#email-editor-selector').val(); diff --git a/public/src/admin/settings/general.js b/public/src/admin/settings/general.js index ac8a0eee91..2487035a8b 100644 --- a/public/src/admin/settings/general.js +++ b/public/src/admin/settings/general.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('admin/settings/general', ['admin/settings'], function (Settings) { diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index ee010cfc47..bcb6f5fd05 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var ajaxify = ajaxify || {}; @@ -329,7 +329,7 @@ $(document).ready(function () { callback(data.toString()); }, error: function (error) { - throw new Error("Unable to load template: " + template + " (" + error.statusText + ")"); + throw new Error('Unable to load template: ' + template + ' (' + error.statusText + ')'); }, }); } diff --git a/public/src/app.js b/public/src/app.js index 792abfa76a..2a95ba29f7 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var app = app || {}; @@ -462,8 +462,8 @@ app.cacheBuster = null; } app.handleSearch = function () { - var searchButton = $("#search-button"); - var searchFields = $("#search-fields"); + var searchButton = $('#search-button'); + var searchFields = $('#search-fields'); var searchInput = $('#search-fields input'); $('#search-form .advanced-search-link').on('mousedown', function () { @@ -507,8 +507,8 @@ app.cacheBuster = null; }; app.prepareSearch = function () { - $("#search-fields").removeClass('hidden'); - $("#search-button").addClass('hidden'); + $('#search-fields').removeClass('hidden'); + $('#search-button').addClass('hidden'); $('#search-fields input').focus(); }; diff --git a/public/src/client/category.js b/public/src/client/category.js index 21ebcda265..e61b0b5e53 100644 --- a/public/src/client/category.js +++ b/public/src/client/category.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('forum/category', [ diff --git a/public/src/client/chats.js b/public/src/client/chats.js index 81b72f198b..88fc720080 100644 --- a/public/src/client/chats.js +++ b/public/src/client/chats.js @@ -313,11 +313,11 @@ define('forum/chats', [ messages.appendChatMessage($('.expanded-chat .chat-content'), data.message); } else { - if (ajaxify.currentPage.startsWith("chats")) { + if (ajaxify.currentPage.startsWith('chats')) { var roomEl = $('[data-roomid=' + data.roomId + ']'); if (roomEl.length > 0) { - roomEl.addClass("unread"); + roomEl.addClass('unread'); } else { var recentEl = components.get('chat/recent'); templates.parse('partials/chats/recent_room', { diff --git a/public/src/client/footer.js b/public/src/client/footer.js index 58837406ee..b6b7d243c9 100644 --- a/public/src/client/footer.js +++ b/public/src/client/footer.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('forum/footer', ['notifications', 'chat', 'components', 'translator'], function (Notifications, Chat, components, translator) { diff --git a/public/src/client/groups/details.js b/public/src/client/groups/details.js index 9e8191a20f..87ef07b573 100644 --- a/public/src/client/groups/details.js +++ b/public/src/client/groups/details.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('forum/groups/details', [ diff --git a/public/src/client/groups/list.js b/public/src/client/groups/list.js index 3a6a651c39..8a1bb996b4 100644 --- a/public/src/client/groups/list.js +++ b/public/src/client/groups/list.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('forum/groups/list', ['forum/infinitescroll'], function (infinitescroll) { diff --git a/public/src/client/groups/memberlist.js b/public/src/client/groups/memberlist.js index 9550ad2568..e69deb1d82 100644 --- a/public/src/client/groups/memberlist.js +++ b/public/src/client/groups/memberlist.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('forum/groups/memberlist', ['components', 'forum/infinitescroll'], function (components, infinitescroll) { diff --git a/public/src/client/login.js b/public/src/client/login.js index 00b0e8ed73..bf138c2a25 100644 --- a/public/src/client/login.js +++ b/public/src/client/login.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('forum/login', ['translator'], function (translator) { diff --git a/public/src/client/reset.js b/public/src/client/reset.js index ea8e1143f6..06bda6307a 100644 --- a/public/src/client/reset.js +++ b/public/src/client/reset.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('forum/reset', function () { diff --git a/public/src/client/reset_code.js b/public/src/client/reset_code.js index 4104648c47..b62a682273 100644 --- a/public/src/client/reset_code.js +++ b/public/src/client/reset_code.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('forum/reset_code', function () { diff --git a/public/src/client/topic/move-post.js b/public/src/client/topic/move-post.js index 167ef5f413..45845bbcf7 100644 --- a/public/src/client/topic/move-post.js +++ b/public/src/client/topic/move-post.js @@ -39,10 +39,10 @@ define('forum/topic/move-post', [], function () { function showMoveModal(modal) { modal.modal('show') - .css("position", "fixed") - .css("left", Math.max(0, (($(window).width() - modal.outerWidth()) / 2) + $(window).scrollLeft()) + "px") - .css("top", "0px") - .css("z-index", "2000"); + .css('position', 'fixed') + .css('left', Math.max(0, (($(window).width() - modal.outerWidth()) / 2) + $(window).scrollLeft()) + 'px') + .css('top', '0px') + .css('z-index', '2000'); } function movePost(post, pid, tid, callback) { diff --git a/public/src/client/unread.js b/public/src/client/unread.js index 18140185ef..4c1c65b7f1 100644 --- a/public/src/client/unread.js +++ b/public/src/client/unread.js @@ -72,7 +72,7 @@ define('forum/unread', ['forum/recent', 'topicSelect', 'forum/infinitescroll', ' topicSelect.init(); - if ($("body").height() <= $(window).height() && $('[component="category"]').children().length >= 20) { + if ($('body').height() <= $(window).height() && $('[component="category"]').children().length >= 20) { $('#load-more-btn').show(); } diff --git a/public/src/installer/install.js b/public/src/installer/install.js index 540f5c877c..e9aaf7629f 100644 --- a/public/src/installer/install.js +++ b/public/src/installer/install.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; $('document').ready(function () { diff --git a/public/src/modules/chat.js b/public/src/modules/chat.js index e5d82ba4aa..ef5f844d64 100644 --- a/public/src/modules/chat.js +++ b/public/src/modules/chat.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('chat', [ diff --git a/public/src/modules/components.js b/public/src/modules/components.js index da6bd20086..14bf2791b3 100644 --- a/public/src/modules/components.js +++ b/public/src/modules/components.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('components', function () { var components = {}; diff --git a/public/src/modules/coverPhoto.js b/public/src/modules/coverPhoto.js index 797211eff4..8620a5df47 100644 --- a/public/src/modules/coverPhoto.js +++ b/public/src/modules/coverPhoto.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('coverPhoto', [ diff --git a/public/src/modules/helpers.js b/public/src/modules/helpers.js index 6f2d92fea6..a3251706b3 100644 --- a/public/src/modules/helpers.js +++ b/public/src/modules/helpers.js @@ -1,5 +1,5 @@ (function (exports) { - "use strict"; + 'use strict'; // export the class if we are in a Node-like system. @@ -56,7 +56,7 @@ helpers.stringify = function (obj) { // Turns the incoming object into a JSON string - return JSON.stringify(obj).replace(/&/gm, "&").replace(//gm, ">").replace(/"/g, '"'); + return JSON.stringify(obj).replace(/&/gm, '&').replace(//gm, '>').replace(/"/g, '"'); }; helpers.escape = function (str) { diff --git a/public/src/modules/iconSelect.js b/public/src/modules/iconSelect.js index 29aff83014..3c72303b73 100644 --- a/public/src/modules/iconSelect.js +++ b/public/src/modules/iconSelect.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('iconSelect', function () { diff --git a/public/src/modules/pictureCropper.js b/public/src/modules/pictureCropper.js index c558775c51..670f9bf91b 100644 --- a/public/src/modules/pictureCropper.js +++ b/public/src/modules/pictureCropper.js @@ -43,15 +43,15 @@ define('pictureCropper', ['translator', 'cropper'], function (translator, croppe viewMode: 1, ready: function () { cropperModal.find('.rotate').on('click', function () { - var degrees = this.getAttribute("data-degrees"); + var degrees = this.getAttribute('data-degrees'); cropperTool.rotate(degrees); }); cropperModal.find('.flip').on('click', function () { - var option = this.getAttribute("data-option"); - var method = this.getAttribute("data-method"); + var option = this.getAttribute('data-option'); + var method = this.getAttribute('data-method'); method === 'scaleX' ? cropperTool.scaleX(option) : cropperTool.scaleY(option); - this.setAttribute("data-option", option * -1); + this.setAttribute('data-option', option * -1); }); cropperModal.find('.reset').on('click', function () { @@ -119,7 +119,7 @@ define('pictureCropper', ['translator', 'cropper'], function (translator, croppe var imageUrl; var imageType = file.type; - reader.addEventListener("load", function () { + reader.addEventListener('load', function () { imageUrl = reader.result; data.uploadModal.modal('hide'); diff --git a/public/src/modules/search.js b/public/src/modules/search.js index e4e64288b2..b4ceec533c 100644 --- a/public/src/modules/search.js +++ b/public/src/modules/search.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('search', ['navigator', 'translator'], function (nav, translator) { diff --git a/public/src/modules/settings.js b/public/src/modules/settings.js index 510fa8e822..04d88e40cd 100644 --- a/public/src/modules/settings.js +++ b/public/src/modules/settings.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('settings', function () { @@ -293,14 +293,14 @@ define('settings', function () { app.alert({ title: 'Settings Not Saved', type: 'danger', - message: "NodeBB failed to save the settings.", + message: 'NodeBB failed to save the settings.', timeout: 5000, }); } else { app.alert({ title: 'Settings Saved', type: 'success', - message: "Settings have been successfully saved", + message: 'Settings have been successfully saved', timeout: 2500, }); } diff --git a/public/src/modules/settings/array.js b/public/src/modules/settings/array.js index 368574f68e..c0753ad0c0 100644 --- a/public/src/modules/settings/array.js +++ b/public/src/modules/settings/array.js @@ -57,7 +57,7 @@ define('settings/array', function () { } } helper.fillField(element, value); - if ($("[data-parent=\"_" + key + "\"]", field).length) { + if ($('[data-parent="_' + key + '"]', field).length) { insertCb(separator); } insertCb(element); @@ -124,7 +124,7 @@ define('settings/array', function () { }, get: function (element, trim, empty) { var key = element.data('key') || element.data('parent'); - var children = $("[data-parent=\"_" + key + "\"]", element); + var children = $('[data-parent="_' + key + '"]', element); var values = []; children.each(function (i, child) { child = $(child); diff --git a/public/src/modules/settings/key.js b/public/src/modules/settings/key.js index a7537b1c51..0e5de046ec 100644 --- a/public/src/modules/settings/key.js +++ b/public/src/modules/settings/key.js @@ -75,9 +75,9 @@ define('settings/key', function () { } else if (code >= 48 && code <= 90) { return String.fromCharCode(code).toUpperCase(); } else if (code >= 112 && code <= 123) { - return "F" + (code - 111); + return 'F' + (code - 111); } else { - return keyMap[code] || ("#" + code); + return keyMap[code] || ('#' + code); } } diff --git a/public/src/modules/sounds.js b/public/src/modules/sounds.js index 9b23ab97bc..f3d07acb6c 100644 --- a/public/src/modules/sounds.js +++ b/public/src/modules/sounds.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('sounds', ['buzz'], function (buzz) { diff --git a/public/src/modules/taskbar.js b/public/src/modules/taskbar.js index 40761ea45a..3897fbe6a1 100644 --- a/public/src/modules/taskbar.js +++ b/public/src/modules/taskbar.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; define('taskbar', function () { diff --git a/public/src/modules/translator.js b/public/src/modules/translator.js index 4caf71ac68..8765540d09 100644 --- a/public/src/modules/translator.js +++ b/public/src/modules/translator.js @@ -46,7 +46,7 @@ }(function (string, load, warn) { 'use strict'; var assign = Object.assign || jQuery.extend; - function classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + function classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } var Translator = (function () { /** diff --git a/public/src/overrides.js b/public/src/overrides.js index 899b2d194d..c3c2d64040 100644 --- a/public/src/overrides.js +++ b/public/src/overrides.js @@ -91,7 +91,7 @@ if ('undefined' !== typeof window) { // FIX FOR #1245 - https://github.com/NodeBB/NodeBB/issues/1245 // from http://stackoverflow.com/questions/15931962/bootstrap-dropdown-disappear-with-right-click-on-firefox // obtain a reference to the original handler - var _clearMenus = $._data(document, "events").click.filter(function (el) { + var _clearMenus = $._data(document, 'events').click.filter(function (el) { return el.namespace === 'bs.data-api.dropdown' && el.selector === undefined; }); diff --git a/public/src/utils.js b/public/src/utils.js index 3a0ba8fb2d..504db54ef6 100644 --- a/public/src/utils.js +++ b/public/src/utils.js @@ -165,29 +165,29 @@ }, extensionMimeTypeMap: { - bmp: "image/bmp", - cmx: "image/x-cmx", - cod: "image/cis-cod", - gif: "image/gif", - ico: "image/x-icon", - ief: "image/ief", - jfif: "image/pipeg", - jpe: "image/jpeg", - jpeg: "image/jpeg", - jpg: "image/jpeg", - png: "image/png", - pbm: "image/x-portable-bitmap", - pgm: "image/x-portable-graymap", - pnm: "image/x-portable-anymap", - ppm: "image/x-portable-pixmap", - ras: "image/x-cmu-raster", - rgb: "image/x-rgb", - svg: "image/svg+xml", - tif: "image/tiff", - tiff: "image/tiff", - xbm: "image/x-xbitmap", - xpm: "image/x-xpixmap", - xwd: "image/x-xwindowdump", + bmp: 'image/bmp', + cmx: 'image/x-cmx', + cod: 'image/cis-cod', + gif: 'image/gif', + ico: 'image/x-icon', + ief: 'image/ief', + jfif: 'image/pipeg', + jpe: 'image/jpeg', + jpeg: 'image/jpeg', + jpg: 'image/jpeg', + png: 'image/png', + pbm: 'image/x-portable-bitmap', + pgm: 'image/x-portable-graymap', + pnm: 'image/x-portable-anymap', + ppm: 'image/x-portable-pixmap', + ras: 'image/x-cmu-raster', + rgb: 'image/x-rgb', + svg: 'image/svg+xml', + tif: 'image/tiff', + tiff: 'image/tiff', + xbm: 'image/x-xbitmap', + xpm: 'image/x-xpixmap', + xwd: 'image/x-xwindowdump', }, fileMimeType: function (path) { @@ -230,7 +230,7 @@ // takes a string like 1000 and returns 1,000 addCommas: function (text) { - return text.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,"); + return text.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,'); }, toISOString: function (timestamp) { @@ -254,11 +254,11 @@ 'th', 'thead', 'time', 'title', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr'], escapeRegexChars: function (text) { - return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); }, escapeHTML: function (raw) { - return raw.replace(/&/gm, "&").replace(//gm, ">"); + return raw.replace(/&/gm, '&').replace(//gm, '>'); }, isAndroidBrowser: function () { @@ -325,7 +325,7 @@ /* Retrieved from http://stackoverflow.com/a/7557433 @ 27 Mar 2016 */ isElementInViewport: function (el) { // special bonus for those using jQuery - if (typeof jQuery === "function" && el instanceof jQuery) { + if (typeof jQuery === 'function' && el instanceof jQuery) { el = el[0]; } @@ -351,7 +351,7 @@ if (options.url) { a = utils.urlToLocation(options.url); } - params = (a ? a.search : window.location.search).substring(1).split("&"); + params = (a ? a.search : window.location.search).substring(1).split('&'); params.forEach(function (param) { var val = param.split('='); diff --git a/public/src/widgets.js b/public/src/widgets.js index de8a1077ee..5c950563f0 100644 --- a/public/src/widgets.js +++ b/public/src/widgets.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; (function (ajaxify) { diff --git a/src/categories/unread.js b/src/categories/unread.js index 8fe4ecaa31..498391693e 100644 --- a/src/categories/unread.js +++ b/src/categories/unread.js @@ -1,5 +1,5 @@ -"use strict"; +'use strict'; var async = require('async'); var db = require('../database'); diff --git a/src/controllers/accounts/profile.js b/src/controllers/accounts/profile.js index f6279aa8eb..d51a2f56da 100644 --- a/src/controllers/accounts/profile.js +++ b/src/controllers/accounts/profile.js @@ -92,11 +92,11 @@ profileController.get = function (req, res, callback) { res.locals.metaTags = [ { - name: "title", + name: 'title', content: userData.fullname || userData.username, }, { - name: "description", + name: 'description', content: plainAboutMe, }, { @@ -117,7 +117,7 @@ profileController.get = function (req, res, callback) { noEscape: true, }, { - property: "og:image:url", + property: 'og:image:url', content: userData.picture, noEscape: true, } diff --git a/src/controllers/accounts/settings.js b/src/controllers/accounts/settings.js index 16939be08d..68f53bd070 100644 --- a/src/controllers/accounts/settings.js +++ b/src/controllers/accounts/settings.js @@ -83,23 +83,23 @@ settingsController.get = function (req, res, callback) { userData.bootswatchSkinOptions = [ - { name: "Default", value: "default" }, - { name: "Cerulean", value: "cerulean" }, - { name: "Cosmo", value: "cosmo" }, - { name: "Cyborg", value: "cyborg" }, - { name: "Darkly", value: "darkly" }, - { name: "Flatly", value: "flatly" }, - { name: "Journal", value: "journal" }, - { name: "Lumen", value: "lumen" }, - { name: "Paper", value: "paper" }, - { name: "Readable", value: "readable" }, - { name: "Sandstone", value: "sandstone" }, - { name: "Simplex", value: "simplex" }, - { name: "Slate", value: "slate" }, - { name: "Spacelab", value: "spacelab" }, - { name: "Superhero", value: "superhero" }, - { name: "United", value: "united" }, - { name: "Yeti", value: "yeti" }, + { name: 'Default', value: 'default' }, + { name: 'Cerulean', value: 'cerulean' }, + { name: 'Cosmo', value: 'cosmo' }, + { name: 'Cyborg', value: 'cyborg' }, + { name: 'Darkly', value: 'darkly' }, + { name: 'Flatly', value: 'flatly' }, + { name: 'Journal', value: 'journal' }, + { name: 'Lumen', value: 'lumen' }, + { name: 'Paper', value: 'paper' }, + { name: 'Readable', value: 'readable' }, + { name: 'Sandstone', value: 'sandstone' }, + { name: 'Simplex', value: 'simplex' }, + { name: 'Slate', value: 'slate' }, + { name: 'Spacelab', value: 'spacelab' }, + { name: 'Superhero', value: 'superhero' }, + { name: 'United', value: 'united' }, + { name: 'Yeti', value: 'yeti' }, ]; var isCustom = true; diff --git a/src/controllers/admin.js b/src/controllers/admin.js index 70fbe6795d..056a7025aa 100644 --- a/src/controllers/admin.js +++ b/src/controllers/admin.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var adminController = { dashboard: require('./admin/dashboard'), diff --git a/src/controllers/admin/appearance.js b/src/controllers/admin/appearance.js index 8956bd175d..ee3232204a 100644 --- a/src/controllers/admin/appearance.js +++ b/src/controllers/admin/appearance.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var appearanceController = {}; diff --git a/src/controllers/admin/blacklist.js b/src/controllers/admin/blacklist.js index e4ce35ccdc..7ce4edda49 100644 --- a/src/controllers/admin/blacklist.js +++ b/src/controllers/admin/blacklist.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var meta = require('../../meta'); diff --git a/src/controllers/admin/categories.js b/src/controllers/admin/categories.js index 727332a24c..d1e7b1ef7c 100644 --- a/src/controllers/admin/categories.js +++ b/src/controllers/admin/categories.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); diff --git a/src/controllers/admin/flags.js b/src/controllers/admin/flags.js index ad81494c19..2191394b57 100644 --- a/src/controllers/admin/flags.js +++ b/src/controllers/admin/flags.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var validator = require('validator'); diff --git a/src/controllers/admin/groups.js b/src/controllers/admin/groups.js index dbd0787818..2f4fa31664 100644 --- a/src/controllers/admin/groups.js +++ b/src/controllers/admin/groups.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); diff --git a/src/controllers/admin/tags.js b/src/controllers/admin/tags.js index a645e2ef11..5e6c0d71a4 100644 --- a/src/controllers/admin/tags.js +++ b/src/controllers/admin/tags.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var topics = require('../../topics'); diff --git a/src/controllers/admin/uploads.js b/src/controllers/admin/uploads.js index bce0d982d6..c939da345f 100644 --- a/src/controllers/admin/uploads.js +++ b/src/controllers/admin/uploads.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var fs = require('fs'); var path = require('path'); diff --git a/src/controllers/admin/users.js b/src/controllers/admin/users.js index eb774f1e26..cb84792b85 100644 --- a/src/controllers/admin/users.js +++ b/src/controllers/admin/users.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var validator = require('validator'); diff --git a/src/controllers/api.js b/src/controllers/api.js index ff2f0041ac..544beed40a 100644 --- a/src/controllers/api.js +++ b/src/controllers/api.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var validator = require('validator'); diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js index 6561bc5385..ffbe36dfc9 100644 --- a/src/controllers/authentication.js +++ b/src/controllers/authentication.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var winston = require('winston'); diff --git a/src/controllers/categories.js b/src/controllers/categories.js index 7fbc26d474..5133444f7a 100644 --- a/src/controllers/categories.js +++ b/src/controllers/categories.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var nconf = require('nconf'); @@ -12,10 +12,10 @@ var categoriesController = {}; categoriesController.list = function (req, res, next) { res.locals.metaTags = [{ - name: "title", + name: 'title', content: validator.escape(String(meta.config.title || 'NodeBB')), }, { - name: "description", + name: 'description', content: validator.escape(String(meta.config.description || '')), }, { property: 'og:title', diff --git a/src/controllers/category.js b/src/controllers/category.js index 218c7c3144..0e68d5a5ce 100644 --- a/src/controllers/category.js +++ b/src/controllers/category.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); @@ -178,7 +178,7 @@ categoryController.get = function (req, res, callback) { content: categoryData.description, }, { - property: "og:type", + property: 'og:type', content: 'website', }, ]; diff --git a/src/controllers/globalmods.js b/src/controllers/globalmods.js index 7e4fd1ffec..793c33653e 100644 --- a/src/controllers/globalmods.js +++ b/src/controllers/globalmods.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var user = require('../user'); var adminBlacklistController = require('./admin/blacklist'); diff --git a/src/controllers/groups.js b/src/controllers/groups.js index e87a9b4361..75df1112eb 100644 --- a/src/controllers/groups.js +++ b/src/controllers/groups.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var nconf = require('nconf'); diff --git a/src/controllers/index.js b/src/controllers/index.js index 359d2ffa40..0f16a19f27 100644 --- a/src/controllers/index.js +++ b/src/controllers/index.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var nconf = require('nconf'); @@ -61,7 +61,7 @@ Controllers.home = function (req, res, next) { var match = /^category\/(\d+)\/(.*)$/.exec(route); if (match) { - req.params.topic_index = "1"; + req.params.topic_index = '1'; req.params.category_id = match[1]; req.params.slug = match[2]; Controllers.category.get(req, res, next); @@ -270,12 +270,12 @@ Controllers.confirmEmail = function (req, res) { Controllers.robots = function (req, res) { res.set('Content-Type', 'text/plain'); - if (meta.config["robots.txt"]) { - res.send(meta.config["robots.txt"]); + if (meta.config['robots.txt']) { + res.send(meta.config['robots.txt']); } else { - res.send("User-agent: *\n" + - "Disallow: " + nconf.get('relative_path') + "/admin/\n" + - "Sitemap: " + nconf.get('url') + "/sitemap.xml"); + res.send('User-agent: *\n' + + 'Disallow: ' + nconf.get('relative_path') + '/admin/\n' + + 'Sitemap: ' + nconf.get('url') + '/sitemap.xml'); } }; diff --git a/src/controllers/mods.js b/src/controllers/mods.js index 4581d7d645..6a1835f980 100644 --- a/src/controllers/mods.js +++ b/src/controllers/mods.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); diff --git a/src/controllers/posts.js b/src/controllers/posts.js index dae990e171..90596d5b34 100644 --- a/src/controllers/posts.js +++ b/src/controllers/posts.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var posts = require('../posts'); var helpers = require('./helpers'); diff --git a/src/controllers/tags.js b/src/controllers/tags.js index 3e364b38d1..36d1969a1d 100644 --- a/src/controllers/tags.js +++ b/src/controllers/tags.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); diff --git a/src/controllers/topics.js b/src/controllers/topics.js index 967747dba4..d74152a37a 100644 --- a/src/controllers/topics.js +++ b/src/controllers/topics.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); @@ -187,11 +187,11 @@ topicsController.get = function (req, res, callback) { res.locals.metaTags = [ { - name: "title", + name: 'title', content: topicData.titleRaw, }, { - name: "description", + name: 'description', content: description, }, { @@ -203,11 +203,11 @@ topicsController.get = function (req, res, callback) { content: description, }, { - property: "og:type", + property: 'og:type', content: 'article', }, { - property: "og:url", + property: 'og:url', content: nconf.get('url') + '/topic/' + topicData.slug + (req.params.post_index ? ('/' + req.params.post_index) : ''), noEscape: true, }, @@ -217,12 +217,12 @@ topicsController.get = function (req, res, callback) { noEscape: true, }, { - property: "og:image:url", + property: 'og:image:url', content: ogImageUrl, noEscape: true, }, { - property: "article:published_time", + property: 'article:published_time', content: utils.toISOString(topicData.timestamp), }, { diff --git a/src/controllers/uploads.js b/src/controllers/uploads.js index a70874b921..a82ff32818 100644 --- a/src/controllers/uploads.js +++ b/src/controllers/uploads.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var fs = require('fs'); var path = require('path'); diff --git a/src/controllers/users.js b/src/controllers/users.js index 2d8f3c8225..fdf6fa36cc 100644 --- a/src/controllers/users.js +++ b/src/controllers/users.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var user = require('../user'); diff --git a/src/coverPhoto.js b/src/coverPhoto.js index 0d13098e62..b86d032a24 100644 --- a/src/coverPhoto.js +++ b/src/coverPhoto.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var coverPhoto = {}; var meta = require('./meta'); diff --git a/src/database.js b/src/database.js index 65a5453d09..ef98e09a59 100644 --- a/src/database.js +++ b/src/database.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var nconf = require('nconf'); var databaseName = nconf.get('database'); diff --git a/src/database/mongo.js b/src/database/mongo.js index 27cbbef503..d82d1527c3 100644 --- a/src/database/mongo.js +++ b/src/database/mongo.js @@ -37,8 +37,8 @@ before: function (value) { value = value || nconf.get('mongo:password') || ''; return value; }, }, { - name: "mongo:database", - description: "MongoDB database name", + name: 'mongo:database', + description: 'MongoDB database name', default: nconf.get('mongo:database') || 'nodebb', }, ]; @@ -92,7 +92,7 @@ mongoClient.connect(connString, connOptions, function (err, _db) { if (err) { - winston.error("NodeBB could not connect to your Mongo database. Mongo returned the following error: " + err.message); + winston.error('NodeBB could not connect to your Mongo database. Mongo returned the following error: ' + err.message); return callback(err); } diff --git a/src/database/mongo/hash.js b/src/database/mongo/hash.js index a82fb294b2..a70578cc9f 100644 --- a/src/database/mongo/hash.js +++ b/src/database/mongo/hash.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; module.exports = function (db, module) { var helpers = module.helpers.mongo; diff --git a/src/database/mongo/helpers.js b/src/database/mongo/helpers.js index beda1b506b..c135cf7f12 100644 --- a/src/database/mongo/helpers.js +++ b/src/database/mongo/helpers.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var helpers = {}; diff --git a/src/database/mongo/list.js b/src/database/mongo/list.js index 02871e78fd..e96ad236fb 100644 --- a/src/database/mongo/list.js +++ b/src/database/mongo/list.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; module.exports = function (db, module) { var helpers = module.helpers.mongo; diff --git a/src/database/mongo/main.js b/src/database/mongo/main.js index 49bb8453bf..5eacf84242 100644 --- a/src/database/mongo/main.js +++ b/src/database/mongo/main.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var winston = require('winston'); diff --git a/src/database/mongo/sets.js b/src/database/mongo/sets.js index f3df45647a..3580702d7a 100644 --- a/src/database/mongo/sets.js +++ b/src/database/mongo/sets.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; module.exports = function (db, module) { var helpers = module.helpers.mongo; diff --git a/src/database/mongo/sorted.js b/src/database/mongo/sorted.js index b8522a323f..cf9dfecc99 100644 --- a/src/database/mongo/sorted.js +++ b/src/database/mongo/sorted.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var utils = require('../../../public/src/utils'); diff --git a/src/database/mongo/sorted/intersect.js b/src/database/mongo/sorted/intersect.js index 989ccefd71..b5c0dae92f 100644 --- a/src/database/mongo/sorted/intersect.js +++ b/src/database/mongo/sorted/intersect.js @@ -58,7 +58,7 @@ module.exports = function (db, module) { score: { $cond: { if: { - $eq: ["$_key", sets[index]], + $eq: ['$_key', sets[index]], }, then: { $multiply: ['$score', weight], diff --git a/src/database/redis.js b/src/database/redis.js index 83384c06f2..41dc300d54 100644 --- a/src/database/redis.js +++ b/src/database/redis.js @@ -29,8 +29,8 @@ before: function (value) { value = value || nconf.get('redis:password') || ''; return value; }, }, { - name: "redis:database", - description: "Which database to use (0..n)", + name: 'redis:database', + description: 'Which database to use (0..n)', default: nconf.get('redis:database') || 0, }, ]; @@ -110,7 +110,7 @@ if (dbIdx) { cxn.select(dbIdx, function (error) { if (error) { - winston.error("NodeBB could not connect to your Redis database. Redis returned the following error: " + error.message); + winston.error('NodeBB could not connect to your Redis database. Redis returned the following error: ' + error.message); process.exit(); } }); @@ -150,7 +150,7 @@ return callback(err); } - var lines = data.toString().split("\r\n").sort(); + var lines = data.toString().split('\r\n').sort(); var redisData = {}; lines.forEach(function (line) { var parts = line.split(':'); diff --git a/src/database/redis/hash.js b/src/database/redis/hash.js index cdc364e47e..bb3c24df5d 100644 --- a/src/database/redis/hash.js +++ b/src/database/redis/hash.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; module.exports = function (redisClient, module) { diff --git a/src/database/redis/helpers.js b/src/database/redis/helpers.js index 53167fb5ee..cb2a77d0f9 100644 --- a/src/database/redis/helpers.js +++ b/src/database/redis/helpers.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var helpers = {}; diff --git a/src/database/redis/list.js b/src/database/redis/list.js index c44c23b475..7c6011e3bc 100644 --- a/src/database/redis/list.js +++ b/src/database/redis/list.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; module.exports = function (redisClient, module) { module.listPrepend = function (key, value, callback) { diff --git a/src/database/redis/main.js b/src/database/redis/main.js index 431b234b47..1ddef46355 100644 --- a/src/database/redis/main.js +++ b/src/database/redis/main.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; module.exports = function (redisClient, module) { diff --git a/src/database/redis/sets.js b/src/database/redis/sets.js index 5b2b803868..72bdceb9fd 100644 --- a/src/database/redis/sets.js +++ b/src/database/redis/sets.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; module.exports = function (redisClient, module) { var helpers = module.helpers.redis; diff --git a/src/database/redis/sorted.js b/src/database/redis/sorted.js index 8276476571..9fa7e07694 100644 --- a/src/database/redis/sorted.js +++ b/src/database/redis/sorted.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; module.exports = function (redisClient, module) { diff --git a/src/emailer.js b/src/emailer.js index e9e529c58f..2a1298ac8c 100644 --- a/src/emailer.js +++ b/src/emailer.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var winston = require('winston'); diff --git a/src/emitter.js b/src/emitter.js index ca262257b7..833c091cb6 100644 --- a/src/emitter.js +++ b/src/emitter.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var eventEmitter = new (require('events')).EventEmitter(); diff --git a/src/file.js b/src/file.js index b056e64ac5..1983b8861a 100644 --- a/src/file.js +++ b/src/file.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var fs = require('fs'); var nconf = require('nconf'); diff --git a/src/hotswap.js b/src/hotswap.js index 6ef0f943eb..d46f6fec8e 100644 --- a/src/hotswap.js +++ b/src/hotswap.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var HotSwap = {}; var winston = require('winston'); diff --git a/src/install.js b/src/install.js index 5d93d04764..cb44f75589 100644 --- a/src/install.js +++ b/src/install.js @@ -260,12 +260,12 @@ function createAdmin(callback) { } if (results['password:confirm'] !== results.password) { - winston.warn("Passwords did not match, please try again"); + winston.warn('Passwords did not match, please try again'); return retryPassword(results); } if (results.password.length < meta.config.minimumPasswordLength) { - winston.warn("Password too short, please try again"); + winston.warn('Password too short, please try again'); return retryPassword(results); } diff --git a/src/logger.js b/src/logger.js index f90744afad..186dd62992 100644 --- a/src/logger.js +++ b/src/logger.js @@ -149,8 +149,8 @@ var opts = { try { return 'io: ' + _uid + ' ' + _type + ' ' + util.inspect(Array.prototype.slice.call(_args)) + '\n'; } catch (err) { - winston.info("Logger.prepare_io_string: Failed", err); - return "error"; + winston.info('Logger.prepare_io_string: Failed', err); + return 'error'; } }; diff --git a/src/meta.js b/src/meta.js index 2db2f09ea0..d4aa3cae49 100644 --- a/src/meta.js +++ b/src/meta.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var winston = require('winston'); diff --git a/src/meta/js.js b/src/meta/js.js index ba00c8fc18..2b8d0db5df 100644 --- a/src/meta/js.js +++ b/src/meta/js.js @@ -40,7 +40,7 @@ module.exports = function (Meta) { 'public/src/ajaxify.js', 'public/src/overrides.js', 'public/src/widgets.js', - "./node_modules/promise-polyfill/promise.js", + './node_modules/promise-polyfill/promise.js', ], // files listed below are only available client-side, or are bundled in to reduce # of network requests on cold load @@ -81,11 +81,11 @@ module.exports = function (Meta) { // modules listed below are routed through express (/src/modules) so they can be defined anonymously modules: { - "Chart.js": './node_modules/chart.js/dist/Chart.min.js', - "mousetrap.js": './node_modules/mousetrap/mousetrap.min.js', - "jqueryui.js": 'public/vendor/jquery/js/jquery-ui.js', - "buzz.js": 'public/vendor/buzz/buzz.js', - "cropper.js": './node_modules/cropperjs/dist/cropper.min.js', + 'Chart.js': './node_modules/chart.js/dist/Chart.min.js', + 'mousetrap.js': './node_modules/mousetrap/mousetrap.min.js', + 'jqueryui.js': 'public/vendor/jquery/js/jquery-ui.js', + 'buzz.js': 'public/vendor/buzz/buzz.js', + 'cropper.js': './node_modules/cropperjs/dist/cropper.min.js', }, }, }; diff --git a/src/meta/tags.js b/src/meta/tags.js index 27a4e1e7ec..56269633ae 100644 --- a/src/meta/tags.js +++ b/src/meta/tags.js @@ -53,11 +53,11 @@ module.exports = function (Meta) { }, links: function (next) { var defaultLinks = [{ - rel: "icon", - type: "image/x-icon", + rel: 'icon', + type: 'image/x-icon', href: nconf.get('relative_path') + '/favicon.ico' + (Meta.config['cache-buster'] ? '?' + Meta.config['cache-buster'] : ''), }, { - rel: "manifest", + rel: 'manifest', href: nconf.get('relative_path') + '/manifest.json', }]; diff --git a/src/meta/templates.js b/src/meta/templates.js index 44740fc787..074c02ac26 100644 --- a/src/meta/templates.js +++ b/src/meta/templates.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var mkdirp = require('mkdirp'); var rimraf = require('rimraf'); @@ -121,13 +121,13 @@ function compile(callback) { var regex = /[ \t]*[ \t]*/; while ((matches = file.match(regex)) !== null) { - var partial = "/" + matches[1]; + var partial = '/' + matches[1]; if (paths[partial] && relativePath !== partial) { file = file.replace(regex, fs.readFileSync(paths[partial]).toString()); } else { winston.warn('[meta/templates] Partial not loaded: ' + matches[1]); - file = file.replace(regex, ""); + file = file.replace(regex, ''); } } diff --git a/src/middleware/admin.js b/src/middleware/admin.js index f5439a139b..02c15c099d 100644 --- a/src/middleware/admin.js +++ b/src/middleware/admin.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var winston = require('winston'); diff --git a/src/middleware/headers.js b/src/middleware/headers.js index 899ce03c12..c31a307bf3 100644 --- a/src/middleware/headers.js +++ b/src/middleware/headers.js @@ -24,11 +24,11 @@ module.exports = function (middleware) { middleware.addExpiresHeaders = function (req, res, next) { if (req.app.enabled('cache')) { - res.setHeader("Cache-Control", "public, max-age=5184000"); - res.setHeader("Expires", new Date(Date.now() + 5184000000).toUTCString()); + res.setHeader('Cache-Control', 'public, max-age=5184000'); + res.setHeader('Expires', new Date(Date.now() + 5184000000).toUTCString()); } else { - res.setHeader("Cache-Control", "public, max-age=0"); - res.setHeader("Expires", new Date().toUTCString()); + res.setHeader('Cache-Control', 'public, max-age=0'); + res.setHeader('Expires', new Date().toUTCString()); } next(); diff --git a/src/middleware/index.js b/src/middleware/index.js index 21208cf9a6..e9a172c326 100644 --- a/src/middleware/index.js +++ b/src/middleware/index.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var fs = require('fs'); diff --git a/src/navigation/admin.js b/src/navigation/admin.js index 50214179da..ade6adaea1 100644 --- a/src/navigation/admin.js +++ b/src/navigation/admin.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); diff --git a/src/navigation/index.js b/src/navigation/index.js index 5563c44c4b..ee97c88f0c 100644 --- a/src/navigation/index.js +++ b/src/navigation/index.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var nconf = require('nconf'); var admin = require('./admin'); diff --git a/src/plugins.js b/src/plugins.js index 3ef50f2c57..c0b4ce980a 100644 --- a/src/plugins.js +++ b/src/plugins.js @@ -179,7 +179,7 @@ var middleware; if (pluginTemplates) { pluginTemplates.forEach(function (pluginTemplate) { if (pluginTemplate.endsWith('.tpl')) { - tplName = "/" + pluginTemplate.replace(templatesPath, '').substring(1); + tplName = '/' + pluginTemplate.replace(templatesPath, '').substring(1); if (templates.hasOwnProperty(tplName)) { winston.verbose('[plugins] ' + tplName + ' replaced by ' + plugin.id); diff --git a/src/privileges.js b/src/privileges.js index 8fe7a6c503..cccbd089d6 100644 --- a/src/privileges.js +++ b/src/privileges.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var privileges = module.exports; diff --git a/src/rewards/admin.js b/src/rewards/admin.js index d54c5b9f2e..bd52824f94 100644 --- a/src/rewards/admin.js +++ b/src/rewards/admin.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var plugins = require('../plugins'); diff --git a/src/rewards/index.js b/src/rewards/index.js index ed8f00d54f..c32bc94c0e 100644 --- a/src/rewards/index.js +++ b/src/rewards/index.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var db = require('../database'); diff --git a/src/routes/accounts.js b/src/routes/accounts.js index ae80b8aa4a..a462399b40 100644 --- a/src/routes/accounts.js +++ b/src/routes/accounts.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var helpers = require('./helpers'); var setupPageRoute = helpers.setupPageRoute; diff --git a/src/routes/admin.js b/src/routes/admin.js index 0611eede70..35ad84203d 100644 --- a/src/routes/admin.js +++ b/src/routes/admin.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var express = require('express'); diff --git a/src/routes/api.js b/src/routes/api.js index c8c11c099e..92649d8fad 100644 --- a/src/routes/api.js +++ b/src/routes/api.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var express = require('express'); diff --git a/src/routes/authentication.js b/src/routes/authentication.js index bc8833f034..1f3a401755 100644 --- a/src/routes/authentication.js +++ b/src/routes/authentication.js @@ -1,5 +1,5 @@ (function (Auth) { - "use strict"; + 'use strict'; var passport = require('passport'); var passportLocal = require('passport-local').Strategy; diff --git a/src/routes/debug.js b/src/routes/debug.js index 175f1ce489..59ec743c00 100644 --- a/src/routes/debug.js +++ b/src/routes/debug.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var express = require('express'); var nconf = require('nconf'); diff --git a/src/routes/feeds.js b/src/routes/feeds.js index d75491e573..3ee7593714 100644 --- a/src/routes/feeds.js +++ b/src/routes/feeds.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var rss = require('rss'); diff --git a/src/routes/index.js b/src/routes/index.js index 5e92851ef9..40688539a4 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var nconf = require('nconf'); var winston = require('winston'); diff --git a/src/routes/meta.js b/src/routes/meta.js index cb089f1200..cfeeac5b9b 100644 --- a/src/routes/meta.js +++ b/src/routes/meta.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; module.exports = function (app, middleware, controllers) { app.get('/sitemap.xml', controllers.sitemap.render); diff --git a/src/settings.js b/src/settings.js index f740a6272a..b663721991 100644 --- a/src/settings.js +++ b/src/settings.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var meta = require('./meta'); diff --git a/src/social.js b/src/social.js index 24aa29df2f..665b57866b 100644 --- a/src/social.js +++ b/src/social.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var plugins = require('./plugins'); var db = require('./database'); @@ -15,19 +15,19 @@ social.getPostSharing = function (callback) { var networks = [ { - id: "facebook", - name: "Facebook", - class: "fa-facebook", + id: 'facebook', + name: 'Facebook', + class: 'fa-facebook', }, { - id: "twitter", - name: "Twitter", - class: "fa-twitter", + id: 'twitter', + name: 'Twitter', + class: 'fa-twitter', }, { - id: "google", - name: "Google+", - class: "fa-google-plus", + id: 'google', + name: 'Google+', + class: 'fa-google-plus', }, ]; diff --git a/src/socket.io/admin.js b/src/socket.io/admin.js index f3266f0152..0658d48a34 100644 --- a/src/socket.io/admin.js +++ b/src/socket.io/admin.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var winston = require('winston'); diff --git a/src/socket.io/admin/categories.js b/src/socket.io/admin/categories.js index 43287fc2b8..faf244f6ef 100644 --- a/src/socket.io/admin/categories.js +++ b/src/socket.io/admin/categories.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); diff --git a/src/socket.io/admin/groups.js b/src/socket.io/admin/groups.js index bb4ab39f4a..b193f6e6ea 100644 --- a/src/socket.io/admin/groups.js +++ b/src/socket.io/admin/groups.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var groups = require('../../groups'); diff --git a/src/socket.io/admin/navigation.js b/src/socket.io/admin/navigation.js index 07af8baa04..ae67588377 100644 --- a/src/socket.io/admin/navigation.js +++ b/src/socket.io/admin/navigation.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var navigationAdmin = require('../../navigation/admin'); var SocketNavigation = {}; diff --git a/src/socket.io/admin/rewards.js b/src/socket.io/admin/rewards.js index 3d895a5281..8b845a33c1 100644 --- a/src/socket.io/admin/rewards.js +++ b/src/socket.io/admin/rewards.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var rewardsAdmin = require('../../rewards/admin'); var SocketRewards = module.exports; diff --git a/src/socket.io/admin/social.js b/src/socket.io/admin/social.js index 5cb797edf1..e69bcc4084 100644 --- a/src/socket.io/admin/social.js +++ b/src/socket.io/admin/social.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var social = require('../../social'); var SocketSocial = {}; diff --git a/src/socket.io/admin/tags.js b/src/socket.io/admin/tags.js index 4362159502..8fe50790eb 100644 --- a/src/socket.io/admin/tags.js +++ b/src/socket.io/admin/tags.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var topics = require('../../topics'); diff --git a/src/socket.io/admin/user.js b/src/socket.io/admin/user.js index f2dd3a6483..aca1bff8a8 100644 --- a/src/socket.io/admin/user.js +++ b/src/socket.io/admin/user.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var validator = require('validator'); diff --git a/src/socket.io/groups.js b/src/socket.io/groups.js index 5689b75538..33df72409a 100644 --- a/src/socket.io/groups.js +++ b/src/socket.io/groups.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); diff --git a/src/socket.io/index.js b/src/socket.io/index.js index 80640a4578..fcce4ecc69 100644 --- a/src/socket.io/index.js +++ b/src/socket.io/index.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var nconf = require('nconf'); diff --git a/src/socket.io/modules.js b/src/socket.io/modules.js index d77cec93b9..a3571c5906 100644 --- a/src/socket.io/modules.js +++ b/src/socket.io/modules.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var validator = require('validator'); diff --git a/src/socket.io/notifications.js b/src/socket.io/notifications.js index 9e0c4f4301..6ab97c5dc8 100644 --- a/src/socket.io/notifications.js +++ b/src/socket.io/notifications.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var user = require('../user'); diff --git a/src/socket.io/posts.js b/src/socket.io/posts.js index 933a758fb0..0a31f8427b 100644 --- a/src/socket.io/posts.js +++ b/src/socket.io/posts.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); diff --git a/src/topics.js b/src/topics.js index 8d1184be5f..23f233d0d2 100644 --- a/src/topics.js +++ b/src/topics.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var _ = require('underscore'); diff --git a/src/upgrade.js b/src/upgrade.js index 99ac96842d..1deba41cc7 100644 --- a/src/upgrade.js +++ b/src/upgrade.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var db = require('./database'); diff --git a/src/user/digest.js b/src/user/digest.js index b4de94efb6..76463caab4 100644 --- a/src/user/digest.js +++ b/src/user/digest.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var winston = require('winston'); diff --git a/src/webserver.js b/src/webserver.js index a1f45cec04..dbc65a36ec 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -220,7 +220,7 @@ function listen(callback) { winston.info('Using ports 80 and 443 is not recommend; use a proxy instead. See README.md'); } - var bind_address = ((nconf.get('bind_address') === "0.0.0.0" || !nconf.get('bind_address')) ? '0.0.0.0' : nconf.get('bind_address')); + var bind_address = ((nconf.get('bind_address') === '0.0.0.0' || !nconf.get('bind_address')) ? '0.0.0.0' : nconf.get('bind_address')); var args = isSocket ? [socketPath] : [port, bind_address]; var oldUmask; diff --git a/src/widgets/admin.js b/src/widgets/admin.js index 88c13332cc..113ff80637 100644 --- a/src/widgets/admin.js +++ b/src/widgets/admin.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var fs = require('fs'); var path = require('path'); diff --git a/src/widgets/index.js b/src/widgets/index.js index 247700ea21..abe63781ef 100644 --- a/src/widgets/index.js +++ b/src/widgets/index.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var async = require('async'); var winston = require('winston'); diff --git a/test/helpers/index.js b/test/helpers/index.js index cfc1f20074..43c7c26211 100644 --- a/test/helpers/index.js +++ b/test/helpers/index.js @@ -148,14 +148,14 @@ helpers.copyFile = function (source, target, callback) { var cbCalled = false; var rd = fs.createReadStream(source); - rd.on("error", function (err) { + rd.on('error', function (err) { done(err); }); var wr = fs.createWriteStream(target); - wr.on("error", function (err) { + wr.on('error', function (err) { done(err); }); - wr.on("close", function () { + wr.on('close', function () { done(); }); rd.pipe(wr); diff --git a/test/mocks/newXhr.js b/test/mocks/newXhr.js index a523d77617..2288b8073c 100644 --- a/test/mocks/newXhr.js +++ b/test/mocks/newXhr.js @@ -35,7 +35,7 @@ var callbacks = {}; var newXhr = function () { stdXhr.apply(this, arguments); for (var method in callbacks) { - if (typeof callbacks[method] == "function") { + if (typeof callbacks[method] == 'function') { callbacks[method].apply(this, arguments); } } diff --git a/test/socket.io.js b/test/socket.io.js index 3fcc7afa2c..0671354bcc 100644 --- a/test/socket.io.js +++ b/test/socket.io.js @@ -3,7 +3,7 @@ // see https://gist.github.com/jfromaniello/4087861#gistcomment-1447029 -process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; +process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; var assert = require('assert'); var async = require('async'); diff --git a/test/translator.js b/test/translator.js index 185f8235f3..196d5ce56f 100644 --- a/test/translator.js +++ b/test/translator.js @@ -119,7 +119,7 @@ describe('new Translator(language)', function () { var translator = Translator.create('en-GB'); var title = 'Test 1\\, 2\\, 3 % salmon'; - var key = "[[topic:composer.replying_to, " + title + "]]"; + var key = '[[topic:composer.replying_to, ' + title + ']]'; return translator.translate(key).then(function (translated) { assert.strictEqual(translated, 'Replying to Test 1, 2, 3 % salmon'); });