343 | 352 | 323 | 234 | 379 | 782 |
341 | 163 | 422 | 234 | 725 | 833 |
221 | 456 | 335 | 423 | 445 | 793 |
112 | 277 | 563 | 423 | 932 | 425 |
587 | 175 | 159 | 734 | 582 | 458 |
From af31dc666fde88b97d86c27652fd960225478989 Mon Sep 17 00:00:00 2001 From: Jinqn <459452372> Date: Fri, 25 Oct 2013 16:58:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[fix]by=20Jinqn=20=E4=BF=AE=E6=94=B9grunt,?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E8=A1=A8=E6=A0=BC=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E7=9A=84demo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gruntfile.js | 36 +++++----- _examples/sortableDemo.html | 135 ++++++++++++++++++++---------------- parse/parse.js | 87 ++++++++++++++++++----- parse/table.js | 16 ++--- 4 files changed, 168 insertions(+), 106 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index b69921cb3..48a5b878a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -6,26 +6,20 @@ module.exports = function ( grunt ) { Util = { jsBasePath: '_src/', + parseBasePath: 'parse/', cssBasePath: 'themes/default/_css/', - fetchScripts: function () { - - var sources = fs.readFileSync( "_examples/editor_api.js" ); - - sources = /\[([^\]]+)\]/.exec( sources ); + fetchScripts: function ( readFile, basePath) { + var sources = fs.readFileSync( readFile ); + sources = /\[([^\]]+\.js'[^\]]+)\]/.exec( sources ); sources = sources[1].replace( /\/\/.*\n/g, '\n' ).replace( /'|"|\n|\t|\s/g, '' ); - sources = sources.split( "," ); - sources.forEach( function ( filepath, index ) { - - sources[ index ] = Util.jsBasePath + filepath; - + sources[ index ] = basePath + filepath; } ); return sources; - }, fetchStyles: function () { @@ -36,9 +30,7 @@ module.exports = function ( grunt ) { src = []; while ( filepath = pattern.exec( sources ) ) { - src.push( this.cssBasePath + filepath[ 1 ].replace( /'|"/g, "" ) ); - } return src; @@ -68,13 +60,21 @@ module.exports = function ( grunt ) { options: { banner: banner + '(function(){\n\n', footer: '\n\n})()', - process: function(src, filepath) { + process: function(src) { return src.replace('/_css/', '/css/'); } }, - src: Util.fetchScripts(), + src: Util.fetchScripts( "_examples/editor_api.js", Util.jsBasePath ), dest: disDir + '<%= pkg.name %>.all.js' }, + parse: { + options: { + banner: banner + '(function(){\n\n', + footer: '\n\n})()' + }, + src: Util.fetchScripts( "ueditor.parse.js", Util.parseBasePath ), + dest: disDir + '<%= pkg.name %>.parse.js' + }, css: { src: Util.fetchStyles(), dest: disDir + 'themes/default/css/ueditor.css' @@ -99,6 +99,10 @@ module.exports = function ( grunt ) { dest: { src: disDir + '<%= pkg.name %>.all.js', dest: disDir + '<%= pkg.name %>.all.min.js' + }, + dest1: { + src: disDir + '<%= pkg.name %>.parse.js', + dest: disDir + '<%= pkg.name %>.parse.min.js' } }, copy: { @@ -106,7 +110,7 @@ module.exports = function ( grunt ) { files: [ { - src: [ 'themes/iframe.css', 'themes/default/dialogbase.css', 'themes/default/images/**', 'dialogs/**', 'lang/**', 'third-party/**', 'ueditor.parse.js' ], + src: [ 'themes/iframe.css', 'themes/default/dialogbase.css', 'themes/default/images/**', 'dialogs/**', 'lang/**', 'third-party/**' ], dest: disDir } diff --git a/_examples/sortableDemo.html b/_examples/sortableDemo.html index 51898ca62..3bbb75b18 100644 --- a/_examples/sortableDemo.html +++ b/_examples/sortableDemo.html @@ -1,71 +1,84 @@ - +
-+
+ 默认排序方法有五种:
+ reversecurrent : 逆序当前
+ orderbyasc : 按ASCII字符升序
+ reversebyasc : 按ASCII字符降序
+ orderbynum : 按数值大小升序
+ reversebynum : 按数值大小降序
+
+ 表格data-sort-type属性值为reversebynum,按照数值大小降序排序,点击第一行的单元格进行排序。 +
+343 | 352 | 323 | 234 | 379 | 782 |
341 | 163 | 422 | 234 | 725 | 833 |
221 | 456 | 335 | 423 | 445 | 793 |
112 | 277 | 563 | 423 | 932 | 425 |
587 | 175 | 159 | 734 | 582 | 458 |