From 9901675ddfbe4b1c6617fd26ff3bb0de8edeb1ce Mon Sep 17 00:00:00 2001
From: worry127722 123 456
'+br+'
123
456
'+br+'
' + br + '
', '检查编辑器清空'); + + if(!ua.browser.ie){ + editor.setContent(''); + editor.fireEvent('delkeydown',{}); + ua.checkSameHtml(editor.body.innerHTML, '' + br + '
', '检查编辑器清空'); + } + editor.setContent(''); + ua.keydown(editor.body, {'keyCode':40}); + + if(ua.browser.ie==8||ua.browser.ie==11) + br = ''+br+'','方向键处理'); + }); test('trace 3396:多次切换源码,不会产生空行', function () { From 29f2ade7cd55549ef81bf91357cbb587eff34c43 Mon Sep 17 00:00:00 2001 From: worry127722
nFKODjk)$_pzS$wL7U>Dn{eJy8-kiXElb8stq3)>cv) z HJ QF!Lxgt=s>7 z3ku}2&yejIqKVQK4T#b&gJCMpYR=8g>%n%S)oN$C#B7h?ADHesRERQ;z3Nu!xu2Ql z2En%OTWN*KWg{bXqE>0NmVh%K9?h*FuryfwE9=-5V;us_gW)KXDU&(SX}5UPf4Hg6 zdaNRW+kyL_3<4o!cR!?q8adx;LB {tR0nB*^^EquhsoRW6323x 9Y~gP5jM=(d6{1dB7^E5dS@ zdF8WVo46h@8$b#(9*1E COlsnB*bSU-so_O~yS){7>TNn!|CVJ*5%xe8Z|Hz=t+)N)x^&>abX zvJ&tJQ10dOwnDx7_~=#O#=zMbbS(q(lcdu;koCQUM17^V+HiRY#eR&+o{QIey5WRu zY%oaXedU=Y&3o|gBZdO=k`fXtH0h2>;399$p3YcJ6go@yI?Z!TQ1I6pCcT|Gt2{Sz z*nl^Z>RGNd%3N}mhyYWV(wAH&OA#X$bEFt
Ff>BcB_<&a d8v02m@Y1)C~vXE|`L?m!6R+ z4v_5`lE82v0ZiQ?T4|{-&g+f^%gQU_!Lx`l@
^jaZ&s+se{E8xQbr$8bN96%IZawxWu%tBWG~|x({FOGO2OAr zMx*b@y(0kYByw=kQ^*3DbWx2#pr7`Lt%I!AlKd2yPsa&-hN#d=!G&^$sgW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4w zwAt@&eUd}mu3|aN5@@)(TT&yc4J%}A;saqnv`Oz~>EX}Ju1ObKWdDkuzWZ5zo-m?R zh~01Dk|pSzP{nR}pb>90Uo=FGhRhjdjcv0rjoZCCuI!LF^4;xWFUY1#w2LEQs0;^( zP=xHM-G0vqM-SVS +zwyW -H8Q8K+-YtTI^Z{N&vp|twuuy96Ci&CCr{fAfsJp#7BC__q$y|f7wc34 z4FLdRK!{>{$4&H03#lfQt6qGhQsb3U3_}UPFog{wb955PgVmv8pcv2XfK{m}&5=_J z7tH~#O>lxjWD=2qlW=LKTRcnxb>rt&@rI$;+L5~enn8P}@oKx5Z#~oiD+XCz{Jhp_ z6xIX`2A`F3)9K6(-8LB);!W4@y z%L1|5yo}Hn-kF@Lpmnft`85`vJyJbnpAROyPwAOx$(LoVl7BR}t5~9&D`%EW8cZ45 zbsVB;-Zcz!N#Y-VKZWR(D+oU ?)-K;m9P_Wc9O@h*nrL& z`{Wv+>~#7;<+`!pi !B9TuFDEgS_h~(@#%_I^VB}x#fO<;dMs&iNk{)t z+r+c|3yZ1)BDejqnMt-O_-f>~t7ebJL;H>ui(qSeli%ETLT@eSs^|xtv3Fhx3ZPf? zZ0GMC*kv{*P>MFUDp78S-XfD>tfr|!3KLoK^I^=IuUP69rr9uBRaUEa4o9yURI%@< zWn- gReguV9X`&F>>*D!uz z|IhjUC-28Uxv$-!DF1@KT#XU^1NRTFzdxz3&1rt87QSp!|8umz`%L{weeJUG%h=|x z;YIWRrvAHz`%mU;tA<~yr@saa!#^ b}OUA^P_-*Eqa{;%~1zkgQsy#GM`Q(O1voAA1#@Ao$$L+J0Y|4GX5 zn)|CB@OA0H?_8ktKXCs?b>M66uO0R4eE+W<^ conf) { - - byte[] data = decode(content); + public static State save(HttpServletRequest request, Map conf) { + String filedName = (String) conf.get("fieldName"); + String fileName = request.getParameter(filedName); + byte[] data = decode(fileName); long maxSize = ((Long) conf.get("maxSize")).longValue(); diff --git a/jsp/src/com/baidu/ueditor/upload/BinaryUploader.java b/jsp/src/com/baidu/ueditor/upload/BinaryUploader.java index c69f9ddd7..f8db98809 100644 --- a/jsp/src/com/baidu/ueditor/upload/BinaryUploader.java +++ b/jsp/src/com/baidu/ueditor/upload/BinaryUploader.java @@ -69,7 +69,15 @@ public static final State save(HttpServletRequest request, savePath = PathFormat.parse(savePath, originFileName); - String physicalPath = (String) conf.get("rootPath") + savePath; + //modified by Ternence + String physicalPath = null; + Object rootPath = request.getAttribute("rootPath"); //get variable "rootPath" from request + if (rootPath !=null) { + physicalPath = request.getAttribute("rootPath") + "/" + savePath; + }else { + physicalPath = conf.get("rootPath") + savePath; + } + InputStream is = fileStream.openStream(); State storageState = StorageManager.saveFileByInputStream(is, diff --git a/jsp/src/com/baidu/ueditor/upload/Uploader.java b/jsp/src/com/baidu/ueditor/upload/Uploader.java index 2312d1bcb..0fbd7115d 100644 --- a/jsp/src/com/baidu/ueditor/upload/Uploader.java +++ b/jsp/src/com/baidu/ueditor/upload/Uploader.java @@ -14,11 +14,11 @@ public Uploader(HttpServletRequest request, Map conf) { } public final State doExec() { - String filedName = (String) this.conf.get("fieldName"); + State state = null; if ("true".equals(this.conf.get("isBase64"))) { - state = Base64Uploader.save(this.request.getParameter(filedName), + state = Base64Uploader.save(this.request, this.conf); } else { state = BinaryUploader.save(this.request, this.conf); From c99eabc886f4e19a3548b818957d1fedfad81596 Mon Sep 17 00:00:00 2001 From: StruggleBird Date: Sat, 31 Jan 2015 16:15:29 +0800 Subject: [PATCH 25/79] =?UTF-8?q?###=E4=BC=98=E5=8C=96=EF=BC=9A=20*=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9C=8D=E5=8A=A1=E7=AB=AF=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8D=E7=A7=B0=E4=B8=BAueditor.config=20*?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E4=BA=86ConfigManager=EF=BC=9A=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E7=AB=AF=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E4=BB=8E?= =?UTF-8?q?classes=E7=9B=AE=E5=BD=95=E8=AF=BB=E5=8F=96=EF=BC=8C=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E4=B8=8D=E5=AD=98=E5=9C=A8=E5=88=99=E4=BB=8Ewebapp?= =?UTF-8?q?=E7=9A=84ueditor=E7=9B=AE=E5=BD=95=E8=AF=BB=E5=8F=96=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E5=A2=9E=E5=BC=BAueditor=E7=9A=84=E5=AE=89?= =?UTF-8?q?=E5=85=A8=E6=80=A7=EF=BC=8C=E9=98=B2=E6=AD=A2=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=A2=AB=E7=AA=A5=E6=8E=A2=EF=BC=9B=20*=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9BinaryUploader=E3=80=81Base64Uploader:?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E9=85=8D=E7=BD=AE=E5=AD=98=E5=82=A8=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=EF=BC=8C=E6=94=AF=E6=8C=81=E5=AD=98=E5=82=A8=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E9=85=8D=E7=BD=AE=E4=B8=BA=E7=BB=9D=E5=AF=B9=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E5=BD=A2=E5=BC=8F=E3=80=82=20=09=E5=85=B7=E4=BD=93?= =?UTF-8?q?=E5=81=9A=E6=B3=95=EF=BC=9Acontroller.jsp=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E5=9C=A8request=E4=BD=9C=E7=94=A8=E5=9F=9F=E5=86=85=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E5=8F=98=E9=87=8FrootPath=E5=92=8C=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E7=9A=84=E5=AD=98=E5=82=A8=E8=B7=9F=E8=B7=AF=E5=BE=84=20,uedit?= =?UTF-8?q?or=E4=BC=9A=E4=BC=98=E5=85=88=E6=9F=A5=E6=89=BE=E8=AF=A5?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=88=99=E5=B0=86=E7=BD=91=E7=AB=99=E6=A0=B9=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E4=BD=9C=E4=B8=BArootPath(=E5=8D=B3=E5=8E=9F=E6=9C=89=E9=85=8D?= =?UTF-8?q?=E7=BD=AE)=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: StruggleBird --- .../baidu/ueditor/upload/Base64Uploader.java | 3 ++- .../baidu/ueditor/upload/BinaryUploader.java | 9 ++------- .../baidu/ueditor/upload/StorageManager.java | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/jsp/src/com/baidu/ueditor/upload/Base64Uploader.java b/jsp/src/com/baidu/ueditor/upload/Base64Uploader.java index a50dd885c..910b482d3 100644 --- a/jsp/src/com/baidu/ueditor/upload/Base64Uploader.java +++ b/jsp/src/com/baidu/ueditor/upload/Base64Uploader.java @@ -31,7 +31,8 @@ public static State save(HttpServletRequest request, Map conf) { (String) conf.get("filename")); savePath = savePath + suffix; - String physicalPath = (String) conf.get("rootPath") + savePath; + String rootPath = StorageManager.getRootPath(request,conf); + String physicalPath = rootPath + savePath; State storageState = StorageManager.saveBinaryFile(data, physicalPath); diff --git a/jsp/src/com/baidu/ueditor/upload/BinaryUploader.java b/jsp/src/com/baidu/ueditor/upload/BinaryUploader.java index f8db98809..a46e1e50c 100644 --- a/jsp/src/com/baidu/ueditor/upload/BinaryUploader.java +++ b/jsp/src/com/baidu/ueditor/upload/BinaryUploader.java @@ -70,13 +70,8 @@ public static final State save(HttpServletRequest request, savePath = PathFormat.parse(savePath, originFileName); //modified by Ternence - String physicalPath = null; - Object rootPath = request.getAttribute("rootPath"); //get variable "rootPath" from request - if (rootPath !=null) { - physicalPath = request.getAttribute("rootPath") + "/" + savePath; - }else { - physicalPath = conf.get("rootPath") + savePath; - } + String rootPath = StorageManager.getRootPath(request,conf); + String physicalPath = rootPath + savePath; InputStream is = fileStream.openStream(); diff --git a/jsp/src/com/baidu/ueditor/upload/StorageManager.java b/jsp/src/com/baidu/ueditor/upload/StorageManager.java index 33911c648..d062ba65c 100644 --- a/jsp/src/com/baidu/ueditor/upload/StorageManager.java +++ b/jsp/src/com/baidu/ueditor/upload/StorageManager.java @@ -10,6 +10,9 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; import org.apache.commons.io.FileUtils; @@ -112,6 +115,22 @@ public static State saveFileByInputStream(InputStream is, String path) { } return new BaseState(false, AppInfo.IO_ERROR); } + + /** + * Get rootPath from request,if not,find it from conf map. + * @param request + * @param conf + * @return + * @create 2015年1月31日 + */ + public static String getRootPath(HttpServletRequest request, Map conf) { + Object rootPath = request.getAttribute("rootPath"); + if (rootPath != null) { + return rootPath + "" + File.separatorChar; + } else { + return conf.get("rootPath") + ""; + } + } private static File getTmpFile() { File tmpDir = FileUtils.getTempDirectory(); From b873773944d17921378e582764662412bb5bc6c0 Mon Sep 17 00:00:00 2001 From: StruggleBird Date: Sat, 31 Jan 2015 16:15:29 +0800 Subject: [PATCH 26/79] =?UTF-8?q?###=E4=BC=98=E5=8C=96=EF=BC=9A=20*=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9C=8D=E5=8A=A1=E7=AB=AF=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8D=E7=A7=B0=E4=B8=BAueditor.config=20*?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E4=BA=86ConfigManager=EF=BC=9A=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E7=AB=AF=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E4=BB=8E?= =?UTF-8?q?classes=E7=9B=AE=E5=BD=95=E8=AF=BB=E5=8F=96=EF=BC=8C=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E4=B8=8D=E5=AD=98=E5=9C=A8=E5=88=99=E4=BB=8Ewebapp?= =?UTF-8?q?=E7=9A=84ueditor=E7=9B=AE=E5=BD=95=E8=AF=BB=E5=8F=96=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E5=A2=9E=E5=BC=BAueditor=E7=9A=84=E5=AE=89?= =?UTF-8?q?=E5=85=A8=E6=80=A7=EF=BC=8C=E9=98=B2=E6=AD=A2=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=A2=AB=E7=AA=A5=E6=8E=A2=EF=BC=9B=20*=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9BinaryUploader=E3=80=81Base64Uploader:?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E9=85=8D=E7=BD=AE=E5=AD=98=E5=82=A8=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=EF=BC=8C=E6=94=AF=E6=8C=81=E5=AD=98=E5=82=A8=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E9=85=8D=E7=BD=AE=E4=B8=BA=E7=BB=9D=E5=AF=B9=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E5=BD=A2=E5=BC=8F=E3=80=82=20=09=E5=85=B7=E4=BD=93?= =?UTF-8?q?=E5=81=9A=E6=B3=95=EF=BC=9Acontroller.jsp=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E5=9C=A8request=E4=BD=9C=E7=94=A8=E5=9F=9F=E5=86=85=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E5=8F=98=E9=87=8FrootPath=E5=92=8C=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E7=9A=84=E5=AD=98=E5=82=A8=E8=B7=9F=E8=B7=AF=E5=BE=84=20,uedit?= =?UTF-8?q?or=E4=BC=9A=E4=BC=98=E5=85=88=E6=9F=A5=E6=89=BE=E8=AF=A5?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=88=99=E5=B0=86=E7=BD=91=E7=AB=99=E6=A0=B9=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E4=BD=9C=E4=B8=BArootPath(=E5=8D=B3=E5=8E=9F=E6=9C=89=E9=85=8D?= =?UTF-8?q?=E7=BD=AE)=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: StruggleBird --- jsp/src/com/baidu/ueditor/ConfigManager.java | 21 ++++++++++++++++++- .../baidu/ueditor/upload/Base64Uploader.java | 4 +++- .../baidu/ueditor/upload/BinaryUploader.java | 10 +++------ .../baidu/ueditor/upload/StorageManager.java | 2 +- 4 files changed, 27 insertions(+), 10 deletions(-) diff --git a/jsp/src/com/baidu/ueditor/ConfigManager.java b/jsp/src/com/baidu/ueditor/ConfigManager.java index cec472447..bebf40aaf 100644 --- a/jsp/src/com/baidu/ueditor/ConfigManager.java +++ b/jsp/src/com/baidu/ueditor/ConfigManager.java @@ -10,6 +10,8 @@ import java.util.HashMap; import java.util.Map; +import javax.servlet.http.HttpServletRequest; + import org.json.JSONArray; import org.json.JSONObject; @@ -150,7 +152,24 @@ public Map getConfig ( int type ) { } - private void initEnv () throws FileNotFoundException, IOException { + /** + * Get rootPath from request,if not,find it from conf map. + * @param request + * @param conf + * @return + * @author Ternence + * @create 2015年1月31日 + */ + public static String getRootPath(HttpServletRequest request, Map conf) { + Object rootPath = request.getAttribute("rootPath"); + if (rootPath != null) { + return rootPath + "" + File.separatorChar; + } else { + return conf.get("rootPath") + ""; + } + } + + private void initEnv () throws FileNotFoundException, IOException { File file = new File( this.originalPath ); diff --git a/jsp/src/com/baidu/ueditor/upload/Base64Uploader.java b/jsp/src/com/baidu/ueditor/upload/Base64Uploader.java index a50dd885c..abe885d45 100644 --- a/jsp/src/com/baidu/ueditor/upload/Base64Uploader.java +++ b/jsp/src/com/baidu/ueditor/upload/Base64Uploader.java @@ -1,5 +1,6 @@ package com.baidu.ueditor.upload; +import com.baidu.ueditor.ConfigManager; import com.baidu.ueditor.PathFormat; import com.baidu.ueditor.define.AppInfo; import com.baidu.ueditor.define.BaseState; @@ -31,7 +32,8 @@ public static State save(HttpServletRequest request, Map conf) { (String) conf.get("filename")); savePath = savePath + suffix; - String physicalPath = (String) conf.get("rootPath") + savePath; + String rootPath = ConfigManager.getRootPath(request,conf); + String physicalPath = rootPath + savePath; State storageState = StorageManager.saveBinaryFile(data, physicalPath); diff --git a/jsp/src/com/baidu/ueditor/upload/BinaryUploader.java b/jsp/src/com/baidu/ueditor/upload/BinaryUploader.java index f8db98809..b4ab26154 100644 --- a/jsp/src/com/baidu/ueditor/upload/BinaryUploader.java +++ b/jsp/src/com/baidu/ueditor/upload/BinaryUploader.java @@ -1,5 +1,6 @@ package com.baidu.ueditor.upload; +import com.baidu.ueditor.ConfigManager; import com.baidu.ueditor.PathFormat; import com.baidu.ueditor.define.AppInfo; import com.baidu.ueditor.define.BaseState; @@ -70,13 +71,8 @@ public static final State save(HttpServletRequest request, savePath = PathFormat.parse(savePath, originFileName); //modified by Ternence - String physicalPath = null; - Object rootPath = request.getAttribute("rootPath"); //get variable "rootPath" from request - if (rootPath !=null) { - physicalPath = request.getAttribute("rootPath") + "/" + savePath; - }else { - physicalPath = conf.get("rootPath") + savePath; - } + String rootPath = ConfigManager.getRootPath(request,conf); + String physicalPath = rootPath + savePath; InputStream is = fileStream.openStream(); diff --git a/jsp/src/com/baidu/ueditor/upload/StorageManager.java b/jsp/src/com/baidu/ueditor/upload/StorageManager.java index 33911c648..f67126375 100644 --- a/jsp/src/com/baidu/ueditor/upload/StorageManager.java +++ b/jsp/src/com/baidu/ueditor/upload/StorageManager.java @@ -112,7 +112,7 @@ public static State saveFileByInputStream(InputStream is, String path) { } return new BaseState(false, AppInfo.IO_ERROR); } - + private static File getTmpFile() { File tmpDir = FileUtils.getTempDirectory(); String tmpFileName = (Math.random() * 10000 + "").replace(".", ""); From 34dbf8964f8df05491ff4754d07d199322e6c6d1 Mon Sep 17 00:00:00 2001 From: dail Date: Fri, 27 Feb 2015 17:32:41 +0800 Subject: [PATCH 27/79] Update dialog.js fix an issue that when use custom theme, the cssRules will lost effect. --- _src/ui/dialog.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_src/ui/dialog.js b/_src/ui/dialog.js index 721050d83..967360ff8 100755 --- a/_src/ui/dialog.js +++ b/_src/ui/dialog.js @@ -17,7 +17,7 @@ options.className = 'edui-for-' + name; } if(cssRules){ - options.cssRules = '.edui-default .edui-for-'+ name +' .edui-dialog-content {'+ cssRules +'}' + options.cssRules = '.edui-for-'+ name +' .edui-dialog-content {'+ cssRules +'}' } } this.initOptions(utils.extend({ @@ -43,6 +43,7 @@ var me = this, theme=this.editor.options.theme; if(this.cssRules){ + this.cssRules = '.edui-' + theme + ' ' + this.cssRules; utils.cssRule('edui-customize-'+this.name+'-style',this.cssRules); } this.initUIBase(); From 146a3b136b40e247c0a6e195fffc70dc056006a5 Mon Sep 17 00:00:00 2001 From: badsummer Date: Thu, 28 May 2015 17:41:45 +0800 Subject: [PATCH 28/79] =?UTF-8?q?=E5=A4=84=E7=90=86=E4=B8=AD=E6=96=87?= =?UTF-8?q?=E5=8F=8C=E5=BC=95=E5=8F=B7=E4=B8=8D=E8=83=BD=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E8=BD=AC=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 处理中文双引号转义问题,如: “测试” => “测试” 在 unhtml 与 html 函数中添加中文双引号转义字符 --- _src/core/utils.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/_src/core/utils.js b/_src/core/utils.js index 036a93d91..de99178e0 100644 --- a/_src/core/utils.js +++ b/_src/core/utils.js @@ -445,7 +445,7 @@ var utils = UE.utils = { }, /** - * 将str中的html符号转义,将转义“',&,<,",>”五个字符 + * 将str中的html符号转义,将转义“',&,<,",>,”,“”七个字符 * @method unhtml * @param { String } str 需要转义的字符串 * @return { String } 转义后的字符串 @@ -459,7 +459,7 @@ var utils = UE.utils = { * ``` */ unhtml:function (str, reg) { - return str ? str.replace(reg || /[&<">'](?:(amp|lt|quot|gt|#39|nbsp|#\d+);)?/g, function (a, b) { + return str ? str.replace(reg || /[&<">'](?:(amp|lt|ldquo|rdquo|quot|gt|#39|nbsp|#\d+);)?/g, function (a, b) { if (b) { return a; } else { @@ -467,6 +467,8 @@ var utils = UE.utils = { '<':'<', '&':'&', '"':'"', + '“':'“', + '”':'”', '>':'>', "'":''' }[a] @@ -492,11 +494,13 @@ var utils = UE.utils = { * ``` */ html:function (str) { - return str ? str.replace(/&((g|l|quo)t|amp|#39|nbsp);/g, function (m) { + return str ? str.replace(/&((g|l|quo|ldquo|rdquo)t|amp|#39|nbsp);/g, function (m) { return { '<':'<', '&':'&', '"':'"', + '“':'“', + '”':'”', '>':'>', ''':"'", ' ':' ' @@ -1189,4 +1193,4 @@ utils.each(['String', 'Function', 'Array', 'Number', 'RegExp', 'Object', 'Date'] UE.utils['is' + v] = function (obj) { return Object.prototype.toString.apply(obj) == '[object ' + v + ']'; } -}); \ No newline at end of file +}); From f3bf5c439b83fc21f6a7ca7ee1e9ced596b9bfea Mon Sep 17 00:00:00 2001 From: birdol Date: Tue, 10 Nov 2015 17:17:52 +0800 Subject: [PATCH 29/79] Update Uploader.class.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 强迫症,错别字。 --- php/Uploader.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/Uploader.class.php b/php/Uploader.class.php index 0ff1b9dc4..e512e8cd5 100755 --- a/php/Uploader.class.php +++ b/php/Uploader.class.php @@ -273,7 +273,7 @@ private function getFullName() $format = str_replace("{ss}", $d[6], $format); $format = str_replace("{time}", $t, $format); - //过滤文件名的非法自负,并替换文件名 + //过滤文件名的非法字符,并替换文件名 $oriName = substr($this->oriName, 0, strrpos($this->oriName, '.')); $oriName = preg_replace("/[\|\?\"\<\>\/\*\\\\]+/", '', $oriName); $format = str_replace("{filename}", $oriName, $format); @@ -350,4 +350,4 @@ public function getFileInfo() ); } -} \ No newline at end of file +} From 1bddfba6df397ac8fe97053752f30250aad5a86b Mon Sep 17 00:00:00 2001 From: zxeoc Date: Thu, 26 Nov 2015 14:44:52 +0800 Subject: [PATCH 30/79] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=9C=A8=E6=9C=8D=E5=8A=A1=E5=99=A8=E4=B8=8A=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E4=B8=8E=E7=BA=BF=E4=B8=8A=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E4=B8=8D=E4=B8=80=E8=87=B4=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=8F=92=E4=BB=B6=E4=B8=8D=E8=83=BD=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E5=8A=A0=E8=BD=BD=E9=85=8D=E7=BD=AE=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rootPath来自于application.getRealPath( "/" )(在controller.jsp中),即来自于服务器本地真实路径,而requestUri来自于request中的访问路径,当两者不一致的时候(如本地路径为localProj,而访问路径为pubProj),会因为拼接出的路经(ConfigManager.originalPath的值)不对而无法加载配置文件,因此应该只取request中的相对路径部分,拼接在本地的绝对路径后面,从而得到配置文件的绝对路径 --- jsp/src/com/baidu/ueditor/ActionEnter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jsp/src/com/baidu/ueditor/ActionEnter.java b/jsp/src/com/baidu/ueditor/ActionEnter.java index 33a3dc7b5..289fcb981 100644 --- a/jsp/src/com/baidu/ueditor/ActionEnter.java +++ b/jsp/src/com/baidu/ueditor/ActionEnter.java @@ -29,7 +29,7 @@ public ActionEnter ( HttpServletRequest request, String rootPath ) { this.rootPath = rootPath; this.actionType = request.getParameter( "action" ); this.contextPath = request.getContextPath(); - this.configManager = ConfigManager.getInstance( this.rootPath, this.contextPath, request.getRequestURI() ); + this.configManager = ConfigManager.getInstance( this.rootPath, this.contextPath, request.getRequestURI().replace(request.getContextPath(),"") ); } @@ -124,4 +124,4 @@ public boolean validCallbackName ( String name ) { } -} \ No newline at end of file +} From 17171cdb4735eda7b4af73ecdfa4b47fb1b9d742 Mon Sep 17 00:00:00 2001 From: zxeoc Date: Thu, 26 Nov 2015 14:45:46 +0800 Subject: [PATCH 31/79] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=9C=A8=E6=9C=8D=E5=8A=A1=E5=99=A8=E4=B8=8A=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E4=B8=8E=E7=BA=BF=E4=B8=8A=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E4=B8=8D=E4=B8=80=E8=87=B4=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=8F=92=E4=BB=B6=E4=B8=8D=E8=83=BD=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E5=8A=A0=E8=BD=BD=E9=85=8D=E7=BD=AE=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rootPath来自于application.getRealPath( "/" )(在controller.jsp中),即来自于服务器本地真实路径,而requestUri来自于request中的访问路径,当两者不一致的时候(如本地路径为localProj,而访问路径为pubProj),会因为拼接出的路经(ConfigManager.originalPath的值)不对而无法加载配置文件,因此应该只取request中的相对路径部分,拼接在本地的绝对路径后面,从而得到配置文件的绝对路径 --- jsp/src/com/baidu/ueditor/ConfigManager.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/jsp/src/com/baidu/ueditor/ConfigManager.java b/jsp/src/com/baidu/ueditor/ConfigManager.java index e84cb3dba..4dc6b3ea5 100644 --- a/jsp/src/com/baidu/ueditor/ConfigManager.java +++ b/jsp/src/com/baidu/ueditor/ConfigManager.java @@ -42,11 +42,7 @@ private ConfigManager ( String rootPath, String contextPath, String uri ) throws this.contextPath = contextPath; - if ( contextPath.length() > 0 ) { - this.rootPath = rootPath.substring( 0, rootPath.length() - contextPath.length() ); - } else { - this.rootPath = rootPath; - } + this.rootPath = rootPath; this.originalPath = this.rootPath + uri; From e6e09e81a3ca8cebb76918b153ded8f4e9e189ce Mon Sep 17 00:00:00 2001 From: wuyuying01 Date: Tue, 15 Dec 2015 15:42:54 +0800 Subject: [PATCH 32/79] A bug in plugin contextmenu Set the value of enableContextMenu first, then get the value, it will always be true. So I add a judge to check whether users have set its value, otherwise its default value is true. --- _src/plugins/contextmenu.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/_src/plugins/contextmenu.js b/_src/plugins/contextmenu.js index 9fdcbb01a..71fa8b364 100644 --- a/_src/plugins/contextmenu.js +++ b/_src/plugins/contextmenu.js @@ -11,7 +11,9 @@ UE.plugins['contextmenu'] = function () { var me = this; - me.setOpt('enableContextMenu',true); + + me.setOpt('enableContextMenu', me.getOpt('enableContextMenu') || true); + if(me.getOpt('enableContextMenu') === false){ return; } From 2ac5f09277e8c66fe5e169892ba6a0eb0d56456d Mon Sep 17 00:00:00 2001 From: eecjimmy Date: Sun, 10 Jan 2016 15:11:19 +0800 Subject: [PATCH 33/79] =?UTF-8?q?textarea=20=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _src/core/Editor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_src/core/Editor.js b/_src/core/Editor.js index 6229c3c93..1d4a0d77d 100644 --- a/_src/core/Editor.js +++ b/_src/core/Editor.js @@ -30,8 +30,8 @@ */ function setValue(form, editor) { var textarea; - if (editor.textarea) { - if (utils.isString(editor.textarea)) { + if (editor.options.textarea) { + if (utils.isString(editor.options.textarea)) { for (var i = 0, ti, tis = domUtils.getElementsByTagName(form, 'textarea'); ti = tis[i++];) { if (ti.id == 'ueditor_textarea_' + editor.options.textarea) { textarea = ti; From 2205cd34afda87e66ca5bf68d6364ceddcbde65f Mon Sep 17 00:00:00 2001 From: Phinome Date: Mon, 1 Feb 2016 17:32:17 +0800 Subject: [PATCH 34/79] add plugins guide --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c2c5c20df..8fdc9dbfa 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,8 @@ ueditor API 文档:[http://ueditor.baidu.com/doc](http://ueditor.baidu.com/doc ueditor github 地址:[http://github.com/fex-team/ueditor](http://github.com/fex-team/ueditor "ueditor github 地址") +ueditor 第三方插件贡献 wiki : [第三方插件贡献规范](https://github.com/fex-team/ueditor/wiki/%E8%B4%A1%E7%8C%AE%E7%AC%AC%E4%B8%89%E6%96%B9%E6%8F%92%E4%BB%B6%E9%A1%B9%E7%9B%AE%E8%AF%B4%E6%98%8E) + ## 3 第三方贡献 ueditor for nodejs 参考[https://github.com/netpi/ueditor](https://github.com/netpi/ueditor) From 90aff8cd483cdd8be2feccba20e96a8a3de7e26c Mon Sep 17 00:00:00 2001 From: 51mono Date: Sat, 13 Feb 2016 01:00:32 +0800 Subject: [PATCH 35/79] =?UTF-8?q?.Net=E7=89=88-=E5=A4=9A=E5=9B=BE=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0-=E5=9C=A8=E7=BA=BF=E7=AE=A1=E7=90=86=EF=BC=9A?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9C=8D=E5=8A=A1=E5=99=A8=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=88=97=E8=A1=A8=E4=B8=8D=E8=83=BD=E5=80=92?= =?UTF-8?q?=E5=BA=8FBug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- net/App_Code/ListFileHandler.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/App_Code/ListFileHandler.cs b/net/App_Code/ListFileHandler.cs index 2cfa22a18..e278e09e2 100644 --- a/net/App_Code/ListFileHandler.cs +++ b/net/App_Code/ListFileHandler.cs @@ -52,9 +52,10 @@ public override void Process() var localPath = Server.MapPath(PathToList); buildingList.AddRange(Directory.GetFiles(localPath, "*", SearchOption.AllDirectories) .Where(x => SearchExtensions.Contains(Path.GetExtension(x).ToLower())) + .Reverse() .Select(x => PathToList + x.Substring(localPath.Length).Replace("\\", "/"))); Total = buildingList.Count; - FileList = buildingList.OrderBy(x => x).Skip(Start).Take(Size).ToArray(); + FileList = buildingList.Skip(Start).Take(Size).ToArray(); } catch (UnauthorizedAccessException) { @@ -103,4 +104,4 @@ private string GetStateString() } return "未知错误"; } -} \ No newline at end of file +} From 022c101cf759956c91341f22289e0124b0ba1052 Mon Sep 17 00:00:00 2001 From: Phinome Date: Sun, 14 Feb 2016 16:09:04 +0800 Subject: [PATCH 36/79] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E6=8F=92=E4=BB=B6=E8=B4=A1=E7=8C=AE=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8fdc9dbfa..83298bfbe 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ ueditor API 文档:[http://ueditor.baidu.com/doc](http://ueditor.baidu.com/doc ueditor github 地址:[http://github.com/fex-team/ueditor](http://github.com/fex-team/ueditor "ueditor github 地址") -ueditor 第三方插件贡献 wiki : [第三方插件贡献规范](https://github.com/fex-team/ueditor/wiki/%E8%B4%A1%E7%8C%AE%E7%AC%AC%E4%B8%89%E6%96%B9%E6%8F%92%E4%BB%B6%E9%A1%B9%E7%9B%AE%E8%AF%B4%E6%98%8E) +ueditor 第三方插件贡献 wiki : [第三方插件贡献规范](http://ueditor.baidu.com/website/thirdproject.html) ## 3 第三方贡献 From 1885e6b4c87857a7dcd4afc0bfc3a0b6d7faf464 Mon Sep 17 00:00:00 2001 From: Phinome Date: Thu, 18 Feb 2016 21:16:24 +0800 Subject: [PATCH 37/79] Create ISSUE_TEMPLATE.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增提 ISSUE 规则模板 --- ISSUE_TEMPLATE.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 ISSUE_TEMPLATE.md diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md new file mode 100644 index 000000000..353a26a50 --- /dev/null +++ b/ISSUE_TEMPLATE.md @@ -0,0 +1,25 @@ +* 首先,感谢各位使用 UEditor。UEditor 是由百度「FEX前端研发团队」开发的所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点,开源基于MIT协议,允许自由使用和修改代码。 +* 其次,我们的目标不仅是要提高在线编辑的编辑体验,也希望能改变前端技术中关于富文本技术的门槛,让大家不再觉得这块是个大坑。 +* 再次,好的产品都是在实践中不断改进的,因此,对于使用 UEditor 的用户,我们表示深深地感谢!对于遇到问题,来到这儿提 `ISSUE` 的用户,我们尽最大的努力解答你们所遇到的各种问题,不断迭代我们的产品,使之趋于更好。 + +**但是**,在回答大量用户提出的 `ISSUE` 的过程中,我们发现:一方面,我们还需要完善我们的文档,让更多的人看看文档就能解决他的问题;另一方面,我们也需要建立一个提 `ISSUE` 的规则, +将我们的主要精力投入到修复 `UEditor` Bugs 和改进 `UEditor` 中去,让越来越多的人能够使用的舒心。 + +## 规则 + +* 提 `ISSUE` 之前,请先看看文档。传送门:[文档](http://fex.baidu.com/ueditor/),很多问题,在文档中都能有答案。特别是配置之类的。 +* 提 `ISSUE` 之前,请先问问搜索引擎(百度、Google),因为你遇到的问题,可能其他人也遇到了,并且已经解决了。 +只需要动动手指,在输入框里输入,就会有答案,这样方便,远比等我们回复快捷。 +* 提 `ISSUE` 之前,如果你已经走过上面两步了,来到 `ISSUE` 这个页面了,此刻,请别急,建议你再搜索一下`ISSUE`。 +因为,或许你将提的问题,也有人遇到了,而且我们已经反馈了。这时,你只需要找到相应的 `ISSUE`,在那个 `ISSUE` 里留下你的关注就好了。很简单吧! + +以上都不满足你,看来这一定是个新的问题。首先,我们要感谢你,帮我们发现了一个新的问题,但是,为了使问题能尽快得到解决。我们建议你按照如下的规则来提: + +* 构想清楚问题的表达; +* 写一个简明扼要的标题 +* 写一个能描述清楚问题的内容,如果有复现步骤当是极好的; + +最后,是我们的一点希望:希望提 `ISSUE` 的同学,能自行排查、定位问题,甚至自行修复,然后给我们提 `Pull Request`。即使做不到提 `Pull Request` +但是你的排查的过程也是在增加你的 `debug` 的能力。 + +最后,再次感谢各位选择 `UEditor`。 From d5cff8b5070675c135258dd0bc4072f66fc0b67e Mon Sep 17 00:00:00 2001 From: Phinome Date: Thu, 18 Feb 2016 21:19:41 +0800 Subject: [PATCH 38/79] Update ISSUE_TEMPLATE.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 简化内容 --- ISSUE_TEMPLATE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index 353a26a50..2d98d4add 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -1,4 +1,4 @@ -* 首先,感谢各位使用 UEditor。UEditor 是由百度「FEX前端研发团队」开发的所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点,开源基于MIT协议,允许自由使用和修改代码。 +* 首先,感谢各位使用 UEditor。 * 其次,我们的目标不仅是要提高在线编辑的编辑体验,也希望能改变前端技术中关于富文本技术的门槛,让大家不再觉得这块是个大坑。 * 再次,好的产品都是在实践中不断改进的,因此,对于使用 UEditor 的用户,我们表示深深地感谢!对于遇到问题,来到这儿提 `ISSUE` 的用户,我们尽最大的努力解答你们所遇到的各种问题,不断迭代我们的产品,使之趋于更好。 @@ -7,7 +7,7 @@ ## 规则 -* 提 `ISSUE` 之前,请先看看文档。传送门:[文档](http://fex.baidu.com/ueditor/),很多问题,在文档中都能有答案。特别是配置之类的。 +* 提 `ISSUE` 之前,请先看看文档。传送门:[文档](http://fex.baidu.com/ueditor/)。很多问题,在文档中都能有答案。特别是配置之类的。 * 提 `ISSUE` 之前,请先问问搜索引擎(百度、Google),因为你遇到的问题,可能其他人也遇到了,并且已经解决了。 只需要动动手指,在输入框里输入,就会有答案,这样方便,远比等我们回复快捷。 * 提 `ISSUE` 之前,如果你已经走过上面两步了,来到 `ISSUE` 这个页面了,此刻,请别急,建议你再搜索一下`ISSUE`。 From 93d14053a0d62c7ad4ad16f04399466a2f483603 Mon Sep 17 00:00:00 2001 From: Phinome Date: Thu, 18 Feb 2016 21:23:42 +0800 Subject: [PATCH 39/79] Update ISSUE_TEMPLATE.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 进一步简化内容 --- ISSUE_TEMPLATE.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index 2d98d4add..76c06ac71 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -1,8 +1,6 @@ -* 首先,感谢各位使用 UEditor。 -* 其次,我们的目标不仅是要提高在线编辑的编辑体验,也希望能改变前端技术中关于富文本技术的门槛,让大家不再觉得这块是个大坑。 -* 再次,好的产品都是在实践中不断改进的,因此,对于使用 UEditor 的用户,我们表示深深地感谢!对于遇到问题,来到这儿提 `ISSUE` 的用户,我们尽最大的努力解答你们所遇到的各种问题,不断迭代我们的产品,使之趋于更好。 +**首先**,感谢各位使用 UEditor,并来到这儿提 `ISSUE`。 -**但是**,在回答大量用户提出的 `ISSUE` 的过程中,我们发现:一方面,我们还需要完善我们的文档,让更多的人看看文档就能解决他的问题;另一方面,我们也需要建立一个提 `ISSUE` 的规则, +**其次**,在回答大量用户提出的 `ISSUE` 的过程中,我们发现需要建立一个提 `ISSUE` 的规则, 将我们的主要精力投入到修复 `UEditor` Bugs 和改进 `UEditor` 中去,让越来越多的人能够使用的舒心。 ## 规则 From 77c068f879de7a752523f91747fd1570e8eb982c Mon Sep 17 00:00:00 2001 From: Phinome Date: Thu, 18 Feb 2016 21:24:07 +0800 Subject: [PATCH 40/79] Update ISSUE_TEMPLATE.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新内容 --- ISSUE_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index 76c06ac71..273d6390e 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -20,4 +20,4 @@ 最后,是我们的一点希望:希望提 `ISSUE` 的同学,能自行排查、定位问题,甚至自行修复,然后给我们提 `Pull Request`。即使做不到提 `Pull Request` 但是你的排查的过程也是在增加你的 `debug` 的能力。 -最后,再次感谢各位选择 `UEditor`。 +再次感谢各位选择 `UEditor`。 From b8830b2c753bd6661c8b4cf6f44abe73fc953c9e Mon Sep 17 00:00:00 2001 From: Phinome Date: Thu, 18 Feb 2016 21:24:46 +0800 Subject: [PATCH 41/79] Update ISSUE_TEMPLATE.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化内容排版 --- ISSUE_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index 273d6390e..33483a4f2 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -20,4 +20,4 @@ 最后,是我们的一点希望:希望提 `ISSUE` 的同学,能自行排查、定位问题,甚至自行修复,然后给我们提 `Pull Request`。即使做不到提 `Pull Request` 但是你的排查的过程也是在增加你的 `debug` 的能力。 -再次感谢各位选择 `UEditor`。 +**再次感谢各位选择 `UEditor`!** From 0df208276fea97b4321b59ff8f6e9b5688c5f474 Mon Sep 17 00:00:00 2001 From: Phinome Date: Thu, 18 Feb 2016 21:27:50 +0800 Subject: [PATCH 42/79] Update ISSUE_TEMPLATE.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化内容 --- ISSUE_TEMPLATE.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index 33483a4f2..e81009ddb 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -5,10 +5,10 @@ ## 规则 -* 提 `ISSUE` 之前,请先看看文档。传送门:[文档](http://fex.baidu.com/ueditor/)。很多问题,在文档中都能有答案。特别是配置之类的。 -* 提 `ISSUE` 之前,请先问问搜索引擎(百度、Google),因为你遇到的问题,可能其他人也遇到了,并且已经解决了。 +* 提 `ISSUE` 之前,**请先看看文档**。传送门:[文档](http://fex.baidu.com/ueditor/)。很多问题,在文档中都能有答案。特别是配置之类的。 +* 提 `ISSUE` 之前,**请先问问搜索引擎(百度、Google)**,因为你遇到的问题,可能其他人也遇到了,并且已经解决了。 只需要动动手指,在输入框里输入,就会有答案,这样方便,远比等我们回复快捷。 -* 提 `ISSUE` 之前,如果你已经走过上面两步了,来到 `ISSUE` 这个页面了,此刻,请别急,建议你再搜索一下`ISSUE`。 +* 提 `ISSUE` 之前,如果你已经走过上面两步了,来到 `ISSUE` 这个页面了,此刻,请别急,**建议你再搜索一下`ISSUE`**。 因为,或许你将提的问题,也有人遇到了,而且我们已经反馈了。这时,你只需要找到相应的 `ISSUE`,在那个 `ISSUE` 里留下你的关注就好了。很简单吧! 以上都不满足你,看来这一定是个新的问题。首先,我们要感谢你,帮我们发现了一个新的问题,但是,为了使问题能尽快得到解决。我们建议你按照如下的规则来提: @@ -17,7 +17,7 @@ * 写一个简明扼要的标题 * 写一个能描述清楚问题的内容,如果有复现步骤当是极好的; -最后,是我们的一点希望:希望提 `ISSUE` 的同学,能自行排查、定位问题,甚至自行修复,然后给我们提 `Pull Request`。即使做不到提 `Pull Request` -但是你的排查的过程也是在增加你的 `debug` 的能力。 +**最后,是我们的一点希望:希望提 `ISSUE` 的同学,能自行排查、定位问题,甚至自行修复,然后给我们提 `Pull Request`。即使做不到提 `Pull Request` +但是你的排查的过程也是在增加你的 `debug` 的能力。** -**再次感谢各位选择 `UEditor`!** +### 再次感谢各位选择 `UEditor`! From 22bef9678bbe5ca78a41a0e6088c71dc5dbbd29b Mon Sep 17 00:00:00 2001 From: Phinome Date: Tue, 5 Apr 2016 22:41:22 +0800 Subject: [PATCH 43/79] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新下载说明 --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 83298bfbe..adb410e7a 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,9 @@ UEditor是由百度web前端研发部开发所见即所得富文本web编辑器 ### 1.1 下载编辑器 -到官网下载ueditor最新版:[[官网地址]](http://ueditor.baidu.com/website/download.html#ueditor "官网下载地址") +1. `git clone ` 仓库 +2. `npm install` 安装依赖(如果没有安装 grunt , 请先在全局安装 grunt) +3. 在终端执行 `grunt default` ### 1.2 创建demo文件 解压下载的包,在解压后的目录创建demo.html文件,填入下面的html代码 From 9da60f3b066584e5383ecd47d50f33bbdba84d69 Mon Sep 17 00:00:00 2001 From: Phinome Date: Wed, 6 Apr 2016 17:38:33 +0800 Subject: [PATCH 44/79] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20js=20=E8=A7=84?= =?UTF-8?q?=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新贡献代码 js 规范 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index adb410e7a..a929c522b 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,8 @@ ueditor github 地址:[http://github.com/fex-team/ueditor](http://github.com/f ueditor 第三方插件贡献 wiki : [第三方插件贡献规范](http://ueditor.baidu.com/website/thirdproject.html) +ueditor 贡献代码规范(javascript): [javascript规范](https://github.com/fex-team/styleguide/blob/master/javascript.md) + ## 3 第三方贡献 ueditor for nodejs 参考[https://github.com/netpi/ueditor](https://github.com/netpi/ueditor) From 196172692fc8554a7bc060ecf72493190c1ee940 Mon Sep 17 00:00:00 2001 From: Phinome Date: Wed, 11 May 2016 22:21:17 +0800 Subject: [PATCH 45/79] update .file-title height for firefox update .file-title height for firefox , ISSUE = 2769 --- dialogs/attachment/attachment.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dialogs/attachment/attachment.css b/dialogs/attachment/attachment.css index e9d11af25..21142fe5a 100755 --- a/dialogs/attachment/attachment.css +++ b/dialogs/attachment/attachment.css @@ -544,7 +544,7 @@ padding: 0 3px; margin: 3px 0 0 0; font-size: 12px; - height: 13px; + height: 15px; color: #555555; text-align: center; width: 107px; @@ -678,4 +678,4 @@ i.file-preview.file-type-bmp, i.file-preview.file-type-png, i.file-preview.file-type-psd{ background-position: -140px center; -} \ No newline at end of file +} From db69aa0163cadfb17db561e447f4f6f74fe76d63 Mon Sep 17 00:00:00 2001 From: sjshare Date: Mon, 16 May 2016 13:39:21 +0800 Subject: [PATCH 46/79] =?UTF-8?q?=E4=BF=AE=E6=94=B9image.js=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E7=89=87=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改本地图片上传,当上传文件出现超出大小或格式不允许时,移除文件后文件总数及总大小出错问题。 --- dialogs/image/image.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dialogs/image/image.js b/dialogs/image/image.js index d0257bded..c79062623 100644 --- a/dialogs/image/image.js +++ b/dialogs/image/image.js @@ -665,8 +665,10 @@ }); uploader.on('fileDequeued', function (file) { - fileCount--; - fileSize -= file.size; + if (file.ext && acceptExtensions.indexOf(file.ext.toLowerCase()) != -1 && file.size <= imageMaxSize) { + fileCount--; + fileSize -= file.size; + } removeFile(file); updateTotalProgress(); From ed5b7ef8240d01d34d5cfb49689c22aea6aae7d0 Mon Sep 17 00:00:00 2001 From: sjshare Date: Mon, 16 May 2016 13:48:00 +0800 Subject: [PATCH 47/79] =?UTF-8?q?=E4=BF=AE=E6=94=B9attachment.js=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改本地文件上传,当上传文件超出大小或格式不允许时,点击移除后文件总数及总大小出错bug。 --- dialogs/attachment/attachment.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/dialogs/attachment/attachment.js b/dialogs/attachment/attachment.js index da73cc9d8..5e73d5e97 100755 --- a/dialogs/attachment/attachment.js +++ b/dialogs/attachment/attachment.js @@ -439,8 +439,10 @@ } uploader.on('fileQueued', function (file) { - fileCount++; - fileSize += file.size; + if (file.ext && acceptExtensions.indexOf(file.ext.toLowerCase()) != -1 && file.size <= fileMaxSize) { + fileCount++; + fileSize += file.size; + } if (fileCount === 1) { $placeHolder.addClass('element-invisible'); @@ -451,8 +453,10 @@ }); uploader.on('fileDequeued', function (file) { - fileCount--; - fileSize -= file.size; + if (file.ext && acceptExtensions.indexOf(file.ext.toLowerCase()) != -1 && file.size <= fileMaxSize) { + fileCount--; + fileSize -= file.size; + } removeFile(file); updateTotalProgress(); @@ -753,4 +757,4 @@ }; -})(); \ No newline at end of file +})(); From 929a79116042821be3a7502995b546768d2ebcf3 Mon Sep 17 00:00:00 2001 From: Dafrok Date: Wed, 1 Jun 2016 16:27:25 +0800 Subject: [PATCH 48/79] =?UTF-8?q?=E6=9B=B4=E6=94=B9gruntfile=E5=92=8Cpacka?= =?UTF-8?q?ge.json=E4=B8=AD=E8=BF=87=E6=97=B6=E7=9A=84=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gruntfile.js | 8 ++++---- package.json | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 34a300eb2..fc95f2c5d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -96,7 +96,7 @@ module.exports = function (grunt) { ext: '.min.css' } }, - closurecompiler: { + uglify: { dist: { options: { banner: '/*!\n * ' + packageJson.name + '\n * version: ' + packageJson.version + '\n * build: <%= new Date() %>\n */' @@ -224,14 +224,14 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-text-replace'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-cssmin'); - grunt.loadNpmTasks('grunt-closurecompiler'); + grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-transcoding'); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.registerTask('default', 'UEditor build', function () { - var tasks = [ 'concat', 'cssmin', 'closurecompiler', 'copy:base', 'copy:' + server, 'copy:demo', 'replace:demo', 'clean' ]; + var tasks = [ 'concat', 'cssmin', 'uglify', 'copy:base', 'copy:' + server, 'copy:demo', 'replace:demo', 'clean' ]; if (encode === 'gbk') { tasks.push('replace:fileEncode'); @@ -274,4 +274,4 @@ module.exports = function (grunt) { } -}; \ No newline at end of file +}; diff --git a/package.json b/package.json index 400d8aa83..74f9e806c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "ueditor", "title": "ueditor", "description": "UEditor富文本web编辑器", - "version": "1.4.3", + "version": "2.0.0", "homepage": "http://ueditor.baidu.com/", "author": { "name": "f-cube @ FEX", @@ -15,7 +15,8 @@ "keywords": [ "ueditor", "web editor", - "javascript" + "javascript", + "rich editor" ], "bugs": { "url": "https://github.com/fex-team/ueditor/issues" @@ -24,7 +25,6 @@ "grunt": "~0.4.1", "grunt-contrib-concat": "~0.3.0", "grunt-contrib-cssmin": "~0.6.0", - "grunt-closurecompiler": "~0.9.9", "grunt-contrib-copy": "~0.4.0", "grunt-transcoding": "~0.1.1", "grunt-text-replace": "~0.3.9", From 70d1c643f0dac7bd0078beb9aa0c76c8de70652a Mon Sep 17 00:00:00 2001 From: Dafrok Date: Thu, 2 Jun 2016 11:54:06 +0800 Subject: [PATCH 49/79] =?UTF-8?q?=E4=BF=AE=E6=94=B9package.json=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0uglify=E7=9A=84dependence?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 74f9e806c..79df27925 100644 --- a/package.json +++ b/package.json @@ -23,12 +23,13 @@ }, "dependencies": { "grunt": "~0.4.1", + "grunt-contrib-clean": "~0.5.0", "grunt-contrib-concat": "~0.3.0", - "grunt-contrib-cssmin": "~0.6.0", "grunt-contrib-copy": "~0.4.0", - "grunt-transcoding": "~0.1.1", + "grunt-contrib-cssmin": "~0.6.0", + "grunt-contrib-uglify": "^1.0.1", "grunt-text-replace": "~0.3.9", - "grunt-contrib-clean": "~0.5.0" + "grunt-transcoding": "~0.1.1" }, "devDependencies": { "grunt": "~0.4.1" From 689030e0a7af8cf0ccd471f37dd7e70d88f4a0e7 Mon Sep 17 00:00:00 2001 From: tangtanglove Date: Mon, 20 Jun 2016 18:15:41 +0800 Subject: [PATCH 50/79] Update Uploader.class.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit iconv函数无法将unicode转换为utf-8(会有警告),更换为mb_convert_encoding函数 --- php/Uploader.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/Uploader.class.php b/php/Uploader.class.php index 6332c9765..1966ab353 100755 --- a/php/Uploader.class.php +++ b/php/Uploader.class.php @@ -61,7 +61,7 @@ public function __construct($fileField, $config, $type = "upload") $this->upFile(); } - $this->stateMap['ERROR_TYPE_NOT_ALLOWED'] = iconv('unicode', 'utf-8', $this->stateMap['ERROR_TYPE_NOT_ALLOWED']); + $this->stateMap['ERROR_TYPE_NOT_ALLOWED'] = mb_convert_encoding($this->stateMap['ERROR_TYPE_NOT_ALLOWED'], 'utf-8', 'auto'); } /** From a83d116501ff00424e9a3108291546f33812d912 Mon Sep 17 00:00:00 2001 From: Phinome Date: Sat, 16 Jul 2016 23:00:14 +0800 Subject: [PATCH 51/79] Update ISSUE_TEMPLATE.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加声明 --- ISSUE_TEMPLATE.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index e81009ddb..7ffa3545f 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -1,3 +1,5 @@ +**声明:如果不看该说明,只在标题中描述问题,一律忽略** + **首先**,感谢各位使用 UEditor,并来到这儿提 `ISSUE`。 **其次**,在回答大量用户提出的 `ISSUE` 的过程中,我们发现需要建立一个提 `ISSUE` 的规则, From 6b7aaf2b2b8c28645a15b601f04a2d587543d9f3 Mon Sep 17 00:00:00 2001 From: phinome Date: Fri, 19 Aug 2016 20:39:40 +0800 Subject: [PATCH 52/79] add FAQ wiki --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a929c522b..1df6b7c43 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ Get Started ===== +> 鉴于目前 ISSUE 较多而维护时间较少,更为重要的是有很多重复的问题,因此特意整理了一份常见问题的 [FAQ Wiki](https://github.com/fex-team/ueditor/wiki/FAQ)。 + ## ueditor富文本编辑器介绍 UEditor是由百度web前端研发部开发所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点,开源基于MIT协议,允许自由使用和修改代码。 From c79d8acb71109ac381543c2697d6da3cd9f79e4e Mon Sep 17 00:00:00 2001 From: Phinome Date: Sun, 11 Dec 2016 20:13:36 +0800 Subject: [PATCH 53/79] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1df6b7c43..58bf63a1e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Get Started ===== -> 鉴于目前 ISSUE 较多而维护时间较少,更为重要的是有很多重复的问题,因此特意整理了一份常见问题的 [FAQ Wiki](https://github.com/fex-team/ueditor/wiki/FAQ)。 +> 鉴于目前 ISSUE 较多而维护时间较少,且在进行后续的版本更新,目前暂时关闭 ISSUE,若社区有人跟进,欢迎和我们联系。重复的问题,请参阅常见问题的 [FAQ Wiki](https://github.com/fex-team/ueditor/wiki/FAQ)。 ## ueditor富文本编辑器介绍 From 84d9f7881938b91d4d0c0f54ed4bf9f775903b53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8B=BC=E6=97=8F=E5=B0=8F=E7=8B=88?= <1340641314@qq.com> Date: Fri, 23 Dec 2016 14:55:20 +0800 Subject: [PATCH 54/79] Update buttonicon.css MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复在webpack下的bug: Module not found: Error: Cannot resolve 'file' or 'directory' ../images/charts.png in --- themes/default/_css/buttonicon.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/default/_css/buttonicon.css b/themes/default/_css/buttonicon.css index 38f059e46..a4b242979 100755 --- a/themes/default/_css/buttonicon.css +++ b/themes/default/_css/buttonicon.css @@ -403,7 +403,7 @@ } .edui-default .edui-for-charts .edui-icon { - background: url( ../images/charts.png ) no-repeat 2px 3px!important; + background: url(../images/charts.png) no-repeat 2px 3px!important; } .edui-default .edui-for-inserttitlecol .edui-icon { @@ -416,4 +416,4 @@ .edui-default .edui-for-simpleupload .edui-icon { background-position: -380px 0px; -} \ No newline at end of file +} From 52d1fa74c434595cc5133a2deb7b33bea4aee6f0 Mon Sep 17 00:00:00 2001 From: Boatman Date: Thu, 9 Feb 2017 17:30:11 +0800 Subject: [PATCH 55/79] =?UTF-8?q?=E4=BF=AE=E6=94=B9htmlParser=E7=9A=84?= =?UTF-8?q?=E6=AD=A3=E5=88=99=E8=A1=A8=E8=BE=BE=E5=BC=8F,=E5=A2=9E?= =?UTF-8?q?=E5=BC=BAhtml=E8=A7=A3=E6=9E=90=E7=9A=84=E5=AE=B9=E9=94=99?= =?UTF-8?q?=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 现有的htmlParser 节点正则表达式无法匹配: 修改正则表达式: --- _src/core/htmlparser.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/_src/core/htmlparser.js b/_src/core/htmlparser.js index 3d242fc16..375968111 100644 --- a/_src/core/htmlparser.js +++ b/_src/core/htmlparser.js @@ -26,7 +26,10 @@ var htmlparser = UE.htmlparser = function (htmlstr,ignoreBlank) { //todo 原来的方式 [^"'<>\/] 有\/就不能配对上这样的标签了 //先去掉了,加上的原因忘了,这里先记录 - var re_tag = /<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)-->)|(?:([^\s\/<>]+)\s*((?:(?:"[^"]*")|(?:'[^']*')|[^"'<>])*)\/?>))/g, + //var re_tag = /<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)-->)|(?:([^\s\/<>]+)\s*((?:(?:"[^"]*")|(?:'[^']*')|[^"'<>])*)\/?>))/g, + //以上的正则表达式无法匹配: + //修改为如下正则表达式: + var re_tag = /<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)-->)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g, re_attr = /([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g; //ie下取得的html可能会有\n存在,要去掉,在处理replace(/[\t\r\n]*/g,'');代码高量的\n不能去除 @@ -194,4 +197,4 @@ var htmlparser = UE.htmlparser = function (htmlstr,ignoreBlank) { text(currentParent, htmlstr.slice(nextIndex)); } return root; -}; \ No newline at end of file +}; From 5df3d0a7d7c78b69c6e3d6d9e442f88a2b504381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=B3=E5=BF=97=E5=87=AF?=Date: Fri, 26 May 2017 19:58:00 +0800 Subject: [PATCH 56/79] Fixed autoheight Plugin onscroll error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复 autoheight 插件在 UE 实例销毁后,因 onscroll 事件监听没有正常取消监听导致 me.window 报 undefined 错误的问题 --- _src/plugins/autoheight.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/_src/plugins/autoheight.js b/_src/plugins/autoheight.js index 6d2d0f11a..40950cb11 100644 --- a/_src/plugins/autoheight.js +++ b/_src/plugins/autoheight.js @@ -53,6 +53,7 @@ UE.plugins['autoheight'] = function () { isFullscreen = f }); me.addListener('destroy', function () { + domUtils.un(me.window, "scroll", fixedScrollTop); me.removeListener('contentchange afterinserthtml keyup mouseup',adjustHeight) }); me.enableAutoHeight = function () { @@ -99,17 +100,20 @@ UE.plugins['autoheight'] = function () { }); //修复内容过多时,回到顶部,顶部内容被工具栏遮挡问题 - var lastScrollY; - window.onscroll = function(){ - if(lastScrollY === null){ - lastScrollY = this.scrollY - }else if(this.scrollY == 0 && lastScrollY != 0){ - me.window.scrollTo(0,0); - lastScrollY = null; - } - } + domUtils.on(me.window, "scroll", fixedScrollTop); }); + var lastScrollY; + + function fixedScrollTop() { + if(!me.window) return; + if(lastScrollY === null){ + lastScrollY = me.window.scrollY + }else if(me.window.scrollY == 0 && lastScrollY != 0){ + me.window.scrollTo(0,0); + lastScrollY = null; + } + } }; From 039c5ccebfaad6cdaaa1e22c212d45fe96780826 Mon Sep 17 00:00:00 2001 From: woleicom <572962673@qq.com> Date: Tue, 13 Jun 2017 15:02:00 +0800 Subject: [PATCH 57/79] Create image.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更改图片尺寸大小bug --- dialogs/image/image.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dialogs/image/image.js b/dialogs/image/image.js index c79062623..a7e822ea5 100644 --- a/dialogs/image/image.js +++ b/dialogs/image/image.js @@ -177,22 +177,22 @@ domUtils.on($G("title"), 'keyup', updatePreview); domUtils.on($G("width"), 'keyup', function(){ - updatePreview(); if(locker.checked) { var proportion =locker.getAttribute('data-proportion'); $G('height').value = Math.round(this.value / proportion); } else { _this.updateLocker(); } + updatePreview(); }); domUtils.on($G("height"), 'keyup', function(){ - updatePreview(); if(locker.checked) { var proportion =locker.getAttribute('data-proportion'); $G('width').value = Math.round(this.value * proportion); } else { _this.updateLocker(); } + updatePreview(); }); domUtils.on($G("lock"), 'change', function(){ var proportion = parseInt($G("width").value) /parseInt($G("height").value); From c036aa821f5015dc3c300fc8a3cdc50df862edad Mon Sep 17 00:00:00 2001 From: Phinome Date: Tue, 13 Jun 2017 23:00:05 +0800 Subject: [PATCH 58/79] prettier format file --- Gruntfile.js | 552 ++-- _parse/background.js | 31 +- _parse/charts.js | 553 ++-- _parse/insertcode.js | 85 +- _parse/list.js | 315 +- _parse/parse.js | 676 ++-- _parse/table.js | 348 +- _parse/video.js | 64 +- _src/adapter/autosave.js | 31 +- _src/adapter/editor.js | 1758 +++++----- _src/adapter/editorui.js | 1780 +++++----- _src/adapter/message.js | 115 +- _src/api.js | 2 +- _src/core/Editor.defaultoptions.js | 59 +- _src/core/Editor.js | 3197 +++++++++--------- _src/core/EventBase.js | 337 +- _src/core/Range.js | 3833 ++++++++++----------- _src/core/Selection.js | 806 ++--- _src/core/ajax.js | 540 +-- _src/core/browser.js | 521 +-- _src/core/domUtils.js | 4961 ++++++++++++++-------------- _src/core/dtd.js | 613 +++- _src/core/filternode.js | 256 +- _src/core/filterword.js | 415 +-- _src/core/htmlparser.js | 385 ++- _src/core/keymap.js | 70 +- _src/core/loadconfig.js | 118 +- _src/core/localstorage.js | 239 +- _src/core/node.js | 946 +++--- _src/core/plugin.js | 140 +- _src/core/utils.js | 2468 +++++++------- _src/editor.js | 30 +- _src/plugins/anchor.js | 186 +- _src/plugins/autofloat.js | 283 +- _src/plugins/autoheight.js | 244 +- _src/plugins/autolink.js | 395 ++- _src/plugins/autosave.js | 230 +- _src/plugins/autosubmit.js | 78 +- _src/plugins/autotypeset.js | 675 ++-- _src/plugins/autoupload.js | 378 ++- _src/plugins/background.js | 237 +- _src/plugins/basestyle.js | 300 +- _src/plugins/blockquote.js | 360 +- _src/plugins/catchremoteimage.js | 224 +- _src/plugins/charts.js | 227 +- _src/plugins/cleardoc.js | 72 +- _src/plugins/contextmenu.js | 1032 +++--- _src/plugins/convertcase.js | 113 +- _src/plugins/copy.js | 137 +- _src/plugins/customstyle.js | 327 +- _src/plugins/defaultfilter.js | 523 +-- _src/plugins/directionality.js | 253 +- _src/plugins/dragdrop.js | 121 +- _src/plugins/elementpath.js | 85 +- _src/plugins/enterkey.js | 375 ++- _src/plugins/fiximgclick.js | 625 ++-- _src/plugins/font.js | 771 ++--- _src/plugins/formatmatch.js | 205 +- _src/plugins/horizontal.js | 168 +- _src/plugins/iframe.js | 18 +- _src/plugins/image.js | 390 ++- _src/plugins/indent.js | 25 +- _src/plugins/insertcode.js | 1038 +++--- _src/plugins/insertfile.js | 143 +- _src/plugins/inserthtml.js | 441 +-- _src/plugins/insertparagraph.js | 47 +- _src/plugins/justify.js | 171 +- _src/plugins/keystrokes.js | 459 +-- _src/plugins/lineheight.js | 43 +- _src/plugins/link.js | 266 +- _src/plugins/list.js | 2402 +++++++------- _src/plugins/music.js | 146 +- _src/plugins/pagebreak.js | 285 +- _src/plugins/paragraph.js | 306 +- _src/plugins/paste.js | 576 ++-- _src/plugins/preview.js | 30 +- _src/plugins/print.js | 11 +- _src/plugins/puretxtpaste.js | 149 +- _src/plugins/removeformat.js | 321 +- _src/plugins/rowspacing.js | 55 +- _src/plugins/scrawl.js | 8 +- _src/plugins/searchreplace.js | 408 +-- _src/plugins/section.js | 522 +-- _src/plugins/selectall.js | 48 +- _src/plugins/serverparam.js | 65 +- _src/plugins/shortcutmenu.js | 110 +- _src/plugins/simpleupload.js | 368 ++- _src/plugins/snapscreen.js | 157 +- _src/plugins/source.js | 530 +-- _src/plugins/table.action.js | 3434 ++++++++++--------- _src/plugins/table.cmds.js | 1853 ++++++----- _src/plugins/table.core.js | 2276 +++++++------ _src/plugins/table.sort.js | 320 +- _src/plugins/template.js | 62 +- _src/plugins/time.js | 47 +- _src/plugins/undo.js | 528 +-- _src/plugins/video.js | 229 +- _src/plugins/webapp.js | 170 +- _src/plugins/wordcount.js | 44 +- _src/plugins/wordimage.js | 91 +- _src/ui/autotypesetbutton.js | 249 +- _src/ui/autotypesetpicker.js | 224 +- _src/ui/breakline.js | 35 +- _src/ui/button.js | 139 +- _src/ui/cellalignpicker.js | 175 +- _src/ui/colorbutton.js | 109 +- _src/ui/colorpicker.js | 158 +- _src/ui/combox.js | 179 +- _src/ui/dialog.js | 843 ++--- _src/ui/mask.js | 100 +- _src/ui/menu.js | 520 +-- _src/ui/menubutton.js | 69 +- _src/ui/message.js | 145 +- _src/ui/multiMenu.js | 72 +- _src/ui/pastepicker.js | 125 +- _src/ui/popup.js | 509 +-- _src/ui/separator.js | 35 +- _src/ui/shortcutmenu.js | 461 +-- _src/ui/splitbutton.js | 178 +- _src/ui/stateful.js | 216 +- _src/ui/tablebutton.js | 61 +- _src/ui/tablepicker.js | 179 +- _src/ui/toolbar.js | 96 +- _src/ui/ui.js | 2 +- _src/ui/uibase.js | 155 +- _src/ui/uiutils.js | 514 +-- ueditor.config.js | 940 +++--- ueditor.parse.js | 115 +- 128 files changed, 31794 insertions(+), 28269 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index fc95f2c5d..6a2d90c75 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,277 +1,303 @@ -'use strict'; - -module.exports = function (grunt) { - - var fs = require("fs"), - Util = { - - jsBasePath: '_src/', - parseBasePath: '_parse/', - cssBasePath: 'themes/default/_css/', - - 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 ] = basePath + filepath; - }); - - return sources; - }, - - fetchStyles: function () { - - var sources = fs.readFileSync(this.cssBasePath + "ueditor.css"), - filepath = null, - pattern = /@import\s+([^;]+)*;/g, - src = []; - - while (filepath = pattern.exec(sources)) { - src.push(this.cssBasePath + filepath[ 1 ].replace(/'|"/g, "")); - } - - return src; - - } +"use strict"; + +module.exports = function(grunt) { + var fs = require("fs"), + Util = { + jsBasePath: "_src/", + parseBasePath: "_parse/", + cssBasePath: "themes/default/_css/", + + 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] = basePath + filepath; + }); + + return sources; + }, + + fetchStyles: function() { + var sources = fs.readFileSync(this.cssBasePath + "ueditor.css"), + filepath = null, + pattern = /@import\s+([^;]+)*;/g, + src = []; + + while ((filepath = pattern.exec(sources))) { + src.push(this.cssBasePath + filepath[1].replace(/'|"/g, "")); + } + return src; + } + }, + packageJson = grunt.file.readJSON("package.json"), + server = grunt.option("server") || "php", + encode = grunt.option("encode") || "utf8", + disDir = "dist/", + banner = + "/*!\n * " + + packageJson.name + + "\n * version: " + + packageJson.version + + "\n * build: <%= new Date() %>\n */\n\n"; + + //init + (function() { + server = typeof server === "string" ? server.toLowerCase() : "php"; + encode = typeof encode === "string" ? encode.toLowerCase() : "utf8"; + + disDir = "dist/" + encode + "-" + server + "/"; + })(); + + grunt.initConfig({ + pkg: packageJson, + concat: { + js: { + options: { + banner: "/*!\n * " + + packageJson.name + + "\n * version: " + + packageJson.version + + "\n * build: <%= new Date() %>\n */\n\n" + + "(function(){\n\n", + footer: "\n\n})();\n", + process: function(src, s) { + var filename = s.substr(s.indexOf("/") + 1); + return ( + "// " + filename + "\n" + src.replace("/_css/", "/css/") + "\n" + ); + } }, - packageJson = grunt.file.readJSON('package.json'), - server = grunt.option('server') || 'php', - encode = grunt.option('encode') || 'utf8', - disDir = "dist/", - banner = '/*!\n * ' + packageJson.name + '\n * version: ' + packageJson.version + '\n * build: <%= new Date() %>\n */\n\n'; - - //init - (function () { - - server = typeof server === "string" ? server.toLowerCase() : 'php'; - encode = typeof encode === "string" ? encode.toLowerCase() : 'utf8'; - - disDir = 'dist/' + encode + '-' + server + '/'; - - })(); - - grunt.initConfig({ - pkg: packageJson, - concat: { - js: { - options: { - banner: '/*!\n * ' + packageJson.name + '\n * version: ' + packageJson.version + '\n * build: <%= new Date() %>\n */\n\n' + - '(function(){\n\n', - footer: '\n\n})();\n', - process: function (src, s) { - var filename = s.substr(s.indexOf('/') + 1); - return '// ' + filename + '\n' + src.replace('/_css/', '/css/') + '\n'; - } - }, - src: Util.fetchScripts("_examples/editor_api.js", Util.jsBasePath), - dest: disDir + packageJson.name + '.all.js' - }, - parse: { - options: { - banner: '/*!\n * ' + packageJson.name + ' parse\n * version: ' + packageJson.version + '\n * build: <%= new Date() %>\n */\n\n' + - '(function(){\n\n', - footer: '\n\n})();\n' - }, - src: Util.fetchScripts("ueditor.parse.js", Util.parseBasePath), - dest: disDir + packageJson.name + '.parse.js' - }, - css: { - src: Util.fetchStyles(), - dest: disDir + 'themes/default/css/ueditor.css' - } + src: Util.fetchScripts("_examples/editor_api.js", Util.jsBasePath), + dest: disDir + packageJson.name + ".all.js" + }, + parse: { + options: { + banner: "/*!\n * " + + packageJson.name + + " parse\n * version: " + + packageJson.version + + "\n * build: <%= new Date() %>\n */\n\n" + + "(function(){\n\n", + footer: "\n\n})();\n" }, - cssmin: { - options: { - banner: banner - }, - files: { - expand: true, - cwd: disDir + 'themes/default/css/', - src: ['*.css', '!*.min.css'], - dest: disDir + 'themes/default/css/', - ext: '.min.css' - } + src: Util.fetchScripts("ueditor.parse.js", Util.parseBasePath), + dest: disDir + packageJson.name + ".parse.js" + }, + css: { + src: Util.fetchStyles(), + dest: disDir + "themes/default/css/ueditor.css" + } + }, + cssmin: { + options: { + banner: banner + }, + files: { + expand: true, + cwd: disDir + "themes/default/css/", + src: ["*.css", "!*.min.css"], + dest: disDir + "themes/default/css/", + ext: ".min.css" + } + }, + uglify: { + dist: { + options: { + banner: "/*!\n * " + + packageJson.name + + "\n * version: " + + packageJson.version + + "\n * build: <%= new Date() %>\n */" }, - uglify: { - dist: { - options: { - banner: '/*!\n * ' + packageJson.name + '\n * version: ' + packageJson.version + '\n * build: <%= new Date() %>\n */' - }, - src: disDir + '<%= pkg.name %>.all.js', - dest: disDir + '<%= pkg.name %>.all.min.js' - }, - parse: { - options: { - banner: '/*!\n * ' + packageJson.name + ' parse\n * version: ' + packageJson.version + '\n * build: <%= new Date() %>\n */' - }, - src: disDir + '<%= pkg.name %>.parse.js', - dest: disDir + '<%= pkg.name %>.parse.min.js' - } + src: disDir + "<%= pkg.name %>.all.js", + dest: disDir + "<%= pkg.name %>.all.min.js" + }, + parse: { + options: { + banner: "/*!\n * " + + packageJson.name + + " parse\n * version: " + + packageJson.version + + "\n * build: <%= new Date() %>\n */" }, - copy: { - base: { - files: [ - { - - src: [ '*.html', 'themes/iframe.css', 'themes/default/dialogbase.css', 'themes/default/images/**', 'dialogs/**', 'lang/**', 'third-party/**' ], - dest: disDir - - } - ] - }, - demo: { - files: [ - { - src: '_examples/completeDemo.html', - dest: disDir + 'index.html' - } - ] - }, - php: { - - expand: true, - src: 'php/**', - dest: disDir - - }, - asp: { - - expand: true, - src: 'asp/**', - dest: disDir - - }, - jsp: { - - expand: true, - src: 'jsp/**', - dest: disDir - - }, - net: { - - expand: true, - src: 'net/**', - dest: disDir - - } - }, - transcoding: { - - options: { - charset: encode - }, - src: [disDir + '**/*.html', disDir + '**/*.js', disDir + '**/*.css', disDir + '**/*.json', disDir + '**/*.jsp', disDir + '**/*.asp'] - - }, - replace: { - - fileEncode: { - src: [ disDir + '**/*.html', disDir + 'dialogs/**/*.js', disDir + '**/*.css', disDir + '**/*.php', disDir + '**/*.jsp', disDir + '**/*.ashx', disDir + '**/*.asp' ], - overwrite: true, - replacements: [ - { - from: /utf-8/gi, - to: 'gbk' - } - ] - }, - demo: { - src: disDir + 'index.html', - overwrite: true, - replacements: [ - { - from: /\.\.\//gi, - to: '' - }, - { - from: 'editor_api.js', - to: packageJson.name + '.all.min.js' - } - ] - }, - gbkasp: { - src: [ disDir + 'asp/*.asp' ], - overwrite: true, - replacements: [ - { - from: /65001/gi, - to: '936' - } - ] - } - - }, - clean: { - build: { - src: [ - disDir + "jsp/src", - disDir + "*/upload", - disDir + ".DS_Store", - disDir + "**/.DS_Store", - disDir + ".git", - disDir + "**/.git" - ] - } - } - - }); - - grunt.loadNpmTasks('grunt-text-replace'); - grunt.loadNpmTasks('grunt-contrib-concat'); - grunt.loadNpmTasks('grunt-contrib-cssmin'); - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-contrib-copy'); - grunt.loadNpmTasks('grunt-transcoding'); - grunt.loadNpmTasks('grunt-contrib-clean'); - - grunt.registerTask('default', 'UEditor build', function () { - - var tasks = [ 'concat', 'cssmin', 'uglify', 'copy:base', 'copy:' + server, 'copy:demo', 'replace:demo', 'clean' ]; - - if (encode === 'gbk') { - tasks.push('replace:fileEncode'); - if (server === 'asp') { - tasks.push('replace:gbkasp'); - } - } - - tasks.push('transcoding'); - - //config修改 - updateConfigFile(); - - grunt.task.run(tasks); - - }); - - - function updateConfigFile() { - - var filename = 'ueditor.config.js', - file = grunt.file.read(filename), - path = server + "/", - suffix = server === "net" ? ".ashx" : "." + server; + src: disDir + "<%= pkg.name %>.parse.js", + dest: disDir + "<%= pkg.name %>.parse.min.js" + } + }, + copy: { + base: { + files: [ + { + src: [ + "*.html", + "themes/iframe.css", + "themes/default/dialogbase.css", + "themes/default/images/**", + "dialogs/**", + "lang/**", + "third-party/**" + ], + dest: disDir + } + ] + }, + demo: { + files: [ + { + src: "_examples/completeDemo.html", + dest: disDir + "index.html" + } + ] + }, + php: { + expand: true, + src: "php/**", + dest: disDir + }, + asp: { + expand: true, + src: "asp/**", + dest: disDir + }, + jsp: { + expand: true, + src: "jsp/**", + dest: disDir + }, + net: { + expand: true, + src: "net/**", + dest: disDir + } + }, + transcoding: { + options: { + charset: encode + }, + src: [ + disDir + "**/*.html", + disDir + "**/*.js", + disDir + "**/*.css", + disDir + "**/*.json", + disDir + "**/*.jsp", + disDir + "**/*.asp" + ] + }, + replace: { + fileEncode: { + src: [ + disDir + "**/*.html", + disDir + "dialogs/**/*.js", + disDir + "**/*.css", + disDir + "**/*.php", + disDir + "**/*.jsp", + disDir + "**/*.ashx", + disDir + "**/*.asp" + ], + overwrite: true, + replacements: [ + { + from: /utf-8/gi, + to: "gbk" + } + ] + }, + demo: { + src: disDir + "index.html", + overwrite: true, + replacements: [ + { + from: /\.\.\//gi, + to: "" + }, + { + from: "editor_api.js", + to: packageJson.name + ".all.min.js" + } + ] + }, + gbkasp: { + src: [disDir + "asp/*.asp"], + overwrite: true, + replacements: [ + { + from: /65001/gi, + to: "936" + } + ] + } + }, + clean: { + build: { + src: [ + disDir + "jsp/src", + disDir + "*/upload", + disDir + ".DS_Store", + disDir + "**/.DS_Store", + disDir + ".git", + disDir + "**/.git" + ] + } + } + }); + + grunt.loadNpmTasks("grunt-text-replace"); + grunt.loadNpmTasks("grunt-contrib-concat"); + grunt.loadNpmTasks("grunt-contrib-cssmin"); + grunt.loadNpmTasks("grunt-contrib-uglify"); + grunt.loadNpmTasks("grunt-contrib-copy"); + grunt.loadNpmTasks("grunt-transcoding"); + grunt.loadNpmTasks("grunt-contrib-clean"); + + grunt.registerTask("default", "UEditor build", function() { + var tasks = [ + "concat", + "cssmin", + "uglify", + "copy:base", + "copy:" + server, + "copy:demo", + "replace:demo", + "clean" + ]; + + if (encode === "gbk") { + tasks.push("replace:fileEncode"); + if (server === "asp") { + tasks.push("replace:gbkasp"); + } + } - file = file.replace(/php\//ig, path).replace(/\.php/ig, suffix); + tasks.push("transcoding"); - if (encode == 'gbk') { - file = file.replace(/utf-8/gi, 'gbk'); - } + //config修改 + updateConfigFile(); - //写入到dist - if (grunt.file.write(disDir + filename, file)) { + grunt.task.run(tasks); + }); - grunt.log.writeln('config file update success'); + function updateConfigFile() { + var filename = "ueditor.config.js", + file = grunt.file.read(filename), + path = server + "/", + suffix = server === "net" ? ".ashx" : "." + server; - } else { - grunt.log.warn('config file update error'); - } + file = file.replace(/php\//ig, path).replace(/\.php/ig, suffix); + if (encode == "gbk") { + file = file.replace(/utf-8/gi, "gbk"); } + //写入到dist + if (grunt.file.write(disDir + filename, file)) { + grunt.log.writeln("config file update success"); + } else { + grunt.log.warn("config file update error"); + } + } }; diff --git a/_parse/background.js b/_parse/background.js index acc8008ef..246bb0e74 100644 --- a/_parse/background.js +++ b/_parse/background.js @@ -1,16 +1,21 @@ -UE.parse.register('background', function (utils) { - var me = this, - root = me.root, - p = root.getElementsByTagName('p'), - styles; +UE.parse.register("background", function(utils) { + var me = this, + root = me.root, + p = root.getElementsByTagName("p"), + styles; - for (var i = 0,ci; ci = p[i++];) { - styles = ci.getAttribute('data-background'); - if (styles){ - ci.parentNode.removeChild(ci); - } + for (var i = 0, ci; (ci = p[i++]); ) { + styles = ci.getAttribute("data-background"); + if (styles) { + ci.parentNode.removeChild(ci); } + } - //追加默认的表格样式 - styles && utils.cssRule('ueditor_background', me.selector + '{' + styles + '}', document); -}); \ No newline at end of file + //追加默认的表格样式 + styles && + utils.cssRule( + "ueditor_background", + me.selector + "{" + styles + "}", + document + ); +}); diff --git a/_parse/charts.js b/_parse/charts.js index c1339aee2..5dbf41a84 100644 --- a/_parse/charts.js +++ b/_parse/charts.js @@ -1,337 +1,288 @@ -UE.parse.register('charts',function( utils ){ - - utils.cssRule('chartsContainerHeight','.edui-chart-container { height:'+(this.chartContainerHeight||300)+'px}'); - var resourceRoot = this.rootPath, - containers = this.root, - sources = null; - - //不存在指定的根路径, 则直接退出 - if ( !resourceRoot ) { - return; +UE.parse.register("charts", function(utils) { + utils.cssRule( + "chartsContainerHeight", + ".edui-chart-container { height:" + + (this.chartContainerHeight || 300) + + "px}" + ); + var resourceRoot = this.rootPath, + containers = this.root, + sources = null; + + //不存在指定的根路径, 则直接退出 + if (!resourceRoot) { + return; + } + + if ((sources = parseSources())) { + loadResources(); + } + + function parseSources() { + if (!containers) { + return null; } - if ( sources = parseSources() ) { - - loadResources(); - - } - - - function parseSources () { + return extractChartData(containers); + } - if ( !containers ) { - return null; - } - - return extractChartData( containers ); - - } - - /** + /** * 提取数据 */ - function extractChartData ( rootNode ) { - - var data = [], - tables = rootNode.getElementsByTagName( "table" ); - - for ( var i = 0, tableNode; tableNode = tables[ i ]; i++ ) { - - if ( tableNode.getAttribute( "data-chart" ) !== null ) { - - data.push( formatData( tableNode ) ); - - } - - } - - return data.length ? data : null; - + function extractChartData(rootNode) { + var data = [], + tables = rootNode.getElementsByTagName("table"); + + for (var i = 0, tableNode; (tableNode = tables[i]); i++) { + if (tableNode.getAttribute("data-chart") !== null) { + data.push(formatData(tableNode)); + } } - function formatData ( tableNode ) { - - var meta = tableNode.getAttribute( "data-chart" ), - metaConfig = {}, - data = []; + return data.length ? data : null; + } - //提取table数据 - for ( var i = 0, row; row = tableNode.rows[ i ]; i++ ) { + function formatData(tableNode) { + var meta = tableNode.getAttribute("data-chart"), + metaConfig = {}, + data = []; - var rowData = []; + //提取table数据 + for (var i = 0, row; (row = tableNode.rows[i]); i++) { + var rowData = []; - for ( var j = 0, cell; cell = row.cells[ j ]; j++ ) { - - var value = ( cell.innerText || cell.textContent || '' ); - rowData.push( cell.tagName == 'TH' ? value:(value | 0) ); - - } - - data.push( rowData ); - - } - - //解析元信息 - meta = meta.split( ";" ); - for ( var i = 0, metaData; metaData = meta[ i ]; i++ ) { - - metaData = metaData.split( ":" ); - metaConfig[ metaData[ 0 ] ] = metaData[ 1 ]; - - } - - - return { - table: tableNode, - meta: metaConfig, - data: data - }; + for (var j = 0, cell; (cell = row.cells[j]); j++) { + var value = cell.innerText || cell.textContent || ""; + rowData.push(cell.tagName == "TH" ? value : value | 0); + } + data.push(rowData); } - //加载资源 - function loadResources () { - - loadJQuery(); - + //解析元信息 + meta = meta.split(";"); + for (var i = 0, metaData; (metaData = meta[i]); i++) { + metaData = metaData.split(":"); + metaConfig[metaData[0]] = metaData[1]; } - function loadJQuery () { - - //不存在jquery, 则加载jquery - if ( !window.jQuery ) { - - utils.loadFile(document,{ - src : resourceRoot + "/third-party/jquery-1.10.2.min.js", - tag : "script", - type : "text/javascript", - defer : "defer" - },function(){ - - loadHighcharts(); - - }); - - } else { - - loadHighcharts(); - + return { + table: tableNode, + meta: metaConfig, + data: data + }; + } + + //加载资源 + function loadResources() { + loadJQuery(); + } + + function loadJQuery() { + //不存在jquery, 则加载jquery + if (!window.jQuery) { + utils.loadFile( + document, + { + src: resourceRoot + "/third-party/jquery-1.10.2.min.js", + tag: "script", + type: "text/javascript", + defer: "defer" + }, + function() { + loadHighcharts(); } - + ); + } else { + loadHighcharts(); } - - function loadHighcharts () { - - //不存在Highcharts, 则加载Highcharts - if ( !window.Highcharts ) { - - utils.loadFile(document,{ - src : resourceRoot + "/third-party/highcharts/highcharts.js", - tag : "script", - type : "text/javascript", - defer : "defer" - },function(){ - - loadTypeConfig(); - - }); - - } else { - - loadTypeConfig(); - + } + + function loadHighcharts() { + //不存在Highcharts, 则加载Highcharts + if (!window.Highcharts) { + utils.loadFile( + document, + { + src: resourceRoot + "/third-party/highcharts/highcharts.js", + tag: "script", + type: "text/javascript", + defer: "defer" + }, + function() { + loadTypeConfig(); } - + ); + } else { + loadTypeConfig(); } - - //加载图表差异化配置文件 - function loadTypeConfig () { - - utils.loadFile(document,{ - src : resourceRoot + "/dialogs/charts/chart.config.js", - tag : "script", - type : "text/javascript", - defer : "defer" - },function(){ - - render(); - - }); - + } + + //加载图表差异化配置文件 + function loadTypeConfig() { + utils.loadFile( + document, + { + src: resourceRoot + "/dialogs/charts/chart.config.js", + tag: "script", + type: "text/javascript", + defer: "defer" + }, + function() { + render(); + } + ); + } + + //渲染图表 + function render() { + var config = null, + chartConfig = null, + container = null; + + for (var i = 0, len = sources.length; i < len; i++) { + config = sources[i]; + + chartConfig = analysisConfig(config); + + container = createContainer(config.table); + + renderChart(container, typeConfig[config.meta.chartType], chartConfig); } + } - //渲染图表 - function render () { - - var config = null, - chartConfig = null, - container = null; - - for ( var i = 0, len = sources.length; i < len; i++ ) { - - config = sources[ i ]; - - chartConfig = analysisConfig( config ); - - container = createContainer( config.table ); - - renderChart( container, typeConfig[ config.meta.chartType ], chartConfig ); - - } - - - } - - /** + /** * 渲染图表 * @param container 图表容器节点对象 * @param typeConfig 图表类型配置 * @param config 图表通用配置 * */ - function renderChart ( container, typeConfig, config ) { - - - $( container ).highcharts( $.extend( {}, typeConfig, { - - credits: { - enabled: false - }, - exporting: { - enabled: false - }, - title: { - text: config.title, - x: -20 //center - }, - subtitle: { - text: config.subTitle, - x: -20 - }, - xAxis: { - title: { - text: config.xTitle - }, - categories: config.categories - }, - yAxis: { - title: { - text: config.yTitle - }, - plotLines: [{ - value: 0, - width: 1, - color: '#808080' - }] - }, - tooltip: { - enabled: true, - valueSuffix: config.suffix - }, - legend: { - layout: 'vertical', - align: 'right', - verticalAlign: 'middle', - borderWidth: 1 - }, - series: config.series - - } )); - - } - - /** + function renderChart(container, typeConfig, config) { + $(container).highcharts( + $.extend({}, typeConfig, { + credits: { + enabled: false + }, + exporting: { + enabled: false + }, + title: { + text: config.title, + x: -20 //center + }, + subtitle: { + text: config.subTitle, + x: -20 + }, + xAxis: { + title: { + text: config.xTitle + }, + categories: config.categories + }, + yAxis: { + title: { + text: config.yTitle + }, + plotLines: [ + { + value: 0, + width: 1, + color: "#808080" + } + ] + }, + tooltip: { + enabled: true, + valueSuffix: config.suffix + }, + legend: { + layout: "vertical", + align: "right", + verticalAlign: "middle", + borderWidth: 1 + }, + series: config.series + }) + ); + } + + /** * 创建图表的容器 * 新创建的容器会替换掉对应的table对象 * */ - function createContainer ( tableNode ) { - - var container = document.createElement( "div" ); - container.className = "edui-chart-container"; - - tableNode.parentNode.replaceChild( container, tableNode ); - - return container; - - } - - //根据config解析出正确的类别和图表数据信息 - function analysisConfig ( config ) { - - var series = [], - //数据类别 - categories = [], - result = [], - data = config.data, - meta = config.meta; - - //数据对齐方式为相反的方式, 需要反转数据 - if ( meta.dataFormat != "1" ) { - - for ( var i = 0, len = data.length; i < len ; i++ ) { - - for ( var j = 0, jlen = data[ i ].length; j < jlen; j++ ) { - - if ( !result[ j ] ) { - result[ j ] = []; - } - - result[ j ][ i ] = data[ i ][ j ]; - - } - - } - - data = result; - + function createContainer(tableNode) { + var container = document.createElement("div"); + container.className = "edui-chart-container"; + + tableNode.parentNode.replaceChild(container, tableNode); + + return container; + } + + //根据config解析出正确的类别和图表数据信息 + function analysisConfig(config) { + var series = [], + //数据类别 + categories = [], + result = [], + data = config.data, + meta = config.meta; + + //数据对齐方式为相反的方式, 需要反转数据 + if (meta.dataFormat != "1") { + for (var i = 0, len = data.length; i < len; i++) { + for (var j = 0, jlen = data[i].length; j < jlen; j++) { + if (!result[j]) { + result[j] = []; + } + + result[j][i] = data[i][j]; } + } - result = {}; - - //普通图表 - if ( meta.chartType != typeConfig.length - 1 ) { - - categories = data[ 0 ].slice( 1 ); - - for ( var i = 1, curData; curData = data[ i ]; i++ ) { - series.push( { - name: curData[ 0 ], - data: curData.slice( 1 ) - } ); - } - - result.series = series; - result.categories = categories; - result.title = meta.title; - result.subTitle = meta.subTitle; - result.xTitle = meta.xTitle; - result.yTitle = meta.yTitle; - result.suffix = meta.suffix; - - } else { - - var curData = []; - - for ( var i = 1, len = data[ 0 ].length; i < len; i++ ) { - - curData.push( [ data[ 0 ][ i ], data[ 1 ][ i ] | 0 ] ); - - } - - //饼图 - series[ 0 ] = { - type: 'pie', - name: meta.tip, - data: curData - }; - - result.series = series; - result.title = meta.title; - result.suffix = meta.suffix; + data = result; + } - } + result = {}; - return result; + //普通图表 + if (meta.chartType != typeConfig.length - 1) { + categories = data[0].slice(1); + for (var i = 1, curData; (curData = data[i]); i++) { + series.push({ + name: curData[0], + data: curData.slice(1) + }); + } + + result.series = series; + result.categories = categories; + result.title = meta.title; + result.subTitle = meta.subTitle; + result.xTitle = meta.xTitle; + result.yTitle = meta.yTitle; + result.suffix = meta.suffix; + } else { + var curData = []; + + for (var i = 1, len = data[0].length; i < len; i++) { + curData.push([data[0][i], data[1][i] | 0]); + } + + //饼图 + series[0] = { + type: "pie", + name: meta.tip, + data: curData + }; + + result.series = series; + result.title = meta.title; + result.suffix = meta.suffix; } -}); \ No newline at end of file + return result; + } +}); diff --git a/_parse/insertcode.js b/_parse/insertcode.js index e34b9bc55..cda95a354 100644 --- a/_parse/insertcode.js +++ b/_parse/insertcode.js @@ -1,42 +1,49 @@ -UE.parse.register('insertcode',function(utils){ - var pres = this.root.getElementsByTagName('pre'); - if(pres.length){ - if(typeof XRegExp == "undefined"){ - var jsurl,cssurl; - if(this.rootPath !== undefined){ - jsurl = utils.removeLastbs(this.rootPath) + '/third-party/SyntaxHighlighter/shCore.js'; - cssurl = utils.removeLastbs(this.rootPath) + '/third-party/SyntaxHighlighter/shCoreDefault.css'; - }else{ - jsurl = this.highlightJsUrl; - cssurl = this.highlightCssUrl; +UE.parse.register("insertcode", function(utils) { + var pres = this.root.getElementsByTagName("pre"); + if (pres.length) { + if (typeof XRegExp == "undefined") { + var jsurl, cssurl; + if (this.rootPath !== undefined) { + jsurl = + utils.removeLastbs(this.rootPath) + + "/third-party/SyntaxHighlighter/shCore.js"; + cssurl = + utils.removeLastbs(this.rootPath) + + "/third-party/SyntaxHighlighter/shCoreDefault.css"; + } else { + jsurl = this.highlightJsUrl; + cssurl = this.highlightCssUrl; + } + utils.loadFile(document, { + id: "syntaxhighlighter_css", + tag: "link", + rel: "stylesheet", + type: "text/css", + href: cssurl + }); + utils.loadFile( + document, + { + id: "syntaxhighlighter_js", + src: jsurl, + tag: "script", + type: "text/javascript", + defer: "defer" + }, + function() { + utils.each(pres, function(pi) { + if (pi && /brush/i.test(pi.className)) { + SyntaxHighlighter.highlight(pi); } - utils.loadFile(document,{ - id : "syntaxhighlighter_css", - tag : "link", - rel : "stylesheet", - type : "text/css", - href : cssurl - }); - utils.loadFile(document,{ - id : "syntaxhighlighter_js", - src : jsurl, - tag : "script", - type : "text/javascript", - defer : "defer" - },function(){ - utils.each(pres,function(pi){ - if(pi && /brush/i.test(pi.className)){ - SyntaxHighlighter.highlight(pi); - } - }); - }); - }else{ - utils.each(pres,function(pi){ - if(pi && /brush/i.test(pi.className)){ - SyntaxHighlighter.highlight(pi); - } - }); + }); } + ); + } else { + utils.each(pres, function(pi) { + if (pi && /brush/i.test(pi.className)) { + SyntaxHighlighter.highlight(pi); + } + }); } - -}); \ No newline at end of file + } +}); diff --git a/_parse/list.js b/_parse/list.js index 061b9e8fd..f50541928 100644 --- a/_parse/list.js +++ b/_parse/list.js @@ -1,94 +1,235 @@ -UE.parse.register('list',function(utils){ - var customCss = [], - customStyle = { - 'cn' : 'cn-1-', - 'cn1' : 'cn-2-', - 'cn2' : 'cn-3-', - 'num' : 'num-1-', - 'num1' : 'num-2-', - 'num2' : 'num-3-', - 'dash' : 'dash', - 'dot' : 'dot' - }; +UE.parse.register("list", function(utils) { + var customCss = [], + customStyle = { + cn: "cn-1-", + cn1: "cn-2-", + cn2: "cn-3-", + num: "num-1-", + num1: "num-2-", + num2: "num-3-", + dash: "dash", + dot: "dot" + }; + utils.extend(this, { + liiconpath: "http://bs.baidu.com/listicon/", + listDefaultPaddingLeft: "20" + }); - utils.extend(this,{ - liiconpath : 'http://bs.baidu.com/listicon/', - listDefaultPaddingLeft : '20' - }); - - var root = this.root, - ols = root.getElementsByTagName('ol'), - uls = root.getElementsByTagName('ul'), - selector = this.selector; - - if(ols.length){ - applyStyle.call(this,ols); - } + var root = this.root, + ols = root.getElementsByTagName("ol"), + uls = root.getElementsByTagName("ul"), + selector = this.selector; - if(uls.length){ - applyStyle.call(this,uls); - } + if (ols.length) { + applyStyle.call(this, ols); + } - if(ols.length || uls.length){ - customCss.push(selector +' .list-paddingleft-1{padding-left:0}'); - customCss.push(selector +' .list-paddingleft-2{padding-left:'+ this.listDefaultPaddingLeft+'px}'); - customCss.push(selector +' .list-paddingleft-3{padding-left:'+ this.listDefaultPaddingLeft*2+'px}'); + if (uls.length) { + applyStyle.call(this, uls); + } - utils.cssRule('list', selector +' ol,'+selector +' ul{margin:0;padding:0;}\n' + selector + ' li{clear:both;}\n'+customCss.join('\n'), document); - } - function applyStyle(nodes){ - var T = this; - utils.each(nodes,function(list){ - if(list.className && /custom_/i.test(list.className)){ - var listStyle = list.className.match(/custom_(\w+)/)[1]; - if(listStyle == 'dash' || listStyle == 'dot'){ - utils.pushItem(customCss,selector +' li.list-' + customStyle[listStyle] + '{background-image:url(' + T.liiconpath +customStyle[listStyle]+'.gif)}'); - utils.pushItem(customCss,selector +' ul.custom_'+listStyle+'{list-style:none;} '+ selector +' ul.custom_'+listStyle+' li{background-position:0 3px;background-repeat:no-repeat}'); + if (ols.length || uls.length) { + customCss.push(selector + " .list-paddingleft-1{padding-left:0}"); + customCss.push( + selector + + " .list-paddingleft-2{padding-left:" + + this.listDefaultPaddingLeft + + "px}" + ); + customCss.push( + selector + + " .list-paddingleft-3{padding-left:" + + this.listDefaultPaddingLeft * 2 + + "px}" + ); - }else{ - var index = 1; - utils.each(list.childNodes,function(li){ - if(li.tagName == 'LI'){ - utils.pushItem(customCss,selector + ' li.list-' + customStyle[listStyle] + index + '{background-image:url(' + T.liiconpath + 'list-'+customStyle[listStyle] +index + '.gif)}'); - index++; - } - }); - utils.pushItem(customCss,selector + ' ol.custom_'+listStyle+'{list-style:none;}'+selector+' ol.custom_'+listStyle+' li{background-position:0 3px;background-repeat:no-repeat}'); - } - switch(listStyle){ - case 'cn': - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-1{padding-left:25px}'); - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-2{padding-left:40px}'); - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-3{padding-left:55px}'); - break; - case 'cn1': - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-1{padding-left:30px}'); - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-2{padding-left:40px}'); - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-3{padding-left:55px}'); - break; - case 'cn2': - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-1{padding-left:40px}'); - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-2{padding-left:55px}'); - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-3{padding-left:68px}'); - break; - case 'num': - case 'num1': - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-1{padding-left:25px}'); - break; - case 'num2': - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-1{padding-left:35px}'); - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-2{padding-left:40px}'); - break; - case 'dash': - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft{padding-left:35px}'); - break; - case 'dot': - utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft{padding-left:20px}'); - } + utils.cssRule( + "list", + selector + + " ol," + + selector + + " ul{margin:0;padding:0;}\n" + + selector + + " li{clear:both;}\n" + + customCss.join("\n"), + document + ); + } + function applyStyle(nodes) { + var T = this; + utils.each(nodes, function(list) { + if (list.className && /custom_/i.test(list.className)) { + var listStyle = list.className.match(/custom_(\w+)/)[1]; + if (listStyle == "dash" || listStyle == "dot") { + utils.pushItem( + customCss, + selector + + " li.list-" + + customStyle[listStyle] + + "{background-image:url(" + + T.liiconpath + + customStyle[listStyle] + + ".gif)}" + ); + utils.pushItem( + customCss, + selector + + " ul.custom_" + + listStyle + + "{list-style:none;} " + + selector + + " ul.custom_" + + listStyle + + " li{background-position:0 3px;background-repeat:no-repeat}" + ); + } else { + var index = 1; + utils.each(list.childNodes, function(li) { + if (li.tagName == "LI") { + utils.pushItem( + customCss, + selector + + " li.list-" + + customStyle[listStyle] + + index + + "{background-image:url(" + + T.liiconpath + + "list-" + + customStyle[listStyle] + + index + + ".gif)}" + ); + index++; } - }); - } - - -}); \ No newline at end of file + }); + utils.pushItem( + customCss, + selector + + " ol.custom_" + + listStyle + + "{list-style:none;}" + + selector + + " ol.custom_" + + listStyle + + " li{background-position:0 3px;background-repeat:no-repeat}" + ); + } + switch (listStyle) { + case "cn": + utils.pushItem( + customCss, + selector + + " li.list-" + + listStyle + + "-paddingleft-1{padding-left:25px}" + ); + utils.pushItem( + customCss, + selector + + " li.list-" + + listStyle + + "-paddingleft-2{padding-left:40px}" + ); + utils.pushItem( + customCss, + selector + + " li.list-" + + listStyle + + "-paddingleft-3{padding-left:55px}" + ); + break; + case "cn1": + utils.pushItem( + customCss, + selector + + " li.list-" + + listStyle + + "-paddingleft-1{padding-left:30px}" + ); + utils.pushItem( + customCss, + selector + + " li.list-" + + listStyle + + "-paddingleft-2{padding-left:40px}" + ); + utils.pushItem( + customCss, + selector + + " li.list-" + + listStyle + + "-paddingleft-3{padding-left:55px}" + ); + break; + case "cn2": + utils.pushItem( + customCss, + selector + + " li.list-" + + listStyle + + "-paddingleft-1{padding-left:40px}" + ); + utils.pushItem( + customCss, + selector + + " li.list-" + + listStyle + + "-paddingleft-2{padding-left:55px}" + ); + utils.pushItem( + customCss, + selector + + " li.list-" + + listStyle + + "-paddingleft-3{padding-left:68px}" + ); + break; + case "num": + case "num1": + utils.pushItem( + customCss, + selector + + " li.list-" + + listStyle + + "-paddingleft-1{padding-left:25px}" + ); + break; + case "num2": + utils.pushItem( + customCss, + selector + + " li.list-" + + listStyle + + "-paddingleft-1{padding-left:35px}" + ); + utils.pushItem( + customCss, + selector + + " li.list-" + + listStyle + + "-paddingleft-2{padding-left:40px}" + ); + break; + case "dash": + utils.pushItem( + customCss, + selector + + " li.list-" + + listStyle + + "-paddingleft{padding-left:35px}" + ); + break; + case "dot": + utils.pushItem( + customCss, + selector + + " li.list-" + + listStyle + + "-paddingleft{padding-left:20px}" + ); + } + } + }); + } +}); diff --git a/_parse/parse.js b/_parse/parse.js index fe1275507..4c377e66c 100644 --- a/_parse/parse.js +++ b/_parse/parse.js @@ -1,327 +1,365 @@ -(function(){ - UE = window.UE || {}; - var isIE = !!window.ActiveXObject; - //定义utils工具 - var utils = { - removeLastbs : function(url){ - return url.replace(/\/$/,'') - }, - extend : function(t,s){ - var a = arguments, - notCover = this.isBoolean(a[a.length - 1]) ? a[a.length - 1] : false, - len = this.isBoolean(a[a.length - 1]) ? a.length - 1 : a.length; - for (var i = 1; i < len; i++) { - var x = a[i]; - for (var k in x) { - if (!notCover || !t.hasOwnProperty(k)) { - t[k] = x[k]; - } - } - } - return t; - }, - isIE : isIE, - cssRule : isIE ? function(key,style,doc){ - var indexList,index; - doc = doc || document; - if(doc.indexList){ - indexList = doc.indexList; - }else{ - indexList = doc.indexList = {}; - } - var sheetStyle; - if(!indexList[key]){ - if(style === undefined){ - return '' - } - sheetStyle = doc.createStyleSheet('',index = doc.styleSheets.length); - indexList[key] = index; - }else{ - sheetStyle = doc.styleSheets[indexList[key]]; - } - if(style === undefined){ - return sheetStyle.cssText - } - sheetStyle.cssText = sheetStyle.cssText + '\n' + (style || '') - } : function(key,style,doc){ - doc = doc || document; - var head = doc.getElementsByTagName('head')[0],node; - if(!(node = doc.getElementById(key))){ - if(style === undefined){ - return '' - } - node = doc.createElement('style'); - node.id = key; - head.appendChild(node) - } - if(style === undefined){ - return node.innerHTML - } - if(style !== ''){ - node.innerHTML = node.innerHTML + '\n' + style; - }else{ - head.removeChild(node) - } - }, - domReady : function (onready) { - var doc = window.document; - if (doc.readyState === "complete") { - onready(); - }else{ - if (isIE) { - (function () { - if (doc.isReady) return; - try { - doc.documentElement.doScroll("left"); - } catch (error) { - setTimeout(arguments.callee, 0); - return; - } - onready(); - })(); - window.attachEvent('onload', function(){ - onready() - }); - } else { - doc.addEventListener("DOMContentLoaded", function () { - doc.removeEventListener("DOMContentLoaded", arguments.callee, false); - onready(); - }, false); - window.addEventListener('load', function(){onready()}, false); - } - } - - }, - each : function(obj, iterator, context) { - if (obj == null) return; - if (obj.length === +obj.length) { - for (var i = 0, l = obj.length; i < l; i++) { - if(iterator.call(context, obj[i], i, obj) === false) - return false; - } - } else { - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - if(iterator.call(context, obj[key], key, obj) === false) - return false; - } - } - } - }, - inArray : function(arr,item){ - var index = -1; - this.each(arr,function(v,i){ - if(v === item){ - index = i; - return false; - } - }); - return index; - }, - pushItem : function(arr,item){ - if(this.inArray(arr,item)==-1){ - arr.push(item) - } - }, - trim: function (str) { - return str.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g, ''); - }, - indexOf: function (array, item, start) { - var index = -1; - start = this.isNumber(start) ? start : 0; - this.each(array, function (v, i) { - if (i >= start && v === item) { - index = i; - return false; - } - }); - return index; - }, - hasClass: function (element, className) { - className = className.replace(/(^[ ]+)|([ ]+$)/g, '').replace(/[ ]{2,}/g, ' ').split(' '); - for (var i = 0, ci, cls = element.className; ci = className[i++];) { - if (!new RegExp('\\b' + ci + '\\b', 'i').test(cls)) { - return false; - } - } - return i - 1 == className.length; - }, - addClass:function (elm, classNames) { - if(!elm)return; - classNames = this.trim(classNames).replace(/[ ]{2,}/g,' ').split(' '); - for(var i = 0,ci,cls = elm.className;ci=classNames[i++];){ - if(!new RegExp('\\b' + ci + '\\b').test(cls)){ - cls += ' ' + ci; - } - } - elm.className = utils.trim(cls); - }, - removeClass:function (elm, classNames) { - classNames = this.isArray(classNames) ? classNames : - this.trim(classNames).replace(/[ ]{2,}/g,' ').split(' '); - for(var i = 0,ci,cls = elm.className;ci=classNames[i++];){ - cls = cls.replace(new RegExp('\\b' + ci + '\\b'),'') - } - cls = this.trim(cls).replace(/[ ]{2,}/g,' '); - elm.className = cls; - !cls && elm.removeAttribute('className'); - }, - on: function (element, type, handler) { - var types = this.isArray(type) ? type : type.split(/\s+/), - k = types.length; - if (k) while (k--) { - type = types[k]; - if (element.addEventListener) { - element.addEventListener(type, handler, false); - } else { - if (!handler._d) { - handler._d = { - els : [] - }; - } - var key = type + handler.toString(),index = utils.indexOf(handler._d.els,element); - if (!handler._d[key] || index == -1) { - if(index == -1){ - handler._d.els.push(element); - } - if(!handler._d[key]){ - handler._d[key] = function (evt) { - return handler.call(evt.srcElement, evt || window.event); - }; - } - - - element.attachEvent('on' + type, handler._d[key]); - } - } - } - element = null; +(function() { + UE = window.UE || {}; + var isIE = !!window.ActiveXObject; + //定义utils工具 + var utils = { + removeLastbs: function(url) { + return url.replace(/\/$/, ""); + }, + extend: function(t, s) { + var a = arguments, + notCover = this.isBoolean(a[a.length - 1]) ? a[a.length - 1] : false, + len = this.isBoolean(a[a.length - 1]) ? a.length - 1 : a.length; + for (var i = 1; i < len; i++) { + var x = a[i]; + for (var k in x) { + if (!notCover || !t.hasOwnProperty(k)) { + t[k] = x[k]; + } + } + } + return t; + }, + isIE: isIE, + cssRule: isIE + ? function(key, style, doc) { + var indexList, index; + doc = doc || document; + if (doc.indexList) { + indexList = doc.indexList; + } else { + indexList = doc.indexList = {}; + } + var sheetStyle; + if (!indexList[key]) { + if (style === undefined) { + return ""; + } + sheetStyle = doc.createStyleSheet( + "", + (index = doc.styleSheets.length) + ); + indexList[key] = index; + } else { + sheetStyle = doc.styleSheets[indexList[key]]; + } + if (style === undefined) { + return sheetStyle.cssText; + } + sheetStyle.cssText = sheetStyle.cssText + "\n" + (style || ""); + } + : function(key, style, doc) { + doc = doc || document; + var head = doc.getElementsByTagName("head")[0], + node; + if (!(node = doc.getElementById(key))) { + if (style === undefined) { + return ""; + } + node = doc.createElement("style"); + node.id = key; + head.appendChild(node); + } + if (style === undefined) { + return node.innerHTML; + } + if (style !== "") { + node.innerHTML = node.innerHTML + "\n" + style; + } else { + head.removeChild(node); + } + }, + domReady: function(onready) { + var doc = window.document; + if (doc.readyState === "complete") { + onready(); + } else { + if (isIE) { + (function() { + if (doc.isReady) return; + try { + doc.documentElement.doScroll("left"); + } catch (error) { + setTimeout(arguments.callee, 0); + return; + } + onready(); + })(); + window.attachEvent("onload", function() { + onready(); + }); + } else { + doc.addEventListener( + "DOMContentLoaded", + function() { + doc.removeEventListener( + "DOMContentLoaded", + arguments.callee, + false + ); + onready(); }, - off: function (element, type, handler) { - var types = this.isArray(type) ? type : type.split(/\s+/), - k = types.length; - if (k) while (k--) { - type = types[k]; - if (element.removeEventListener) { - element.removeEventListener(type, handler, false); - } else { - var key = type + handler.toString(); - try{ - element.detachEvent('on' + type, handler._d ? handler._d[key] : handler); - }catch(e){} - if (handler._d && handler._d[key]) { - var index = utils.indexOf(handler._d.els,element); - if(index!=-1){ - handler._d.els.splice(index,1); - } - handler._d.els.length == 0 && delete handler._d[key]; - } - } - } + false + ); + window.addEventListener( + "load", + function() { + onready(); }, - loadFile : function () { - var tmpList = []; - function getItem(doc,obj){ - try{ - for(var i= 0,ci;ci=tmpList[i++];){ - if(ci.doc === doc && ci.url == (obj.src || obj.href)){ - return ci; - } - } - }catch(e){ - return null; - } + false + ); + } + } + }, + each: function(obj, iterator, context) { + if (obj == null) return; + if (obj.length === +obj.length) { + for (var i = 0, l = obj.length; i < l; i++) { + if (iterator.call(context, obj[i], i, obj) === false) return false; + } + } else { + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + if (iterator.call(context, obj[key], key, obj) === false) + return false; + } + } + } + }, + inArray: function(arr, item) { + var index = -1; + this.each(arr, function(v, i) { + if (v === item) { + index = i; + return false; + } + }); + return index; + }, + pushItem: function(arr, item) { + if (this.inArray(arr, item) == -1) { + arr.push(item); + } + }, + trim: function(str) { + return str.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g, ""); + }, + indexOf: function(array, item, start) { + var index = -1; + start = this.isNumber(start) ? start : 0; + this.each(array, function(v, i) { + if (i >= start && v === item) { + index = i; + return false; + } + }); + return index; + }, + hasClass: function(element, className) { + className = className + .replace(/(^[ ]+)|([ ]+$)/g, "") + .replace(/[ ]{2,}/g, " ") + .split(" "); + for (var i = 0, ci, cls = element.className; (ci = className[i++]); ) { + if (!new RegExp("\\b" + ci + "\\b", "i").test(cls)) { + return false; + } + } + return i - 1 == className.length; + }, + addClass: function(elm, classNames) { + if (!elm) return; + classNames = this.trim(classNames).replace(/[ ]{2,}/g, " ").split(" "); + for (var i = 0, ci, cls = elm.className; (ci = classNames[i++]); ) { + if (!new RegExp("\\b" + ci + "\\b").test(cls)) { + cls += " " + ci; + } + } + elm.className = utils.trim(cls); + }, + removeClass: function(elm, classNames) { + classNames = this.isArray(classNames) + ? classNames + : this.trim(classNames).replace(/[ ]{2,}/g, " ").split(" "); + for (var i = 0, ci, cls = elm.className; (ci = classNames[i++]); ) { + cls = cls.replace(new RegExp("\\b" + ci + "\\b"), ""); + } + cls = this.trim(cls).replace(/[ ]{2,}/g, " "); + elm.className = cls; + !cls && elm.removeAttribute("className"); + }, + on: function(element, type, handler) { + var types = this.isArray(type) ? type : type.split(/\s+/), + k = types.length; + if (k) + while (k--) { + type = types[k]; + if (element.addEventListener) { + element.addEventListener(type, handler, false); + } else { + if (!handler._d) { + handler._d = { + els: [] + }; + } + var key = type + handler.toString(), + index = utils.indexOf(handler._d.els, element); + if (!handler._d[key] || index == -1) { + if (index == -1) { + handler._d.els.push(element); + } + if (!handler._d[key]) { + handler._d[key] = function(evt) { + return handler.call(evt.srcElement, evt || window.event); + }; + } - } - return function (doc, obj, fn) { - var item = getItem(doc,obj); - if (item) { - if(item.ready){ - fn && fn(); - }else{ - item.funs.push(fn) - } - return; - } - tmpList.push({ - doc:doc, - url:obj.src||obj.href, - funs:[fn] - }); - if (!doc.body) { - var html = []; - for(var p in obj){ - if(p == 'tag')continue; - html.push(p + '="' + obj[p] + '"') - } - doc.write('<' + obj.tag + ' ' + html.join(' ') + ' >'+obj.tag+'>'); - return; - } - if (obj.id && doc.getElementById(obj.id)) { - return; - } - var element = doc.createElement(obj.tag); - delete obj.tag; - for (var p in obj) { - element.setAttribute(p, obj[p]); - } - element.onload = element.onreadystatechange = function () { - if (!this.readyState || /loaded|complete/.test(this.readyState)) { - item = getItem(doc,obj); - if (item.funs.length > 0) { - item.ready = 1; - for (var fi; fi = item.funs.pop();) { - fi(); - } - } - element.onload = element.onreadystatechange = null; - } - }; - element.onerror = function(){ - throw Error('The load '+(obj.href||obj.src)+' fails,check the url') - }; - doc.getElementsByTagName("head")[0].appendChild(element); - } - }() - }; - utils.each(['String', 'Function', 'Array', 'Number', 'RegExp', 'Object','Boolean'], function (v) { - utils['is' + v] = function (obj) { - return Object.prototype.toString.apply(obj) == '[object ' + v + ']'; + element.attachEvent("on" + type, handler._d[key]); + } + } } - }); - var parselist = {}; - UE.parse = { - register : function(parseName,fn){ - parselist[parseName] = fn; - }, - load : function(opt){ - utils.each(parselist,function(v){ - v.call(opt,utils); - }) + element = null; + }, + off: function(element, type, handler) { + var types = this.isArray(type) ? type : type.split(/\s+/), + k = types.length; + if (k) + while (k--) { + type = types[k]; + if (element.removeEventListener) { + element.removeEventListener(type, handler, false); + } else { + var key = type + handler.toString(); + try { + element.detachEvent( + "on" + type, + handler._d ? handler._d[key] : handler + ); + } catch (e) {} + if (handler._d && handler._d[key]) { + var index = utils.indexOf(handler._d.els, element); + if (index != -1) { + handler._d.els.splice(index, 1); + } + handler._d.els.length == 0 && delete handler._d[key]; + } + } } - }; - uParse = function(selector,opt){ - utils.domReady(function(){ - var contents; - if(document.querySelectorAll){ - contents = document.querySelectorAll(selector) - }else{ - if(/^#/.test(selector)){ - contents = [document.getElementById(selector.replace(/^#/,''))] - }else if(/^\./.test(selector)){ - var contents = []; - utils.each(document.getElementsByTagName('*'),function(node){ - if(node.className && new RegExp('\\b' + selector.replace(/^\./,'') + '\\b','i').test(node.className)){ - contents.push(node) - } - }) - }else{ - contents = document.getElementsByTagName(selector) - } + }, + loadFile: (function() { + var tmpList = []; + function getItem(doc, obj) { + try { + for (var i = 0, ci; (ci = tmpList[i++]); ) { + if (ci.doc === doc && ci.url == (obj.src || obj.href)) { + return ci; } - utils.each(contents,function(v){ - UE.parse.load(utils.extend({root:v,selector:selector},opt)) - }) - }) + } + } catch (e) { + return null; + } + } + return function(doc, obj, fn) { + var item = getItem(doc, obj); + if (item) { + if (item.ready) { + fn && fn(); + } else { + item.funs.push(fn); + } + return; + } + tmpList.push({ + doc: doc, + url: obj.src || obj.href, + funs: [fn] + }); + if (!doc.body) { + var html = []; + for (var p in obj) { + if (p == "tag") continue; + html.push(p + '="' + obj[p] + '"'); + } + doc.write( + "<" + obj.tag + " " + html.join(" ") + " >" + obj.tag + ">" + ); + return; + } + if (obj.id && doc.getElementById(obj.id)) { + return; + } + var element = doc.createElement(obj.tag); + delete obj.tag; + for (var p in obj) { + element.setAttribute(p, obj[p]); + } + element.onload = element.onreadystatechange = function() { + if (!this.readyState || /loaded|complete/.test(this.readyState)) { + item = getItem(doc, obj); + if (item.funs.length > 0) { + item.ready = 1; + for (var fi; (fi = item.funs.pop()); ) { + fi(); + } + } + element.onload = element.onreadystatechange = null; + } + }; + element.onerror = function() { + throw Error( + "The load " + (obj.href || obj.src) + " fails,check the url" + ); + }; + doc.getElementsByTagName("head")[0].appendChild(element); + }; + })() + }; + utils.each( + ["String", "Function", "Array", "Number", "RegExp", "Object", "Boolean"], + function(v) { + utils["is" + v] = function(obj) { + return Object.prototype.toString.apply(obj) == "[object " + v + "]"; + }; + } + ); + var parselist = {}; + UE.parse = { + register: function(parseName, fn) { + parselist[parseName] = fn; + }, + load: function(opt) { + utils.each(parselist, function(v) { + v.call(opt, utils); + }); } + }; + uParse = function(selector, opt) { + utils.domReady(function() { + var contents; + if (document.querySelectorAll) { + contents = document.querySelectorAll(selector); + } else { + if (/^#/.test(selector)) { + contents = [document.getElementById(selector.replace(/^#/, ""))]; + } else if (/^\./.test(selector)) { + var contents = []; + utils.each(document.getElementsByTagName("*"), function(node) { + if ( + node.className && + new RegExp("\\b" + selector.replace(/^\./, "") + "\\b", "i").test( + node.className + ) + ) { + contents.push(node); + } + }); + } else { + contents = document.getElementsByTagName(selector); + } + } + utils.each(contents, function(v) { + UE.parse.load(utils.extend({ root: v, selector: selector }, opt)); + }); + }); + }; })(); diff --git a/_parse/table.js b/_parse/table.js index 94156c068..fc3333c6f 100644 --- a/_parse/table.js +++ b/_parse/table.js @@ -1,161 +1,217 @@ -UE.parse.register('table', function (utils) { - var me = this, - root = this.root, - tables = root.getElementsByTagName('table'); - if (tables.length) { - var selector = this.selector; - //追加默认的表格样式 - utils.cssRule('table', - selector + ' table.noBorderTable td,' + - selector + ' table.noBorderTable th,' + - selector + ' table.noBorderTable caption{border:1px dashed #ddd !important}' + - selector + ' table.sortEnabled tr.firstRow th,' + selector + ' table.sortEnabled tr.firstRow td{padding-right:20px; background-repeat: no-repeat;' + - 'background-position: center right; background-image:url(' + this.rootPath + 'themes/default/images/sortable.png);}' + - selector + ' table.sortEnabled tr.firstRow th:hover,' + selector + ' table.sortEnabled tr.firstRow td:hover{background-color: #EEE;}' + - selector + ' table{margin-bottom:10px;border-collapse:collapse;display:table;}' + - selector + ' td,' + selector + ' th{padding: 5px 10px;border: 1px solid #DDD;}' + - selector + ' caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}' + - selector + ' th{border-top:1px solid #BBB;background:#F7F7F7;}' + - selector + ' table tr.firstRow th{border-top:2px solid #BBB;background:#F7F7F7;}' + - selector + ' tr.ue-table-interlace-color-single td{ background: #fcfcfc; }' + - selector + ' tr.ue-table-interlace-color-double td{ background: #f7faff; }' + - selector + ' td p{margin:0;padding:0;width:auto;height:auto;}', - document); - //填充空的单元格 +UE.parse.register("table", function(utils) { + var me = this, + root = this.root, + tables = root.getElementsByTagName("table"); + if (tables.length) { + var selector = this.selector; + //追加默认的表格样式 + utils.cssRule( + "table", + selector + + " table.noBorderTable td," + + selector + + " table.noBorderTable th," + + selector + + " table.noBorderTable caption{border:1px dashed #ddd !important}" + + selector + + " table.sortEnabled tr.firstRow th," + + selector + + " table.sortEnabled tr.firstRow td{padding-right:20px; background-repeat: no-repeat;" + + "background-position: center right; background-image:url(" + + this.rootPath + + "themes/default/images/sortable.png);}" + + selector + + " table.sortEnabled tr.firstRow th:hover," + + selector + + " table.sortEnabled tr.firstRow td:hover{background-color: #EEE;}" + + selector + + " table{margin-bottom:10px;border-collapse:collapse;display:table;}" + + selector + + " td," + + selector + + " th{padding: 5px 10px;border: 1px solid #DDD;}" + + selector + + " caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}" + + selector + + " th{border-top:1px solid #BBB;background:#F7F7F7;}" + + selector + + " table tr.firstRow th{border-top:2px solid #BBB;background:#F7F7F7;}" + + selector + + " tr.ue-table-interlace-color-single td{ background: #fcfcfc; }" + + selector + + " tr.ue-table-interlace-color-double td{ background: #f7faff; }" + + selector + + " td p{margin:0;padding:0;width:auto;height:auto;}", + document + ); + //填充空的单元格 - utils.each('td th caption'.split(' '), function (tag) { - var cells = root.getElementsByTagName(tag); - cells.length && utils.each(cells, function (node) { - if (!node.firstChild) { - node.innerHTML = ' '; - - } - }) + utils.each("td th caption".split(" "), function(tag) { + var cells = root.getElementsByTagName(tag); + cells.length && + utils.each(cells, function(node) { + if (!node.firstChild) { + node.innerHTML = " "; + } }); + }); - //表格可排序 - var tables = root.getElementsByTagName('table'); - utils.each(tables, function (table) { - if (/\bsortEnabled\b/.test(table.className)) { - utils.on(table, 'click', function(e){ - var target = e.target || e.srcElement, - cell = findParentByTagName(target, ['td', 'th']); - var table = findParentByTagName(target, 'table'), - colIndex = utils.indexOf(table.rows[0].cells, cell), - sortType = table.getAttribute('data-sort-type'); - if(colIndex != -1) { - sortTable(table, colIndex, me.tableSortCompareFn || sortType); - updateTable(table); - } - }); - } + //表格可排序 + var tables = root.getElementsByTagName("table"); + utils.each(tables, function(table) { + if (/\bsortEnabled\b/.test(table.className)) { + utils.on(table, "click", function(e) { + var target = e.target || e.srcElement, + cell = findParentByTagName(target, ["td", "th"]); + var table = findParentByTagName(target, "table"), + colIndex = utils.indexOf(table.rows[0].cells, cell), + sortType = table.getAttribute("data-sort-type"); + if (colIndex != -1) { + sortTable(table, colIndex, me.tableSortCompareFn || sortType); + updateTable(table); + } }); + } + }); - //按照标签名查找父节点 - function findParentByTagName(target, tagNames) { - var i, current = target; - tagNames = utils.isArray(tagNames) ? tagNames:[tagNames]; - while(current){ - for(i = 0;i < tagNames.length; i++) { - if(current.tagName == tagNames[i].toUpperCase()) return current; - } - current = current.parentNode; - } - return null; + //按照标签名查找父节点 + function findParentByTagName(target, tagNames) { + var i, + current = target; + tagNames = utils.isArray(tagNames) ? tagNames : [tagNames]; + while (current) { + for (i = 0; i < tagNames.length; i++) { + if (current.tagName == tagNames[i].toUpperCase()) return current; } - //表格排序 - function sortTable(table, sortByCellIndex, compareFn) { - var rows = table.rows, - trArray = [], - flag = rows[0].cells[0].tagName === "TH", - lastRowIndex = 0; + current = current.parentNode; + } + return null; + } + //表格排序 + function sortTable(table, sortByCellIndex, compareFn) { + var rows = table.rows, + trArray = [], + flag = rows[0].cells[0].tagName === "TH", + lastRowIndex = 0; - for (var i = 0,len = rows.length; i < len; i++) { - trArray[i] = rows[i]; - } + for (var i = 0, len = rows.length; i < len; i++) { + trArray[i] = rows[i]; + } - var Fn = { - 'reversecurrent': function(td1,td2){ - return 1; - }, - 'orderbyasc': function(td1,td2){ - var value1 = td1.innerText||td1.textContent, - value2 = td2.innerText||td2.textContent; - return value1.localeCompare(value2); - }, - 'reversebyasc': function(td1,td2){ - var value1 = td1.innerHTML, - value2 = td2.innerHTML; - return value2.localeCompare(value1); - }, - 'orderbynum': function(td1,td2){ - var value1 = td1[utils.isIE ? 'innerText':'textContent'].match(/\d+/), - value2 = td2[utils.isIE ? 'innerText':'textContent'].match(/\d+/); - if(value1) value1 = +value1[0]; - if(value2) value2 = +value2[0]; - return (value1||0) - (value2||0); - }, - 'reversebynum': function(td1,td2){ - var value1 = td1[utils.isIE ? 'innerText':'textContent'].match(/\d+/), - value2 = td2[utils.isIE ? 'innerText':'textContent'].match(/\d+/); - if(value1) value1 = +value1[0]; - if(value2) value2 = +value2[0]; - return (value2||0) - (value1||0); - } - }; + var Fn = { + reversecurrent: function(td1, td2) { + return 1; + }, + orderbyasc: function(td1, td2) { + var value1 = td1.innerText || td1.textContent, + value2 = td2.innerText || td2.textContent; + return value1.localeCompare(value2); + }, + reversebyasc: function(td1, td2) { + var value1 = td1.innerHTML, + value2 = td2.innerHTML; + return value2.localeCompare(value1); + }, + orderbynum: function(td1, td2) { + var value1 = td1[utils.isIE ? "innerText" : "textContent"].match( + /\d+/ + ), + value2 = td2[utils.isIE ? "innerText" : "textContent"].match(/\d+/); + if (value1) value1 = +value1[0]; + if (value2) value2 = +value2[0]; + return (value1 || 0) - (value2 || 0); + }, + reversebynum: function(td1, td2) { + var value1 = td1[utils.isIE ? "innerText" : "textContent"].match( + /\d+/ + ), + value2 = td2[utils.isIE ? "innerText" : "textContent"].match(/\d+/); + if (value1) value1 = +value1[0]; + if (value2) value2 = +value2[0]; + return (value2 || 0) - (value1 || 0); + } + }; - //对表格设置排序的标记data-sort-type - table.setAttribute('data-sort-type', compareFn && typeof compareFn === "string" && Fn[compareFn] ? compareFn:''); + //对表格设置排序的标记data-sort-type + table.setAttribute( + "data-sort-type", + compareFn && typeof compareFn === "string" && Fn[compareFn] + ? compareFn + : "" + ); - //th不参与排序 - flag && trArray.splice(0, 1); - trArray = sort(trArray,function (tr1, tr2) { - var result; - if (compareFn && typeof compareFn === "function") { - result = compareFn.call(this, tr1.cells[sortByCellIndex], tr2.cells[sortByCellIndex]); - } else if (compareFn && typeof compareFn === "number") { - result = 1; - } else if (compareFn && typeof compareFn === "string" && Fn[compareFn]) { - result = Fn[compareFn].call(this, tr1.cells[sortByCellIndex], tr2.cells[sortByCellIndex]); - } else { - result = Fn['orderbyasc'].call(this, tr1.cells[sortByCellIndex], tr2.cells[sortByCellIndex]); - } - return result; - }); - var fragment = table.ownerDocument.createDocumentFragment(); - for (var j = 0, len = trArray.length; j < len; j++) { - fragment.appendChild(trArray[j]); - } - var tbody = table.getElementsByTagName("tbody")[0]; - if(!lastRowIndex){ - tbody.appendChild(fragment); - }else{ - tbody.insertBefore(fragment,rows[lastRowIndex- range.endRowIndex + range.beginRowIndex - 1]) - } + //th不参与排序 + flag && trArray.splice(0, 1); + trArray = sort(trArray, function(tr1, tr2) { + var result; + if (compareFn && typeof compareFn === "function") { + result = compareFn.call( + this, + tr1.cells[sortByCellIndex], + tr2.cells[sortByCellIndex] + ); + } else if (compareFn && typeof compareFn === "number") { + result = 1; + } else if ( + compareFn && + typeof compareFn === "string" && + Fn[compareFn] + ) { + result = Fn[compareFn].call( + this, + tr1.cells[sortByCellIndex], + tr2.cells[sortByCellIndex] + ); + } else { + result = Fn["orderbyasc"].call( + this, + tr1.cells[sortByCellIndex], + tr2.cells[sortByCellIndex] + ); } - //冒泡排序 - function sort(array, compareFn){ - compareFn = compareFn || function(item1, item2){ return item1.localeCompare(item2);}; - for(var i= 0,len = array.length; i 0){ - var t = array[i]; - array[i] = array[j]; - array[j] = t; - } - } - } - return array; + return result; + }); + var fragment = table.ownerDocument.createDocumentFragment(); + for (var j = 0, len = trArray.length; j < len; j++) { + fragment.appendChild(trArray[j]); + } + var tbody = table.getElementsByTagName("tbody")[0]; + if (!lastRowIndex) { + tbody.appendChild(fragment); + } else { + tbody.insertBefore( + fragment, + rows[lastRowIndex - range.endRowIndex + range.beginRowIndex - 1] + ); + } + } + //冒泡排序 + function sort(array, compareFn) { + compareFn = + compareFn || + function(item1, item2) { + return item1.localeCompare(item2); + }; + for (var i = 0, len = array.length; i < len; i++) { + for (var j = i, length = array.length; j < length; j++) { + if (compareFn(array[i], array[j]) > 0) { + var t = array[i]; + array[i] = array[j]; + array[j] = t; + } } - //更新表格 - function updateTable(table) { - //给第一行设置firstRow的样式名称,在排序图标的样式上使用到 - if(!utils.hasClass(table.rows[0], "firstRow")) { - for(var i = 1; i< table.rows.length; i++) { - utils.removeClass(table.rows[i], "firstRow"); - } - utils.addClass(table.rows[0], "firstRow"); - } + } + return array; + } + //更新表格 + function updateTable(table) { + //给第一行设置firstRow的样式名称,在排序图标的样式上使用到 + if (!utils.hasClass(table.rows[0], "firstRow")) { + for (var i = 1; i < table.rows.length; i++) { + utils.removeClass(table.rows[i], "firstRow"); } + utils.addClass(table.rows[0], "firstRow"); + } } + } }); diff --git a/_parse/video.js b/_parse/video.js index da8ff80eb..b49425377 100644 --- a/_parse/video.js +++ b/_parse/video.js @@ -1,34 +1,38 @@ -UE.parse.register('vedio',function(utils){ - var video = this.root.getElementsByTagName('video'), - audio = this.root.getElementsByTagName('audio'); +UE.parse.register("vedio", function(utils) { + var video = this.root.getElementsByTagName("video"), + audio = this.root.getElementsByTagName("audio"); - document.createElement('video');document.createElement('audio'); - if(video.length || audio.length){ - var sourcePath = utils.removeLastbs(this.rootPath), - jsurl = sourcePath + '/third-party/video-js/video.js', - cssurl = sourcePath + '/third-party/video-js/video-js.min.css', - swfUrl = sourcePath + '/third-party/video-js/video-js.swf'; + document.createElement("video"); + document.createElement("audio"); + if (video.length || audio.length) { + var sourcePath = utils.removeLastbs(this.rootPath), + jsurl = sourcePath + "/third-party/video-js/video.js", + cssurl = sourcePath + "/third-party/video-js/video-js.min.css", + swfUrl = sourcePath + "/third-party/video-js/video-js.swf"; - if(window.videojs) { - videojs.autoSetup(); - } else { - utils.loadFile(document,{ - id : "video_css", - tag : "link", - rel : "stylesheet", - type : "text/css", - href : cssurl - }); - utils.loadFile(document,{ - id : "video_js", - src : jsurl, - tag : "script", - type : "text/javascript" - },function(){ - videojs.options.flash.swf = swfUrl; - videojs.autoSetup(); - }); + if (window.videojs) { + videojs.autoSetup(); + } else { + utils.loadFile(document, { + id: "video_css", + tag: "link", + rel: "stylesheet", + type: "text/css", + href: cssurl + }); + utils.loadFile( + document, + { + id: "video_js", + src: jsurl, + tag: "script", + type: "text/javascript" + }, + function() { + videojs.options.flash.swf = swfUrl; + videojs.autoSetup(); } - + ); } -}); \ No newline at end of file + } +}); diff --git a/_src/adapter/autosave.js b/_src/adapter/autosave.js index 1923aa874..722feb848 100644 --- a/_src/adapter/autosave.js +++ b/_src/adapter/autosave.js @@ -1,18 +1,17 @@ -UE.registerUI('autosave', function(editor) { - var timer = null,uid = null; - editor.on('afterautosave',function(){ - clearTimeout(timer); - - timer = setTimeout(function(){ - if(uid){ - editor.trigger('hidemessage',uid); - } - uid = editor.trigger('showmessage',{ - content : editor.getLang('autosave.success'), - timeout : 2000 - }); - - },2000) - }) +UE.registerUI("autosave", function(editor) { + var timer = null, + uid = null; + editor.on("afterautosave", function() { + clearTimeout(timer); + timer = setTimeout(function() { + if (uid) { + editor.trigger("hidemessage", uid); + } + uid = editor.trigger("showmessage", { + content: editor.getLang("autosave.success"), + timeout: 2000 + }); + }, 2000); + }); }); diff --git a/_src/adapter/editor.js b/_src/adapter/editor.js index ef9933a04..234797e86 100644 --- a/_src/adapter/editor.js +++ b/_src/adapter/editor.js @@ -2,820 +2,959 @@ ///commands 全屏 ///commandsName FullScreen ///commandsTitle 全屏 -(function () { - var utils = baidu.editor.utils, - uiUtils = baidu.editor.ui.uiUtils, - UIBase = baidu.editor.ui.UIBase, - domUtils = baidu.editor.dom.domUtils; - var nodeStack = []; - - function EditorUI(options) { - this.initOptions(options); - this.initEditorUI(); - } - - EditorUI.prototype = { - uiName:'editor', - initEditorUI:function () { - this.editor.ui = this; - this._dialogs = {}; - this.initUIBase(); - this._initToolbars(); - var editor = this.editor, - me = this; - - editor.addListener('ready', function () { - //提供getDialog方法 - editor.getDialog = function (name) { - return editor.ui._dialogs[name + "Dialog"]; - }; - domUtils.on(editor.window, 'scroll', function (evt) { - baidu.editor.ui.Popup.postHide(evt); - }); - //提供编辑器实时宽高(全屏时宽高不变化) - editor.ui._actualFrameWidth = editor.options.initialFrameWidth; - - UE.browser.ie && UE.browser.version === 6 && editor.container.ownerDocument.execCommand("BackgroundImageCache", false, true); - - //display bottom-bar label based on config - if (editor.options.elementPathEnabled) { - editor.ui.getDom('elementpath').innerHTML = ' '; - } - if (editor.options.wordCount) { - function countFn() { - setCount(editor,me); - domUtils.un(editor.document, "click", arguments.callee); - } - domUtils.on(editor.document, "click", countFn); - editor.ui.getDom('wordcount').innerHTML = editor.getLang("wordCountTip"); - } - editor.ui._scale(); - if (editor.options.scaleEnabled) { - if (editor.autoHeightEnabled) { - editor.disableAutoHeight(); - } - me.enableScale(); - } else { - me.disableScale(); - } - if (!editor.options.elementPathEnabled && !editor.options.wordCount && !editor.options.scaleEnabled) { - editor.ui.getDom('elementpath').style.display = "none"; - editor.ui.getDom('wordcount').style.display = "none"; - editor.ui.getDom('scale').style.display = "none"; - } - - if (!editor.selection.isFocus())return; - editor.fireEvent('selectionchange', false, true); - - - }); - - editor.addListener('mousedown', function (t, evt) { - var el = evt.target || evt.srcElement; - baidu.editor.ui.Popup.postHide(evt, el); - baidu.editor.ui.ShortCutMenu.postHide(evt); - - }); - editor.addListener("delcells", function () { - if (UE.ui['edittip']) { - new UE.ui['edittip'](editor); - } - editor.getDialog('edittip').open(); - }); - - var pastePop, isPaste = false, timer; - editor.addListener("afterpaste", function () { - if(editor.queryCommandState('pasteplain')) - return; - if(baidu.editor.ui.PastePicker){ - pastePop = new baidu.editor.ui.Popup({ - content:new baidu.editor.ui.PastePicker({editor:editor}), - editor:editor, - className:'edui-wordpastepop' - }); - pastePop.render(); - } - isPaste = true; - }); - - editor.addListener("afterinserthtml", function () { - clearTimeout(timer); - timer = setTimeout(function () { - if (pastePop && (isPaste || editor.ui._isTransfer)) { - if(pastePop.isHidden()){ - var span = domUtils.createElement(editor.document, 'span', { - 'style':"line-height:0px;", - 'innerHTML':'\ufeff' - }), - range = editor.selection.getRange(); - range.insertNode(span); - var tmp= getDomNode(span, 'firstChild', 'previousSibling'); - tmp && pastePop.showAnchor(tmp.nodeType == 3 ? tmp.parentNode : tmp); - domUtils.remove(span); - }else{ - pastePop.show(); - } - delete editor.ui._isTransfer; - isPaste = false; - } - }, 200) - }); - editor.addListener('contextmenu', function (t, evt) { - baidu.editor.ui.Popup.postHide(evt); - }); - editor.addListener('keydown', function (t, evt) { - if (pastePop) pastePop.dispose(evt); - var keyCode = evt.keyCode || evt.which; - if(evt.altKey&&keyCode==90){ - UE.ui.buttons['fullscreen'].onclick(); - } - }); - editor.addListener('wordcount', function (type) { - setCount(this,me); - }); - function setCount(editor,ui) { - editor.setOpt({ - wordCount:true, - maximumWords:10000, - wordCountMsg:editor.options.wordCountMsg || editor.getLang("wordCountMsg"), - wordOverFlowMsg:editor.options.wordOverFlowMsg || editor.getLang("wordOverFlowMsg") - }); - var opt = editor.options, - max = opt.maximumWords, - msg = opt.wordCountMsg , - errMsg = opt.wordOverFlowMsg, - countDom = ui.getDom('wordcount'); - if (!opt.wordCount) { - return; - } - var count = editor.getContentLength(true); - if (count > max) { - countDom.innerHTML = errMsg; - editor.fireEvent("wordcountoverflow"); - } else { - countDom.innerHTML = msg.replace("{#leave}", max - count).replace("{#count}", count); - } - } - - editor.addListener('selectionchange', function () { - if (editor.options.elementPathEnabled) { - me[(editor.queryCommandState('elementpath') == -1 ? 'dis' : 'en') + 'ableElementPath']() - } - if (editor.options.scaleEnabled) { - me[(editor.queryCommandState('scale') == -1 ? 'dis' : 'en') + 'ableScale'](); +(function() { + var utils = baidu.editor.utils, + uiUtils = baidu.editor.ui.uiUtils, + UIBase = baidu.editor.ui.UIBase, + domUtils = baidu.editor.dom.domUtils; + var nodeStack = []; + + function EditorUI(options) { + this.initOptions(options); + this.initEditorUI(); + } + + EditorUI.prototype = { + uiName: "editor", + initEditorUI: function() { + this.editor.ui = this; + this._dialogs = {}; + this.initUIBase(); + this._initToolbars(); + var editor = this.editor, + me = this; + + editor.addListener("ready", function() { + //提供getDialog方法 + editor.getDialog = function(name) { + return editor.ui._dialogs[name + "Dialog"]; + }; + domUtils.on(editor.window, "scroll", function(evt) { + baidu.editor.ui.Popup.postHide(evt); + }); + //提供编辑器实时宽高(全屏时宽高不变化) + editor.ui._actualFrameWidth = editor.options.initialFrameWidth; + + UE.browser.ie && + UE.browser.version === 6 && + editor.container.ownerDocument.execCommand( + "BackgroundImageCache", + false, + true + ); + + //display bottom-bar label based on config + if (editor.options.elementPathEnabled) { + editor.ui.getDom("elementpath").innerHTML = + ' "; + } + if (editor.options.wordCount) { + function countFn() { + setCount(editor, me); + domUtils.un(editor.document, "click", arguments.callee); + } + domUtils.on(editor.document, "click", countFn); + editor.ui.getDom("wordcount").innerHTML = editor.getLang( + "wordCountTip" + ); + } + editor.ui._scale(); + if (editor.options.scaleEnabled) { + if (editor.autoHeightEnabled) { + editor.disableAutoHeight(); + } + me.enableScale(); + } else { + me.disableScale(); + } + if ( + !editor.options.elementPathEnabled && + !editor.options.wordCount && + !editor.options.scaleEnabled + ) { + editor.ui.getDom("elementpath").style.display = "none"; + editor.ui.getDom("wordcount").style.display = "none"; + editor.ui.getDom("scale").style.display = "none"; + } - } - }); - var popup = new baidu.editor.ui.Popup({ - editor:editor, - content:'', - className:'edui-bubble', - _onEditButtonClick:function () { - this.hide(); - editor.ui._dialogs.linkDialog.open(); - }, - _onImgEditButtonClick:function (name) { - this.hide(); - editor.ui._dialogs[name] && editor.ui._dialogs[name].open(); - - }, - _onImgSetFloat:function (value) { - this.hide(); - editor.execCommand("imagefloat", value); - - }, - _setIframeAlign:function (value) { - var frame = popup.anchorEl; - var newFrame = frame.cloneNode(true); - switch (value) { - case -2: - newFrame.setAttribute("align", ""); - break; - case -1: - newFrame.setAttribute("align", "left"); - break; - case 1: - newFrame.setAttribute("align", "right"); - break; - } - frame.parentNode.insertBefore(newFrame, frame); - domUtils.remove(frame); - popup.anchorEl = newFrame; - popup.showAnchor(popup.anchorEl); - }, - _updateIframe:function () { - var frame = editor._iframe = popup.anchorEl; - if(domUtils.hasClass(frame, 'ueditor_baidumap')) { - editor.selection.getRange().selectNode(frame).select(); - editor.ui._dialogs.mapDialog.open(); - popup.hide(); - } else { - editor.ui._dialogs.insertframeDialog.open(); - popup.hide(); - } - }, - _onRemoveButtonClick:function (cmdName) { - editor.execCommand(cmdName); - this.hide(); - }, - queryAutoHide:function (el) { - if (el && el.ownerDocument == editor.document) { - if (el.tagName.toLowerCase() == 'img' || domUtils.findParentByTagName(el, 'a', true)) { - return el !== popup.anchorEl; - } - } - return baidu.editor.ui.Popup.prototype.queryAutoHide.call(this, el); - } - }); - popup.render(); - if (editor.options.imagePopup) { - editor.addListener('mouseover', function (t, evt) { - evt = evt || window.event; - var el = evt.target || evt.srcElement; - if (editor.ui._dialogs.insertframeDialog && /iframe/ig.test(el.tagName)) { - var html = popup.formatHtml( - '' + editor.getLang("property") + ': ' + editor.getLang("default") + ' ' + editor.getLang("justifyleft") + ' ' + editor.getLang("justifyright") + ' ' + - ' ' + editor.getLang("modify") + ' '); - if (html) { - popup.getDom('content').innerHTML = html; - popup.anchorEl = el; - popup.showAnchor(popup.anchorEl); - } else { - popup.hide(); - } - } - }); - editor.addListener('selectionchange', function (t, causeByUi) { - if (!causeByUi) return; - var html = '', str = "", - img = editor.selection.getRange().getClosedNode(), - dialogs = editor.ui._dialogs; - if (img && img.tagName == 'IMG') { - var dialogName = 'insertimageDialog'; - if (img.className.indexOf("edui-faked-video") != -1 || img.className.indexOf("edui-upload-video") != -1) { - dialogName = "insertvideoDialog" - } - if (img.className.indexOf("edui-faked-webapp") != -1) { - dialogName = "webappDialog" - } - if (img.src.indexOf("http://api.map.baidu.com") != -1) { - dialogName = "mapDialog" - } - if (img.className.indexOf("edui-faked-music") != -1) { - dialogName = "musicDialog" - } - if (img.src.indexOf("http://maps.google.com/maps/api/staticmap") != -1) { - dialogName = "gmapDialog" - } - if (img.getAttribute("anchorname")) { - dialogName = "anchorDialog"; - html = popup.formatHtml( - '' + editor.getLang("property") + ': ' + editor.getLang("modify") + ' ' + - '' + editor.getLang("delete") + ' '); - } - if (img.getAttribute("word_img")) { - //todo 放到dialog去做查询 - editor.word_img = [img.getAttribute("word_img")]; - dialogName = "wordimageDialog" - } - if(domUtils.hasClass(img, 'loadingclass') || domUtils.hasClass(img, 'loaderrorclass')) { - dialogName = ""; - } - if (!dialogs[dialogName]) { - return; - } - str = '' + editor.getLang("property") + ': '+ - '' + editor.getLang("default") + ' ' + - '' + editor.getLang("justifyleft") + ' ' + - '' + editor.getLang("justifyright") + ' ' + - '' + editor.getLang("justifycenter") + ' '+ - '' + editor.getLang("modify") + ' '; - - !html && (html = popup.formatHtml(str)) - - } - if (editor.ui._dialogs.linkDialog) { - var link = editor.queryCommandValue('link'); - var url; - if (link && (url = (link.getAttribute('_href') || link.getAttribute('href', 2)))) { - var txt = url; - if (url.length > 30) { - txt = url.substring(0, 20) + "..."; - } - if (html) { - html += '' - } - html += popup.formatHtml( - '' + editor.getLang("anthorMsg") + ': ' + txt + '' + - ' ' + editor.getLang("modify") + '' + - ' ' + editor.getLang("clear") + ' '); - popup.showAnchor(link); - } - } - - if (html) { - popup.getDom('content').innerHTML = html; - popup.anchorEl = img || link; - popup.showAnchor(popup.anchorEl); - } else { - popup.hide(); - } - }); + if (!editor.selection.isFocus()) return; + editor.fireEvent("selectionchange", false, true); + }); + + editor.addListener("mousedown", function(t, evt) { + var el = evt.target || evt.srcElement; + baidu.editor.ui.Popup.postHide(evt, el); + baidu.editor.ui.ShortCutMenu.postHide(evt); + }); + editor.addListener("delcells", function() { + if (UE.ui["edittip"]) { + new UE.ui["edittip"](editor); + } + editor.getDialog("edittip").open(); + }); + + var pastePop, + isPaste = false, + timer; + editor.addListener("afterpaste", function() { + if (editor.queryCommandState("pasteplain")) return; + if (baidu.editor.ui.PastePicker) { + pastePop = new baidu.editor.ui.Popup({ + content: new baidu.editor.ui.PastePicker({ editor: editor }), + editor: editor, + className: "edui-wordpastepop" + }); + pastePop.render(); + } + isPaste = true; + }); + + editor.addListener("afterinserthtml", function() { + clearTimeout(timer); + timer = setTimeout(function() { + if (pastePop && (isPaste || editor.ui._isTransfer)) { + if (pastePop.isHidden()) { + var span = domUtils.createElement(editor.document, "span", { + style: "line-height:0px;", + innerHTML: "\ufeff" + }), + range = editor.selection.getRange(); + range.insertNode(span); + var tmp = getDomNode(span, "firstChild", "previousSibling"); + tmp && + pastePop.showAnchor(tmp.nodeType == 3 ? tmp.parentNode : tmp); + domUtils.remove(span); + } else { + pastePop.show(); } - + delete editor.ui._isTransfer; + isPaste = false; + } + }, 200); + }); + editor.addListener("contextmenu", function(t, evt) { + baidu.editor.ui.Popup.postHide(evt); + }); + editor.addListener("keydown", function(t, evt) { + if (pastePop) pastePop.dispose(evt); + var keyCode = evt.keyCode || evt.which; + if (evt.altKey && keyCode == 90) { + UE.ui.buttons["fullscreen"].onclick(); + } + }); + editor.addListener("wordcount", function(type) { + setCount(this, me); + }); + function setCount(editor, ui) { + editor.setOpt({ + wordCount: true, + maximumWords: 10000, + wordCountMsg: + editor.options.wordCountMsg || editor.getLang("wordCountMsg"), + wordOverFlowMsg: + editor.options.wordOverFlowMsg || editor.getLang("wordOverFlowMsg") + }); + var opt = editor.options, + max = opt.maximumWords, + msg = opt.wordCountMsg, + errMsg = opt.wordOverFlowMsg, + countDom = ui.getDom("wordcount"); + if (!opt.wordCount) { + return; + } + var count = editor.getContentLength(true); + if (count > max) { + countDom.innerHTML = errMsg; + editor.fireEvent("wordcountoverflow"); + } else { + countDom.innerHTML = msg + .replace("{#leave}", max - count) + .replace("{#count}", count); + } + } + + editor.addListener("selectionchange", function() { + if (editor.options.elementPathEnabled) { + me[ + (editor.queryCommandState("elementpath") == -1 ? "dis" : "en") + + "ableElementPath" + ](); + } + if (editor.options.scaleEnabled) { + me[ + (editor.queryCommandState("scale") == -1 ? "dis" : "en") + + "ableScale" + ](); + } + }); + var popup = new baidu.editor.ui.Popup({ + editor: editor, + content: "", + className: "edui-bubble", + _onEditButtonClick: function() { + this.hide(); + editor.ui._dialogs.linkDialog.open(); }, - _initToolbars:function () { - var editor = this.editor; - var toolbars = this.toolbars || []; - var toolbarUis = []; - var extraUIs = []; - for (var i = 0; i < toolbars.length; i++) { - var toolbar = toolbars[i]; - var toolbarUi = new baidu.editor.ui.Toolbar({theme:editor.options.theme}); - for (var j = 0; j < toolbar.length; j++) { - var toolbarItem = toolbar[j]; - var toolbarItemUi = null; - if (typeof toolbarItem == 'string') { - toolbarItem = toolbarItem.toLowerCase(); - if (toolbarItem == '|') { - toolbarItem = 'Separator'; - } - if(toolbarItem == '||'){ - toolbarItem = 'Breakline'; - } - var ui = baidu.editor.ui[toolbarItem]; - if (ui) { - if(utils.isFunction(ui)){ - toolbarItemUi = new baidu.editor.ui[toolbarItem](editor); - }else{ - if(ui.id && ui.id != editor.key){ - continue; - } - var itemUI = ui.execFn.call(editor,editor,toolbarItem); - if(itemUI){ - if(ui.index === undefined){ - toolbarUi.add(itemUI); - continue; - }else{ - extraUIs.push({ - index:ui.index, - itemUI:itemUI - }) - } - } - } - } - //fullscreen这里单独处理一下,放到首行去 - if (toolbarItem == 'fullscreen') { - if (toolbarUis && toolbarUis[0]) { - toolbarUis[0].items.splice(0, 0, toolbarItemUi); - } else { - toolbarItemUi && toolbarUi.items.splice(0, 0, toolbarItemUi); - } - continue; - } - } else { - toolbarItemUi = toolbarItem; - } - if (toolbarItemUi && toolbarItemUi.id) { - - toolbarUi.add(toolbarItemUi); - } - } - toolbarUis[i] = toolbarUi; - } - - //接受外部定制的UI - - utils.each(extraUIs,function(obj){ - toolbarUi.add(obj.itemUI,obj.index) - }); - this.toolbars = toolbarUis; + _onImgEditButtonClick: function(name) { + this.hide(); + editor.ui._dialogs[name] && editor.ui._dialogs[name].open(); }, - getHtmlTpl:function () { - return '' + - '' + - '' + - '' + - //modify wdcount by matao - '
' + - '