Bug 33868: Upgrade the Multiple Select plugin in the staff interface
This patch upgrades the Multiple Select plugin in the staff interface and adds some minor adjustments to system preferences CSS to accommodate the change. The listing on the about page is updated with current information. To test, apply the patch and clear your browser cache if necessary. - Go to Administration -> System preferences. - Test some preferences which use the plugin, e.g. - ApplyFrameworkDefaults - CoceProviders - OpacHiddenItemsExceptions - OPACAllowUserToChangeBranch - Confirm that the menus look correct and work correctly. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
62b2609e86
commit
fa809812be
|
|
@ -1,589 +0,0 @@
|
|||
/**
|
||||
* @author zhixin wen <wenzhixin2010@gmail.com>
|
||||
* @version 1.1.0
|
||||
*
|
||||
* http://wenzhixin.net.cn/p/multiple-select/
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
|
||||
'use strict';
|
||||
|
||||
function MultipleSelect($el, options) {
|
||||
var that = this,
|
||||
name = $el.attr('name') || options.name || ''
|
||||
|
||||
$el.parent().hide();
|
||||
var elWidth = $el.css("width");
|
||||
$el.parent().show();
|
||||
if (elWidth=="0px") {elWidth = $el.outerWidth()+20}
|
||||
|
||||
this.$el = $el.hide();
|
||||
this.options = options;
|
||||
this.$parent = $('<div' + $.map(['class', 'title'],function (att) {
|
||||
var attValue = that.$el.attr(att) || '';
|
||||
attValue = (att === 'class' ? ('ms-parent' + (attValue ? ' ' : '')) : '') + attValue;
|
||||
return attValue ? (' ' + att + '="' + attValue + '"') : '';
|
||||
}).join('') + ' />');
|
||||
this.$choice = $('<button type="button" class="ms-choice"><span class="placeholder">' +
|
||||
options.placeholder + '</span><div></div></button>');
|
||||
this.$drop = $('<div class="ms-drop ' + options.position + '"></div>');
|
||||
this.$el.after(this.$parent);
|
||||
this.$parent.append(this.$choice);
|
||||
this.$parent.append(this.$drop);
|
||||
|
||||
if (this.$el.prop('disabled')) {
|
||||
this.$choice.addClass('disabled');
|
||||
}
|
||||
this.$parent.css('width', options.width || elWidth);
|
||||
|
||||
if (!this.options.keepOpen) {
|
||||
$('body').click(function (e) {
|
||||
if ($(e.target)[0] === that.$choice[0] ||
|
||||
$(e.target).parents('.ms-choice')[0] === that.$choice[0]) {
|
||||
return;
|
||||
}
|
||||
if (($(e.target)[0] === that.$drop[0] ||
|
||||
$(e.target).parents('.ms-drop')[0] !== that.$drop[0]) &&
|
||||
that.options.isOpen) {
|
||||
that.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.selectAllName = 'name="selectAll' + name + '"';
|
||||
this.selectGroupName = 'name="selectGroup' + name + '"';
|
||||
this.selectItemName = 'name="selectItem' + name + '"';
|
||||
}
|
||||
|
||||
MultipleSelect.prototype = {
|
||||
constructor: MultipleSelect,
|
||||
|
||||
init: function () {
|
||||
var that = this,
|
||||
html = [];
|
||||
if (this.options.filter) {
|
||||
html.push(
|
||||
'<div class="ms-search">',
|
||||
'<input type="text" autocomplete="off" autocorrect="off" autocapitilize="off" spellcheck="false">',
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
html.push('<ul>');
|
||||
if (this.options.selectAll && !this.options.single) {
|
||||
html.push(
|
||||
'<li class="ms-select-all">',
|
||||
'<label>',
|
||||
'<input type="checkbox" ' + this.selectAllName + ' /> ',
|
||||
this.options.selectAllDelimiter[0] + this.options.selectAllText + this.options.selectAllDelimiter[1],
|
||||
'</label>',
|
||||
'</li>'
|
||||
);
|
||||
}
|
||||
$.each(this.$el.children(), function (i, elm) {
|
||||
html.push(that.optionToHtml(i, elm));
|
||||
});
|
||||
html.push('<li class="ms-no-results">' + this.options.noMatchesFound + '</li>');
|
||||
html.push('</ul>');
|
||||
this.$drop.html(html.join(''));
|
||||
|
||||
this.$drop.find('ul').css('max-height', this.options.maxHeight + 'px');
|
||||
this.$drop.find('.multiple').css('width', this.options.multipleWidth + 'px');
|
||||
|
||||
this.$searchInput = this.$drop.find('.ms-search input');
|
||||
this.$selectAll = this.$drop.find('input[' + this.selectAllName + ']');
|
||||
this.$selectGroups = this.$drop.find('input[' + this.selectGroupName + ']');
|
||||
this.$selectItems = this.$drop.find('input[' + this.selectItemName + ']:enabled');
|
||||
this.$disableItems = this.$drop.find('input[' + this.selectItemName + ']:disabled');
|
||||
this.$noResults = this.$drop.find('.ms-no-results');
|
||||
this.events();
|
||||
this.updateSelectAll(true);
|
||||
this.update(true);
|
||||
|
||||
if (this.options.isOpen) {
|
||||
this.open();
|
||||
}
|
||||
},
|
||||
|
||||
optionToHtml: function (i, elm, group, groupDisabled) {
|
||||
var that = this,
|
||||
$elm = $(elm),
|
||||
html = [],
|
||||
multiple = this.options.multiple,
|
||||
optAttributesToCopy = ['class', 'title'],
|
||||
clss = $.map(optAttributesToCopy, function (att, i) {
|
||||
var isMultiple = att === 'class' && multiple;
|
||||
var attValue = $elm.attr(att) || '';
|
||||
return (isMultiple || attValue) ?
|
||||
(' ' + att + '="' + (isMultiple ? ('multiple' + (attValue ? ' ' : '')) : '') + attValue + '"') :
|
||||
'';
|
||||
}).join(''),
|
||||
disabled,
|
||||
type = this.options.single ? 'radio' : 'checkbox';
|
||||
|
||||
if ($elm.is('option')) {
|
||||
var value = $elm.val(),
|
||||
text = that.options.textTemplate($elm),
|
||||
selected = (that.$el.attr('multiple') != undefined) ? $elm.prop('selected') : ($elm.attr('selected') == 'selected'),
|
||||
style = this.options.styler(value) ? ' style="' + this.options.styler(value) + '"' : '';
|
||||
|
||||
disabled = groupDisabled || $elm.prop('disabled');
|
||||
if ((this.options.blockSeparator > "") && (this.options.blockSeparator == $elm.val())) {
|
||||
html.push(
|
||||
'<li' + clss + style + '>',
|
||||
'<label class="' + this.options.blockSeparator + (disabled ? 'disabled' : '') + '">',
|
||||
text,
|
||||
'</label>',
|
||||
'</li>'
|
||||
);
|
||||
} else {
|
||||
html.push(
|
||||
'<li' + clss + style + '>',
|
||||
'<label' + (disabled ? ' class="disabled"' : '') + '>',
|
||||
'<input type="' + type + '" ' + this.selectItemName + ' value="' + value + '"' +
|
||||
(selected ? ' checked="checked"' : '') +
|
||||
(disabled ? ' disabled="disabled"' : '') +
|
||||
(group ? ' data-group="' + group + '"' : '') +
|
||||
'/> ',
|
||||
text,
|
||||
'</label>',
|
||||
'</li>'
|
||||
);
|
||||
}
|
||||
} else if (!group && $elm.is('optgroup')) {
|
||||
var _group = 'group_' + i,
|
||||
label = $elm.attr('label');
|
||||
|
||||
disabled = $elm.prop('disabled');
|
||||
html.push(
|
||||
'<li class="group">',
|
||||
'<label class="optgroup' + (disabled ? ' disabled' : '') + '" data-group="' + _group + '">',
|
||||
(this.options.hideOptgroupCheckboxes ? '' : '<input type="checkbox" ' + this.selectGroupName +
|
||||
(disabled ? ' disabled="disabled"' : '') + ' /> '),
|
||||
label,
|
||||
'</label>',
|
||||
'</li>');
|
||||
$.each($elm.children(), function (i, elm) {
|
||||
html.push(that.optionToHtml(i, elm, _group, disabled));
|
||||
});
|
||||
}
|
||||
return html.join('');
|
||||
},
|
||||
|
||||
events: function () {
|
||||
var that = this;
|
||||
|
||||
function toggleOpen(e) {
|
||||
e.preventDefault();
|
||||
that[that.options.isOpen ? 'close' : 'open']();
|
||||
}
|
||||
|
||||
var label = this.$el.parent().closest('label')[0] || $('label[for=' + this.$el.attr('id') + ']')[0];
|
||||
if (label) {
|
||||
$(label).off('click').on('click', function (e) {
|
||||
if (e.target.nodeName.toLowerCase() !== 'label' || e.target !== this) {
|
||||
return;
|
||||
}
|
||||
toggleOpen(e);
|
||||
if (!that.options.filter || !that.options.isOpen) {
|
||||
that.focus();
|
||||
}
|
||||
e.stopPropagation(); // Causes lost focus otherwise
|
||||
});
|
||||
}
|
||||
this.$choice.off('click').on('click', toggleOpen)
|
||||
.off('focus').on('focus', this.options.onFocus)
|
||||
.off('blur').on('blur', this.options.onBlur);
|
||||
|
||||
this.$parent.off('keydown').on('keydown', function (e) {
|
||||
switch (e.which) {
|
||||
case 27: // esc key
|
||||
that.close();
|
||||
that.$choice.focus();
|
||||
break;
|
||||
}
|
||||
});
|
||||
this.$searchInput.off('keydown').on('keydown',function (e) {
|
||||
if (e.keyCode === 9 && e.shiftKey) { // Ensure shift-tab causes lost focus from filter as with clicking away
|
||||
that.close();
|
||||
}
|
||||
}).off('keyup').on('keyup', function (e) {
|
||||
if (that.options.filterAcceptOnEnter &&
|
||||
(e.which === 13 || e.which == 32) && // enter or space
|
||||
that.$searchInput.val() // Avoid selecting/deselecting if no choices made
|
||||
) {
|
||||
that.$selectAll.click();
|
||||
that.close();
|
||||
that.focus();
|
||||
return;
|
||||
}
|
||||
that.filter();
|
||||
});
|
||||
this.$selectAll.off('click').on('click', function () {
|
||||
var checked = $(this).prop('checked'),
|
||||
$items = that.$selectItems.filter(':visible');
|
||||
if ($items.length === that.$selectItems.length) {
|
||||
that[checked ? 'checkAll' : 'uncheckAll']();
|
||||
} else { // when the filter option is true
|
||||
that.$selectGroups.prop('checked', checked);
|
||||
$items.prop('checked', checked);
|
||||
that.options[checked ? 'onCheckAll' : 'onUncheckAll']();
|
||||
that.update();
|
||||
}
|
||||
});
|
||||
this.$selectGroups.off('click').on('click', function () {
|
||||
var group = $(this).parent().attr('data-group'),
|
||||
$items = that.$selectItems.filter(':visible'),
|
||||
$children = $items.filter('[data-group="' + group + '"]'),
|
||||
checked = $children.length !== $children.filter(':checked').length;
|
||||
$children.prop('checked', checked);
|
||||
that.updateSelectAll();
|
||||
that.update();
|
||||
that.options.onOptgroupClick({
|
||||
label: $(this).parent().text(),
|
||||
checked: checked,
|
||||
children: $children.get()
|
||||
});
|
||||
});
|
||||
this.$selectItems.off('click').on('click', function () {
|
||||
that.updateSelectAll();
|
||||
that.update();
|
||||
that.updateOptGroupSelect();
|
||||
that.options.onClick({
|
||||
label: $(this).parent().text(),
|
||||
value: $(this).val(),
|
||||
checked: $(this).prop('checked')
|
||||
});
|
||||
|
||||
if (that.options.single && that.options.isOpen && !that.options.keepOpen) {
|
||||
that.close();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
open: function () {
|
||||
if (this.$choice.hasClass('disabled')) {
|
||||
return;
|
||||
}
|
||||
this.options.isOpen = true;
|
||||
this.$choice.find('>div').addClass('open');
|
||||
this.$drop.show();
|
||||
|
||||
// fix filter bug: no results show
|
||||
this.$selectAll.parent().show();
|
||||
this.$noResults.hide();
|
||||
|
||||
// Fix #77: 'All selected' when no options
|
||||
if (this.$el.children().length === 0) {
|
||||
this.$selectAll.parent().hide();
|
||||
this.$noResults.show();
|
||||
}
|
||||
|
||||
if (this.options.container) {
|
||||
var offset = this.$drop.offset();
|
||||
this.$drop.appendTo($(this.options.container));
|
||||
this.$drop.offset({ top: offset.top, left: offset.left });
|
||||
}
|
||||
if (this.options.filter) {
|
||||
this.$searchInput.val('');
|
||||
this.$searchInput.focus();
|
||||
this.filter();
|
||||
}
|
||||
this.options.onOpen();
|
||||
},
|
||||
|
||||
close: function () {
|
||||
this.options.isOpen = false;
|
||||
this.$choice.find('>div').removeClass('open');
|
||||
this.$drop.hide();
|
||||
if (this.options.container) {
|
||||
this.$parent.append(this.$drop);
|
||||
this.$drop.css({
|
||||
'top': 'auto',
|
||||
'left': 'auto'
|
||||
});
|
||||
}
|
||||
this.options.onClose();
|
||||
},
|
||||
|
||||
update: function (isInit) {
|
||||
var selects = this.getSelects(),
|
||||
$span = this.$choice.find('>span');
|
||||
|
||||
if (selects.length === 0) {
|
||||
$span.addClass('placeholder').html(this.options.placeholder);
|
||||
} else if (this.options.countSelected && selects.length < this.options.minumimCountSelected) {
|
||||
$span.removeClass('placeholder').html(
|
||||
(this.options.displayValues ? selects : this.getSelects('text'))
|
||||
.join(this.options.delimiter));
|
||||
} else if (this.options.allSelected &&
|
||||
selects.length === this.$selectItems.length + this.$disableItems.length) {
|
||||
$span.removeClass('placeholder').html(this.options.allSelected);
|
||||
} else if ((this.options.countSelected || this.options.etcaetera) && selects.length > this.options.minumimCountSelected) {
|
||||
if (this.options.etcaetera) {
|
||||
$span.removeClass('placeholder').html((this.options.displayValues ? selects : this.getSelects('text').slice(0, this.options.minumimCountSelected)).join(this.options.delimiter) + '...');
|
||||
}
|
||||
else {
|
||||
$span.removeClass('placeholder').html(this.options.countSelected
|
||||
.replace('#', selects.length)
|
||||
.replace('%', this.$selectItems.length + this.$disableItems.length));
|
||||
}
|
||||
} else {
|
||||
$span.removeClass('placeholder').html(
|
||||
(this.options.displayValues ? selects : this.getSelects('text'))
|
||||
.join(this.options.delimiter));
|
||||
}
|
||||
// set selects to select
|
||||
this.$el.val(this.getSelects());
|
||||
|
||||
// add selected class to selected li
|
||||
this.$drop.find('li').removeClass('selected');
|
||||
this.$drop.find('input[' + this.selectItemName + ']:checked').each(function () {
|
||||
$(this).parents('li').first().addClass('selected');
|
||||
});
|
||||
|
||||
// trigger <select> change event
|
||||
if (!isInit) {
|
||||
this.$el.trigger('change');
|
||||
}
|
||||
},
|
||||
|
||||
updateSelectAll: function (Init) {
|
||||
var $items = this.$selectItems;
|
||||
if (!Init) { $items = $items.filter(':visible'); }
|
||||
this.$selectAll.prop('checked', $items.length &&
|
||||
$items.length === $items.filter(':checked').length);
|
||||
if (this.$selectAll.prop('checked')) {
|
||||
this.options.onCheckAll();
|
||||
}
|
||||
},
|
||||
|
||||
updateOptGroupSelect: function () {
|
||||
var $items = this.$selectItems.filter(':visible');
|
||||
$.each(this.$selectGroups, function (i, val) {
|
||||
var group = $(val).parent().attr('data-group'),
|
||||
$children = $items.filter('[data-group="' + group + '"]');
|
||||
$(val).prop('checked', $children.length &&
|
||||
$children.length === $children.filter(':checked').length);
|
||||
});
|
||||
},
|
||||
|
||||
//value or text, default: 'value'
|
||||
getSelects: function (type) {
|
||||
var that = this,
|
||||
texts = [],
|
||||
values = [];
|
||||
this.$drop.find('input[' + this.selectItemName + ']:checked').each(function () {
|
||||
texts.push($(this).parents('li').first().text());
|
||||
values.push($(this).val());
|
||||
});
|
||||
|
||||
if (type === 'text' && this.$selectGroups.length) {
|
||||
texts = [];
|
||||
this.$selectGroups.each(function () {
|
||||
var html = [],
|
||||
text = $.trim($(this).parent().text()),
|
||||
group = $(this).parent().data('group'),
|
||||
$children = that.$drop.find('[' + that.selectItemName + '][data-group="' + group + '"]'),
|
||||
$selected = $children.filter(':checked');
|
||||
|
||||
if ($selected.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
html.push('[');
|
||||
html.push(text);
|
||||
if ($children.length > $selected.length) {
|
||||
var list = [];
|
||||
$selected.each(function () {
|
||||
list.push($(this).parent().text());
|
||||
});
|
||||
html.push(': ' + list.join(', '));
|
||||
}
|
||||
html.push(']');
|
||||
texts.push(html.join(''));
|
||||
});
|
||||
}
|
||||
return type === 'text' ? texts : values;
|
||||
},
|
||||
|
||||
setSelects: function (values) {
|
||||
var that = this;
|
||||
this.$selectItems.prop('checked', false);
|
||||
$.each(values, function (i, value) {
|
||||
that.$selectItems.filter('[value="' + value + '"]').prop('checked', true);
|
||||
});
|
||||
this.$selectAll.prop('checked', this.$selectItems.length ===
|
||||
this.$selectItems.filter(':checked').length);
|
||||
this.update();
|
||||
},
|
||||
|
||||
enable: function () {
|
||||
this.$choice.removeClass('disabled');
|
||||
},
|
||||
|
||||
disable: function () {
|
||||
this.$choice.addClass('disabled');
|
||||
},
|
||||
|
||||
checkAll: function () {
|
||||
this.$selectItems.prop('checked', true);
|
||||
this.$selectGroups.prop('checked', true);
|
||||
this.$selectAll.prop('checked', true);
|
||||
this.update();
|
||||
this.options.onCheckAll();
|
||||
},
|
||||
|
||||
uncheckAll: function () {
|
||||
this.$selectItems.prop('checked', false);
|
||||
this.$selectGroups.prop('checked', false);
|
||||
this.$selectAll.prop('checked', false);
|
||||
this.update();
|
||||
this.options.onUncheckAll();
|
||||
},
|
||||
|
||||
focus: function () {
|
||||
this.$choice.focus();
|
||||
this.options.onFocus();
|
||||
},
|
||||
|
||||
blur: function () {
|
||||
this.$choice.blur();
|
||||
this.options.onBlur();
|
||||
},
|
||||
|
||||
refresh: function () {
|
||||
this.init();
|
||||
},
|
||||
|
||||
filter: function () {
|
||||
var that = this,
|
||||
text = $.trim(this.$searchInput.val()).toLowerCase();
|
||||
if (text.length === 0) {
|
||||
this.$selectItems.parent().show();
|
||||
this.$disableItems.parent().show();
|
||||
this.$selectGroups.parent().show();
|
||||
} else {
|
||||
this.$selectItems.each(function () {
|
||||
var $parent = $(this).parent();
|
||||
$parent[$parent.text().toLowerCase().indexOf(text) < 0 ? 'hide' : 'show']();
|
||||
});
|
||||
this.$disableItems.parent().hide();
|
||||
this.$selectGroups.each(function () {
|
||||
var $parent = $(this).parent();
|
||||
var group = $parent.attr('data-group'),
|
||||
$items = that.$selectItems.filter(':visible');
|
||||
$parent[$items.filter('[data-group="' + group + '"]').length === 0 ? 'hide' : 'show']();
|
||||
});
|
||||
|
||||
//Check if no matches found
|
||||
if (this.$selectItems.filter(':visible').length) {
|
||||
this.$selectAll.parent().show();
|
||||
this.$noResults.hide();
|
||||
} else {
|
||||
this.$selectAll.parent().hide();
|
||||
this.$noResults.show();
|
||||
}
|
||||
}
|
||||
this.updateOptGroupSelect();
|
||||
this.updateSelectAll();
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.multipleSelect = function () {
|
||||
var option = arguments[0],
|
||||
args = arguments,
|
||||
|
||||
value,
|
||||
allowedMethods = [
|
||||
'getSelects', 'setSelects',
|
||||
'enable', 'disable',
|
||||
'checkAll', 'uncheckAll',
|
||||
'focus', 'blur',
|
||||
'refresh'
|
||||
];
|
||||
|
||||
this.each(function () {
|
||||
var $this = $(this),
|
||||
data = $this.data('multipleSelect'),
|
||||
options = $.extend({}, $.fn.multipleSelect.defaults,
|
||||
$this.data(), typeof option === 'object' && option);
|
||||
|
||||
if (!data) {
|
||||
data = new MultipleSelect($this, options);
|
||||
$this.data('multipleSelect', data);
|
||||
}
|
||||
|
||||
if (typeof option === 'string') {
|
||||
if ($.inArray(option, allowedMethods) < 0) {
|
||||
throw "Unknown method: " + option;
|
||||
}
|
||||
value = data[option](args[1]);
|
||||
} else {
|
||||
data.init();
|
||||
if (args[1]) {
|
||||
value = data[args[1]].apply(data, [].slice.call(args, 2));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return value ? value : this;
|
||||
};
|
||||
|
||||
$.fn.multipleSelect.defaults = {
|
||||
name: '',
|
||||
isOpen: false,
|
||||
placeholder: '',
|
||||
selectAll: true,
|
||||
selectAllText: 'Select all',
|
||||
selectAllDelimiter: ['[', ']'],
|
||||
allSelected: 'All selected',
|
||||
minumimCountSelected: 3,
|
||||
countSelected: '# of % selected',
|
||||
noMatchesFound: 'No matches found',
|
||||
multiple: false,
|
||||
multipleWidth: 80,
|
||||
single: false,
|
||||
filter: false,
|
||||
width: undefined,
|
||||
maxHeight: 250,
|
||||
container: null,
|
||||
position: 'bottom',
|
||||
keepOpen: false,
|
||||
blockSeparator: '',
|
||||
displayValues: false,
|
||||
delimiter: ', ',
|
||||
|
||||
styler: function () {
|
||||
return false;
|
||||
},
|
||||
textTemplate: function ($elm) {
|
||||
return $elm.text();
|
||||
},
|
||||
|
||||
onOpen: function () {
|
||||
return false;
|
||||
},
|
||||
onClose: function () {
|
||||
return false;
|
||||
},
|
||||
onCheckAll: function () {
|
||||
return false;
|
||||
},
|
||||
onUncheckAll: function () {
|
||||
return false;
|
||||
},
|
||||
onFocus: function () {
|
||||
return false;
|
||||
},
|
||||
onBlur: function () {
|
||||
return false;
|
||||
},
|
||||
onOptgroupClick: function () {
|
||||
return false;
|
||||
},
|
||||
onClick: function () {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
})(jQuery);
|
||||
|
|
@ -1,191 +0,0 @@
|
|||
/**
|
||||
* @author zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
.ms-parent {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.ms-choice {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 26px;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
border: 1px solid #aaa;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
line-height: 26px;
|
||||
color: #444;
|
||||
text-decoration: none;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.ms-choice.disabled {
|
||||
background-color: #f4f4f4;
|
||||
background-image: none;
|
||||
border: 1px solid #ddd;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.ms-choice > span {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 20px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: block;
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
.ms-choice > span.placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.ms-choice > div {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 20px;
|
||||
height: 25px;
|
||||
background: url('multiple-select.png') right top no-repeat;
|
||||
}
|
||||
|
||||
.ms-choice > div.open {
|
||||
background: url('multiple-select.png') left top no-repeat;
|
||||
}
|
||||
|
||||
.ms-drop {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
display: none;
|
||||
margin-top: -1px;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
z-index: 1000;
|
||||
background: #fff;
|
||||
color: #000;
|
||||
border: 1px solid #aaa;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.ms-drop.bottom {
|
||||
top: 100%;
|
||||
-webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
|
||||
-moz-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
|
||||
box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
|
||||
}
|
||||
|
||||
.ms-drop.top {
|
||||
bottom: 100%;
|
||||
-webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
|
||||
-moz-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
|
||||
box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
|
||||
}
|
||||
|
||||
.ms-search {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
min-height: 26px;
|
||||
padding: 4px;
|
||||
position: relative;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
z-index: 10000;
|
||||
}
|
||||
|
||||
.ms-search input {
|
||||
width: 100%;
|
||||
height: auto !important;
|
||||
min-height: 24px;
|
||||
padding: 0 20px 0 5px;
|
||||
margin: 0;
|
||||
outline: 0;
|
||||
font-family: sans-serif;
|
||||
font-size: 1em;
|
||||
border: 1px solid #aaa;
|
||||
-webkit-border-radius: 0;
|
||||
-moz-border-radius: 0;
|
||||
border-radius: 0;
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
background: #fff url('multiple-select.png') no-repeat 100% -22px;
|
||||
background: url('multiple-select.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
|
||||
background: url('multiple-select.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
|
||||
background: url('multiple-select.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
|
||||
background: url('multiple-select.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
|
||||
background: url('multiple-select.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
|
||||
background: url('multiple-select.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
|
||||
}
|
||||
|
||||
.ms-search, .ms-search input {
|
||||
-webkit-box-sizing: border-box;
|
||||
-khtml-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
-ms-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.ms-drop ul {
|
||||
overflow: auto;
|
||||
margin: 0;
|
||||
padding: 5px 8px;
|
||||
}
|
||||
|
||||
.ms-drop ul > li {
|
||||
list-style: none;
|
||||
display: list-item;
|
||||
background-image: none;
|
||||
position: static;
|
||||
}
|
||||
|
||||
.ms-drop ul > li .disabled {
|
||||
opacity: .35;
|
||||
filter: Alpha(Opacity=35);
|
||||
}
|
||||
|
||||
.ms-drop ul > li.multiple {
|
||||
display: block;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.ms-drop ul > li.group {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.ms-drop ul > li.multiple label {
|
||||
width: 100%;
|
||||
display: block;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.ms-drop ul > li label {
|
||||
font-weight: normal;
|
||||
display: block;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.ms-drop ul > li label.optgroup {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.ms-drop input[type="checkbox"] {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.ms-drop .ms-no-results {
|
||||
display: none;
|
||||
}
|
||||
10
koha-tmpl/intranet-tmpl/lib/jquery/plugins/multiple-select/multiple-select.min.css
vendored
Normal file
10
koha-tmpl/intranet-tmpl/lib/jquery/plugins/multiple-select/multiple-select.min.css
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* multiple-select - Multiple select is a jQuery plugin to select multiple elements with checkboxes :).
|
||||
*
|
||||
* @version v1.6.0
|
||||
* @homepage http://multiple-select.wenzhixin.net.cn
|
||||
* @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
@charset "UTF-8";.ms-offscreen{clip:rect(0 0 0 0)!important;width:1px!important;height:1px!important;border:0!important;margin:0!important;padding:0!important;overflow:hidden!important;position:absolute!important;outline:0!important;left:auto!important;top:auto!important}.ms-parent{display:inline-block;position:relative;vertical-align:middle}.ms-choice{display:block;width:100%;height:26px;padding:0;overflow:hidden;cursor:pointer;border:1px solid #aaa;text-align:left;white-space:nowrap;line-height:26px;color:#444;text-decoration:none;border-radius:4px;background-color:#fff}.ms-choice.disabled{background-color:#f4f4f4;background-image:none;border:1px solid #ddd;cursor:default}.ms-choice>span{position:absolute;top:0;left:0;right:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;padding-left:8px}.ms-choice>span.placeholder{color:#999}.ms-choice>div.icon-close{position:absolute;top:0;right:16px;height:100%;width:16px}.ms-choice>div.icon-close:before{content:'×';color:#888;font-weight:bold}.ms-choice>div.icon-close:hover:before{color:#333}.ms-choice>div.icon-caret{position:absolute;width:0;height:0;top:50%;right:8px;margin-top:-2px;border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px}.ms-choice>div.icon-caret.open{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.ms-drop{width:auto;min-width:100%;overflow:hidden;display:none;margin-top:-1px;padding:0;position:absolute;z-index:1000;background:#fff;color:#000;border:1px solid #aaa;border-radius:4px}.ms-drop.bottom{top:100%;box-shadow:0 4px 5px rgba(0,0,0,0.15)}.ms-drop.top{bottom:100%;box-shadow:0 -4px 5px rgba(0,0,0,0.15)}.ms-search{display:inline-block;margin:0;min-height:26px;padding:2px;position:relative;white-space:nowrap;width:100%;z-index:10000;box-sizing:border-box}.ms-search input{width:100%;height:auto!important;min-height:24px;padding:0 5px;margin:0;outline:0;font-family:sans-serif;border:1px solid #aaa;border-radius:5px;box-shadow:none}.ms-drop ul{overflow:auto;margin:0;padding:0}.ms-drop ul>li{list-style:none;display:list-item;background-image:none;position:static;padding:.25rem 8px}.ms-drop ul>li .disabled{font-weight:normal!important;opacity:.35;filter:Alpha(Opacity=35);cursor:default}.ms-drop ul>li.multiple{display:block;float:left}.ms-drop ul>li.group{clear:both}.ms-drop ul>li.multiple label{width:100%;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ms-drop ul>li label{position:relative;padding-left:1.25rem;margin-bottom:0;font-weight:normal;display:block;white-space:nowrap;cursor:pointer}.ms-drop ul>li label.optgroup{font-weight:bold}.ms-drop ul>li.hide-radio{padding:0}.ms-drop ul>li.hide-radio:focus,.ms-drop ul>li.hide-radio:hover{background-color:#f8f9fa}.ms-drop ul>li.hide-radio.selected{color:#fff;background-color:#007bff}.ms-drop ul>li.hide-radio label{margin-bottom:0;padding:5px 8px}.ms-drop ul>li.hide-radio input{display:none}.ms-drop ul>li.option-level-1 label{padding-left:28px}.ms-drop ul>li.option-divider{padding:0;border-top:1px solid #e9ecef}.ms-drop input[type="radio"],.ms-drop input[type="checkbox"]{position:absolute;margin-top:.3rem;margin-left:-1.25rem}.ms-drop .ms-no-results{display:none}
|
||||
10
koha-tmpl/intranet-tmpl/lib/jquery/plugins/multiple-select/multiple-select.min.js
vendored
Normal file
10
koha-tmpl/intranet-tmpl/lib/jquery/plugins/multiple-select/multiple-select.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Binary file not shown.
|
Before Width: | Height: | Size: 3.3 KiB |
|
|
@ -183,3 +183,11 @@ span.overridden {
|
|||
#menu ul ul {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
#admin_preferences .ms-drop ul {
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
#admin_preferences .ms-drop label span {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -983,9 +983,9 @@
|
|||
by Allan Jardine is licensed under the BSD 3 and GPL v2 license.
|
||||
</p>
|
||||
|
||||
<h2>jquery.multiple.select.js</h2>
|
||||
<h2>jQuery Multiple Select Plugin</h2>
|
||||
<p>
|
||||
The <a href="http://wenzhixin.net.cn/p/multiple-select/">jQuery multiple select plugin</a> by Zhixin Wen is licensed under the MIT license.
|
||||
The <a href="https://multiple-select.wenzhixin.net.cn/">jQuery Multiple Select plugin</a> by Zhixin Wen is licensed under the MIT license.
|
||||
</p>
|
||||
|
||||
<h2>Javascript Diff Algorithm</h2>
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
[% INCLUDE 'doc-head-open.inc' %]
|
||||
<title>System preferences › Administration › Koha</title>
|
||||
[% INCLUDE 'doc-head-close.inc' %]
|
||||
[% Asset.css("lib/jquery/plugins/multiple-select/multiple-select.min.css") | $raw %]
|
||||
[% Asset.css("css/preferences.css") | $raw %]
|
||||
[% Asset.css("lib/jquery/plugins/multiple-select/multiple-select.css") | $raw %]
|
||||
[% Asset.css("css/humanmsg.css") | $raw %]
|
||||
[% Asset.css("lib/codemirror/codemirror.min.css") | $raw %]
|
||||
[% Asset.css("lib/codemirror/lint.min.css") | $raw %]
|
||||
|
|
@ -239,7 +239,7 @@
|
|||
[% MACRO jsinclude BLOCK %]
|
||||
[% INCLUDE 'datatables.inc' %]
|
||||
[% Asset.js("lib/hc-sticky.js") | $raw %]
|
||||
[% Asset.js("lib/jquery/plugins/multiple-select/jquery.multiple.select.js") | $raw %]
|
||||
[% Asset.js("lib/jquery/plugins/multiple-select/multiple-select.min.js") | $raw %]
|
||||
[% Asset.js( "lib/codemirror/codemirror.min.js" ) | $raw %]
|
||||
[% Asset.js( "lib/codemirror/css.min.js" ) | $raw %]
|
||||
[% Asset.js( "lib/codemirror/javascript.min.js" ) | $raw %]
|
||||
|
|
|
|||
Loading…
Reference in New Issue