You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by el...@apache.org on 2015/06/08 20:03:26 UTC
svn commit: r1684236 - in /lucene/dev/branches/lucene_solr_5_2: ./ solr/
solr/CHANGES.txt solr/webapp/ solr/webapp/web/js/lib/naturalSort.js
Author: elyograg
Date: Mon Jun 8 18:03:25 2015
New Revision: 1684236
URL: http://svn.apache.org/r1684236
Log:
SOLR-7588: Fix javascript bug introduced by SOLR-7409 that broke dataimport in admin UI. (merge trunk r1684234)
Modified:
lucene/dev/branches/lucene_solr_5_2/ (props changed)
lucene/dev/branches/lucene_solr_5_2/solr/ (props changed)
lucene/dev/branches/lucene_solr_5_2/solr/CHANGES.txt (contents, props changed)
lucene/dev/branches/lucene_solr_5_2/solr/webapp/ (props changed)
lucene/dev/branches/lucene_solr_5_2/solr/webapp/web/js/lib/naturalSort.js
Modified: lucene/dev/branches/lucene_solr_5_2/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_5_2/solr/CHANGES.txt?rev=1684236&r1=1684235&r2=1684236&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_5_2/solr/CHANGES.txt (original)
+++ lucene/dev/branches/lucene_solr_5_2/solr/CHANGES.txt Mon Jun 8 18:03:25 2015
@@ -9,6 +9,28 @@ caching, replication, and a web administ
See http://lucene.apache.org/solr for more information.
+================== 5.2.1 ==================
+
+Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release
+
+Versions of Major Components
+---------------------
+Apache Tika 1.7
+Carrot2 3.9.0
+Velocity 1.7 and Velocity Tools 2.0
+Apache UIMA 2.3.1
+Apache ZooKeeper 3.4.6
+Jetty 9.2.10.v20150310
+
+Detailed Change List
+----------------------
+
+Bug Fixes
+----------------------
+
+* SOLR-7588: Fix javascript bug introduced by SOLR-7409 that breaks the
+ dataimport screen in the admin UI. (Bill Bell via Shawn Heisey)
+
================== 5.2.0 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release
Modified: lucene/dev/branches/lucene_solr_5_2/solr/webapp/web/js/lib/naturalSort.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_5_2/solr/webapp/web/js/lib/naturalSort.js?rev=1684236&r1=1684235&r2=1684236&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_5_2/solr/webapp/web/js/lib/naturalSort.js (original)
+++ lucene/dev/branches/lucene_solr_5_2/solr/webapp/web/js/lib/naturalSort.js Mon Jun 8 18:03:25 2015
@@ -1,5 +1,4 @@
/*
-
naturalSort.js
- by Jim Palmer and other contributors
@@ -24,62 +23,60 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE F
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.
-
*/
-# naturalSort.js 0.7.0
-# https://github.com/jarinudom/naturalSort.js
-# (c) 2011 Jim Palmer and other contributors
-# naturalSort.js may be freely distributed under the MIT license.
-window.naturalSort = (a, b) ->
- re = /(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/g
- sre = /(^[ ]*|[ ]*$)/g
- dre = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/
- hre = /^0x[0-9a-f]+$/i
- ore = /^0/
- i = (s) ->
- naturalSort.insensitive and ('' + s).toLowerCase() or '' + s
-
- # convert all to strings strip whitespace
- x = i(a).replace(sre, '') or ''
- y = i(b).replace(sre, '') or ''
-
- # chunk/tokenize
- xN = x.replace(re, '\u0000$1\u0000').replace(/\0$/, '').replace(/^\0/, '').split('\u0000')
- yN = y.replace(re, '\u0000$1\u0000').replace(/\0$/, '').replace(/^\0/, '').split('\u0000')
-
- # numeric, hex or date detection
- xD = parseInt(x.match(hre), 16) or (xN.length isnt 1 and x.match(dre) and Date.parse(x))
- yD = parseInt(y.match(hre), 16) or xD and y.match(dre) and Date.parse(y) or null
- oFxNcL = undefined
- oFyNcL = undefined
-
- # first try and sort Hex codes or Dates
- if yD
- return -1 if xD < yD
- return 1 if xD > yD
-
- # natural sorting through split numeric strings and default strings
- cLoc = 0
- numS = Math.max(xN.length, yN.length)
-
- while cLoc < numS
- # find floats not starting with '0', string or 0 if not defined (Clint Priest)
- oFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc]) || xN[cLoc] || 0
- oFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc]) || yN[cLoc] || 0
-
- # handle numeric vs string comparison - number < string - (Kyle Adams)
- if isNaN(oFxNcL) != isNaN(oFyNcL)
- return (if (isNaN(oFxNcL)) then 1 else -1)
-
- # Rely on string comparison of different types - i.e. '02' < 2 != '02' < '2'
- else if typeof oFxNcL != typeof oFyNcL
- oFxNcL += ''
- oFyNcL += ''
-
- return -1 if oFxNcL < oFyNcL
- return 1 if oFxNcL > oFyNcL
-
- cLoc++
+// naturalSort.js 0.7.0
+// https://github.com/jarinudom/naturalSort.js
+// (c) 2011 Jim Palmer and other contributors
+// naturalSort.js may be freely distributed under the MIT license.
+// Generated by CoffeeScript 1.7.1
+(function() {
+ window.naturalSort = function(a, b) {
+ var cLoc, dre, hre, i, numS, oFxNcL, oFyNcL, ore, re, sre, x, xD, xN, y, yD, yN;
+ re = /(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/g;
+ sre = /(^[ ]*|[ ]*$)/g;
+ dre = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/;
+ hre = /^0x[0-9a-f]+$/i;
+ ore = /^0/;
+ i = function(s) {
+ return naturalSort.insensitive && ('' + s).toLowerCase() || '' + s;
+ };
+ x = i(a).replace(sre, '') || '';
+ y = i(b).replace(sre, '') || '';
+ xN = x.replace(re, '\u0000$1\u0000').replace(/\0$/, '').replace(/^\0/, '').split('\u0000');
+ yN = y.replace(re, '\u0000$1\u0000').replace(/\0$/, '').replace(/^\0/, '').split('\u0000');
+ xD = parseInt(x.match(hre), 16) || (xN.length !== 1 && x.match(dre) && Date.parse(x));
+ yD = parseInt(y.match(hre), 16) || xD && y.match(dre) && Date.parse(y) || null;
+ oFxNcL = void 0;
+ oFyNcL = void 0;
+ if (yD) {
+ if (xD < yD) {
+ return -1;
+ }
+ if (xD > yD) {
+ return 1;
+ }
+ }
+ cLoc = 0;
+ numS = Math.max(xN.length, yN.length);
+ while (cLoc < numS) {
+ oFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc]) || xN[cLoc] || 0;
+ oFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc]) || yN[cLoc] || 0;
+ if (isNaN(oFxNcL) !== isNaN(oFyNcL)) {
+ return (isNaN(oFxNcL) ? 1 : -1);
+ } else if (typeof oFxNcL !== typeof oFyNcL) {
+ oFxNcL += '';
+ oFyNcL += '';
+ }
+ if (oFxNcL < oFyNcL) {
+ return -1;
+ }
+ if (oFxNcL > oFyNcL) {
+ return 1;
+ }
+ cLoc++;
+ }
+ return 0;
+ };
- return 0
+}).call(this);