diff options
| author | Nik Nyby <nikolas@gnu.org> | 2015-08-26 00:24:55 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-09-02 13:52:38 -0400 |
| commit | 722bf23518afad6fd90694c17484da33551e4cef (patch) | |
| tree | 2691ad771db7fe67e207ef5f96221687316b7f5c /js_tests/admin/jsi18n-mocks.test.js | |
| parent | 0e925de245a0a1bf5d063c816c8bff9f0280a4c7 (diff) | |
Added linting for JavaScript tests.
Diffstat (limited to 'js_tests/admin/jsi18n-mocks.test.js')
| -rw-r--r-- | js_tests/admin/jsi18n-mocks.test.js | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/js_tests/admin/jsi18n-mocks.test.js b/js_tests/admin/jsi18n-mocks.test.js index dcd7c67c3e..4858de6eb3 100644 --- a/js_tests/admin/jsi18n-mocks.test.js +++ b/js_tests/admin/jsi18n-mocks.test.js @@ -1,22 +1,30 @@ -(function (globals) { - +(function(globals) { + 'use strict'; var django = globals.django || (globals.django = {}); - django.pluralidx = function (count) { return (count == 1) ? 0 : 1; }; + django.pluralidx = function(count) { return (count === 1) ? 0 : 1; }; /* gettext identity library */ - django.gettext = function (msgid) { return msgid; }; - django.ngettext = function (singular, plural, count) { return (count == 1) ? singular : plural; }; - django.gettext_noop = function (msgid) { return msgid; }; - django.pgettext = function (context, msgid) { return msgid; }; - django.npgettext = function (context, singular, plural, count) { return (count == 1) ? singular : plural; }; + django.gettext = function(msgid) { return msgid; }; + django.ngettext = function(singular, plural, count) { + return (count === 1) ? singular : plural; + }; + django.gettext_noop = function(msgid) { return msgid; }; + django.pgettext = function(context, msgid) { return msgid; }; + django.npgettext = function(context, singular, plural, count) { + return (count === 1) ? singular : plural; + }; - django.interpolate = function (fmt, obj, named) { + django.interpolate = function(fmt, obj, named) { if (named) { - return fmt.replace(/%\(\w+\)s/g, function(match){return String(obj[match.slice(2,-2)])}); + return fmt.replace(/%\(\w+\)s/g, function(match) { + return String(obj[match.slice(2, -2)]); + }); } else { - return fmt.replace(/%s/g, function(match){return String(obj.shift())}); + return fmt.replace(/%s/g, function(match) { + return String(obj.shift()); + }); } }; @@ -60,9 +68,9 @@ "YEAR_MONTH_FORMAT": "F Y" }; - django.get_format = function (format_type) { + django.get_format = function(format_type) { var value = django.formats[format_type]; - if (typeof(value) == 'undefined') { + if (typeof value === 'undefined') { return format_type; } else { return value; |
