summaryrefslogtreecommitdiff
path: root/chimere
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-03-06 19:06:02 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-03-06 19:06:02 +0100
commit4d483ae06f8e7f90c76d2f4c6bb2745dc573c89e (patch)
treee9f9b71e2374c5417e13645c78c702a12c52fc98 /chimere
parente3533b5da0d9e78e427e1f34dd723a8d34404459 (diff)
downloadChimère-4d483ae06f8e7f90c76d2f4c6bb2745dc573c89e.tar.bz2
Chimère-4d483ae06f8e7f90c76d2f4c6bb2745dc573c89e.zip
Update bsmselect to last version
Diffstat (limited to 'chimere')
-rw-r--r--chimere/static/bsmSelect/MIT-LICENSE.txt4
-rw-r--r--chimere/static/bsmSelect/README.md22
-rw-r--r--chimere/static/bsmSelect/css/jquery.bsmselect.css8
-rw-r--r--chimere/static/bsmSelect/js/jquery.bsmselect.compatibility.js10
-rw-r--r--chimere/static/bsmSelect/js/jquery.bsmselect.js43
-rw-r--r--chimere/static/bsmSelect/js/jquery.bsmselect.sortable.js18
6 files changed, 64 insertions, 41 deletions
diff --git a/chimere/static/bsmSelect/MIT-LICENSE.txt b/chimere/static/bsmSelect/MIT-LICENSE.txt
index 908016b..c5d6611 100644
--- a/chimere/static/bsmSelect/MIT-LICENSE.txt
+++ b/chimere/static/bsmSelect/MIT-LICENSE.txt
@@ -1,5 +1,5 @@
Copyright (c) 2008 by Ryan Cramer, http://www.ryancramer.com
-Copyright (c) 2010 by Victor Berchet
+Copyright (c) 2010-2013 by Victor Berchet
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -18,4 +18,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/chimere/static/bsmSelect/README.md b/chimere/static/bsmSelect/README.md
index bd14c6a..8d65624 100644
--- a/chimere/static/bsmSelect/README.md
+++ b/chimere/static/bsmSelect/README.md
@@ -50,7 +50,8 @@ The newly created select default option is the original select title attribute:
* listType:
* Specify what list will be created or used as part of the bsmSelect.
- * Can accept a callback that accepts the original <select> as an argument and returns a jQuery object with a single list.
+ * Can accept a callback that accepts the original <select> as an argument and
+ returns a jQuery object with a single list.
* Allowed values:
* 'ol'
* 'ul'
@@ -88,13 +89,16 @@ The newly created select default option is the original select title attribute:
* addItemTarget:
* Where to place new selected items that are added to the list.
- * Allowed values: 'top' or 'bottom' or 'original' to keep the original select sort order
+ * Allowed values: 'top' or 'bottom' or 'original' to keep the original select
+ sort order
* Default: 'bottom'
- * Note: When using the 'original' mode, the sort order can be overriden by setting the 'bsm-order' data on each option.
+ * Note: When using the 'original' mode, the sort order can be overriden by setting
+ the 'bsm-order' data on each option.
* debugMode:
- * Keeps original select multiple visible so that you can monitor live changes made to it when debugging.
+ * Keeps original select multiple visible so that you can monitor live changes
+ made to it when debugging.
* Default: false
* extractLabel:
@@ -104,14 +108,16 @@ The newly created select default option is the original select title attribute:
* plugins
- * An array of plugins objects to enable (they only are required to have an `init` method which is called on init with the Bsmselect instance as single argument).
+ * An array of plugins objects to enable (they only are required to have an `init`
+ method which is called on init with the Bsmselect instance as single argument).
* Default: an empty array (no plugin enabled by default)
### Text Labels ###
* title
- * Text used for the default select label (when original select title attribute is not set)
+ * Text used for the default select label (when original select title attribute
+ is not set)
* Default: 'Select...'
* removeLabel:
@@ -179,7 +185,9 @@ The newly created select default option is the original select title attribute:
* [Victor Berchet](http://github.com/vicb) is the author of bsmSelect
* [Andy Fowler](http://github.com/andyfowler) has contributed many enhancements
* [Cracky](https://github.com/Cracky)
- * [Marc Busqué](https://github.com/laMarciana) has contributed to fix [issue #21](https://github.com/vicb/bsmSelect/issues/21) and with minimal CSS
+ * [Marc Busqué](https://github.com/laMarciana) has contributed to fix
+ [issue #21](https://github.com/vicb/bsmSelect/issues/21) and with minimal CSS
+ * [DrewBe121212](https://github.com/DrewBe121212) has fixed issues 28 et 29.
## History ##
diff --git a/chimere/static/bsmSelect/css/jquery.bsmselect.css b/chimere/static/bsmSelect/css/jquery.bsmselect.css
index ad770d0..cc35cc3 100644
--- a/chimere/static/bsmSelect/css/jquery.bsmselect.css
+++ b/chimere/static/bsmSelect/css/jquery.bsmselect.css
@@ -36,7 +36,7 @@
list-style: none;
background: #ddd;
border: 1px solid #bbb;
- width: 100%;
+ width: auto;
margin: 0 0 -1px 0;
line-height: 1em;
}
@@ -62,3 +62,9 @@
top: 0;
padding: 5px;
}
+
+.bsmScrollWorkaround {
+ /* Fix a bug when the 'html' element has an overflow set to either 'scroll' or 'auto' on FF. */
+ padding-bottom: 1px;
+ overflow: auto;
+}
diff --git a/chimere/static/bsmSelect/js/jquery.bsmselect.compatibility.js b/chimere/static/bsmSelect/js/jquery.bsmselect.compatibility.js
index a743a07..683d865 100644
--- a/chimere/static/bsmSelect/js/jquery.bsmselect.compatibility.js
+++ b/chimere/static/bsmSelect/js/jquery.bsmselect.compatibility.js
@@ -1,17 +1,17 @@
/*
* Better Select Multiple Compatibility Plugin - jQuery Plugin
*
- * Copyright (c) 2010 by Victor Berchet - http://www.github.com/vicb
+ * Copyright (c) 2010-2011 by Victor Berchet - http://www.github.com/vicb
*
* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
*
- * version: v1.0.0 - 2010-09-05
+ * version: v1.0.1 - 2011-11-14
*/
(function($) {
$.bsmSelect.plugins.compatibility = function()
{
- if (!(this instanceof arguments.callee)) {
- return new arguments.callee();
+ if (!(this instanceof $.bsmSelect.plugins.compatibility)) {
+ return new $.bsmSelect.plugins.compatibility();
}
}
@@ -31,7 +31,7 @@
o.showEffect = $.bsmSelect.effects[o.animate.add];
} else {
o.showEffect = $.bsmSelect.effects.show;
- }
+ }
if ($.isFunction(o.animate.drop)) {
o.hideEffect = o.animate.drop;
diff --git a/chimere/static/bsmSelect/js/jquery.bsmselect.js b/chimere/static/bsmSelect/js/jquery.bsmselect.js
index 25527c6..7751418 100644
--- a/chimere/static/bsmSelect/js/jquery.bsmselect.js
+++ b/chimere/static/bsmSelect/js/jquery.bsmselect.js
@@ -4,11 +4,11 @@
* based on Alternate Select Multiple (asmSelect) 1.0.4a beta (http://www.ryancramer.com/projects/asmselect/)
*
* Copyright (c) 2009 by Ryan Cramer - http://www.ryancramer.com
- * Copyright (c) 2010 by Victor Berchet - http://www.github.com/vicb
+ * Copyright (c) 2010-2013 by Victor Berchet - http://www.github.com/vicb
*
* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
*
- * bsmSelect version: v1.4.3 - 2011-05-05
+ * bsmSelect version: v1.4.7 - 2013-12-19
*/
(function($) {
@@ -39,7 +39,7 @@
if (o.addItemTarget === 'original') {
$('option', this.$original).each(function(i, o) {
- if ($(o).data('bsm-order') === null) { $(o).data('bsm-order', i); }
+ if ($(o).data('bsm-order') === undefined) { $(o).data('bsm-order', i); }
});
}
@@ -47,7 +47,6 @@
this.$select = $('<select>', {
'class': o.selectClass,
- name: o.selectClass + this.uid,
id: o.selectClass + this.uid,
change: $.proxy(this.selectChangeEvent, this),
click: $.proxy(this.selectClickEvent, this)
@@ -69,7 +68,7 @@
if (!this.$list.parent().length) { this.$original.before(this.$list); }
if (this.$original.attr('id')) {
- $('label[for=' + this.$original.attr('id') + ']').attr('for', this.$select.attr('id'));
+ $("label[for='" + this.$original.attr('id') + "']").attr('for', this.$select.attr('id'));
}
// set up remove event (may be a link, or the list item itself)
@@ -86,11 +85,12 @@
* Check to make sure it's not an IE screwup, and add it to the list
*/
selectChangeEvent: function() {
- if ($.browser.msie && $.browser.version < 7 && !this.ieClick) { return; }
+ if ($.browser && $.browser.msie && $.browser.version < 7 && !this.ieClick) { return; }
var bsmOpt = $('option:selected:eq(0)', this.$select);
if (bsmOpt.data('orig-option')) {
- this.addListItem(bsmOpt);
- this.triggerOriginalChange(bsmOpt.data('orig-option'), 'add');
+ if (this.triggerOriginalChange(bsmOpt.data('orig-option'), 'add') == false) {
+ this.addListItem(bsmOpt);
+ }
}
this.ieClick = false;
},
@@ -115,7 +115,7 @@
this.buildSelect();
// opera has an issue where it needs a force redraw, otherwise
// the items won't appear until something else forces a redraw
- if ($.browser.opera) { this.$list.hide().show(); }
+ if ($.browser && $.browser.opera) { this.$list.hide().show(); }
}
},
@@ -198,7 +198,7 @@
.removeAttr('selected')
.attr('disabled', 'disabled')
.toggle(!this.options.hideWhenAdded);
- if ($.browser.msie && $.browser.version < 8) { this.$select.hide().show(); } // this forces IE to update display
+ if ($.browser && $.browser.msie && $.browser.version < 8) { this.$select.hide().show(); } // this forces IE to update display
},
/**
@@ -210,7 +210,7 @@
$bsmOpt.removeClass(this.options.optionDisabledClass)
.removeAttr('disabled')
.toggle(!this.options.hideWhenAdded);
- if ($.browser.msie && $.browser.version < 8) { this.$select.hide().show(); } // this forces IE to update display
+ if ($.browser && $.browser.msie && $.browser.version < 8) { this.$select.hide().show(); } // this forces IE to update display
},
/**
@@ -243,7 +243,7 @@
break;
case 'original':
var order = $origOpt.data('bsm-order'), inserted = false;
- $('.' + o.listItemClass, this.$list).each(function() {
+ this.$list.children().each(function() {
if (order < $(this).data('bsm-option').data('orig-option').data('bsm-order')) {
$item.hide().insertBefore(this);
inserted = true;
@@ -268,15 +268,16 @@
/**
* Remove an item from the list of selection
*
- * @param {jQuey} $item A list item
+ * @param {jQuery} $item A list item
*/
dropListItem: function($item) {
var $bsmOpt = $item.data('bsm-option'), o = this.options;
- $bsmOpt.removeData('item').data('orig-option').removeAttr('selected');
- (this.buildingSelect ? $.bsmSelect.effects.remove : o.hideEffect)($item);
- this.enableSelectOption($bsmOpt);
- o.highlightEffect(this.$select, $item, o.highlightRemovedLabel, o);
- this.triggerOriginalChange($bsmOpt.data('orig-option'), 'drop');
+ if (this.triggerOriginalChange($bsmOpt.data('orig-option'), 'drop') == false) {
+ $bsmOpt.removeData('item').data('orig-option').removeAttr('selected');
+ (this.buildingSelect ? $.bsmSelect.effects.remove : o.hideEffect)($item);
+ this.enableSelectOption($bsmOpt);
+ o.highlightEffect(this.$select, $item, o.highlightRemovedLabel, o);
+ }
},
/**
@@ -285,15 +286,19 @@
*
* @param {jQuery} $origOpt The option from the original select
* @param {String} type Event type
+ *
+ * @return Whether the event default is prevented
*/
triggerOriginalChange: function($origOpt, type) {
+ var event = $.Event('change');
this.ignoreOriginalChangeEvent = true;
- this.$original.trigger('change', [{
+ this.$original.trigger(event, [{
option: $origOpt,
value: $origOpt.val(),
item: $origOpt.data('bsm-option').data('item'),
type: type
}]);
+ return event.isDefaultPrevented();
}
};
diff --git a/chimere/static/bsmSelect/js/jquery.bsmselect.sortable.js b/chimere/static/bsmSelect/js/jquery.bsmselect.sortable.js
index 3e4b9f8..cd79028 100644
--- a/chimere/static/bsmSelect/js/jquery.bsmselect.sortable.js
+++ b/chimere/static/bsmSelect/js/jquery.bsmselect.sortable.js
@@ -1,17 +1,17 @@
/*
* Better Select Multiple Sortable Plugin
*
- * Copyright (c) 2010 by Victor Berchet - http://www.github.com/vicb
+ * Copyright (c) 2010-2012 by Victor Berchet - http://www.github.com/vicb
*
* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
*
- * version: v1.1.1 - 2010-11-17
+ * version: v1.4.4 - 2012-01-19
*/
(function($) {
$.bsmSelect.plugins.sortable = function(sortConfig, options)
{
- if (!(this instanceof arguments.callee)) {
- return new arguments.callee(sortConfig, options);
+ if (!(this instanceof $.bsmSelect.plugins.sortable)) {
+ return new $.bsmSelect.plugins.sortable(sortConfig, options);
}
this.sortConfig = sortConfig;
this.options = $.extend({}, this.defaultOpt, options || {});
@@ -27,13 +27,18 @@
config = $.extend({}, this.sortConfig, { items: '.' + o.listItemClass }),
self = this;
bsm.$list.addClass(o.listSortableClass).sortable(config);
+ // Fix a bug when the 'html' element has an overflow set to either 'scroll' or 'auto' on FF.
+ // See issue #21 (https://github.com/vicb/bsmSelect/issues/21)
+ if ($.inArray($('html').css('overflow-x'), ['auto', 'scroll']) > -1 || $.inArray($('html').css('overflow-y'), ['auto', 'scroll']) > -1) {
+ $('.' + o.listSortableClass).addClass('bsmScrollWorkaround');
+ }
bsm.$original.bind('change', function(e, info) { self.onChange.call(self, bsm, e, info); } );
bsm.$list.bind('sortupdate', function(e, ui) { self.onSort.call(self, bsm, e, ui); } );
},
onChange: function(bsm, e, info) {
- if (info && info.type == 'add' && !bsm.buildingSelect) {
- info.option.detach()[bsm.options.addItemTarget == 'top' ? 'prependTo' : 'appendTo'](bsm.$original);
+ if (info && info.type === 'add' && !bsm.buildingSelect) {
+ info.option.detach()[bsm.options.addItemTarget === 'top' ? 'prependTo' : 'appendTo'](bsm.$original);
bsm.$list.sortable('refresh');
}
},
@@ -46,4 +51,3 @@
}
});
})(jQuery);
-