summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiovane <giovaneliberato@gmail.com>2015-12-30 16:03:27 -0200
committerGiovane <giovaneliberato@gmail.com>2015-12-30 16:03:27 -0200
commit111205c8cd74d553201b42db3041d870ae833165 (patch)
tree4a2a4f5158e45b4802c06336d792f2905c45f020
parentf8418b0a41298777834e00f4276b2a34d8c6ad39 (diff)
Updates jshint to latest version #565
- Change 'use strict' mode to function-level - Update needed files
-rw-r--r--web-ui/.jshintrc2
-rw-r--r--web-ui/app/js/features/features.js2
-rw-r--r--web-ui/app/js/foundation/initialize_foundation.js6
-rw-r--r--web-ui/app/js/foundation/off_canvas.js3
-rw-r--r--web-ui/app/js/helpers/contenttype.js2
-rw-r--r--web-ui/app/js/helpers/iterator.js2
-rw-r--r--web-ui/app/js/mail_list/ui/mail_item_factory.js2
-rw-r--r--web-ui/app/js/mail_list/ui/mail_items/mail_item.js2
-rw-r--r--web-ui/app/js/mail_list_actions/ui/mail_list_actions.js3
-rw-r--r--web-ui/app/js/mail_view/ui/mail_view.js2
-rw-r--r--web-ui/app/js/mail_view/ui/recipients/recipient.js2
-rw-r--r--web-ui/app/js/mail_view/ui/recipients/recipients_input.js2
-rw-r--r--web-ui/app/js/mail_view/ui/recipients/recipients_iterator.js2
-rw-r--r--web-ui/app/js/mail_view/ui/send_button.js3
-rw-r--r--web-ui/app/js/main.js3
-rw-r--r--web-ui/app/js/mixins/with_feature_toggle.js2
-rw-r--r--web-ui/app/js/mixins/with_mail_tagging.js2
-rw-r--r--web-ui/app/js/page/pane_contract_expand.js2
-rw-r--r--web-ui/app/js/services/model/mail.js3
-rw-r--r--web-ui/app/js/style_guide/main.js3
-rw-r--r--web-ui/package.json2
-rw-r--r--web-ui/test/spec/page/pane_contract_expand.spec.js3
-rw-r--r--web-ui/test/spec/services/mail_service.spec.js4
-rw-r--r--web-ui/test/test-main.js3
-rw-r--r--web-ui/test/test_data.js3
25 files changed, 30 insertions, 35 deletions
diff --git a/web-ui/.jshintrc b/web-ui/.jshintrc
index c56e2bd2..220aedfe 100644
--- a/web-ui/.jshintrc
+++ b/web-ui/.jshintrc
@@ -15,7 +15,7 @@
"quotmark": "single",
"regexp": true,
"smarttabs": true,
- "strict": true,
+ "strict": "function",
"trailing": true,
"undef": false,
"validthis": true,
diff --git a/web-ui/app/js/features/features.js b/web-ui/app/js/features/features.js
index 4d04df64..80ecc225 100644
--- a/web-ui/app/js/features/features.js
+++ b/web-ui/app/js/features/features.js
@@ -14,9 +14,9 @@
* You should have received a copy of the GNU Affero General Public License
* along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
*/
-'use strict';
define(['helpers/monitored_ajax'], function(monitoredAjax) {
+ 'use strict';
var cachedDisabledFeatures;
var cachedDispatcherFeatures;
diff --git a/web-ui/app/js/foundation/initialize_foundation.js b/web-ui/app/js/foundation/initialize_foundation.js
index b382a168..42405dfe 100644
--- a/web-ui/app/js/foundation/initialize_foundation.js
+++ b/web-ui/app/js/foundation/initialize_foundation.js
@@ -1,3 +1,5 @@
-'use strict';
-$(document).foundation();
+(function() {
+ 'use strict';
+ $(document).foundation();
+})();
diff --git a/web-ui/app/js/foundation/off_canvas.js b/web-ui/app/js/foundation/off_canvas.js
index 805dfab8..66334470 100644
--- a/web-ui/app/js/foundation/off_canvas.js
+++ b/web-ui/app/js/foundation/off_canvas.js
@@ -14,9 +14,8 @@
* You should have received a copy of the GNU Affero General Public License
* along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
*/
-'use strict';
define(['flight/lib/component', 'page/events'], function (defineComponent, events) {
-
+ 'use strict';
return defineComponent(function() {
this.closeSlider = function (ev){
diff --git a/web-ui/app/js/helpers/contenttype.js b/web-ui/app/js/helpers/contenttype.js
index 764b6032..92b456e9 100644
--- a/web-ui/app/js/helpers/contenttype.js
+++ b/web-ui/app/js/helpers/contenttype.js
@@ -14,8 +14,8 @@
* You should have received a copy of the GNU Affero General Public License
* along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
*/
-'use strict';
define([], function () {
+ 'use strict';
var exports = {};
// Licence: PUBLIC DOMAIN <http://unlicense.org/>
diff --git a/web-ui/app/js/helpers/iterator.js b/web-ui/app/js/helpers/iterator.js
index b5b44379..236c7a40 100644
--- a/web-ui/app/js/helpers/iterator.js
+++ b/web-ui/app/js/helpers/iterator.js
@@ -14,8 +14,8 @@
* You should have received a copy of the GNU Affero General Public License
* along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
*/
-'use strict';
define(function () {
+ 'use strict';
return Iterator;
diff --git a/web-ui/app/js/mail_list/ui/mail_item_factory.js b/web-ui/app/js/mail_list/ui/mail_item_factory.js
index ddfa4c62..7205d35c 100644
--- a/web-ui/app/js/mail_list/ui/mail_item_factory.js
+++ b/web-ui/app/js/mail_list/ui/mail_item_factory.js
@@ -14,7 +14,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
*/
-'use strict';
define(
[
@@ -23,6 +22,7 @@ define(
'mail_list/ui/mail_items/sent_item'
],
function (GenericMailItem, DraftItem, SentItem) {
+ 'use strict';
var MAIL_ITEM_TYPE = {
'drafts': DraftItem,
diff --git a/web-ui/app/js/mail_list/ui/mail_items/mail_item.js b/web-ui/app/js/mail_list/ui/mail_items/mail_item.js
index 266db926..c075b0b5 100644
--- a/web-ui/app/js/mail_list/ui/mail_items/mail_item.js
+++ b/web-ui/app/js/mail_list/ui/mail_items/mail_item.js
@@ -14,7 +14,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
*/
-'use strict';
define(
[
@@ -24,6 +23,7 @@ define(
],
function (viewHelper, templates, events) {
+ 'use strict';
function mailItem() {
this.updateSelected = function (ev, data) {
if (data.ident === this.attr.mail.ident) { this.doSelect(); }
diff --git a/web-ui/app/js/mail_list_actions/ui/mail_list_actions.js b/web-ui/app/js/mail_list_actions/ui/mail_list_actions.js
index f71ed07c..69e5fde4 100644
--- a/web-ui/app/js/mail_list_actions/ui/mail_list_actions.js
+++ b/web-ui/app/js/mail_list_actions/ui/mail_list_actions.js
@@ -14,7 +14,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
*/
-'use strict';
define(
[
@@ -50,7 +49,7 @@ define(
markManyAsReadTrigger,
markAsUnreadTrigger
) {
-
+ 'use strict';
return defineComponent(mailsActions);
function mailsActions() {
diff --git a/web-ui/app/js/mail_view/ui/mail_view.js b/web-ui/app/js/mail_view/ui/mail_view.js
index 01db6c4f..76c5b7d9 100644
--- a/web-ui/app/js/mail_view/ui/mail_view.js
+++ b/web-ui/app/js/mail_view/ui/mail_view.js
@@ -15,7 +15,6 @@
* along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
*/
-'use strict';
define(
[
'flight/lib/component',
@@ -29,6 +28,7 @@ define(
],
function (defineComponent, templates, mailActions, viewHelpers, withHideAndShow, withMailTagging, events, i18n) {
+ 'use strict';
return defineComponent(mailView, mailActions, withHideAndShow, withMailTagging);
diff --git a/web-ui/app/js/mail_view/ui/recipients/recipient.js b/web-ui/app/js/mail_view/ui/recipients/recipient.js
index abfbc8e4..c13a52b1 100644
--- a/web-ui/app/js/mail_view/ui/recipients/recipient.js
+++ b/web-ui/app/js/mail_view/ui/recipients/recipient.js
@@ -14,7 +14,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
*/
-'use strict';
define(
[
@@ -24,6 +23,7 @@ define(
],
function (defineComponent, templates, events) {
+ 'use strict';
return defineComponent(recipient);
diff --git a/web-ui/app/js/mail_view/ui/recipients/recipients_input.js b/web-ui/app/js/mail_view/ui/recipients/recipients_input.js
index db0b10f7..62bc9c4a 100644
--- a/web-ui/app/js/mail_view/ui/recipients/recipients_input.js
+++ b/web-ui/app/js/mail_view/ui/recipients/recipients_input.js
@@ -14,7 +14,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
*/
-'use strict';
define([
'flight/lib/component',
@@ -22,6 +21,7 @@ define([
'features'
],
function (defineComponent, events, features) {
+ 'use strict';
function recipientsInput() {
var EXIT_KEY_CODE_MAP = {
diff --git a/web-ui/app/js/mail_view/ui/recipients/recipients_iterator.js b/web-ui/app/js/mail_view/ui/recipients/recipients_iterator.js
index 6c52c52e..624ac4f5 100644
--- a/web-ui/app/js/mail_view/ui/recipients/recipients_iterator.js
+++ b/web-ui/app/js/mail_view/ui/recipients/recipients_iterator.js
@@ -15,8 +15,8 @@
* along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
*/
-'use strict';
define(['helpers/iterator'], function (Iterator) {
+ 'use strict';
return RecipientsIterator;
diff --git a/web-ui/app/js/mail_view/ui/send_button.js b/web-ui/app/js/mail_view/ui/send_button.js
index b16ea055..b1f35906 100644
--- a/web-ui/app/js/mail_view/ui/send_button.js
+++ b/web-ui/app/js/mail_view/ui/send_button.js
@@ -14,8 +14,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
*/
-'use strict';
-
define([
'flight/lib/component',
'flight/lib/utils',
@@ -23,6 +21,7 @@ define([
'helpers/view_helper'
],
function (defineComponent, utils, events, viewHelper) {
+ 'use strict';
return defineComponent(sendButton);
diff --git a/web-ui/app/js/main.js b/web-ui/app/js/main.js
index ea68218d..5fb2e46f 100644
--- a/web-ui/app/js/main.js
+++ b/web-ui/app/js/main.js
@@ -14,7 +14,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
*/
-'use strict';
requirejs.config({
baseUrl: '../assets/',
@@ -48,6 +47,7 @@ require([
'flight/lib/compose',
'flight/lib/debug'
], function(compose, debug){
+ 'use strict';
debug.enable(true);
debug.events.logAll();
});
@@ -65,6 +65,7 @@ require(
],
function(compose, registry, advice, withLogging, debug, events, initializeDefault, _monkeyPatched) {
+ 'use strict';
window.Pixelated = window.Pixelated || {};
window.Pixelated.events = events;
diff --git a/web-ui/app/js/mixins/with_feature_toggle.js b/web-ui/app/js/mixins/with_feature_toggle.js
index b286cc48..195b08bc 100644
--- a/web-ui/app/js/mixins/with_feature_toggle.js
+++ b/web-ui/app/js/mixins/with_feature_toggle.js
@@ -15,9 +15,9 @@
* along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
*/
-'use strict';
define(['features'],
function(features) {
+ 'use strict';
function withFeatureToggle(componentName, behaviorForFeatureOff) {
return function() {
diff --git a/web-ui/app/js/mixins/with_mail_tagging.js b/web-ui/app/js/mixins/with_mail_tagging.js
index 8e27d672..1fc1c3bd 100644
--- a/web-ui/app/js/mixins/with_mail_tagging.js
+++ b/web-ui/app/js/mixins/with_mail_tagging.js
@@ -15,10 +15,10 @@
* along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
*/
-'use strict';
define(
['page/events', 'features'],
function (events, features) {
+ 'use strict';
function withMailTagging () {
this.updateTags = function(mail, tags) {
this.trigger(document, events.mail.tags.update, {ident: mail.ident, tags: tags});
diff --git a/web-ui/app/js/page/pane_contract_expand.js b/web-ui/app/js/page/pane_contract_expand.js
index aee8c44f..9bb435c4 100644
--- a/web-ui/app/js/page/pane_contract_expand.js
+++ b/web-ui/app/js/page/pane_contract_expand.js
@@ -14,9 +14,9 @@
* You should have received a copy of the GNU Affero General Public License
* along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
*/
-'use strict';
define(['flight/lib/component', 'page/events'], function (describeComponent, events) {
+ 'use strict';
return describeComponent(paneContractExpand);
diff --git a/web-ui/app/js/services/model/mail.js b/web-ui/app/js/services/model/mail.js
index c41bcff9..64a10c1c 100644
--- a/web-ui/app/js/services/model/mail.js
+++ b/web-ui/app/js/services/model/mail.js
@@ -14,9 +14,8 @@
* You should have received a copy of the GNU Affero General Public License
* along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
*/
-'use strict';
-
define(['helpers/contenttype'], function (contentType) {
+ 'use strict';
function isSentMail() {
return _.has(this, 'mailbox') && this.mailbox.toUpperCase() === 'SENT';
}
diff --git a/web-ui/app/js/style_guide/main.js b/web-ui/app/js/style_guide/main.js
index 170d1187..32c213cf 100644
--- a/web-ui/app/js/style_guide/main.js
+++ b/web-ui/app/js/style_guide/main.js
@@ -14,9 +14,8 @@
* You should have received a copy of the GNU Affero General Public License
* along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
*/
-'use strict';
-
$(document).ready(function(){
+ 'use strict';
$('a[href*=#]').click(function() {
if (location.pathname.replace(/^\//,'') === this.pathname.replace(/^\//,'') &&
location.hostname === this.hostname) {
diff --git a/web-ui/package.json b/web-ui/package.json
index e03d607c..d067dc68 100644
--- a/web-ui/package.json
+++ b/web-ui/package.json
@@ -9,7 +9,7 @@
"handlebars": "2.0.0",
"html-minifier": "1.0.1",
"imagemin": "4.0.0",
- "jshint": "2.8.0",
+ "jshint": "2.9.1-rc2",
"karma": "0.12.31",
"karma-chrome-launcher": "0.1.7",
"karma-firefox-launcher": "0.1.4",
diff --git a/web-ui/test/spec/page/pane_contract_expand.spec.js b/web-ui/test/spec/page/pane_contract_expand.spec.js
index 6c7ebcfc..5ec7192a 100644
--- a/web-ui/test/spec/page/pane_contract_expand.spec.js
+++ b/web-ui/test/spec/page/pane_contract_expand.spec.js
@@ -1,7 +1,6 @@
-'use strict';
describeComponent('page/pane_contract_expand', function () {
-
+ 'use strict';
var fixture;
beforeEach(function () {
diff --git a/web-ui/test/spec/services/mail_service.spec.js b/web-ui/test/spec/services/mail_service.spec.js
index d0911768..82714797 100644
--- a/web-ui/test/spec/services/mail_service.spec.js
+++ b/web-ui/test/spec/services/mail_service.spec.js
@@ -1,7 +1,5 @@
-'use strict';
-
describeComponent('services/mail_service', function () {
-
+ 'use strict';
var email1, i18n;
var features;
diff --git a/web-ui/test/test-main.js b/web-ui/test/test-main.js
index cfd2d81c..7d87d9de 100644
--- a/web-ui/test/test-main.js
+++ b/web-ui/test/test-main.js
@@ -1,6 +1,6 @@
-'use strict';
var tests = Object.keys(window.__karma__.files).filter(function (file) {
+ 'use strict';
return (/\.spec\.js$/.test(file));
});
@@ -39,6 +39,7 @@ requirejs.config({
deps: tests,
callback: function () {
+ 'use strict';
require(['page/events','test/test_data', 'views/i18n', 'monkey_patching/array', 'views/recipientListFormatter', 'test/custom_matchers'], function (events, testData, i18n, mp, recipientListFormatter, customMatchers) {
window.Pixelated = window.Pixelated || {};
window.Pixelated.events = events;
diff --git a/web-ui/test/test_data.js b/web-ui/test/test_data.js
index 62492bbe..ea9458dc 100644
--- a/web-ui/test/test_data.js
+++ b/web-ui/test/test_data.js
@@ -1,6 +1,5 @@
-'use strict';
-
define(function() {
+'use strict';
var rawMail = {
header: {
to:'jed_waelchi@cummerata.info',