r217 - in sandbox/nuiton-js-select2: . src/main/resources/META-INF/nuiton-js src/main/resources/nuiton-js-select2
Author: echatellier Date: 2013-09-20 15:29:04 +0200 (Fri, 20 Sep 2013) New Revision: 217 Url: http://nuiton.org/projects/nuiton-js/repository/revisions/217 Log: Update select2 Added: sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_bg.js sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_fa.js sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_ms.js sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_th.js Modified: sandbox/nuiton-js-select2/pom.xml sandbox/nuiton-js-select2/src/main/resources/META-INF/nuiton-js/wro-select2.xml sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2.css sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2.js sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_es.js sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_nl.js sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_pt-BR.js sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_pt-PT.js Modified: sandbox/nuiton-js-select2/pom.xml =================================================================== --- sandbox/nuiton-js-select2/pom.xml 2013-09-09 15:40:55 UTC (rev 216) +++ sandbox/nuiton-js-select2/pom.xml 2013-09-20 13:29:04 UTC (rev 217) @@ -14,7 +14,7 @@ </parent> <artifactId>nuiton-js-select2</artifactId> - <version>3.4.1-1-SNAPSHOT</version> + <version>3.4.3-1-SNAPSHOT</version> <name>Nuiton JS :: Select2</name> <description>Select2 jar packaging</description> @@ -29,9 +29,9 @@ </licenses> <scm> - <connection>scm:svn:http://svn.nuiton.org/svn/nuiton-js/tags/nuiton-js-select2-3.4.1-1</connection> - <developerConnection>scm:svn:http://svn.nuiton.org/svn/nuiton-js/tags/nuiton-js-select2-3.4.1-1</developerConnection> - <url>http://www.nuiton.org/repositories/browse/nuiton-js/tags/nuiton-js-select2-3.4.1-1</url> + <connection>scm:svn:http://svn.nuiton.org/svn/nuiton-js/tags/nuiton-js-select2-3.4.3-1</connection> + <developerConnection>scm:svn:http://svn.nuiton.org/svn/nuiton-js/tags/nuiton-js-select2-3.4.3-1</developerConnection> + <url>http://www.nuiton.org/repositories/browse/nuiton-js/tags/nuiton-js-select2-3.4.3-1</url> </scm> <dependencies> Modified: sandbox/nuiton-js-select2/src/main/resources/META-INF/nuiton-js/wro-select2.xml =================================================================== --- sandbox/nuiton-js-select2/src/main/resources/META-INF/nuiton-js/wro-select2.xml 2013-09-09 15:40:55 UTC (rev 216) +++ sandbox/nuiton-js-select2/src/main/resources/META-INF/nuiton-js/wro-select2.xml 2013-09-20 13:29:04 UTC (rev 217) @@ -24,12 +24,17 @@ <groups xmlns="http://www.isdc.ro/wro"> <group name='select2'> <js>classpath:nuiton-js-select2/select2.js</js> + <css>classpath:nuiton-js-select2/select2.css</css> </group> - <group name='select2-ar'> + <group name='select2-ar'> <js>classpath:nuiton-js-select2/select2_locale_ar.js</js> </group> + <group name='select2-bg'> + <js>classpath:nuiton-js-select2/select2_locale_bg.js</js> + </group> + <group name='select2-ca'> <js>classpath:nuiton-js-select2/select2_locale_ca.js</js> </group> @@ -62,6 +67,10 @@ <js>classpath:nuiton-js-select2/select2_locale_eu.js</js> </group> + <group name='select2-fa'> + <js>classpath:nuiton-js-select2/select2_locale_fa.js</js> + </group> + <group name='select2-fi'> <js>classpath:nuiton-js-select2/select2_locale_fi.js</js> </group> @@ -118,6 +127,10 @@ <js>classpath:nuiton-js-select2/select2_locale_mk.js</js> </group> + <group name='select2-ms'> + <js>classpath:nuiton-js-select2/select2_locale_ms.js</js> + </group> + <group name='select2-nl'> <js>classpath:nuiton-js-select2/select2_locale_nl.js</js> </group> @@ -154,6 +167,10 @@ <js>classpath:nuiton-js-select2/select2_locale_sv.js</js> </group> + <group name='select2-th'> + <js>classpath:nuiton-js-select2/select2_locale_th.js</js> + </group> + <group name='select2-tr'> <js>classpath:nuiton-js-select2/select2_locale_tr.js</js> </group> Modified: sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2.css =================================================================== --- sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2.css 2013-09-09 15:40:55 UTC (rev 216) +++ sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2.css 2013-09-20 13:29:04 UTC (rev 217) @@ -1,5 +1,5 @@ /* %%Ignore-License -Version: 3.4.1 Timestamp: Thu Jun 27 18:02:10 PDT 2013 +Version: 3.4.3 Timestamp: Tue Sep 17 06:47:14 PDT 2013 */ .select2-container { margin: 0; @@ -14,7 +14,7 @@ .select2-container, .select2-drop, .select2-search, -.select2-search input{ +.select2-search input { /* Force border-box so that % widths fit the parent container without overlap because of margin/padding. @@ -22,9 +22,7 @@ More Info : http://www.quirksmode.org/css/box.html */ -webkit-box-sizing: border-box; /* webkit */ - -khtml-box-sizing: border-box; /* konqueror */ -moz-box-sizing: border-box; /* firefox */ - -ms-box-sizing: border-box; /* ie */ box-sizing: border-box; /* css3 */ } @@ -41,45 +39,34 @@ color: #444; text-decoration: none; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; + border-radius: 4px; - -webkit-background-clip: padding-box; - -moz-background-clip: padding; - background-clip: padding-box; + background-clip: padding-box; -webkit-touch-callout: none; -webkit-user-select: none; - -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; background-color: #fff; - background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white)); - background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%); - background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 50%); - background-image: -o-linear-gradient(bottom, #eeeeee 0%, #ffffff 50%); - background-image: -ms-linear-gradient(top, #ffffff 0%, #eeeeee 50%); + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.5, #fff)); + background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 50%); + background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 50%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0); - background-image: linear-gradient(top, #ffffff 0%, #eeeeee 50%); + background-image: linear-gradient(top, #fff 0%, #eee 50%); } .select2-container.select2-drop-above .select2-choice { border-bottom-color: #aaa; - -webkit-border-radius:0 0 4px 4px; - -moz-border-radius:0 0 4px 4px; - border-radius:0 0 4px 4px; + border-radius: 0 0 4px 4px; - background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.9, white)); - background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 90%); - background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 90%); - background-image: -o-linear-gradient(bottom, #eeeeee 0%, white 90%); - background-image: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 90%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 ); - background-image: linear-gradient(top, #eeeeee 0%,#ffffff 90%); + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.9, #fff)); + background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 90%); + background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 90%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0); + background-image: linear-gradient(top, #eee 0%, #fff 90%); } .select2-container.select2-allowclear .select2-choice .select2-chosen { @@ -93,9 +80,7 @@ white-space: nowrap; - -ms-text-overflow: ellipsis; - -o-text-overflow: ellipsis; - text-overflow: ellipsis; + text-overflow: ellipsis; } .select2-container .select2-choice abbr { @@ -124,29 +109,21 @@ cursor: pointer; } -.select2-drop-undermask { - border: 0; - margin: 0; - padding: 0; - position: absolute; - left: 0; - top: 0; - z-index: 9998; - background-color: transparent; - filter: alpha(opacity=0); -} - .select2-drop-mask { border: 0; margin: 0; padding: 0; - position: absolute; + position: fixed; left: 0; top: 0; + min-height: 100%; + min-width: 100%; + height: auto; + width: auto; + opacity: 0; z-index: 9998; /* styles required for IE to work */ background-color: #fff; - opacity: 0; filter: alpha(opacity=0); } @@ -162,12 +139,9 @@ border: 1px solid #aaa; border-top: 0; - -webkit-border-radius: 0 0 4px 4px; - -moz-border-radius: 0 0 4px 4px; - border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; -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); } @@ -185,12 +159,9 @@ border-top: 1px solid #aaa; border-bottom: 0; - -webkit-border-radius: 4px 4px 0 0; - -moz-border-radius: 4px 4px 0 0; - border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; -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); } @@ -212,22 +183,16 @@ top: 0; border-left: 1px solid #aaa; - -webkit-border-radius: 0 4px 4px 0; - -moz-border-radius: 0 4px 4px 0; - border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; - -webkit-background-clip: padding-box; - -moz-background-clip: padding; - background-clip: padding-box; + background-clip: padding-box; background: #ccc; background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee)); background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%); background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%); - background-image: -o-linear-gradient(bottom, #ccc 0%, #eee 60%); - background-image: -ms-linear-gradient(top, #cccccc 0%, #eeeeee 60%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc', GradientType = 0); - background-image: linear-gradient(top, #cccccc 0%, #eeeeee 60%); + background-image: linear-gradient(top, #ccc 0%, #eee 60%); } .select2-container .select2-choice .select2-arrow b { @@ -263,21 +228,16 @@ font-size: 1em; border: 1px solid #aaa; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; + border-radius: 0; -webkit-box-shadow: none; - -moz-box-shadow: none; box-shadow: none; background: #fff url('select2.png') no-repeat 100% -22px; - background: url('select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); - background: url('select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background: url('select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background: url('select2.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); - background: url('select2.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%); - background: url('select2.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%, #eeeeee 99%); + background: url('select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee)); + background: url('select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%); + background: url('select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%); + background: url('select2.png') no-repeat 100% -22px, linear-gradient(top, #fff 85%, #eee 99%); } .select2-drop.select2-drop-above .select2-search input { @@ -286,12 +246,10 @@ .select2-search input.select2-active { background: #fff url('select2-spinner.gif') no-repeat 100%; - background: url('select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); - background: url('select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background: url('select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background: url('select2-spinner.gif') no-repeat 100%, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); - background: url('select2-spinner.gif') no-repeat 100%, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%); - background: url('select2-spinner.gif') no-repeat 100%, linear-gradient(top, #ffffff 85%, #eeeeee 99%); + background: url('select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee)); + background: url('select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%); + background: url('select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%); + background: url('select2-spinner.gif') no-repeat 100%, linear-gradient(top, #fff 85%, #eee 99%); } .select2-container-active .select2-choice, @@ -299,33 +257,24 @@ border: 1px solid #5897fb; outline: none; - -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3); - -moz-box-shadow: 0 0 5px rgba(0,0,0,.3); - box-shadow: 0 0 5px rgba(0,0,0,.3); + -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3); + box-shadow: 0 0 5px rgba(0, 0, 0, .3); } .select2-dropdown-open .select2-choice { border-bottom-color: transparent; -webkit-box-shadow: 0 1px 0 #fff inset; - -moz-box-shadow: 0 1px 0 #fff inset; box-shadow: 0 1px 0 #fff inset; - -webkit-border-bottom-left-radius: 0; - -moz-border-radius-bottomleft: 0; - border-bottom-left-radius: 0; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; - -webkit-border-bottom-right-radius: 0; - -moz-border-radius-bottomright: 0; - border-bottom-right-radius: 0; - background-color: #eee; - background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee)); - background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%); - background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%); - background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%); - background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 ); - background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%); + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #fff), color-stop(0.5, #eee)); + background-image: -webkit-linear-gradient(center bottom, #fff 0%, #eee 50%); + background-image: -moz-linear-gradient(center bottom, #fff 0%, #eee 50%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0); + background-image: linear-gradient(top, #fff 0%, #eee 50%); } .select2-dropdown-open.select2-drop-above .select2-choice, @@ -333,13 +282,11 @@ border: 1px solid #5897fb; border-top-color: transparent; - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, white), color-stop(0.5, #eeeeee)); - background-image: -webkit-linear-gradient(center top, white 0%, #eeeeee 50%); - background-image: -moz-linear-gradient(center top, white 0%, #eeeeee 50%); - background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%); - background-image: -ms-linear-gradient(bottom, #ffffff 0%,#eeeeee 50%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 ); - background-image: linear-gradient(bottom, #ffffff 0%,#eeeeee 50%); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(0.5, #eee)); + background-image: -webkit-linear-gradient(center top, #fff 0%, #eee 50%); + background-image: -moz-linear-gradient(center top, #fff 0%, #eee 50%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0); + background-image: linear-gradient(bottom, #fff 0%, #eee 50%); } .select2-dropdown-open .select2-choice .select2-arrow { @@ -359,7 +306,7 @@ position: relative; overflow-x: hidden; overflow-y: auto; - -webkit-tap-highlight-color: rgba(0,0,0,0); + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } .select2-results ul.select2-result-sub { @@ -394,7 +341,6 @@ -webkit-touch-callout: none; -webkit-user-select: none; - -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; @@ -415,7 +361,7 @@ } .select2-results .select2-highlighted ul { - background: white; + background: #fff; color: #000; } @@ -489,12 +435,10 @@ overflow: hidden; background-color: #fff; - background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff)); - background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%); - background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%); - background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%); - background-image: -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%); - background-image: linear-gradient(top, #eeeeee 1%, #ffffff 15%); + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eee), color-stop(15%, #fff)); + background-image: -webkit-linear-gradient(top, #eee 1%, #fff 15%); + background-image: -moz-linear-gradient(top, #eee 1%, #fff 15%); + background-image: linear-gradient(top, #eee 1%, #fff 15%); } .select2-locked { @@ -509,9 +453,8 @@ border: 1px solid #5897fb; outline: none; - -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3); - -moz-box-shadow: 0 0 5px rgba(0,0,0,.3); - box-shadow: 0 0 5px rgba(0,0,0,.3); + -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3); + box-shadow: 0 0 5px rgba(0, 0, 0, .3); } .select2-container-multi .select2-choices li { float: left; @@ -533,7 +476,6 @@ outline: 0; border: 0; -webkit-box-shadow: none; - -moz-box-shadow: none; box-shadow: none; background: transparent !important; } @@ -556,33 +498,25 @@ cursor: default; border: 1px solid #aaaaaa; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; + border-radius: 3px; - -webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05); - -moz-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05); - box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05); + -webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05); + box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05); - -webkit-background-clip: padding-box; - -moz-background-clip: padding; - background-clip: padding-box; + background-clip: padding-box; -webkit-touch-callout: none; -webkit-user-select: none; - -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; background-color: #e4e4e4; - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0 ); - background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee)); - background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); - background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); - background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); - background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); - background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0); + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eee)); + background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%); + background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%); + background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%); } .select2-container-multi .select2-choices .select2-search-choice .select2-chosen { cursor: default; @@ -616,7 +550,7 @@ } /* disabled styles */ -.select2-container-multi.select2-container-disabled .select2-choices{ +.select2-container-multi.select2-container-disabled .select2-choices { background-color: #f4f4f4; background-image: none; border: 1px solid #ddd; @@ -631,7 +565,7 @@ } .select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close { display: none; - background:none; + background: none; } /* end multiselect */ @@ -642,16 +576,17 @@ } .select2-offscreen, .select2-offscreen:focus { - clip: rect(0 0 0 0); - width: 1px; - height: 1px; - border: 0; - margin: 0; - padding: 0; - overflow: hidden; - position: absolute; - outline: 0; - left: 0px; + 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: 0px !important; + top: 0px !important; } .select2-display-none { Modified: sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2.js =================================================================== --- sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2.js 2013-09-09 15:40:55 UTC (rev 216) +++ sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2.js 2013-09-20 13:29:04 UTC (rev 217) @@ -1,7 +1,7 @@ -/* %%Ignore-License +/* %%Ignore-License Copyright 2012 Igor Vaynberg -Version: 3.4.1 Timestamp: Thu Jun 27 18:02:10 PDT 2013 +Version: 3.4.3 Timestamp: Tue Sep 17 06:47:14 PDT 2013 This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU General Public License version 2 (the "GPL License"). You may choose either license to govern your @@ -20,7 +20,7 @@ */ (function ($) { if(typeof $.fn.each2 == "undefined") { - $.fn.extend({ + $.extend($.fn, { /* * 4-10 times faster .each replacement * use it carefully, as it overrides jQuery context of element on each iteration @@ -96,12 +96,28 @@ return k >= 112 && k <= 123; } }, - MEASURE_SCROLLBAR_TEMPLATE = "<div class='select2-measure-scrollbar'></div>"; + MEASURE_SCROLLBAR_TEMPLATE = "<div class='select2-measure-scrollbar'></div>", + DIACRITICS = {"\u24B6":"A","\uFF21":"A","\u00C0":"A","\u00C1":"A","\u00C2":"A","\u1EA6":"A","\u1EA4":"A","\u1EAA":"A","\u1EA8":"A","\u00C3":"A","\u0100":"A","\u0102":"A","\u1EB0":"A","\u1EAE":"A","\u1EB4":"A","\u1EB2":"A","\u0226":"A","\u01E0":"A","\u00C4":"A","\u01DE":"A","\u1EA2":"A","\u00C5":"A","\u01FA":"A","\u01CD":"A","\u0200":"A","\u0202":"A","\u1EA0":"A","\u1EAC":"A","\u1EB6":"A","\u1E00":"A","\u0104":"A","\u023A":"A","\u2C6F":"A","\uA732":"AA","\u00C6":"AE","\u01FC":"AE","\u01E2":"AE","\uA734":"AO","\uA736":"AU","\uA738":"AV","\uA73A":"AV","\uA73C":"AY","\u24B7":"B","\uFF22":"B","\u1E02":"B","\u1E04":"B","\u1E06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24B8":"C","\uFF23":"C","\u0106":"C","\u0108":"C","\u010A":"C","\u010C":"C","\u00C7":"C","\u1E08":"C","\u0187":"C","\u023B":"C","\uA73E":"C","\u24B9":"D","\uFF24":"D","\u1E0A":"D","\u010E":"D","\u1E0C":"D","\u1E10":"D","\u1E12":"D","\u1E0E":"D","\u0110":"D","\u018B":"D","\u018A":"D","\u0189":"D","\uA779":"D","\u01F1":"DZ","\u01C4":"DZ","\u01F2":"Dz","\u01C5":"Dz","\u24BA":"E","\uFF25":"E","\u00C8":"E","\u00C9":"E","\u00CA":"E","\u1EC0":"E","\u1EBE":"E","\u1EC4":"E","\u1EC2":"E","\u1EBC":"E","\u0112":"E","\u1E14":"E","\u1E16":"E","\u0114":"E","\u0116":"E","\u00CB":"E","\u1EBA":"E","\u011A":"E","\u0204":"E","\u0206":"E","\u1EB8":"E","\u1EC6":"E","\u0228":"E","\u1E1C":"E","\u0118":"E","\u1E18":"E","\u1E1A":"E","\u0190":"E","\u018E":"E","\u24BB":"F","\uFF26":"F","\u1E1E":"F","\u0191":"F","\uA77B":"F","\u24BC":"G","\uFF27":"G","\u01F4":"G","\u011C":"G","\u1E20":"G","\u011E":"G","\u0120":"G","\u01E6":"G","\u0122":"G","\u01E4":"G","\u0193":"G","\uA7A0":"G","\uA77D":"G","\uA77E":"G","\u24BD":"H","\uFF28":"H","\u0124":"H","\u1E22":"H","\u1E26":"H","\u021E":"H","\u1E24":"H","\u1E28":"H","\u1E2A":"H","\u0126":"H","\u2C67":"H","\u2C75":"H","\uA78D":"H","\u24BE":"I","\uFF29":"I","\u00CC":"I","\u00CD":"I","\u00CE":"I","\u0128":"I","\u012A":"I","\u012C":"I","\u0130":"I","\u00CF":"I","\u1E2E":"I","\u1EC8":"I","\u01CF":"I","\u0208":"I","\u020A":"I","\u1ECA":"I","\u012E":"I","\u1E2C":"I","\u0197":"I","\u24BF":"J","\uFF2A":"J","\u0134":"J","\u0248":"J","\u24C0":"K","\uFF2B":"K","\u1E30":"K","\u01E8":"K","\u1E32":"K","\u0136":"K","\u1E34":"K","\u0198":"K","\u2C69":"K","\uA740":"K","\uA742":"K","\uA744":"K","\uA7A2":"K","\u24C1":"L","\uFF2C":"L","\u013F":"L","\u0139":"L","\u013D":"L","\u1E36":"L","\u1E38":"L","\u013B":"L","\u1E3C":"L","\u1E3A":"L","\u0141":"L","\u023D":"L","\u2C62":"L","\u2C60":"L","\uA748":"L","\uA746":"L","\uA780":"L","\u01C7":"LJ","\u01C8":"Lj","\u24C2":"M","\uFF2D":"M","\u1E3E":"M","\u1E40":"M","\u1E42":"M","\u2C6E":"M","\u019C":"M","\u24C3":"N","\uFF2E":"N","\u01F8":"N","\u0143":"N","\u00D1":"N","\u1E44":"N","\u0147":"N","\u1E46":"N","\u0145":"N","\u1E4A":"N","\u1E48":"N","\u0220":"N","\u019D":"N","\uA790":"N","\uA7A4":"N","\u01CA":"NJ","\u01CB":"Nj","\u24C4":"O","\uFF2F":"O","\u00D2":"O","\u00D3":"O","\u00D4":"O","\u1ED2":"O","\u1ED0":"O","\u1ED6":"O","\u1ED4":"O","\u00D5":"O","\u1E4C":"O","\u022C":"O","\u1E4E":"O","\u014C":"O","\u1E50":"O","\u1E52":"O","\u014E":"O","\u022E":"O","\u0230":"O","\u00D6":"O","\u022A":"O","\u1ECE":"O","\u0150":"O","\u01D1":"O","\u020C":"O","\u020E":"O","\u01A0":"O","\u1EDC":"O","\u1EDA":"O","\u1EE0":"O","\u1EDE":"O","\u1EE2":"O","\u1ECC":"O","\u1ED8":"O","\u01EA":"O","\u01EC":"O","\u00D8":"O","\u01FE":"O","\u0186":"O","\u019F":"O","\uA74A":"O","\uA74C":"O","\u01A2":"OI","\uA74E":"OO","\u0222":"OU","\u24C5":"P","\uFF30":"P","\u1E54":"P","\u1E56":"P","\u01A4":"P","\u2C63":"P","\uA750":"P","\uA752":"P","\uA754":"P","\u24C6":"Q","\uFF31":"Q","\uA756":"Q","\uA758":"Q","\u024A":"Q","\u24C7":"R","\uFF32":"R","\u0154":"R","\u1E58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1E5A":"R","\u1E5C":"R","\u0156":"R","\u1E5E":"R","\u024C":"R","\u2C64":"R","\uA75A":"R","\uA7A6":"R","\uA782":"R","\u24C8":"S","\uFF33":"S","\u1E9E":"S","\u015A":"S","\u1E64":"S","\u015C":"S","\u1E60":"S","\u0160":"S","\u1E66":"S","\u1E62":"S","\u1E68":"S","\u0218":"S","\u015E":"S","\u2C7E":"S","\uA7A8":"S","\uA784":"S","\u24C9":"T","\uFF34":"T","\u1E6A":"T","\u0164":"T","\u1E6C":"T","\u021A":"T","\u0162":"T","\u1E70":"T","\u1E6E":"T","\u0166":"T","\u01AC":"T","\u01AE":"T","\u023E":"T","\uA786":"T","\uA728":"TZ","\u24CA":"U","\uFF35":"U","\u00D9":"U","\u00DA":"U","\u00DB":"U","\u0168":"U","\u1E78":"U","\u016A":"U","\u1E7A":"U","\u016C":"U","\u00DC":"U","\u01DB":"U","\u01D7":"U","\u01D5":"U","\u01D9":"U","\u1EE6":"U","\u016E":"U","\u0170":"U","\u01D3":"U","\u0214":"U","\u0216":"U","\u01AF":"U","\u1EEA":"U","\u1EE8":"U","\u1EEE":"U","\u1EEC":"U","\u1EF0":"U","\u1EE4":"U","\u1E72":"U","\u0172":"U","\u1E76":"U","\u1E74":"U","\u0244":"U","\u24CB":"V","\uFF36":"V","\u1E7C":"V","\u1E7E":"V","\u01B2":"V","\uA75E":"V","\u0245":"V","\uA760":"VY","\u24CC":"W","\uFF37":"W","\u1E80":"W","\u1E82":"W","\u0174":"W","\u1E86":"W","\u1E84":"W","\u1E88":"W","\u2C72":"W","\u24CD":"X","\uFF38":"X","\u1E8A":"X","\u1E8C":"X","\u24CE":"Y","\uFF39":"Y","\u1EF2":"Y","\u00DD":"Y","\u0176":"Y","\u1EF8":"Y","\u0232":"Y","\u1E8E":"Y","\u0178":"Y","\u1EF6":"Y","\u1EF4":"Y","\u01B3":"Y","\u024E":"Y","\u1EFE":"Y","\u24CF":"Z","\uFF3A":"Z","\u0179":"Z","\u1E90":"Z","\u017B":"Z","\u017D":"Z","\u1E92":"Z","\u1E94":"Z","\u01B5":"Z","\u0224":"Z","\u2C7F":"Z","\u2C6B":"Z","\uA762":"Z","\u24D0":"a","\uFF41":"a","\u1E9A":"a","\u00E0":"a","\u00E1":"a","\u00E2":"a","\u1EA7":"a","\u1EA5":"a","\u1EAB":"a","\u1EA9":"a","\u00E3":"a","\u0101":"a","\u0103":"a","\u1EB1":"a","\u1EAF":"a","\u1EB5":"a","\u1EB3":"a","\u0227":"a","\u01E1":"a","\u00E4":"a","\u01DF":"a","\u1EA3":"a","\u00E5":"a","\u01FB":"a","\u01CE":"a","\u0201":"a","\u0203":"a","\u1EA1":"a","\u1EAD":"a","\u1EB7":"a","\u1E01":"a","\u0105":"a","\u2C65":"a","\u0250":"a","\uA733":"aa","\u00E6":"ae","\u01FD":"ae","\u01E3":"ae","\uA735":"ao","\uA737":"au","\uA739":"av","\uA73B":"av","\uA73D":"ay","\u24D1":"b","\uFF42":"b","\u1E03":"b","\u1E05":"b","\u1E07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24D2":"c","\uFF43":"c","\u0107":"c","\u0109":"c","\u010B":"c","\u010D":"c","\u00E7":"c","\u1E09":"c","\u0188":"c","\u023C":"c","\uA73F":"c","\u2184":"c","\u24D3":"d","\uFF44":"d","\u1E0B":"d","\u010F":"d","\u1E0D":"d","\u1E11":"d","\u1E13":"d","\u1E0F":"d","\u0111":"d","\u018C":"d","\u0256":"d","\u0257":"d","\uA77A":"d","\u01F3":"dz","\u01C6":"dz","\u24D4":"e","\uFF45":"e","\u00E8":"e","\u00E9":"e","\u00EA":"e","\u1EC1":"e","\u1EBF":"e","\u1EC5":"e","\u1EC3":"e","\u1EBD":"e","\u0113":"e","\u1E15":"e","\u1E17":"e","\u0115":"e","\u0117":"e","\u00EB":"e","\u1EBB":"e","\u011B":"e","\u0205":"e","\u0207":"e","\u1EB9":"e","\u1EC7":"e","\u0229":"e","\u1E1D":"e","\u0119":"e","\u1E19":"e","\u1E1B":"e","\u0247":"e","\u025B":"e","\u01DD":"e","\u24D5":"f","\uFF46":"f","\u1E1F":"f","\u0192":"f","\uA77C":"f","\u24D6":"g","\uFF47":"g","\u01F5":"g","\u011D":"g","\u1E21":"g","\u011F":"g","\u0121":"g","\u01E7":"g","\u0123":"g","\u01E5":"g","\u0260":"g","\uA7A1":"g","\u1D79":"g","\uA77F":"g","\u24D7":"h","\uFF48":"h","\u0125":"h","\u1E23":"h","\u1E27":"h","\u021F":"h","\u1E25":"h","\u1E29":"h","\u1E2B":"h","\u1E96":"h","\u0127":"h","\u2C68":"h","\u2C76":"h","\u0265":"h","\u0195":"hv","\u24D8":"i","\uFF49":"i","\u00EC":"i","\u00ED":"i","\u00EE":"i","\u0129":"i","\u012B":"i","\u012D":"i","\u00EF":"i","\u1E2F":"i","\u1EC9":"i","\u01D0":"i","\u0209":"i","\u020B":"i","\u1ECB":"i","\u012F":"i","\u1E2D":"i","\u0268":"i","\u0131":"i","\u24D9":"j","\uFF4A":"j","\u0135":"j","\u01F0":"j","\u0249":"j","\u24DA":"k","\uFF4B":"k","\u1E31":"k","\u01E9":"k","\u1E33":"k","\u0137":"k","\u1E35":"k","\u0199":"k","\u2C6A":"k","\uA741":"k","\uA743":"k","\uA745":"k","\uA7A3":"k","\u24DB":"l","\uFF4C":"l","\u0140":"l","\u013A":"l","\u013E":"l","\u1E37":"l","\u1E39":"l","\u013C":"l","\u1E3D":"l","\u1E3B":"l","\u017F":"l","\u0142":"l","\u019A":"l","\u026B":"l","\u2C61":"l","\uA749":"l","\uA781":"l","\uA747":"l","\u01C9":"lj","\u24DC":"m","\uFF4D":"m","\u1E3F":"m","\u1E41":"m","\u1E43":"m","\u0271":"m","\u026F":"m","\u24DD":"n","\uFF4E":"n","\u01F9":"n","\u0144":"n","\u00F1":"n","\u1E45":"n","\u0148":"n","\u1E47":"n","\u0146":"n","\u1E4B":"n","\u1E49":"n","\u019E":"n","\u0272":"n","\u0149":"n","\uA791":"n","\uA7A5":"n","\u01CC":"nj","\u24DE":"o","\uFF4F":"o","\u00F2":"o","\u00F3":"o","\u00F4":"o","\u1ED3":"o","\u1ED1":"o","\u1ED7":"o","\u1ED5":"o","\u00F5":"o","\u1E4D":"o","\u022D":"o","\u1E4F":"o","\u014D":"o","\u1E51":"o","\u1E53":"o","\u014F":"o","\u022F":"o","\u0231":"o","\u00F6":"o","\u022B":"o","\u1ECF":"o","\u0151":"o","\u01D2":"o","\u020D":"o","\u020F":"o","\u01A1":"o","\u1EDD":"o","\u1EDB":"o","\u1EE1":"o","\u1EDF":"o","\u1EE3":"o","\u1ECD":"o","\u1ED9":"o","\u01EB":"o","\u01ED":"o","\u00F8":"o","\u01FF":"o","\u0254":"o","\uA74B":"o","\uA74D":"o","\u0275":"o","\u01A3":"oi","\u0223":"ou","\uA74F":"oo","\u24DF":"p","\uFF50":"p","\u1E55":"p","\u1E57":"p","\u01A5":"p","\u1D7D":"p","\uA751":"p","\uA753":"p","\uA755":"p","\u24E0":"q","\uFF51":"q","\u024B":"q","\uA757":"q","\uA759":"q","\u24E1":"r","\uFF52":"r","\u0155":"r","\u1E59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1E5B":"r","\u1E5D":"r","\u0157":"r","\u1E5F":"r","\u024D":"r","\u027D":"r","\uA75B":"r","\uA7A7":"r","\uA783":"r","\u24E2":"s","\uFF53":"s","\u00DF":"s","\u015B":"s","\u1E65":"s","\u015D":"s","\u1E61":"s","\u0161":"s","\u1E67":"s","\u1E63":"s","\u1E69":"s","\u0219":"s","\u015F":"s","\u023F":"s","\uA7A9":"s","\uA785":"s","\u1E9B":"s","\u24E3":"t","\uFF54":"t","\u1E6B":"t","\u1E97":"t","\u0165":"t","\u1E6D":"t","\u021B":"t","\u0163":"t","\u1E71":"t","\u1E6F":"t","\u0167":"t","\u01AD":"t","\u0288":"t","\u2C66":"t","\uA787":"t","\uA729":"tz","\u24E4":"u","\uFF55":"u","\u00F9":"u","\u00FA":"u","\u00FB":"u","\u0169":"u","\u1E79":"u","\u016B":"u","\u1E7B":"u","\u016D":"u","\u00FC":"u","\u01DC":"u","\u01D8":"u","\u01D6":"u","\u01DA":"u","\u1EE7":"u","\u016F":"u","\u0171":"u","\u01D4":"u","\u0215":"u","\u0217":"u","\u01B0":"u","\u1EEB":"u","\u1EE9":"u","\u1EEF":"u","\u1EED":"u","\u1EF1":"u","\u1EE5":"u","\u1E73":"u","\u0173":"u","\u1E77":"u","\u1E75":"u","\u0289":"u","\u24E5":"v","\uFF56":"v","\u1E7D":"v","\u1E7F":"v","\u028B":"v","\uA75F":"v","\u028C":"v","\uA761":"vy","\u24E6":"w","\uFF57":"w","\u1E81":"w","\u1E83":"w","\u0175":"w","\u1E87":"w","\u1E85":"w","\u1E98":"w","\u1E89":"w","\u2C73":"w","\u24E7":"x","\uFF58":"x","\u1E8B":"x","\u1E8D":"x","\u24E8":"y","\uFF59":"y","\u1EF3":"y","\u00FD":"y","\u0177":"y","\u1EF9":"y","\u0233":"y","\u1E8F":"y","\u00FF":"y","\u1EF7":"y","\u1E99":"y","\u1EF5":"y","\u01B4":"y","\u024F":"y","\u1EFF":"y","\u24E9":"z","\uFF5A":"z","\u017A":"z","\u1E91":"z","\u017C":"z","\u017E":"z","\u1E93":"z","\u1E95":"z","\u01B6":"z","\u0225":"z","\u0240":"z","\u2C6C":"z","\uA763":"z"}; + $document = $(document); nextUid=(function() { var counter=1; return function() { return counter++; }; }()); + + function stripDiacritics(str) { + var ret, i, l, c; + + if (!str || str.length < 1) return str; + + ret = ""; + for (i = 0, l = str.length; i < l; i++) { + c = str.charAt(i); + ret += DIACRITICS[c] || c; + } + return ret; + } + function indexOf(value, array) { var i = 0, l = array.length; for (; i < l; i = i + 1) { @@ -343,7 +359,7 @@ function markMatch(text, term, markup, escapeMarkup) { - var match=text.toUpperCase().indexOf(term.toUpperCase()), + var match=stripDiacritics(text.toUpperCase()).indexOf(stripDiacritics(term.toUpperCase())), tl=term.length; if (match<0) { @@ -392,7 +408,6 @@ */ function ajax(options) { var timeout, // current scheduled but not yet executed request - requestSequence = 0, // sequence used to drop out-of-order responses handler = null, quietMillis = options.quietMillis || 100, ajaxUrl = options.url, @@ -401,9 +416,7 @@ return function (query) { window.clearTimeout(timeout); timeout = window.setTimeout(function () { - requestSequence += 1; // increment the sequence - var requestNumber = requestSequence, // this request's sequence number - data = options.data, // ajax data function + var data = options.data, // ajax data function url = ajaxUrl, // ajax url string or function transport = options.transport || $.fn.select2.ajaxDefaults.transport, // deprecated - to be removed in 4.0 - use params instead @@ -433,9 +446,6 @@ dataType: options.dataType, data: data, success: function (data) { - if (requestNumber < requestSequence) { - return; - } // TODO - replace query.page with query so users have access to term, page, etc. var results = options.results(data, query.page); query.callback(results); @@ -668,6 +678,7 @@ syncCssClasses(this.container, this.opts.element, this.opts.adaptContainerCssClass); + this.container.attr("style", opts.element.attr("style")); this.container.css(evaluate(opts.containerCss)); this.container.addClass(evaluate(opts.containerCssClass)); @@ -677,22 +688,31 @@ this.opts.element .data("select2", this) .attr("tabindex", "-1") - .before(this.container); + .before(this.container) + .on("click.select2", killEvent); // do not leak click events + this.container.data("select2", this); this.dropdown = this.container.find(".select2-drop"); + + syncCssClasses(this.dropdown, this.opts.element, this.opts.adaptDropdownCssClass); + this.dropdown.addClass(evaluate(opts.dropdownCssClass)); this.dropdown.data("select2", this); + this.dropdown.on("click", killEvent); this.results = results = this.container.find(resultsSelector); this.search = search = this.container.find("input.select2-input"); + this.queryCount = 0; this.resultsPage = 0; this.context = null; // initialize the container this.initContainer(); + this.container.on("click", killEvent); + installFilteredMouseMove(this.results); this.dropdown.on("mousemove-filtered touchstart touchmove touchend", resultsSelector, this.bind(this.highlightUnderEvent)); @@ -758,15 +778,19 @@ // Calculate size of scrollbar scrollBarDimensions = scrollBarDimensions || measureScrollbar(); - this.autofocus = opts.element.prop("autofocus") + this.autofocus = opts.element.prop("autofocus"); opts.element.prop("autofocus", false); if (this.autofocus) this.focus(); + + this.nextSearchTerm = undefined; }, // abstract destroy: function () { var element=this.opts.element, select2 = element.data("select2"); + this.close(); + if (this.propertyObserver) { delete this.propertyObserver; this.propertyObserver = null; } if (select2 !== undefined) { @@ -944,16 +968,17 @@ } else if ("tags" in opts) { opts.query = tags(opts.tags); if (opts.createSearchChoice === undefined) { - opts.createSearchChoice = function (term) { return {id: term, text: term}; }; + opts.createSearchChoice = function (term) { return {id: $.trim(term), text: $.trim(term)}; }; } if (opts.initSelection === undefined) { opts.initSelection = function (element, callback) { var data = []; $(splitVal(element.val(), opts.separator)).each(function () { - var id = this, text = this, tags=opts.tags; + var obj = { id: this, text: this }, + tags = opts.tags; if ($.isFunction(tags)) tags=tags(); - $(tags).each(function() { if (equal(this.id, id)) { text = this.text; return false; } }); - data.push({id: id, text: text}); + $(tags).each(function() { if (equal(this.id, obj.id)) { obj = this; return false; } }); + data.push(obj); }); callback(data); @@ -1075,15 +1100,19 @@ // abstract enable: function(enabled) { if (enabled === undefined) enabled = true; - if (this._enabled === enabled) return false; + if (this._enabled === enabled) return; this._enabled = enabled; this.opts.element.prop("disabled", !enabled); this.enableInterface(); - return true; }, // abstract + disable: function() { + this.enable(false); + }, + + // abstract readonly: function(enabled) { if (enabled === undefined) enabled = false; if (this._readonly === enabled) return false; @@ -1244,7 +1273,7 @@ if (self.opts.selectOnBlur) { self.selectHighlighted({noFocus: true}); } - self.close(); + self.close({focus:false}); e.preventDefault(); e.stopPropagation(); } @@ -1261,10 +1290,9 @@ this.dropdown.attr("id", "select2-drop"); // show the elements - maskCss=_makeMaskCss(); + mask.show(); - mask.css(maskCss).show(); - + this.positionDropdown(); this.dropdown.show(); this.positionDropdown(); @@ -1275,18 +1303,11 @@ var that = this; this.container.parents().add(window).each(function () { $(this).on(resize+" "+scroll+" "+orient, function (e) { - var maskCss=_makeMaskCss(); - $("#select2-drop-mask").css(maskCss); that.positionDropdown(); }); }); - function _makeMaskCss() { - return { - width : Math.max(document.documentElement.scrollWidth, $(window).width()), - height : Math.max(document.documentElement.scrollHeight, $(window).height()) - } - } + }, // abstract @@ -1306,7 +1327,7 @@ $("#select2-drop-mask").hide(); this.dropdown.removeAttr("id"); // only the active dropdown has the select2-drop id this.dropdown.hide(); - this.container.removeClass("select2-dropdown-open"); + this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"); this.results.empty(); @@ -1381,7 +1402,7 @@ // abstract findHighlightableChoices: function() { - return this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)"); + return this.results.find(".select2-result-selectable:not(.select2-disabled)"); }, // abstract @@ -1412,7 +1433,7 @@ if (index >= choices.length) index = choices.length - 1; if (index < 0) index = 0; - this.results.find(".select2-highlighted").removeClass("select2-highlighted"); + this.removeHighlight(); choice = $(choices[index]); choice.addClass("select2-highlighted"); @@ -1425,6 +1446,10 @@ } }, + removeHighlight: function() { + this.results.find(".select2-highlighted").removeClass("select2-highlighted"); + }, + // abstract countSelectableResults: function() { return this.findHighlightableChoices().length; @@ -1437,8 +1462,8 @@ var choices = this.findHighlightableChoices(); this.highlight(choices.index(el)); } else if (el.length == 0) { - // if we are over an unselectable item remove al highlights - this.results.find(".select2-highlighted").removeClass("select2-highlighted"); + // if we are over an unselectable item remove all highlights + this.removeHighlight(); } }, @@ -1482,6 +1507,7 @@ self.positionDropdown(); self.resultsPage = page; self.context = data.context; + this.opts.element.trigger({ type: "select2-loaded", items: data }); })}); } }, @@ -1505,7 +1531,9 @@ self = this, input, term = search.val(), - lastTerm=$.data(this.container, "select2-last-term"); + lastTerm = $.data(this.container, "select2-last-term"), + // sequence number used to drop out-of-order responses + queryNumber; // prevent duplicate queries against the same term if (initial !== true && lastTerm && equal(term, lastTerm)) return; @@ -1527,6 +1555,8 @@ postRender(); } + queryNumber = ++this.queryCount; + var maxSelSize = this.getMaximumSelectionSize(); if (maxSelSize >=1) { data = this.data(); @@ -1561,6 +1591,8 @@ search.addClass("select2-active"); + this.removeHighlight(); + // give the tokenizer a chance to pre-process the input input = this.tokenize(); if (input != undefined && input != null) { @@ -1578,6 +1610,11 @@ callback: this.bind(function (data) { var def; // default choice + // ignore old responses + if (queryNumber != this.queryCount) { + return; + } + // ignore a response if the select2 has been closed before it was received if (!this.opened()) { this.search.removeClass("select2-active"); @@ -1705,7 +1742,7 @@ attrs = style.split(';'); for (i = 0, l = attrs.length; i < l; i = i + 1) { matches = attrs[i].replace(/\s/g, '') - .match(/width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i); + .match(/[^-]width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i); if (matches !== null && matches.length >= 1) return matches[1]; } @@ -1795,17 +1832,31 @@ el.setSelectionRange(len, len); } + // initializes search's value with nextSearchTerm (if defined by user) + // ignore nextSearchTerm if the dropdown is opened by the user pressing a letter + if(this.search.val() === "") { + if(this.nextSearchTerm != undefined){ + this.search.val(this.nextSearchTerm); + this.search.select(); + } + } + this.focusser.prop("disabled", true).val(""); this.updateResults(true); this.opts.element.trigger($.Event("select2-open")); }, // single - close: function () { + close: function (params) { if (!this.opened()) return; this.parent.close.apply(this, arguments); + + params = params || {focus: true}; this.focusser.removeAttr("disabled"); - this.focusser.focus(); + + if (params.focus) { + this.focusser.focus(); + } }, // single @@ -1831,6 +1882,13 @@ }, // single + destroy: function() { + $("label[for='" + this.focusser.attr('id') + "']") + .attr('for', this.opts.element.attr("id")); + this.parent.destroy.apply(this, arguments); + }, + + // single initContainer: function () { var selection, @@ -1992,6 +2050,11 @@ clear: function(triggerChange) { var data=this.selection.data("select2-data"); if (data) { // guard against queued quick consecutive clicks + var evt = $.Event("select2-clearing"); + this.opts.element.trigger(evt); + if (evt.isDefaultPrevented()) { + return; + } var placeholderOption = this.getPlaceholderOption(); this.opts.element.val(placeholderOption ? placeholderOption.val() : ""); this.selection.find(".select2-chosen").empty(); @@ -2012,7 +2075,7 @@ initSelection: function () { var selected; if (this.isPlaceholderOptionSelected()) { - this.updateSelection([]); + this.updateSelection(null); this.close(); this.setPlaceholder(); } else { @@ -2029,10 +2092,11 @@ isPlaceholderOptionSelected: function() { var placeholderOption; - return ((placeholderOption = this.getPlaceholderOption()) !== undefined && placeholderOption.is(':selected')) || - (this.opts.element.val() === "") || - (this.opts.element.val() === undefined) || - (this.opts.element.val() === null); + if (!this.getPlaceholder()) return false; // no placeholder specified so no option should be considered + return ((placeholderOption = this.getPlaceholderOption()) !== undefined && placeholderOption.is(':selected')) + || (this.opts.element.val() === "") + || (this.opts.element.val() === undefined) + || (this.opts.element.val() === null); }, // single @@ -2157,10 +2221,11 @@ this.opts.element.trigger({ type: "select2-selected", val: this.id(data), choice: data }); + this.nextSearchTerm = this.opts.nextSearchTerm(data, this.search.val()); this.close(); if (!options || !options.noFocus) - this.selection.focus(); + this.focusser.focus(); if (!equal(old, this.id(data))) { this.triggerChange({added:data,removed:oldData}); } }, @@ -2173,7 +2238,9 @@ this.selection.data("select2-data", data); container.empty(); - formatted=this.opts.formatSelection(data, container, this.opts.escapeMarkup); + if (data !== null) { + formatted=this.opts.formatSelection(data, container, this.opts.escapeMarkup); + } if (formatted !== undefined) { container.append(formatted); } @@ -2247,15 +2314,19 @@ }, // single - data: function(value, triggerChange) { - var data; + data: function(value) { + var data, + triggerChange = false; if (arguments.length === 0) { data = this.selection.data("select2-data"); if (data == undefined) data = null; return data; } else { - if (!value || value === "") { + if (arguments.length > 1) { + triggerChange = arguments[1]; + } + if (!value) { this.clear(triggerChange); } else { data = this.data(); @@ -2278,7 +2349,7 @@ }).html([ "<ul class='select2-choices'>", " <li class='select2-search-field'>", - " <input type='text' autocomplete='off' autocorrect='off' autocapitilize='off' spellcheck='false' class='select2-input'>", + " <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>", " </li>", "</ul>", "<div class='select2-drop select2-drop-multi select2-display-none'>", @@ -2365,6 +2436,13 @@ }, // multi + destroy: function() { + $("label[for='" + this.search.attr('id') + "']") + .attr('for', this.opts.element.attr("id")); + this.parent.destroy.apply(this, arguments); + }, + + // multi initContainer: function () { var selector = ".select2-choices", selection; @@ -2373,11 +2451,11 @@ this.selection = selection = this.container.find(selector); var _this = this; - this.selection.on("mousedown", ".select2-search-choice", function (e) { + this.selection.on("click", ".select2-search-choice:not(.select2-locked)", function (e) { //killEvent(e); _this.search[0].focus(); _this.selectChoice($(this)); - }) + }); // rewrite labels from original element to focusser this.search.attr("id", "s2id_autogen"+nextUid()); @@ -2661,7 +2739,7 @@ this.opts.element.trigger({ type: "selected", val: this.id(data), choice: data }); - if (this.select || !this.opts.closeOnSelect) this.postprocessResults(); + if (this.select || !this.opts.closeOnSelect) this.postprocessResults(data, false, this.opts.closeOnSelect===true); if (this.opts.closeOnSelect) { this.close(); @@ -2770,9 +2848,7 @@ return; } - index = indexOf(this.id(data), val); - - if (index >= 0) { + while((index = indexOf(this.id(data), val)) >= 0) { val.splice(index, 1); this.setVal(val); if (this.select) this.postprocessResults(); @@ -2853,7 +2929,7 @@ searchWidth = minimumWidth; } - this.search.width(searchWidth); + this.search.width(Math.floor(searchWidth)); }, // multi @@ -2945,7 +3021,7 @@ self.updateSelection(data); self.clearSearch(); if (triggerChange) { - self.triggerChange(this.buildChangeDetails(oldData, this.data())); + self.triggerChange(self.buildChangeDetails(oldData, this.data())); } }); } @@ -3012,8 +3088,9 @@ opts, select2, method, value, multiple, - allowedMethods = ["val", "destroy", "opened", "open", "close", "focus", "isFocused", "container", "dropdown", "onSortStart", "onSortEnd", "enable", "readonly", "positionDropdown", "data", "search"], - valueMethods = ["val", "opened", "isFocused", "container", "data"], + allowedMethods = ["val", "destroy", "opened", "open", "close", "focus", "isFocused", "container", "dropdown", "onSortStart", "onSortEnd", "enable", "disable", "readonly", "positionDropdown", "data", "search"], + valueMethods = ["opened", "isFocused", "container", "dropdown"], + propertyMethods = ["val", "data"], methodsMap = { search: "externalSearch" }; this.each(function () { @@ -3051,8 +3128,9 @@ value = select2[method].apply(select2, args.slice(1)); } - if (indexOf(args[0], valueMethods) >= 0) { - return false; + if (indexOf(args[0], valueMethods) >= 0 + || (indexOf(args[0], propertyMethods) && args.length == 1)) { + return false; // abort the iteration, ready to return first matched value } } else { throw "Invalid arguments to select2 plugin: " + args; @@ -3096,7 +3174,7 @@ maximumSelectionSize: 0, id: function (e) { return e.id; }, matcher: function(term, text) { - return (''+text).toUpperCase().indexOf((''+term).toUpperCase()) >= 0; + return stripDiacritics(''+text).toUpperCase().indexOf(stripDiacritics(''+term).toUpperCase()) >= 0; }, separator: ",", tokenSeparators: [], @@ -3105,7 +3183,8 @@ blurOnChange: false, selectOnBlur: false, adaptContainerCssClass: function(c) { return c; }, - adaptDropdownCssClass: function(c) { return null; } + adaptDropdownCssClass: function(c) { return null; }, + nextSearchTerm: function(selectedObject, currentSearchTerm) { return undefined; } }; $.fn.select2.ajaxDefaults = { @@ -3126,7 +3205,8 @@ }, util: { debounce: debounce, markMatch: markMatch, - escapeMarkup: defaultEscapeMarkup + escapeMarkup: defaultEscapeMarkup, + stripDiacritics: stripDiacritics }, "class": { "abstract": AbstractSelect2, "single": SingleSelect2, Added: sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_bg.js =================================================================== --- sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_bg.js (rev 0) +++ sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_bg.js 2013-09-20 13:29:04 UTC (rev 217) @@ -0,0 +1,17 @@ +/** %%Ignore-License + * Select2 <Language> translation. + * + * Author: Lubomir Vikev <lubomirvikev@gmail.com> + */ +(function ($) { + "use strict"; + + $.extend($.fn.select2.defaults, { + formatNoMatches: function () { return "Няма намерени съвпадения"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Моля въведете още " + n + " символ" + (n == 1 ? "" : "а"); }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Моля въведете с " + n + " по-малко символ" + (n == 1? "" : "а"); }, + formatSelectionTooBig: function (limit) { return "Можете да направите до " + limit + (limit == 1 ? " избор" : " избора"); }, + formatLoadMore: function (pageNumber) { return "Зареждат се още..."; }, + formatSearching: function () { return "Търсене..."; } + }); +})(jQuery); Modified: sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_es.js =================================================================== --- sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_es.js 2013-09-09 15:40:55 UTC (rev 216) +++ sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_es.js 2013-09-20 13:29:04 UTC (rev 217) @@ -6,10 +6,10 @@ $.extend($.fn.select2.defaults, { formatNoMatches: function () { return "No se encontraron resultados"; }, - formatInputTooShort: function (input, min) { var n = min - input.length; return "Por favor adicione " + n + " caracter" + (n == 1? "" : "es"); }, - formatInputTooLong: function (input, max) { var n = input.length - max; return "Por favor elimine " + n + " caracter" + (n == 1? "" : "es"); }, - formatSelectionTooBig: function (limit) { return "Solo puede seleccionar " + limit + " elemento" + (limit == 1 ? "" : "s"); }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Por favor, introduzca " + n + " car" + (n == 1? "á" : "a") + "cter" + (n == 1? "" : "es"); }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Por favor, elimine " + n + " car" + (n == 1? "á" : "a") + "cter" + (n == 1? "" : "es"); }, + formatSelectionTooBig: function (limit) { return "Sólo puede seleccionar " + limit + " elemento" + (limit == 1 ? "" : "s"); }, formatLoadMore: function (pageNumber) { return "Cargando más resultados..."; }, formatSearching: function () { return "Buscando..."; } }); -})(jQuery); \ No newline at end of file +})(jQuery); Added: sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_fa.js =================================================================== --- sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_fa.js (rev 0) +++ sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_fa.js 2013-09-20 13:29:04 UTC (rev 217) @@ -0,0 +1,17 @@ +/** %%Ignore-License + * Select2 <fa> translation. + * + * Author: Ali Choopan <choopan@arsh.co> + */ +(function ($) { + "use strict"; + + $.extend($.fn.select2.defaults, { + formatNoMatches: function () { return "نتیجهای یافت نشد."; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return " لطفا بیش از"+n+"کاراکتر وارد نمایید "; }, + formatInputTooLong: function (input, max) { var n = input.length - max; return " لطفا" + n + " کاراکتر را حذف کنید."; }, + formatSelectionTooBig: function (limit) { return "شما فقط میتوانید " + limit + " مورد را انتخاب کنید"; }, + formatLoadMore: function (pageNumber) { return "در حال بارگذاری موارد بیشتر ..."; }, + formatSearching: function () { return "در حال جستجو"; } + }); +})(jQuery); Added: sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_ms.js =================================================================== --- sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_ms.js (rev 0) +++ sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_ms.js 2013-09-20 13:29:04 UTC (rev 217) @@ -0,0 +1,17 @@ +/** %%Ignore-License + * Select2 Malay translation. + * + * Author: Kepoweran <kepoweran@gmail.com> + */ +(function ($) { + "use strict"; + + $.extend($.fn.select2.defaults, { + formatNoMatches: function () { return "Tiada padanan yang ditemui"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Sila masukkan " + n + " aksara lagi"; }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Sila hapuskan " + n + " aksara"; }, + formatSelectionTooBig: function (limit) { return "Anda hanya boleh memilih " + limit + " pilihan"; }, + formatLoadMore: function (pageNumber) { return "Sedang memuatkan keputusan..."; }, + formatSearching: function () { return "Mencari..."; } + }); +})(jQuery); Modified: sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_nl.js =================================================================== --- sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_nl.js 2013-09-09 15:40:55 UTC (rev 216) +++ sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_nl.js 2013-09-20 13:29:04 UTC (rev 217) @@ -10,6 +10,6 @@ formatInputTooLong: function (input, max) { var n = input.length - max; return "Vul " + n + " karakter" + (n == 1? "" : "s") + " minder in"; }, formatSelectionTooBig: function (limit) { return "Maximaal " + limit + " item" + (limit == 1 ? "" : "s") + " toegestaan"; }, formatLoadMore: function (pageNumber) { return "Meer resultaten laden..."; }, - formatSearching: function () { return "Zoeken..."; }, + formatSearching: function () { return "Zoeken..."; } }); })(jQuery); \ No newline at end of file Modified: sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_pt-BR.js =================================================================== --- sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_pt-BR.js 2013-09-09 15:40:55 UTC (rev 216) +++ sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_pt-BR.js 2013-09-20 13:29:04 UTC (rev 217) @@ -6,8 +6,8 @@ $.extend($.fn.select2.defaults, { formatNoMatches: function () { return "Nenhum resultado encontrado"; }, - formatInputTooShort: function (input, min) { var n = min - input.length; return "Informe " + n + " caracter" + (n == 1? "" : "es"); }, - formatInputTooLong: function (input, max) { var n = input.length - max; return "Apague " + n + " caracter" + (n == 1? "" : "es"); }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Informe " + n + " caractere" + (n == 1? "" : "s"); }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Apague " + n + " caractere" + (n == 1? "" : "s"); }, formatSelectionTooBig: function (limit) { return "Só é possível selecionar " + limit + " elemento" + (limit == 1 ? "" : "s"); }, formatLoadMore: function (pageNumber) { return "Carregando mais resultados..."; }, formatSearching: function () { return "Buscando..."; } Modified: sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_pt-PT.js =================================================================== --- sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_pt-PT.js 2013-09-09 15:40:55 UTC (rev 216) +++ sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_pt-PT.js 2013-09-20 13:29:04 UTC (rev 217) @@ -6,8 +6,8 @@ $.extend($.fn.select2.defaults, { formatNoMatches: function () { return "Nenhum resultado encontrado"; }, - formatInputTooShort: function (input, min) { var n = min - input.length; return "Introduza " + n + " caracter" + (n == 1 ? "" : "es"); }, - formatInputTooLong: function (input, max) { var n = input.length - max; return "Apague " + n + " caracter" + (n == 1 ? "" : "es"); }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Introduza " + n + " car" + (n == 1 ? "ácter" : "acteres"); }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Apague " + n + " car" + (n == 1 ? "ácter" : "acteres"); }, formatSelectionTooBig: function (limit) { return "Só é possível selecionar " + limit + " elemento" + (limit == 1 ? "" : "s"); }, formatLoadMore: function (pageNumber) { return "A carregar mais resultados..."; }, formatSearching: function () { return "A pesquisar..."; } Added: sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_th.js =================================================================== --- sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_th.js (rev 0) +++ sandbox/nuiton-js-select2/src/main/resources/nuiton-js-select2/select2_locale_th.js 2013-09-20 13:29:04 UTC (rev 217) @@ -0,0 +1,17 @@ +/** %%Ignore-License + * Select2 Thai translation. + * + * Author: Atsawin Chaowanakritsanakul <joke@nakhon.net> + */ +(function ($) { + "use strict"; + + $.extend($.fn.select2.defaults, { + formatNoMatches: function () { return "ไม่พบข้อมูล"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "โปรดพิมพ์เพิ่มอีก " + n + " ตัวอักษร"; }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "โปรดลบออก " + n + " ตัวอักษร"; }, + formatSelectionTooBig: function (limit) { return "คุณสามารถเลือกได้ไม่เกิน " + limit + " รายการ"; }, + formatLoadMore: function (pageNumber) { return "กำลังค้นข้อมูลเพิ่ม..."; }, + formatSearching: function () { return "กำลังค้นข้อมูล..."; } + }); +})(jQuery);
participants (1)
-
echatellier@users.nuiton.org