mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Update AdminLTE
- from 2.4.5 to 2.4.18 (cannot detect any issues) - set default scancycle for Apple Devices to 1
This commit is contained in:
@@ -3,8 +3,9 @@ define([
|
||||
'jquery-mousewheel',
|
||||
|
||||
'./select2/core',
|
||||
'./select2/defaults'
|
||||
], function ($, _, Select2, Defaults) {
|
||||
'./select2/defaults',
|
||||
'./select2/utils'
|
||||
], function ($, _, Select2, Defaults, Utils) {
|
||||
if ($.fn.select2 == null) {
|
||||
// All methods that should return the element
|
||||
var thisMethods = ['open', 'close', 'destroy'];
|
||||
@@ -25,7 +26,7 @@ define([
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
|
||||
this.each(function () {
|
||||
var instance = $(this).data('select2');
|
||||
var instance = Utils.GetData(this, 'select2');
|
||||
|
||||
if (instance == null && window.console && console.error) {
|
||||
console.error(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
define([
|
||||
'jquery'
|
||||
], function ($) {
|
||||
'jquery',
|
||||
'../utils'
|
||||
], function ($, Utils) {
|
||||
function InputData (decorated, $element, options) {
|
||||
this._currentData = [];
|
||||
this._valueSeparator = options.get('valueSeparator') || ',';
|
||||
@@ -117,7 +118,7 @@ define([
|
||||
|
||||
InputData.prototype.addOptions = function (_, $options) {
|
||||
var options = $.map($options, function ($option) {
|
||||
return $.data($option[0], 'data');
|
||||
return Utils.GetData($option[0], 'data');
|
||||
});
|
||||
|
||||
this._currentData.push.apply(this._currentData, options);
|
||||
|
||||
@@ -5,8 +5,8 @@ define([
|
||||
'./keys'
|
||||
], function ($, Options, Utils, KEYS) {
|
||||
var Select2 = function ($element, options) {
|
||||
if ($element.data('select2') != null) {
|
||||
$element.data('select2').destroy();
|
||||
if (Utils.GetData($element[0], 'select2') != null) {
|
||||
Utils.GetData($element[0], 'select2').destroy();
|
||||
}
|
||||
|
||||
this.$element = $element;
|
||||
@@ -22,7 +22,7 @@ define([
|
||||
// Set up the tabindex
|
||||
|
||||
var tabindex = $element.attr('tabindex') || 0;
|
||||
$element.data('old-tabindex', tabindex);
|
||||
Utils.StoreData($element[0], 'old-tabindex', tabindex);
|
||||
$element.attr('tabindex', '-1');
|
||||
|
||||
// Set up containers and adapters
|
||||
@@ -83,6 +83,9 @@ define([
|
||||
// Synchronize any monitored attributes
|
||||
this._syncAttributes();
|
||||
|
||||
Utils.StoreData($element[0], 'select2', this);
|
||||
|
||||
// Ensure backwards compatibility with $element.data('select2').
|
||||
$element.data('select2', this);
|
||||
};
|
||||
|
||||
@@ -159,6 +162,12 @@ define([
|
||||
return null;
|
||||
}
|
||||
|
||||
if (method == 'computedstyle') {
|
||||
var computedStyle = window.getComputedStyle($element[0]);
|
||||
|
||||
return computedStyle.width;
|
||||
}
|
||||
|
||||
return method;
|
||||
};
|
||||
|
||||
@@ -417,7 +426,8 @@ define([
|
||||
'open': 'opening',
|
||||
'close': 'closing',
|
||||
'select': 'selecting',
|
||||
'unselect': 'unselecting'
|
||||
'unselect': 'unselecting',
|
||||
'clear': 'clearing'
|
||||
};
|
||||
|
||||
if (args === undefined) {
|
||||
@@ -572,10 +582,12 @@ define([
|
||||
this._syncS = null;
|
||||
|
||||
this.$element.off('.select2');
|
||||
this.$element.attr('tabindex', this.$element.data('old-tabindex'));
|
||||
this.$element.attr('tabindex',
|
||||
Utils.GetData(this.$element[0], 'old-tabindex'));
|
||||
|
||||
this.$element.removeClass('select2-hidden-accessible');
|
||||
this.$element.attr('aria-hidden', 'false');
|
||||
Utils.RemoveData(this.$element[0]);
|
||||
this.$element.removeData('select2');
|
||||
|
||||
this.dataAdapter.destroy();
|
||||
@@ -603,7 +615,7 @@ define([
|
||||
|
||||
this.$container.addClass('select2-container--' + this.options.get('theme'));
|
||||
|
||||
$container.data('element', this.$element);
|
||||
Utils.StoreData($container[0], 'element', this.$element);
|
||||
|
||||
return $container;
|
||||
};
|
||||
|
||||
@@ -82,7 +82,8 @@ define([
|
||||
}, function () {
|
||||
// Attempt to detect if a request was aborted
|
||||
// Only works if the transport exposes a status property
|
||||
if ($request.status && $request.status === '0') {
|
||||
if ('status' in $request &&
|
||||
($request.status === 0 || $request.status === '0')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ define([
|
||||
// Remove anything added to child elements
|
||||
this.$element.find('*').each(function () {
|
||||
// Remove any custom data set by Select2
|
||||
$.removeData(this, 'data');
|
||||
Utils.RemoveData(this);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -192,7 +192,7 @@ define([
|
||||
normalizedData.element = option;
|
||||
|
||||
// Override the option's data with the combined data
|
||||
$.data(option, 'data', normalizedData);
|
||||
Utils.StoreData(option, 'data', normalizedData);
|
||||
|
||||
return $option;
|
||||
};
|
||||
@@ -200,7 +200,7 @@ define([
|
||||
SelectAdapter.prototype.item = function ($option) {
|
||||
var data = {};
|
||||
|
||||
data = $.data($option[0], 'data');
|
||||
data = Utils.GetData($option[0], 'data');
|
||||
|
||||
if (data != null) {
|
||||
return data;
|
||||
@@ -238,13 +238,13 @@ define([
|
||||
data = this._normalizeItem(data);
|
||||
data.element = $option[0];
|
||||
|
||||
$.data($option[0], 'data', data);
|
||||
Utils.StoreData($option[0], 'data', data);
|
||||
|
||||
return data;
|
||||
};
|
||||
|
||||
SelectAdapter.prototype._normalizeItem = function (item) {
|
||||
if (!$.isPlainObject(item)) {
|
||||
if (item !== Object(item)) {
|
||||
item = {
|
||||
id: item,
|
||||
text: item
|
||||
|
||||
@@ -58,7 +58,7 @@ define([
|
||||
// Replace the search term if we have the search box
|
||||
if (this.$search.length) {
|
||||
this.$search.val(tokenData.term);
|
||||
this.$search.focus();
|
||||
this.$search.trigger('focus');
|
||||
}
|
||||
|
||||
params.term = tokenData.term;
|
||||
|
||||
@@ -365,6 +365,7 @@ define([
|
||||
maximumSelectionLength: 0,
|
||||
minimumResultsForSearch: 0,
|
||||
selectOnClose: false,
|
||||
scrollAfterSelect: false,
|
||||
sorter: function (data) {
|
||||
return data;
|
||||
},
|
||||
@@ -387,7 +388,7 @@ define([
|
||||
|
||||
var convertedData = Utils._convertData(data);
|
||||
|
||||
$.extend(this.defaults, convertedData);
|
||||
$.extend(true, this.defaults, convertedData);
|
||||
};
|
||||
|
||||
var defaults = new Defaults();
|
||||
|
||||
@@ -262,6 +262,7 @@ define([
|
||||
'\u019F': 'O',
|
||||
'\uA74A': 'O',
|
||||
'\uA74C': 'O',
|
||||
'\u0152': 'OE',
|
||||
'\u01A2': 'OI',
|
||||
'\uA74E': 'OO',
|
||||
'\u0222': 'OU',
|
||||
@@ -671,6 +672,7 @@ define([
|
||||
'\uA74B': 'o',
|
||||
'\uA74D': 'o',
|
||||
'\u0275': 'o',
|
||||
'\u0153': 'oe',
|
||||
'\u01A3': 'oi',
|
||||
'\u0223': 'ou',
|
||||
'\uA74F': 'oo',
|
||||
@@ -839,8 +841,9 @@ define([
|
||||
'\u03CD': '\u03C5',
|
||||
'\u03CB': '\u03C5',
|
||||
'\u03B0': '\u03C5',
|
||||
'\u03C9': '\u03C9',
|
||||
'\u03C2': '\u03C3'
|
||||
'\u03CE': '\u03C9',
|
||||
'\u03C2': '\u03C3',
|
||||
'\u2019': '\''
|
||||
};
|
||||
|
||||
return diacritics;
|
||||
|
||||
@@ -30,7 +30,7 @@ define([
|
||||
};
|
||||
|
||||
Dropdown.prototype.position = function ($dropdown, $container) {
|
||||
// Should be implmented in subclasses
|
||||
// Should be implemented in subclasses
|
||||
};
|
||||
|
||||
Dropdown.prototype.destroy = function () {
|
||||
|
||||
@@ -90,14 +90,14 @@ define([
|
||||
|
||||
var $watchers = this.$container.parents().filter(Utils.hasScroll);
|
||||
$watchers.each(function () {
|
||||
$(this).data('select2-scroll-position', {
|
||||
Utils.StoreData(this, 'select2-scroll-position', {
|
||||
x: $(this).scrollLeft(),
|
||||
y: $(this).scrollTop()
|
||||
});
|
||||
});
|
||||
|
||||
$watchers.on(scrollEvent, function (ev) {
|
||||
var position = $(this).data('select2-scroll-position');
|
||||
var position = Utils.GetData(this, 'select2-scroll-position');
|
||||
$(this).scrollTop(position.y);
|
||||
});
|
||||
|
||||
@@ -156,10 +156,10 @@ define([
|
||||
top: container.bottom
|
||||
};
|
||||
|
||||
// Determine what the parent element is to use for calciulating the offset
|
||||
// Determine what the parent element is to use for calculating the offset
|
||||
var $offsetParent = this.$dropdownParent;
|
||||
|
||||
// For statically positoned elements, we need to get the element
|
||||
// For statically positioned elements, we need to get the element
|
||||
// that is determining the offset
|
||||
if ($offsetParent.css('position') === 'static') {
|
||||
$offsetParent = $offsetParent.offsetParent();
|
||||
|
||||
@@ -21,7 +21,7 @@ define([
|
||||
var originalEvent = evt.originalEvent;
|
||||
|
||||
// Don't close if the control key is being held
|
||||
if (originalEvent && originalEvent.ctrlKey) {
|
||||
if (originalEvent && (originalEvent.ctrlKey || originalEvent.metaKey)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ define([
|
||||
|
||||
if (this.showLoadingMore(data)) {
|
||||
this.$results.append(this.$loadingMore);
|
||||
this.loadMoreIfNeeded();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -36,25 +37,27 @@ define([
|
||||
self.loading = true;
|
||||
});
|
||||
|
||||
this.$results.on('scroll', function () {
|
||||
var isLoadMoreVisible = $.contains(
|
||||
document.documentElement,
|
||||
self.$loadingMore[0]
|
||||
);
|
||||
this.$results.on('scroll', this.loadMoreIfNeeded.bind(this));
|
||||
};
|
||||
|
||||
if (self.loading || !isLoadMoreVisible) {
|
||||
return;
|
||||
}
|
||||
InfiniteScroll.prototype.loadMoreIfNeeded = function () {
|
||||
var isLoadMoreVisible = $.contains(
|
||||
document.documentElement,
|
||||
this.$loadingMore[0]
|
||||
);
|
||||
|
||||
var currentOffset = self.$results.offset().top +
|
||||
self.$results.outerHeight(false);
|
||||
var loadingMoreOffset = self.$loadingMore.offset().top +
|
||||
self.$loadingMore.outerHeight(false);
|
||||
if (this.loading || !isLoadMoreVisible) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentOffset + 50 >= loadingMoreOffset) {
|
||||
self.loadMore();
|
||||
}
|
||||
});
|
||||
var currentOffset = this.$results.offset().top +
|
||||
this.$results.outerHeight(false);
|
||||
var loadingMoreOffset = this.$loadingMore.offset().top +
|
||||
this.$loadingMore.outerHeight(false);
|
||||
|
||||
if (currentOffset + 50 >= loadingMoreOffset) {
|
||||
this.loadMore();
|
||||
}
|
||||
};
|
||||
|
||||
InfiniteScroll.prototype.loadMore = function () {
|
||||
|
||||
@@ -49,10 +49,10 @@ define([
|
||||
container.on('open', function () {
|
||||
self.$search.attr('tabindex', 0);
|
||||
|
||||
self.$search.focus();
|
||||
self.$search.trigger('focus');
|
||||
|
||||
window.setTimeout(function () {
|
||||
self.$search.focus();
|
||||
self.$search.trigger('focus');
|
||||
}, 0);
|
||||
});
|
||||
|
||||
@@ -60,11 +60,12 @@ define([
|
||||
self.$search.attr('tabindex', -1);
|
||||
|
||||
self.$search.val('');
|
||||
self.$search.trigger('blur');
|
||||
});
|
||||
|
||||
container.on('focus', function () {
|
||||
if (!container.isOpen()) {
|
||||
self.$search.focus();
|
||||
self.$search.trigger('focus');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
define([
|
||||
|
||||
], function () {
|
||||
'../utils'
|
||||
], function (Utils) {
|
||||
function SelectOnClose () { }
|
||||
|
||||
SelectOnClose.prototype.bind = function (decorated, container, $container) {
|
||||
@@ -31,7 +31,7 @@ define([
|
||||
return;
|
||||
}
|
||||
|
||||
var data = $highlightedResults.data('data');
|
||||
var data = Utils.GetData($highlightedResults[0], 'data');
|
||||
|
||||
// Don't re-select already selected resulte
|
||||
if (
|
||||
|
||||
@@ -39,6 +39,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Besig…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Verwyder alle items';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -25,6 +25,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'جاري البحث…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'قم بإزالة كل العناصر';
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -22,6 +22,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Axtarılır…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Bütün elementləri sil';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -42,6 +42,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Търсене…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Премахнете всички елементи';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
45
front/lib/AdminLTE/bower_components/select2/src/js/select2/i18n/bn.js
vendored
Normal file
45
front/lib/AdminLTE/bower_components/select2/src/js/select2/i18n/bn.js
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
define(function () {
|
||||
// Bangla
|
||||
return {
|
||||
errorLoading: function () {
|
||||
return 'ফলাফলগুলি লোড করা যায়নি।';
|
||||
},
|
||||
inputTooLong: function (args) {
|
||||
var overChars = args.input.length - args.maximum;
|
||||
|
||||
var message = 'অনুগ্রহ করে ' + overChars + ' টি অক্ষর মুছে দিন।';
|
||||
|
||||
if (overChars != 1) {
|
||||
message = 'অনুগ্রহ করে ' + overChars + ' টি অক্ষর মুছে দিন।';
|
||||
}
|
||||
|
||||
return message;
|
||||
},
|
||||
inputTooShort: function (args) {
|
||||
var remainingChars = args.minimum - args.input.length;
|
||||
|
||||
var message = remainingChars + ' টি অক্ষর অথবা অধিক অক্ষর লিখুন।';
|
||||
|
||||
return message;
|
||||
},
|
||||
loadingMore: function () {
|
||||
return 'আরো ফলাফল লোড হচ্ছে ...';
|
||||
},
|
||||
maximumSelected: function (args) {
|
||||
var message = args.maximum + ' টি আইটেম নির্বাচন করতে পারবেন।';
|
||||
|
||||
if (args.maximum != 1) {
|
||||
message = args.maximum + ' টি আইটেম নির্বাচন করতে পারবেন।';
|
||||
}
|
||||
|
||||
return message;
|
||||
},
|
||||
noResults: function () {
|
||||
return 'কোন ফলাফল পাওয়া যায়নি।';
|
||||
},
|
||||
searching: function () {
|
||||
return 'অনুসন্ধান করা হচ্ছে ...';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -50,6 +50,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Pretraga…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Uklonite sve stavke';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -47,6 +47,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Cercant…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Treu tots els elements';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -56,6 +56,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Vyhledávání…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Odstraňte všechny položky';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -31,6 +31,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Søger…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Fjern alle elementer';
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -35,6 +35,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Suche…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Entferne alle Gegenstände';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -43,6 +43,10 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Pyta se…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
// To DO : in Lower Sorbian.
|
||||
return 'Remove all items';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -47,6 +47,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Αναζήτηση…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Καταργήστε όλα τα στοιχεία';
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -39,6 +39,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Searching…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Remove all items';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -47,6 +47,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Buscando…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Eliminar todos los elementos';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -48,6 +48,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Otsin…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Eemalda kõik esemed';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -46,6 +46,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Bilatzen…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Kendu elementu guztiak';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -33,6 +33,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'در حال جستجو...';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'همه موارد را حذف کنید';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -25,6 +25,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Haetaan…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Poista kaikki kohteet';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -8,26 +8,29 @@ define(function () {
|
||||
var overChars = args.input.length - args.maximum;
|
||||
|
||||
return 'Supprimez ' + overChars + ' caractère' +
|
||||
(overChars > 1) ? 's' : '';
|
||||
((overChars > 1) ? 's' : '');
|
||||
},
|
||||
inputTooShort: function (args) {
|
||||
var remainingChars = args.minimum - args.input.length;
|
||||
|
||||
return 'Saisissez au moins ' + remainingChars + ' caractère' +
|
||||
(remainingChars > 1) ? 's' : '';
|
||||
((remainingChars > 1) ? 's' : '');
|
||||
},
|
||||
loadingMore: function () {
|
||||
return 'Chargement de résultats supplémentaires…';
|
||||
},
|
||||
maximumSelected: function (args) {
|
||||
return 'Vous pouvez seulement sélectionner ' + args.maximum +
|
||||
' élément' + (args.maximum > 1) ? 's' : '';
|
||||
' élément' + ((args.maximum > 1) ? 's' : '');
|
||||
},
|
||||
noResults: function () {
|
||||
return 'Aucun résultat trouvé';
|
||||
},
|
||||
searching: function () {
|
||||
return 'Recherche en cours…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Supprimer tous les éléments';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -34,6 +34,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Buscando…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Elimina todos os elementos';
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -51,6 +51,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'מחפש…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'הסר את כל הפריטים';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -34,6 +34,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'खोज रहा है...';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'सभी वस्तुओं को हटा दें';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -39,6 +39,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Pretraga…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Ukloni sve stavke';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -43,6 +43,10 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Pyta so…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
// To DO : in Upper Sorbian.
|
||||
return 'Remove all items';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -25,6 +25,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Keresés…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Távolítson el minden elemet';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -33,6 +33,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Որոնում․․․';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Հեռացնել բոլոր տարրերը';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -25,6 +25,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Mencari…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Hapus semua item';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -36,6 +36,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Leita…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Fjarlægðu öll atriði';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -43,6 +43,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Sto cercando…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Rimuovi tutti gli oggetti';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -31,6 +31,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return '検索しています…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'すべてのアイテムを削除';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
40
front/lib/AdminLTE/bower_components/select2/src/js/select2/i18n/ka.js
vendored
Normal file
40
front/lib/AdminLTE/bower_components/select2/src/js/select2/i18n/ka.js
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
define(function () {
|
||||
// Georgian
|
||||
return {
|
||||
errorLoading: function () {
|
||||
return 'მონაცემების ჩატვირთვა შეუძლებელია.';
|
||||
},
|
||||
inputTooLong: function (args) {
|
||||
var overChars = args.input.length - args.maximum;
|
||||
|
||||
var message = 'გთხოვთ აკრიფეთ ' + overChars + ' სიმბოლოთი ნაკლები';
|
||||
|
||||
return message;
|
||||
},
|
||||
inputTooShort: function (args) {
|
||||
var remainingChars = args.minimum - args.input.length;
|
||||
|
||||
var message = 'გთხოვთ აკრიფეთ ' + remainingChars + ' სიმბოლო ან მეტი';
|
||||
|
||||
return message;
|
||||
},
|
||||
loadingMore: function () {
|
||||
return 'მონაცემების ჩატვირთვა…';
|
||||
},
|
||||
maximumSelected: function (args) {
|
||||
var message = 'თქვენ შეგიძლიათ აირჩიოთ არაუმეტეს ' + args.maximum +
|
||||
' ელემენტი';
|
||||
|
||||
return message;
|
||||
},
|
||||
noResults: function () {
|
||||
return 'რეზულტატი არ მოიძებნა';
|
||||
},
|
||||
searching: function () {
|
||||
return 'ძიება…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'ამოიღე ყველა ელემენტი';
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -31,6 +31,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'កំពុងស្វែងរក...';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'លុបធាតុទាំងអស់';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -31,6 +31,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return '검색 중…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return '모든 항목 삭제';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -47,6 +47,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Ieškoma…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Pašalinti visus elementus';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -46,6 +46,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Meklēšana…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Noņemt visus vienumus';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -42,6 +42,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Пребарување…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Отстрани ги сите предмети';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -25,6 +25,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Mencari…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Keluarkan semua item';
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -12,9 +12,7 @@ define(function () {
|
||||
inputTooShort: function (args) {
|
||||
var remainingChars = args.minimum - args.input.length;
|
||||
|
||||
var message = 'Vennligst skriv inn ' + remainingChars + ' tegn til';
|
||||
|
||||
return message + ' tegn til';
|
||||
return 'Vennligst skriv inn ' + remainingChars + ' tegn til';
|
||||
},
|
||||
loadingMore: function () {
|
||||
return 'Laster flere resultater…';
|
||||
@@ -27,6 +25,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Søker…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Fjern alle elementer';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
47
front/lib/AdminLTE/bower_components/select2/src/js/select2/i18n/ne.js
vendored
Normal file
47
front/lib/AdminLTE/bower_components/select2/src/js/select2/i18n/ne.js
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
define(function () {
|
||||
// Nepali
|
||||
return {
|
||||
errorLoading: function () {
|
||||
return 'नतिजाहरु देखाउन सकिएन।';
|
||||
},
|
||||
inputTooLong: function (args) {
|
||||
var overChars = args.input.length - args.maximum;
|
||||
|
||||
var message = 'कृपया ' + overChars + ' अक्षर मेटाउनुहोस्।';
|
||||
|
||||
if (overChars != 1) {
|
||||
message += 'कृपया ' + overChars + ' अक्षरहरु मेटाउनुहोस्।';
|
||||
}
|
||||
|
||||
return message;
|
||||
},
|
||||
inputTooShort: function (args) {
|
||||
var remainingChars = args.minimum - args.input.length;
|
||||
|
||||
var message = 'कृपया बाँकी रहेका ' + remainingChars +
|
||||
' वा अरु धेरै अक्षरहरु भर्नुहोस्।';
|
||||
|
||||
return message;
|
||||
},
|
||||
loadingMore: function () {
|
||||
return 'अरु नतिजाहरु भरिँदैछन् …';
|
||||
},
|
||||
maximumSelected: function (args) {
|
||||
var message = 'तँपाई ' + args.maximum +
|
||||
' वस्तु मात्र छान्न पाउँनुहुन्छ।';
|
||||
|
||||
if (args.maximum != 1) {
|
||||
message = 'तँपाई ' + args.maximum +
|
||||
' वस्तुहरु मात्र छान्न पाउँनुहुन्छ।';
|
||||
}
|
||||
|
||||
return message;
|
||||
},
|
||||
noResults: function () {
|
||||
return 'कुनै पनि नतिजा भेटिएन।';
|
||||
},
|
||||
searching: function () {
|
||||
return 'खोजि हुँदैछ…';
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -38,6 +38,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Zoeken…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Verwijder alle items';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -40,6 +40,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Trwa wyszukiwanie…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Usuń wszystkie przedmioty';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -40,6 +40,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'لټول کيږي...';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'ټول توکي لرې کړئ';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -41,6 +41,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Buscando…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Remover todos os itens';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -35,6 +35,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'A procurar…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Remover todos os itens';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -41,6 +41,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Căutare…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Eliminați toate elementele';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -31,7 +31,7 @@ define(function () {
|
||||
inputTooShort: function (args) {
|
||||
var remainingChars = args.minimum - args.input.length;
|
||||
|
||||
var message = 'Пожалуйста, введите еще хотя бы ' + remainingChars +
|
||||
var message = 'Пожалуйста, введите ещё хотя бы ' + remainingChars +
|
||||
' символ';
|
||||
|
||||
message += ending(remainingChars, '', 'a', 'ов');
|
||||
@@ -53,6 +53,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Поиск…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Удалить все элементы';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -54,6 +54,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Vyhľadávanie…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Odstráňte všetky položky';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -49,6 +49,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Iščem…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Odstranite vse elemente';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
48
front/lib/AdminLTE/bower_components/select2/src/js/select2/i18n/sq.js
vendored
Normal file
48
front/lib/AdminLTE/bower_components/select2/src/js/select2/i18n/sq.js
vendored
Normal file
@@ -0,0 +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';
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -50,6 +50,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Претрага…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Уклоните све ставке';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -50,6 +50,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Pretraga…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Уклоните све ставке';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -32,6 +32,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Söker…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Ta bort alla objekt';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -31,6 +31,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'กำลังค้นข้อมูล…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'ลบรายการทั้งหมด';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
40
front/lib/AdminLTE/bower_components/select2/src/js/select2/i18n/tk.js
vendored
Normal file
40
front/lib/AdminLTE/bower_components/select2/src/js/select2/i18n/tk.js
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
define(function () {
|
||||
// Turkmen
|
||||
return {
|
||||
errorLoading: function (){
|
||||
return 'Netije ýüklenmedi.';
|
||||
},
|
||||
inputTooLong: function (args) {
|
||||
var overChars = args.input.length - args.maximum;
|
||||
|
||||
var message = overChars + ' harp bozuň.';
|
||||
|
||||
return message;
|
||||
},
|
||||
inputTooShort: function (args) {
|
||||
var remainingChars = args.minimum - args.input.length;
|
||||
|
||||
var message = 'Ýene-de iň az ' + remainingChars + ' harp ýazyň.';
|
||||
|
||||
return message;
|
||||
},
|
||||
loadingMore: function () {
|
||||
return 'Köpräk netije görkezilýär…';
|
||||
},
|
||||
maximumSelected: function (args) {
|
||||
var message = 'Diňe ' + args.maximum + ' sanysyny saýlaň.';
|
||||
|
||||
return message;
|
||||
},
|
||||
noResults: function () {
|
||||
return 'Netije tapylmady.';
|
||||
},
|
||||
searching: function () {
|
||||
return 'Gözlenýär…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
// TO DO : add in turkmen,
|
||||
return 'Remove all items';
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -31,6 +31,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Aranıyor…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Tüm öğeleri kaldır';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
define(function () {
|
||||
// Ukranian
|
||||
// Ukrainian
|
||||
function ending (count, one, couple, more) {
|
||||
if (count % 100 > 10 && count % 100 < 15) {
|
||||
return more;
|
||||
@@ -38,6 +38,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Пошук…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Видалити всі елементи';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -4,18 +4,15 @@ define(function () {
|
||||
inputTooLong: function (args) {
|
||||
var overChars = args.input.length - args.maximum;
|
||||
|
||||
var message = 'Vui lòng nhập ít hơn ' + overChars + ' ký tự';
|
||||
|
||||
if (overChars != 1) {
|
||||
message += 's';
|
||||
}
|
||||
var message = 'Vui lòng xóa bớt ' + overChars + ' ký tự';
|
||||
|
||||
return message;
|
||||
},
|
||||
inputTooShort: function (args) {
|
||||
var remainingChars = args.minimum - args.input.length;
|
||||
|
||||
var message = 'Vui lòng nhập nhiều hơn ' + remainingChars + ' ký tự';
|
||||
var message = 'Vui lòng nhập thêm từ ' + remainingChars +
|
||||
' ký tự trở lên';
|
||||
|
||||
return message;
|
||||
},
|
||||
@@ -32,6 +29,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return 'Đang tìm…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return 'Xóa tất cả các mục';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -31,6 +31,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return '搜索中…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return '删除所有项目';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -28,6 +28,9 @@ define(function () {
|
||||
},
|
||||
searching: function () {
|
||||
return '搜尋中…';
|
||||
},
|
||||
removeAllItems: function () {
|
||||
return '刪除所有項目';
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -55,7 +55,7 @@ define([
|
||||
$e.prop('disabled', this.options.disabled);
|
||||
$e.prop('multiple', this.options.multiple);
|
||||
|
||||
if ($e.data('select2Tags')) {
|
||||
if (Utils.GetData($e[0], 'select2Tags')) {
|
||||
if (this.options.debug && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `data-select2-tags` attribute has been changed to ' +
|
||||
@@ -64,11 +64,11 @@ define([
|
||||
);
|
||||
}
|
||||
|
||||
$e.data('data', $e.data('select2Tags'));
|
||||
$e.data('tags', true);
|
||||
Utils.StoreData($e[0], 'data', Utils.GetData($e[0], 'select2Tags'));
|
||||
Utils.StoreData($e[0], 'tags', true);
|
||||
}
|
||||
|
||||
if ($e.data('ajaxUrl')) {
|
||||
if (Utils.GetData($e[0], 'ajaxUrl')) {
|
||||
if (this.options.debug && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `data-ajax-url` attribute has been changed to ' +
|
||||
@@ -77,21 +77,45 @@ define([
|
||||
);
|
||||
}
|
||||
|
||||
$e.attr('ajax--url', $e.data('ajaxUrl'));
|
||||
$e.data('ajax--url', $e.data('ajaxUrl'));
|
||||
$e.attr('ajax--url', Utils.GetData($e[0], 'ajaxUrl'));
|
||||
Utils.StoreData($e[0], 'ajax-Url', Utils.GetData($e[0], 'ajaxUrl'));
|
||||
}
|
||||
|
||||
var dataset = {};
|
||||
|
||||
function upperCaseLetter(_, letter) {
|
||||
return letter.toUpperCase();
|
||||
}
|
||||
|
||||
// Pre-load all of the attributes which are prefixed with `data-`
|
||||
for (var attr = 0; attr < $e[0].attributes.length; attr++) {
|
||||
var attributeName = $e[0].attributes[attr].name;
|
||||
var prefix = 'data-';
|
||||
|
||||
if (attributeName.substr(0, prefix.length) == prefix) {
|
||||
// Get the contents of the attribute after `data-`
|
||||
var dataName = attributeName.substring(prefix.length);
|
||||
|
||||
// Get the data contents from the consistent source
|
||||
// This is more than likely the jQuery data helper
|
||||
var dataValue = Utils.GetData($e[0], dataName);
|
||||
|
||||
// camelCase the attribute name to match the spec
|
||||
var camelDataName = dataName.replace(/-([a-z])/g, upperCaseLetter);
|
||||
|
||||
// Store the data attribute contents into the dataset since
|
||||
dataset[camelDataName] = dataValue;
|
||||
}
|
||||
}
|
||||
|
||||
// Prefer the element's `dataset` attribute if it exists
|
||||
// jQuery 1.x does not correctly handle data attributes with multiple dashes
|
||||
if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
|
||||
dataset = $.extend(true, {}, $e[0].dataset, $e.data());
|
||||
} else {
|
||||
dataset = $e.data();
|
||||
dataset = $.extend(true, {}, $e[0].dataset, dataset);
|
||||
}
|
||||
|
||||
var data = $.extend(true, {}, dataset);
|
||||
// Prefer our internal data cache if it exists
|
||||
var data = $.extend(true, {}, Utils.GetData($e[0]), dataset);
|
||||
|
||||
data = Utils._convertData(data);
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ define([
|
||||
$options.each(function () {
|
||||
var $option = $(this);
|
||||
|
||||
var item = $.data(this, 'data');
|
||||
var item = Utils.GetData(this, 'data');
|
||||
|
||||
// id needs to be converted to a string when comparing
|
||||
var id = '' + item.id;
|
||||
@@ -175,7 +175,12 @@ define([
|
||||
'aria-selected': 'false'
|
||||
};
|
||||
|
||||
if (data.disabled) {
|
||||
var matches = window.Element.prototype.matches ||
|
||||
window.Element.prototype.msMatchesSelector ||
|
||||
window.Element.prototype.webkitMatchesSelector;
|
||||
|
||||
if ((data.element != null && matches.call(data.element, ':disabled')) ||
|
||||
(data.element == null && data.disabled)) {
|
||||
delete attrs['aria-selected'];
|
||||
attrs['aria-disabled'] = 'true';
|
||||
}
|
||||
@@ -235,7 +240,7 @@ define([
|
||||
this.template(data, option);
|
||||
}
|
||||
|
||||
$.data(option, 'data', data);
|
||||
Utils.StoreData(option, 'data', data);
|
||||
|
||||
return option;
|
||||
};
|
||||
@@ -276,7 +281,10 @@ define([
|
||||
}
|
||||
|
||||
self.setClasses();
|
||||
self.highlightFirstItem();
|
||||
|
||||
if (self.options.get('scrollAfterSelect')) {
|
||||
self.highlightFirstItem();
|
||||
}
|
||||
});
|
||||
|
||||
container.on('unselect', function () {
|
||||
@@ -285,7 +293,10 @@ define([
|
||||
}
|
||||
|
||||
self.setClasses();
|
||||
self.highlightFirstItem();
|
||||
|
||||
if (self.options.get('scrollAfterSelect')) {
|
||||
self.highlightFirstItem();
|
||||
}
|
||||
});
|
||||
|
||||
container.on('open', function () {
|
||||
@@ -321,7 +332,7 @@ define([
|
||||
return;
|
||||
}
|
||||
|
||||
var data = $highlighted.data('data');
|
||||
var data = Utils.GetData($highlighted[0], 'data');
|
||||
|
||||
if ($highlighted.attr('aria-selected') == 'true') {
|
||||
self.trigger('close', {});
|
||||
@@ -339,8 +350,9 @@ define([
|
||||
|
||||
var currentIndex = $options.index($highlighted);
|
||||
|
||||
// If we are already at te top, don't move further
|
||||
if (currentIndex === 0) {
|
||||
// If we are already at the top, don't move further
|
||||
// If no options, currentIndex will be -1
|
||||
if (currentIndex <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -433,7 +445,7 @@ define([
|
||||
function (evt) {
|
||||
var $this = $(this);
|
||||
|
||||
var data = $this.data('data');
|
||||
var data = Utils.GetData(this, 'data');
|
||||
|
||||
if ($this.attr('aria-selected') === 'true') {
|
||||
if (self.options.get('multiple')) {
|
||||
@@ -456,7 +468,7 @@ define([
|
||||
|
||||
this.$results.on('mouseenter', '.select2-results__option[aria-selected]',
|
||||
function (evt) {
|
||||
var data = $(this).data('data');
|
||||
var data = Utils.GetData(this, 'data');
|
||||
|
||||
self.getHighlightedResults()
|
||||
.removeClass('select2-results__option--highlighted');
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
define([
|
||||
'jquery',
|
||||
'../keys'
|
||||
], function ($, KEYS) {
|
||||
'../keys',
|
||||
'../utils'
|
||||
], function ($, KEYS, Utils) {
|
||||
function AllowClear () { }
|
||||
|
||||
AllowClear.prototype.bind = function (decorated, container, $container) {
|
||||
@@ -43,10 +44,22 @@ define([
|
||||
|
||||
evt.stopPropagation();
|
||||
|
||||
var data = $clear.data('data');
|
||||
var data = Utils.GetData($clear[0], 'data');
|
||||
|
||||
var previousVal = this.$element.val();
|
||||
this.$element.val(this.placeholder.id);
|
||||
|
||||
var unselectData = {
|
||||
data: data
|
||||
};
|
||||
this.trigger('clear', unselectData);
|
||||
if (unselectData.prevented) {
|
||||
this.$element.val(previousVal);
|
||||
return;
|
||||
}
|
||||
|
||||
for (var d = 0; d < data.length; d++) {
|
||||
var unselectData = {
|
||||
unselectData = {
|
||||
data: data[d]
|
||||
};
|
||||
|
||||
@@ -56,11 +69,12 @@ define([
|
||||
|
||||
// If the event was prevented, don't clear it out.
|
||||
if (unselectData.prevented) {
|
||||
this.$element.val(previousVal);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.$element.val(this.placeholder.id).trigger('change');
|
||||
this.$element.trigger('change');
|
||||
|
||||
this.trigger('toggle', {});
|
||||
};
|
||||
@@ -83,12 +97,14 @@ define([
|
||||
return;
|
||||
}
|
||||
|
||||
var removeAll = this.options.get('translations').get('removeAllItems');
|
||||
|
||||
var $remove = $(
|
||||
'<span class="select2-selection__clear">' +
|
||||
'<span class="select2-selection__clear" title="' + removeAll() +'">' +
|
||||
'×' +
|
||||
'</span>'
|
||||
);
|
||||
$remove.data('data', data);
|
||||
Utils.StoreData($remove[0], 'data', data);
|
||||
|
||||
this.$selection.find('.select2-selection__rendered').prepend($remove);
|
||||
};
|
||||
|
||||
@@ -21,8 +21,8 @@ define([
|
||||
|
||||
this._tabindex = 0;
|
||||
|
||||
if (this.$element.data('old-tabindex') != null) {
|
||||
this._tabindex = this.$element.data('old-tabindex');
|
||||
if (Utils.GetData(this.$element[0], 'old-tabindex') != null) {
|
||||
this._tabindex = Utils.GetData(this.$element[0], 'old-tabindex');
|
||||
} else if (this.$element.attr('tabindex') != null) {
|
||||
this._tabindex = this.$element.attr('tabindex');
|
||||
}
|
||||
@@ -81,7 +81,7 @@ define([
|
||||
self.$selection.removeAttr('aria-activedescendant');
|
||||
self.$selection.removeAttr('aria-owns');
|
||||
|
||||
self.$selection.focus();
|
||||
self.$selection.trigger('focus');
|
||||
|
||||
self._detachCloseHandler(container);
|
||||
});
|
||||
@@ -130,7 +130,7 @@ define([
|
||||
return;
|
||||
}
|
||||
|
||||
var $element = $this.data('element');
|
||||
var $element = Utils.GetData(this, 'element');
|
||||
|
||||
$element.select2('close');
|
||||
});
|
||||
|
||||
@@ -9,10 +9,13 @@ define([
|
||||
'open', 'opening',
|
||||
'close', 'closing',
|
||||
'select', 'selecting',
|
||||
'unselect', 'unselecting'
|
||||
'unselect', 'unselecting',
|
||||
'clear', 'clearing'
|
||||
];
|
||||
|
||||
var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting'];
|
||||
var preventableEvents = [
|
||||
'opening', 'closing', 'selecting', 'unselecting', 'clearing'
|
||||
];
|
||||
|
||||
decorated.call(this, container, $container);
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ define([
|
||||
var $remove = $(this);
|
||||
var $selection = $remove.parent();
|
||||
|
||||
var data = $selection.data('data');
|
||||
var data = Utils.GetData($selection[0], 'data');
|
||||
|
||||
self.trigger('unselect', {
|
||||
originalEvent: evt,
|
||||
@@ -55,7 +55,9 @@ define([
|
||||
};
|
||||
|
||||
MultipleSelection.prototype.clear = function () {
|
||||
this.$selection.find('.select2-selection__rendered').empty();
|
||||
var $rendered = this.$selection.find('.select2-selection__rendered');
|
||||
$rendered.empty();
|
||||
$rendered.removeAttr('title');
|
||||
};
|
||||
|
||||
MultipleSelection.prototype.display = function (data, container) {
|
||||
@@ -93,9 +95,9 @@ define([
|
||||
var formatted = this.display(selection, $selection);
|
||||
|
||||
$selection.append(formatted);
|
||||
$selection.prop('title', selection.title || selection.text);
|
||||
$selection.attr('title', selection.title || selection.text);
|
||||
|
||||
$selection.data('data', selection);
|
||||
Utils.StoreData($selection[0], 'data', selection);
|
||||
|
||||
$selections.push($selection);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ define([
|
||||
.prev('.select2-selection__choice');
|
||||
|
||||
if ($previousChoice.length > 0) {
|
||||
var item = $previousChoice.data('data');
|
||||
var item = Utils.GetData($previousChoice[0], 'data');
|
||||
|
||||
self.searchRemoveChoice(item);
|
||||
|
||||
@@ -175,7 +175,7 @@ define([
|
||||
|
||||
this.resizeSearch();
|
||||
if (searchHadFocus) {
|
||||
this.$search.focus();
|
||||
this.$search.trigger('focus');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -32,7 +32,10 @@ define([
|
||||
|
||||
var id = container.id + '-container';
|
||||
|
||||
this.$selection.find('.select2-selection__rendered').attr('id', id);
|
||||
this.$selection.find('.select2-selection__rendered')
|
||||
.attr('id', id)
|
||||
.attr('role', 'textbox')
|
||||
.attr('aria-readonly', 'true');
|
||||
this.$selection.attr('aria-labelledby', id);
|
||||
|
||||
this.$selection.on('mousedown', function (evt) {
|
||||
@@ -56,17 +59,15 @@ define([
|
||||
|
||||
container.on('focus', function (evt) {
|
||||
if (!container.isOpen()) {
|
||||
self.$selection.focus();
|
||||
self.$selection.trigger('focus');
|
||||
}
|
||||
});
|
||||
|
||||
container.on('selection:update', function (params) {
|
||||
self.update(params.data);
|
||||
});
|
||||
};
|
||||
|
||||
SingleSelection.prototype.clear = function () {
|
||||
this.$selection.find('.select2-selection__rendered').empty();
|
||||
var $rendered = this.$selection.find('.select2-selection__rendered');
|
||||
$rendered.empty();
|
||||
$rendered.removeAttr('title'); // clear tooltip on empty
|
||||
};
|
||||
|
||||
SingleSelection.prototype.display = function (data, container) {
|
||||
@@ -92,7 +93,7 @@ define([
|
||||
var formatted = this.display(selection, $rendered);
|
||||
|
||||
$rendered.empty().append(formatted);
|
||||
$rendered.prop('title', selection.title || selection.text);
|
||||
$rendered.attr('title', selection.title || selection.text);
|
||||
};
|
||||
|
||||
return SingleSelection;
|
||||
|
||||
@@ -74,10 +74,10 @@ define([
|
||||
DecoratedClass.prototype = new ctr();
|
||||
|
||||
for (var m = 0; m < superMethods.length; m++) {
|
||||
var superMethod = superMethods[m];
|
||||
var superMethod = superMethods[m];
|
||||
|
||||
DecoratedClass.prototype[superMethod] =
|
||||
SuperClass.prototype[superMethod];
|
||||
DecoratedClass.prototype[superMethod] =
|
||||
SuperClass.prototype[superMethod];
|
||||
}
|
||||
|
||||
var calledMethod = function (methodName) {
|
||||
@@ -272,5 +272,67 @@ define([
|
||||
$element.append($nodes);
|
||||
};
|
||||
|
||||
// Cache objects in Utils.__cache instead of $.data (see #4346)
|
||||
Utils.__cache = {};
|
||||
|
||||
var id = 0;
|
||||
Utils.GetUniqueElementId = function (element) {
|
||||
// Get a unique element Id. If element has no id,
|
||||
// creates a new unique number, stores it in the id
|
||||
// attribute and returns the new id.
|
||||
// If an id already exists, it simply returns it.
|
||||
|
||||
var select2Id = element.getAttribute('data-select2-id');
|
||||
if (select2Id == null) {
|
||||
// If element has id, use it.
|
||||
if (element.id) {
|
||||
select2Id = element.id;
|
||||
element.setAttribute('data-select2-id', select2Id);
|
||||
} else {
|
||||
element.setAttribute('data-select2-id', ++id);
|
||||
select2Id = id.toString();
|
||||
}
|
||||
}
|
||||
return select2Id;
|
||||
};
|
||||
|
||||
Utils.StoreData = function (element, name, value) {
|
||||
// Stores an item in the cache for a specified element.
|
||||
// name is the cache key.
|
||||
var id = Utils.GetUniqueElementId(element);
|
||||
if (!Utils.__cache[id]) {
|
||||
Utils.__cache[id] = {};
|
||||
}
|
||||
|
||||
Utils.__cache[id][name] = value;
|
||||
};
|
||||
|
||||
Utils.GetData = function (element, name) {
|
||||
// Retrieves a value from the cache by its key (name)
|
||||
// name is optional. If no name specified, return
|
||||
// all cache items for the specified element.
|
||||
// and for a specified element.
|
||||
var id = Utils.GetUniqueElementId(element);
|
||||
if (name) {
|
||||
if (Utils.__cache[id]) {
|
||||
if (Utils.__cache[id][name] != null) {
|
||||
return Utils.__cache[id][name];
|
||||
}
|
||||
return $(element).data(name); // Fallback to HTML5 data attribs.
|
||||
}
|
||||
return $(element).data(name); // Fallback to HTML5 data attribs.
|
||||
} else {
|
||||
return Utils.__cache[id];
|
||||
}
|
||||
};
|
||||
|
||||
Utils.RemoveData = function (element) {
|
||||
// Removes all cached items for a specified element.
|
||||
var id = Utils.GetUniqueElementId(element);
|
||||
if (Utils.__cache[id] != null) {
|
||||
delete Utils.__cache[id];
|
||||
}
|
||||
};
|
||||
|
||||
return Utils;
|
||||
});
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Released under the MIT license
|
||||
* https://github.com/select2/select2/blob/master/LICENSE.md
|
||||
*/
|
||||
(function (factory) {
|
||||
;(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['jquery'], factory);
|
||||
|
||||
Reference in New Issue
Block a user