From bbd320d75e27d798ca1441097aa24f973c1ce271 Mon Sep 17 00:00:00 2001 From: Kevin Brown Date: Sat, 20 Jul 2019 23:01:38 -0400 Subject: [PATCH] Convert source and tests to unix newlines --- src/js/select2/i18n/sq.js | 96 +++++----- tests/results/infiniteScroll-tests.js | 252 +++++++++++++------------- tests/results/option-tests.js | 124 ++++++------- tests/selection/focusing-tests.js | 82 ++++----- tests/unit-jq1.html | 200 ++++++++++---------- tests/unit-jq2.html | 200 ++++++++++---------- tests/unit-jq3.html | 200 ++++++++++---------- 7 files changed, 577 insertions(+), 577 deletions(-) diff --git a/src/js/select2/i18n/sq.js b/src/js/select2/i18n/sq.js index d3e1b8a5..30eef3ba 100644 --- a/src/js/select2/i18n/sq.js +++ b/src/js/select2/i18n/sq.js @@ -1,48 +1,48 @@ -define(function () { - // Albanian - return { - errorLoading: function () { - return 'Rezultatet nuk mund të ngarkoheshin.'; - }, - inputTooLong: function (args) { - var overChars = args.input.length - args.maximum; - - var message = 'Të lutem fshi ' + overChars + ' karakter'; - - if (overChars != 1) { - message += 'e'; - } - - return message; - }, - inputTooShort: function (args) { - var remainingChars = args.minimum - args.input.length; - - var message = 'Të lutem shkruaj ' + remainingChars + - ' ose më shumë karaktere'; - - return message; - }, - loadingMore: function () { - return 'Duke ngarkuar më shumë rezultate…'; - }, - maximumSelected: function (args) { - var message = 'Mund të zgjedhësh vetëm ' + args.maximum + ' element'; - - if (args.maximum != 1) { - message += 'e'; - } - - return message; - }, - noResults: function () { - return 'Nuk u gjet asnjë rezultat'; - }, - searching: function () { - return 'Duke kërkuar…'; - }, - removeAllItems: function () { - return 'Hiq të gjitha sendet'; - } - }; -}); +define(function () { + // Albanian + return { + errorLoading: function () { + return 'Rezultatet nuk mund të ngarkoheshin.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Të lutem fshi ' + overChars + ' karakter'; + + if (overChars != 1) { + message += 'e'; + } + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Të lutem shkruaj ' + remainingChars + + ' ose më shumë karaktere'; + + return message; + }, + loadingMore: function () { + return 'Duke ngarkuar më shumë rezultate…'; + }, + maximumSelected: function (args) { + var message = 'Mund të zgjedhësh vetëm ' + args.maximum + ' element'; + + if (args.maximum != 1) { + message += 'e'; + } + + return message; + }, + noResults: function () { + return 'Nuk u gjet asnjë rezultat'; + }, + searching: function () { + return 'Duke kërkuar…'; + }, + removeAllItems: function () { + return 'Hiq të gjitha sendet'; + } + }; +}); diff --git a/tests/results/infiniteScroll-tests.js b/tests/results/infiniteScroll-tests.js index a8ddc99a..89bece63 100644 --- a/tests/results/infiniteScroll-tests.js +++ b/tests/results/infiniteScroll-tests.js @@ -1,126 +1,126 @@ -module('Results - Infinite scrolling'); - -test('loadingMore is triggered even without a scrollbar', function (assert) { - assert.expect(1); - - var $ = require('jquery'); - - var $select = $(''); - - var $container = $(''); - var container = new MockContainer(); - - var Utils = require('select2/utils'); - var Options = require('select2/options'); - - var Results = require('select2/results'); - var InfiniteScroll = require('select2/dropdown/infiniteScroll'); - - var InfiniteScrollResults = Utils.Decorate(Results, InfiniteScroll); - - var results = new InfiniteScrollResults($select, new Options({})); - - // Fake the data adapter for the `setClasses` method - results.data = {}; - results.data.current = function (callback) { - callback([{ id: 'test' }]); - }; - - $('#qunit-fixture').append(results.render()); - - results.bind(container, $container); - - results.on('query:append', function () { - assert.ok(true, 'It tried to load more immediately'); - }); - - container.trigger('results:all', { - data: { - results: [ - { - id: 'test', - text: 'Test' - } - ], - pagination: { - more: true - } - } - }); -}); - -test('loadingMore is not triggered without scrolling', function (assert) { - assert.expect(0); - - var $ = require('jquery'); - - var $select = $(''); - - var $container = $(''); - var container = new MockContainer(); - - var Utils = require('select2/utils'); - var Options = require('select2/options'); - - var Results = require('select2/results'); - var InfiniteScroll = require('select2/dropdown/infiniteScroll'); - - var InfiniteScrollResults = Utils.Decorate(Results, InfiniteScroll); - - var results = new InfiniteScrollResults($select, new Options({})); - - // Fake the data adapter for the `setClasses` method - results.data = {}; - results.data.current = function (callback) { - callback([{ id: 'test' }]); - }; - - var $results = results.render(); - - $('#qunit-fixture').append($results); - $results.css('max-height', '100px'); - - results.bind(container, $container); - - results.on('query:append', function () { - assert.ok(false, 'It tried to load more immediately'); - }); - - container.trigger('results:all', { - data: { - results: [ - { - id: 'test', - text: 'Test' - }, - { - id: 'test', - text: 'Test' - }, - { - id: 'test', - text: 'Test' - }, - { - id: 'test', - text: 'Test' - }, - { - id: 'test', - text: 'Test' - }, - { - id: 'test', - text: 'Test' - }, - { - id: 'test', - text: 'Test' - } - ], - pagination: { - more: true - } - } - }); -}); +module('Results - Infinite scrolling'); + +test('loadingMore is triggered even without a scrollbar', function (assert) { + assert.expect(1); + + var $ = require('jquery'); + + var $select = $(''); + + var $container = $(''); + var container = new MockContainer(); + + var Utils = require('select2/utils'); + var Options = require('select2/options'); + + var Results = require('select2/results'); + var InfiniteScroll = require('select2/dropdown/infiniteScroll'); + + var InfiniteScrollResults = Utils.Decorate(Results, InfiniteScroll); + + var results = new InfiniteScrollResults($select, new Options({})); + + // Fake the data adapter for the `setClasses` method + results.data = {}; + results.data.current = function (callback) { + callback([{ id: 'test' }]); + }; + + $('#qunit-fixture').append(results.render()); + + results.bind(container, $container); + + results.on('query:append', function () { + assert.ok(true, 'It tried to load more immediately'); + }); + + container.trigger('results:all', { + data: { + results: [ + { + id: 'test', + text: 'Test' + } + ], + pagination: { + more: true + } + } + }); +}); + +test('loadingMore is not triggered without scrolling', function (assert) { + assert.expect(0); + + var $ = require('jquery'); + + var $select = $(''); + + var $container = $(''); + var container = new MockContainer(); + + var Utils = require('select2/utils'); + var Options = require('select2/options'); + + var Results = require('select2/results'); + var InfiniteScroll = require('select2/dropdown/infiniteScroll'); + + var InfiniteScrollResults = Utils.Decorate(Results, InfiniteScroll); + + var results = new InfiniteScrollResults($select, new Options({})); + + // Fake the data adapter for the `setClasses` method + results.data = {}; + results.data.current = function (callback) { + callback([{ id: 'test' }]); + }; + + var $results = results.render(); + + $('#qunit-fixture').append($results); + $results.css('max-height', '100px'); + + results.bind(container, $container); + + results.on('query:append', function () { + assert.ok(false, 'It tried to load more immediately'); + }); + + container.trigger('results:all', { + data: { + results: [ + { + id: 'test', + text: 'Test' + }, + { + id: 'test', + text: 'Test' + }, + { + id: 'test', + text: 'Test' + }, + { + id: 'test', + text: 'Test' + }, + { + id: 'test', + text: 'Test' + }, + { + id: 'test', + text: 'Test' + }, + { + id: 'test', + text: 'Test' + } + ], + pagination: { + more: true + } + } + }); +}); diff --git a/tests/results/option-tests.js b/tests/results/option-tests.js index 6ffbb373..f98937e7 100644 --- a/tests/results/option-tests.js +++ b/tests/results/option-tests.js @@ -1,63 +1,63 @@ -module('Results - option'); - -var $ = require('jquery'); - -var Options = require('select2/options'); - -var Results = require('select2/results'); - -test('disabled property on option is respected - enabled', function (assert) { - var results = new Results($(''), new Options({})); - - var $option = $(''); - var option = results.option({ - element: $option[0] - }); - - assert.notEqual(option.getAttribute('aria-disabled'), 'true'); -}); - -test('disabled property on option is respected - disabled', function (assert) { - var results = new Results($(''), new Options({})); - - var $option = $(''); - var option = results.option({ - element: $option[0] - }); - - assert.equal(option.getAttribute('aria-disabled'), 'true'); -}); - -test('disabled property on enabled optgroup is respected', function (assert) { - var results = new Results($(''), new Options({})); - - var $option = $(''); - var option = results.option({ - element: $option[0] - }); - - assert.notEqual(option.getAttribute('aria-disabled'), 'true'); -}); - -test('disabled property on disabled optgroup is respected', function (assert) { - var results = new Results($(''), new Options({})); - - var $option = $(''); - var option = results.option({ - element: $option[0] - }); - - assert.equal(option.getAttribute('aria-disabled'), 'true'); -}); - -test('option in disabled optgroup is disabled', function (assert) { - var results = new Results($(''), new Options({})); - - var $option = $('') - .find('option'); - var option = results.option({ - element: $option[0] - }); - - assert.equal(option.getAttribute('aria-disabled'), 'true'); +module('Results - option'); + +var $ = require('jquery'); + +var Options = require('select2/options'); + +var Results = require('select2/results'); + +test('disabled property on option is respected - enabled', function (assert) { + var results = new Results($(''), new Options({})); + + var $option = $(''); + var option = results.option({ + element: $option[0] + }); + + assert.notEqual(option.getAttribute('aria-disabled'), 'true'); +}); + +test('disabled property on option is respected - disabled', function (assert) { + var results = new Results($(''), new Options({})); + + var $option = $(''); + var option = results.option({ + element: $option[0] + }); + + assert.equal(option.getAttribute('aria-disabled'), 'true'); +}); + +test('disabled property on enabled optgroup is respected', function (assert) { + var results = new Results($(''), new Options({})); + + var $option = $(''); + var option = results.option({ + element: $option[0] + }); + + assert.notEqual(option.getAttribute('aria-disabled'), 'true'); +}); + +test('disabled property on disabled optgroup is respected', function (assert) { + var results = new Results($(''), new Options({})); + + var $option = $(''); + var option = results.option({ + element: $option[0] + }); + + assert.equal(option.getAttribute('aria-disabled'), 'true'); +}); + +test('option in disabled optgroup is disabled', function (assert) { + var results = new Results($(''), new Options({})); + + var $option = $('') + .find('option'); + var option = results.option({ + element: $option[0] + }); + + assert.equal(option.getAttribute('aria-disabled'), 'true'); }); \ No newline at end of file diff --git a/tests/selection/focusing-tests.js b/tests/selection/focusing-tests.js index 81a50492..fcb2c6e7 100644 --- a/tests/selection/focusing-tests.js +++ b/tests/selection/focusing-tests.js @@ -1,41 +1,41 @@ -module('Selection containers - Managing focus'); - -var SingleSelection = require('select2/selection/single'); - -var $ = require('jquery'); -var Options = require('select2/options'); - -var options = new Options({}); - -test('close sets the focus to the selection', function (assert) { - var $container = $('#qunit-fixture .event-container'); - var container = new MockContainer(); - var selection = new SingleSelection( - $('#qunit-fixture .single'), - options - ); - - var $selection = selection.render(); - selection.bind(container, $container); - - selection.update([{ - id: 'test', - text: 'test' - }]); - - $container.append($selection); - - assert.notEqual( - document.activeElement, - $selection[0], - 'The selection had focus originally' - ); - - container.trigger('close'); - - assert.equal( - document.activeElement, - $selection[0], - 'After close, focus must be set to selection' - ); -}); +module('Selection containers - Managing focus'); + +var SingleSelection = require('select2/selection/single'); + +var $ = require('jquery'); +var Options = require('select2/options'); + +var options = new Options({}); + +test('close sets the focus to the selection', function (assert) { + var $container = $('#qunit-fixture .event-container'); + var container = new MockContainer(); + var selection = new SingleSelection( + $('#qunit-fixture .single'), + options + ); + + var $selection = selection.render(); + selection.bind(container, $container); + + selection.update([{ + id: 'test', + text: 'test' + }]); + + $container.append($selection); + + assert.notEqual( + document.activeElement, + $selection[0], + 'The selection had focus originally' + ); + + container.trigger('close'); + + assert.equal( + document.activeElement, + $selection[0], + 'After close, focus must be set to selection' + ); +}); diff --git a/tests/unit-jq1.html b/tests/unit-jq1.html index c980e2fa..730b35db 100644 --- a/tests/unit-jq1.html +++ b/tests/unit-jq1.html @@ -1,100 +1,100 @@ - - - - - - - -
-
-
- -
- - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + +
+
+
+ +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/unit-jq2.html b/tests/unit-jq2.html index 409080d4..6ff3b0c2 100644 --- a/tests/unit-jq2.html +++ b/tests/unit-jq2.html @@ -1,100 +1,100 @@ - - - - - - - -
-
-
- -
- - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + +
+
+
+ +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/unit-jq3.html b/tests/unit-jq3.html index f3754d4a..e38105e3 100644 --- a/tests/unit-jq3.html +++ b/tests/unit-jq3.html @@ -1,100 +1,100 @@ - - - - - - - -
-
-
- -
- - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + +
+
+
+ +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +