baidu_ueditor_rails5 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/assets/javascripts/baidu_ueditor.js +1 -1
- data/app/assets/javascripts/ueditor/dialogs/anchor/anchor.html +40 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/attachment.css +681 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/attachment.html +60 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/attachment.js +754 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_chm.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_default.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_doc.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_exe.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_jpg.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_mp3.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_mv.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_pdf.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_ppt.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_psd.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_rar.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_txt.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_xls.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/images/alignicon.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/images/alignicon.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/images/bg.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/images/file-icons.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/images/file-icons.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/images/icons.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/images/icons.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/images/image.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/images/progress.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/images/success.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/attachment/images/success.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/background/background.css +94 -0
- data/app/assets/javascripts/ueditor/dialogs/background/background.html +56 -0
- data/app/assets/javascripts/ueditor/dialogs/background/background.js +376 -0
- data/app/assets/javascripts/ueditor/dialogs/background/images/bg.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/background/images/success.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/charts/chart.config.js +65 -0
- data/app/assets/javascripts/ueditor/dialogs/charts/charts.css +165 -0
- data/app/assets/javascripts/ueditor/dialogs/charts/charts.html +89 -0
- data/app/assets/javascripts/ueditor/dialogs/charts/charts.js +519 -0
- data/app/assets/javascripts/ueditor/dialogs/charts/images/charts0.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/charts/images/charts1.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/charts/images/charts2.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/charts/images/charts3.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/charts/images/charts4.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/charts/images/charts5.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/emotion/emotion.css +43 -0
- data/app/assets/javascripts/ueditor/dialogs/emotion/emotion.html +54 -0
- data/app/assets/javascripts/ueditor/dialogs/emotion/emotion.js +186 -0
- data/app/assets/javascripts/ueditor/dialogs/emotion/images/0.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/emotion/images/bface.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/emotion/images/cface.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/emotion/images/fface.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/emotion/images/jxface2.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/emotion/images/neweditor-tab-bg.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/emotion/images/tface.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/emotion/images/wface.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/emotion/images/yface.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/gmap/gmap.html +89 -0
- data/app/assets/javascripts/ueditor/dialogs/help/help.css +7 -0
- data/app/assets/javascripts/ueditor/dialogs/help/help.html +82 -0
- data/app/assets/javascripts/ueditor/dialogs/help/help.js +56 -0
- data/app/assets/javascripts/ueditor/dialogs/image/image.css +894 -0
- data/app/assets/javascripts/ueditor/dialogs/image/image.html +120 -0
- data/app/assets/javascripts/ueditor/dialogs/image/image.js +1142 -0
- data/app/assets/javascripts/ueditor/dialogs/image/images/alignicon.jpg +0 -0
- data/app/assets/javascripts/ueditor/dialogs/image/images/bg.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/image/images/icons.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/image/images/icons.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/image/images/image.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/image/images/progress.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/image/images/success.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/image/images/success.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/insertframe/insertframe.html +98 -0
- data/app/assets/javascripts/ueditor/dialogs/internal.js +81 -0
- data/app/assets/javascripts/ueditor/dialogs/link/link.html +126 -0
- data/app/assets/javascripts/ueditor/dialogs/map/map.html +135 -0
- data/app/assets/javascripts/ueditor/dialogs/map/show.html +118 -0
- data/app/assets/javascripts/ueditor/dialogs/music/music.css +30 -0
- data/app/assets/javascripts/ueditor/dialogs/music/music.html +32 -0
- data/app/assets/javascripts/ueditor/dialogs/music/music.js +192 -0
- data/app/assets/javascripts/ueditor/dialogs/preview/preview.html +40 -0
- data/app/assets/javascripts/ueditor/dialogs/scrawl/images/addimg.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/scrawl/images/brush.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/scrawl/images/delimg.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/scrawl/images/delimgH.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/scrawl/images/empty.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/scrawl/images/emptyH.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/scrawl/images/eraser.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/scrawl/images/redo.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/scrawl/images/redoH.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/scrawl/images/scale.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/scrawl/images/scaleH.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/scrawl/images/size.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/scrawl/images/undo.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/scrawl/images/undoH.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/scrawl/scrawl.css +72 -0
- data/app/assets/javascripts/ueditor/dialogs/scrawl/scrawl.html +95 -0
- data/app/assets/javascripts/ueditor/dialogs/scrawl/scrawl.js +671 -0
- data/app/assets/javascripts/ueditor/dialogs/searchreplace/searchreplace.html +102 -0
- data/app/assets/javascripts/ueditor/dialogs/searchreplace/searchreplace.js +164 -0
- data/app/assets/javascripts/ueditor/dialogs/snapscreen/snapscreen.html +58 -0
- data/app/assets/javascripts/ueditor/dialogs/spechars/spechars.html +21 -0
- data/app/assets/javascripts/ueditor/dialogs/spechars/spechars.js +57 -0
- data/app/assets/javascripts/ueditor/dialogs/table/dragicon.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/table/edittable.css +84 -0
- data/app/assets/javascripts/ueditor/dialogs/table/edittable.html +64 -0
- data/app/assets/javascripts/ueditor/dialogs/table/edittable.js +237 -0
- data/app/assets/javascripts/ueditor/dialogs/table/edittd.html +61 -0
- data/app/assets/javascripts/ueditor/dialogs/table/edittip.html +33 -0
- data/app/assets/javascripts/ueditor/dialogs/template/config.js +42 -0
- data/app/assets/javascripts/ueditor/dialogs/template/images/bg.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/template/images/pre0.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/template/images/pre1.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/template/images/pre2.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/template/images/pre3.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/template/images/pre4.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/template/template.css +18 -0
- data/app/assets/javascripts/ueditor/dialogs/template/template.html +26 -0
- data/app/assets/javascripts/ueditor/dialogs/template/template.js +53 -0
- data/app/assets/javascripts/ueditor/dialogs/video/images/bg.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/video/images/center_focus.jpg +0 -0
- data/app/assets/javascripts/ueditor/dialogs/video/images/file-icons.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/video/images/file-icons.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/video/images/icons.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/video/images/icons.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/video/images/image.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/video/images/left_focus.jpg +0 -0
- data/app/assets/javascripts/ueditor/dialogs/video/images/none_focus.jpg +0 -0
- data/app/assets/javascripts/ueditor/dialogs/video/images/progress.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/video/images/right_focus.jpg +0 -0
- data/app/assets/javascripts/ueditor/dialogs/video/images/success.gif +0 -0
- data/app/assets/javascripts/ueditor/dialogs/video/images/success.png +0 -0
- data/app/assets/javascripts/ueditor/dialogs/video/video.css +635 -0
- data/app/assets/javascripts/ueditor/dialogs/video/video.html +86 -0
- data/app/assets/javascripts/ueditor/dialogs/video/video.js +791 -0
- data/app/assets/javascripts/ueditor/dialogs/webapp/webapp.html +53 -0
- data/app/assets/javascripts/ueditor/dialogs/wordimage/fClipboard_ueditor.swf +0 -0
- data/app/assets/javascripts/ueditor/dialogs/wordimage/imageUploader.swf +0 -0
- data/app/assets/javascripts/ueditor/dialogs/wordimage/tangram.js +1495 -0
- data/app/assets/javascripts/ueditor/dialogs/wordimage/wordimage.html +111 -0
- data/app/assets/javascripts/ueditor/dialogs/wordimage/wordimage.js +157 -0
- data/app/assets/javascripts/ueditor/index.html +175 -0
- data/app/assets/javascripts/ueditor/lang/en/en.js +684 -0
- data/app/assets/javascripts/ueditor/lang/en/images/addimage.png +0 -0
- data/app/assets/javascripts/ueditor/lang/en/images/alldeletebtnhoverskin.png +0 -0
- data/app/assets/javascripts/ueditor/lang/en/images/alldeletebtnupskin.png +0 -0
- data/app/assets/javascripts/ueditor/lang/en/images/background.png +0 -0
- data/app/assets/javascripts/ueditor/lang/en/images/button.png +0 -0
- data/app/assets/javascripts/ueditor/lang/en/images/copy.png +0 -0
- data/app/assets/javascripts/ueditor/lang/en/images/deletedisable.png +0 -0
- data/app/assets/javascripts/ueditor/lang/en/images/deleteenable.png +0 -0
- data/app/assets/javascripts/ueditor/lang/en/images/listbackground.png +0 -0
- data/app/assets/javascripts/ueditor/lang/en/images/localimage.png +0 -0
- data/app/assets/javascripts/ueditor/lang/en/images/music.png +0 -0
- data/app/assets/javascripts/ueditor/lang/en/images/rotateleftdisable.png +0 -0
- data/app/assets/javascripts/ueditor/lang/en/images/rotateleftenable.png +0 -0
- data/app/assets/javascripts/ueditor/lang/en/images/rotaterightdisable.png +0 -0
- data/app/assets/javascripts/ueditor/lang/en/images/rotaterightenable.png +0 -0
- data/app/assets/javascripts/ueditor/lang/en/images/upload.png +0 -0
- data/app/assets/javascripts/ueditor/lang/zh-cn/images/copy.png +0 -0
- data/app/assets/javascripts/ueditor/lang/zh-cn/images/localimage.png +0 -0
- data/app/assets/javascripts/ueditor/lang/zh-cn/images/music.png +0 -0
- data/app/assets/javascripts/ueditor/lang/zh-cn/images/upload.png +0 -0
- data/app/assets/javascripts/ueditor/lang/zh-cn/zh-cn.js +669 -0
- data/app/assets/javascripts/ueditor/themes/default/css/ueditor.css +1903 -0
- data/app/assets/javascripts/ueditor/themes/default/css/ueditor.min.css +8 -0
- data/app/assets/javascripts/ueditor/themes/default/dialogbase.css +100 -0
- data/app/assets/javascripts/ueditor/themes/default/images/anchor.gif +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/arrow.png +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/arrow_down.png +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/arrow_up.png +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/button-bg.gif +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/cancelbutton.gif +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/charts.png +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/cursor_h.gif +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/cursor_h.png +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/cursor_v.gif +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/cursor_v.png +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/dialog-title-bg.png +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/filescan.png +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/highlighted.gif +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/icons-all.gif +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/icons.gif +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/icons.png +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/loaderror.png +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/loading.gif +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/lock.gif +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/neweditor-tab-bg.png +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/pagebreak.gif +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/scale.png +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/sortable.png +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/spacer.gif +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/sparator_v.png +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/table-cell-align.png +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/tangram-colorpicker.png +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/toolbar_bg.png +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/unhighlighted.gif +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/upload.png +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/videologo.gif +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/word.gif +0 -0
- data/app/assets/javascripts/ueditor/themes/default/images/wordpaste.png +0 -0
- data/app/assets/javascripts/ueditor/themes/iframe.css +1 -0
- data/app/assets/javascripts/ueditor/third-party/SyntaxHighlighter/shCore.js +3655 -0
- data/app/assets/javascripts/ueditor/third-party/SyntaxHighlighter/shCoreDefault.css +1 -0
- data/app/assets/javascripts/ueditor/third-party/codemirror/codemirror.css +104 -0
- data/app/assets/javascripts/ueditor/third-party/codemirror/codemirror.js +3581 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/adapters/mootools-adapter.js +13 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/adapters/mootools-adapter.src.js +313 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/adapters/prototype-adapter.js +15 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/adapters/prototype-adapter.src.js +316 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/adapters/standalone-framework.js +17 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/adapters/standalone-framework.src.js +583 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/highcharts-more.js +50 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/highcharts-more.src.js +2430 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/highcharts.js +283 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/highcharts.src.js +16974 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/modules/annotations.js +7 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/modules/annotations.src.js +401 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/modules/canvas-tools.js +133 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/modules/canvas-tools.src.js +3113 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/modules/data.js +17 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/modules/data.src.js +582 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/modules/drilldown.js +11 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/modules/drilldown.src.js +447 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/modules/exporting.js +22 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/modules/exporting.src.js +709 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/modules/funnel.js +12 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/modules/funnel.src.js +289 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/modules/heatmap.js +1 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/modules/heatmap.src.js +53 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/modules/map.js +27 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/modules/map.src.js +1002 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/modules/no-data-to-display.js +12 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/modules/no-data-to-display.src.js +128 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/themes/dark-blue.js +254 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/themes/dark-green.js +255 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/themes/gray.js +257 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/themes/grid.js +103 -0
- data/app/assets/javascripts/ueditor/third-party/highcharts/themes/skies.js +89 -0
- data/app/assets/javascripts/ueditor/third-party/jquery-1.10.2.js +9789 -0
- data/app/assets/javascripts/ueditor/third-party/jquery-1.10.2.min.js +6 -0
- data/app/assets/javascripts/ueditor/third-party/jquery-1.10.2.min.map +1 -0
- data/app/assets/javascripts/ueditor/third-party/snapscreen/UEditorSnapscreen.exe +0 -0
- data/app/assets/javascripts/ueditor/third-party/video-js/font/vjs.eot +0 -0
- data/app/assets/javascripts/ueditor/third-party/video-js/font/vjs.svg +65 -0
- data/app/assets/javascripts/ueditor/third-party/video-js/font/vjs.ttf +0 -0
- data/app/assets/javascripts/ueditor/third-party/video-js/font/vjs.woff +0 -0
- data/app/assets/javascripts/ueditor/third-party/video-js/video-js.css +766 -0
- data/app/assets/javascripts/ueditor/third-party/video-js/video-js.min.css +5 -0
- data/app/assets/javascripts/ueditor/third-party/video-js/video-js.swf +0 -0
- data/app/assets/javascripts/ueditor/third-party/video-js/video.dev.js +7108 -0
- data/app/assets/javascripts/ueditor/third-party/video-js/video.js +129 -0
- data/app/assets/javascripts/ueditor/third-party/webuploader/Uploader.swf +0 -0
- data/app/assets/javascripts/ueditor/third-party/webuploader/webuploader.css +28 -0
- data/app/assets/javascripts/ueditor/third-party/webuploader/webuploader.custom.js +5670 -0
- data/app/assets/javascripts/ueditor/third-party/webuploader/webuploader.custom.min.js +2 -0
- data/app/assets/javascripts/ueditor/third-party/webuploader/webuploader.flashonly.js +4176 -0
- data/app/assets/javascripts/ueditor/third-party/webuploader/webuploader.flashonly.min.js +2 -0
- data/app/assets/javascripts/ueditor/third-party/webuploader/webuploader.html5only.js +5559 -0
- data/app/assets/javascripts/ueditor/third-party/webuploader/webuploader.html5only.min.js +2 -0
- data/app/assets/javascripts/ueditor/third-party/webuploader/webuploader.js +6733 -0
- data/app/assets/javascripts/ueditor/third-party/webuploader/webuploader.min.js +2 -0
- data/app/assets/javascripts/ueditor/third-party/webuploader/webuploader.withoutimage.js +4593 -0
- data/app/assets/javascripts/ueditor/third-party/webuploader/webuploader.withoutimage.min.js +2 -0
- data/app/assets/javascripts/ueditor/third-party/xss.min.js +1 -0
- data/app/assets/javascripts/ueditor/third-party/zeroclipboard/ZeroClipboard.js +1256 -0
- data/app/assets/javascripts/ueditor/third-party/zeroclipboard/ZeroClipboard.min.js +9 -0
- data/app/assets/javascripts/ueditor/third-party/zeroclipboard/ZeroClipboard.swf +0 -0
- data/app/assets/javascripts/ueditor/ueditor.all.js +29568 -0
- data/app/assets/javascripts/ueditor/ueditor.all.min.js +18 -0
- data/app/assets/javascripts/ueditor/ueditor.config.js +497 -0
- data/app/assets/javascripts/ueditor/ueditor.parse.js +1022 -0
- data/app/assets/javascripts/ueditor/ueditor.parse.min.js +7 -0
- data/app/assets/javascripts/{ueditor → ueditor_custom}/preinit.js.erb +0 -0
- data/lib/baidu_ueditor_rails/version.rb +1 -1
- metadata +292 -21
@@ -0,0 +1,1022 @@
|
|
1
|
+
/*!
|
2
|
+
* UEditor
|
3
|
+
* version: ueditor
|
4
|
+
* build: Wed Aug 10 2016 11:06:03 GMT+0800 (CST)
|
5
|
+
*/
|
6
|
+
|
7
|
+
(function(){
|
8
|
+
|
9
|
+
(function(){
|
10
|
+
UE = window.UE || {};
|
11
|
+
var isIE = !!window.ActiveXObject;
|
12
|
+
//定义utils工具
|
13
|
+
var utils = {
|
14
|
+
removeLastbs : function(url){
|
15
|
+
return url.replace(/\/$/,'')
|
16
|
+
},
|
17
|
+
extend : function(t,s){
|
18
|
+
var a = arguments,
|
19
|
+
notCover = this.isBoolean(a[a.length - 1]) ? a[a.length - 1] : false,
|
20
|
+
len = this.isBoolean(a[a.length - 1]) ? a.length - 1 : a.length;
|
21
|
+
for (var i = 1; i < len; i++) {
|
22
|
+
var x = a[i];
|
23
|
+
for (var k in x) {
|
24
|
+
if (!notCover || !t.hasOwnProperty(k)) {
|
25
|
+
t[k] = x[k];
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
29
|
+
return t;
|
30
|
+
},
|
31
|
+
isIE : isIE,
|
32
|
+
cssRule : isIE ? function(key,style,doc){
|
33
|
+
var indexList,index;
|
34
|
+
doc = doc || document;
|
35
|
+
if(doc.indexList){
|
36
|
+
indexList = doc.indexList;
|
37
|
+
}else{
|
38
|
+
indexList = doc.indexList = {};
|
39
|
+
}
|
40
|
+
var sheetStyle;
|
41
|
+
if(!indexList[key]){
|
42
|
+
if(style === undefined){
|
43
|
+
return ''
|
44
|
+
}
|
45
|
+
sheetStyle = doc.createStyleSheet('',index = doc.styleSheets.length);
|
46
|
+
indexList[key] = index;
|
47
|
+
}else{
|
48
|
+
sheetStyle = doc.styleSheets[indexList[key]];
|
49
|
+
}
|
50
|
+
if(style === undefined){
|
51
|
+
return sheetStyle.cssText
|
52
|
+
}
|
53
|
+
sheetStyle.cssText = sheetStyle.cssText + '\n' + (style || '')
|
54
|
+
} : function(key,style,doc){
|
55
|
+
doc = doc || document;
|
56
|
+
var head = doc.getElementsByTagName('head')[0],node;
|
57
|
+
if(!(node = doc.getElementById(key))){
|
58
|
+
if(style === undefined){
|
59
|
+
return ''
|
60
|
+
}
|
61
|
+
node = doc.createElement('style');
|
62
|
+
node.id = key;
|
63
|
+
head.appendChild(node)
|
64
|
+
}
|
65
|
+
if(style === undefined){
|
66
|
+
return node.innerHTML
|
67
|
+
}
|
68
|
+
if(style !== ''){
|
69
|
+
node.innerHTML = node.innerHTML + '\n' + style;
|
70
|
+
}else{
|
71
|
+
head.removeChild(node)
|
72
|
+
}
|
73
|
+
},
|
74
|
+
domReady : function (onready) {
|
75
|
+
var doc = window.document;
|
76
|
+
if (doc.readyState === "complete") {
|
77
|
+
onready();
|
78
|
+
}else{
|
79
|
+
if (isIE) {
|
80
|
+
(function () {
|
81
|
+
if (doc.isReady) return;
|
82
|
+
try {
|
83
|
+
doc.documentElement.doScroll("left");
|
84
|
+
} catch (error) {
|
85
|
+
setTimeout(arguments.callee, 0);
|
86
|
+
return;
|
87
|
+
}
|
88
|
+
onready();
|
89
|
+
})();
|
90
|
+
window.attachEvent('onload', function(){
|
91
|
+
onready()
|
92
|
+
});
|
93
|
+
} else {
|
94
|
+
doc.addEventListener("DOMContentLoaded", function () {
|
95
|
+
doc.removeEventListener("DOMContentLoaded", arguments.callee, false);
|
96
|
+
onready();
|
97
|
+
}, false);
|
98
|
+
window.addEventListener('load', function(){onready()}, false);
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
},
|
103
|
+
each : function(obj, iterator, context) {
|
104
|
+
if (obj == null) return;
|
105
|
+
if (obj.length === +obj.length) {
|
106
|
+
for (var i = 0, l = obj.length; i < l; i++) {
|
107
|
+
if(iterator.call(context, obj[i], i, obj) === false)
|
108
|
+
return false;
|
109
|
+
}
|
110
|
+
} else {
|
111
|
+
for (var key in obj) {
|
112
|
+
if (obj.hasOwnProperty(key)) {
|
113
|
+
if(iterator.call(context, obj[key], key, obj) === false)
|
114
|
+
return false;
|
115
|
+
}
|
116
|
+
}
|
117
|
+
}
|
118
|
+
},
|
119
|
+
inArray : function(arr,item){
|
120
|
+
var index = -1;
|
121
|
+
this.each(arr,function(v,i){
|
122
|
+
if(v === item){
|
123
|
+
index = i;
|
124
|
+
return false;
|
125
|
+
}
|
126
|
+
});
|
127
|
+
return index;
|
128
|
+
},
|
129
|
+
pushItem : function(arr,item){
|
130
|
+
if(this.inArray(arr,item)==-1){
|
131
|
+
arr.push(item)
|
132
|
+
}
|
133
|
+
},
|
134
|
+
trim: function (str) {
|
135
|
+
return str.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g, '');
|
136
|
+
},
|
137
|
+
indexOf: function (array, item, start) {
|
138
|
+
var index = -1;
|
139
|
+
start = this.isNumber(start) ? start : 0;
|
140
|
+
this.each(array, function (v, i) {
|
141
|
+
if (i >= start && v === item) {
|
142
|
+
index = i;
|
143
|
+
return false;
|
144
|
+
}
|
145
|
+
});
|
146
|
+
return index;
|
147
|
+
},
|
148
|
+
hasClass: function (element, className) {
|
149
|
+
className = className.replace(/(^[ ]+)|([ ]+$)/g, '').replace(/[ ]{2,}/g, ' ').split(' ');
|
150
|
+
for (var i = 0, ci, cls = element.className; ci = className[i++];) {
|
151
|
+
if (!new RegExp('\\b' + ci + '\\b', 'i').test(cls)) {
|
152
|
+
return false;
|
153
|
+
}
|
154
|
+
}
|
155
|
+
return i - 1 == className.length;
|
156
|
+
},
|
157
|
+
addClass:function (elm, classNames) {
|
158
|
+
if(!elm)return;
|
159
|
+
classNames = this.trim(classNames).replace(/[ ]{2,}/g,' ').split(' ');
|
160
|
+
for(var i = 0,ci,cls = elm.className;ci=classNames[i++];){
|
161
|
+
if(!new RegExp('\\b' + ci + '\\b').test(cls)){
|
162
|
+
cls += ' ' + ci;
|
163
|
+
}
|
164
|
+
}
|
165
|
+
elm.className = utils.trim(cls);
|
166
|
+
},
|
167
|
+
removeClass:function (elm, classNames) {
|
168
|
+
classNames = this.isArray(classNames) ? classNames :
|
169
|
+
this.trim(classNames).replace(/[ ]{2,}/g,' ').split(' ');
|
170
|
+
for(var i = 0,ci,cls = elm.className;ci=classNames[i++];){
|
171
|
+
cls = cls.replace(new RegExp('\\b' + ci + '\\b'),'')
|
172
|
+
}
|
173
|
+
cls = this.trim(cls).replace(/[ ]{2,}/g,' ');
|
174
|
+
elm.className = cls;
|
175
|
+
!cls && elm.removeAttribute('className');
|
176
|
+
},
|
177
|
+
on: function (element, type, handler) {
|
178
|
+
var types = this.isArray(type) ? type : type.split(/\s+/),
|
179
|
+
k = types.length;
|
180
|
+
if (k) while (k--) {
|
181
|
+
type = types[k];
|
182
|
+
if (element.addEventListener) {
|
183
|
+
element.addEventListener(type, handler, false);
|
184
|
+
} else {
|
185
|
+
if (!handler._d) {
|
186
|
+
handler._d = {
|
187
|
+
els : []
|
188
|
+
};
|
189
|
+
}
|
190
|
+
var key = type + handler.toString(),index = utils.indexOf(handler._d.els,element);
|
191
|
+
if (!handler._d[key] || index == -1) {
|
192
|
+
if(index == -1){
|
193
|
+
handler._d.els.push(element);
|
194
|
+
}
|
195
|
+
if(!handler._d[key]){
|
196
|
+
handler._d[key] = function (evt) {
|
197
|
+
return handler.call(evt.srcElement, evt || window.event);
|
198
|
+
};
|
199
|
+
}
|
200
|
+
|
201
|
+
|
202
|
+
element.attachEvent('on' + type, handler._d[key]);
|
203
|
+
}
|
204
|
+
}
|
205
|
+
}
|
206
|
+
element = null;
|
207
|
+
},
|
208
|
+
off: function (element, type, handler) {
|
209
|
+
var types = this.isArray(type) ? type : type.split(/\s+/),
|
210
|
+
k = types.length;
|
211
|
+
if (k) while (k--) {
|
212
|
+
type = types[k];
|
213
|
+
if (element.removeEventListener) {
|
214
|
+
element.removeEventListener(type, handler, false);
|
215
|
+
} else {
|
216
|
+
var key = type + handler.toString();
|
217
|
+
try{
|
218
|
+
element.detachEvent('on' + type, handler._d ? handler._d[key] : handler);
|
219
|
+
}catch(e){}
|
220
|
+
if (handler._d && handler._d[key]) {
|
221
|
+
var index = utils.indexOf(handler._d.els,element);
|
222
|
+
if(index!=-1){
|
223
|
+
handler._d.els.splice(index,1);
|
224
|
+
}
|
225
|
+
handler._d.els.length == 0 && delete handler._d[key];
|
226
|
+
}
|
227
|
+
}
|
228
|
+
}
|
229
|
+
},
|
230
|
+
loadFile : function () {
|
231
|
+
var tmpList = [];
|
232
|
+
function getItem(doc,obj){
|
233
|
+
try{
|
234
|
+
for(var i= 0,ci;ci=tmpList[i++];){
|
235
|
+
if(ci.doc === doc && ci.url == (obj.src || obj.href)){
|
236
|
+
return ci;
|
237
|
+
}
|
238
|
+
}
|
239
|
+
}catch(e){
|
240
|
+
return null;
|
241
|
+
}
|
242
|
+
|
243
|
+
}
|
244
|
+
return function (doc, obj, fn) {
|
245
|
+
var item = getItem(doc,obj);
|
246
|
+
if (item) {
|
247
|
+
if(item.ready){
|
248
|
+
fn && fn();
|
249
|
+
}else{
|
250
|
+
item.funs.push(fn)
|
251
|
+
}
|
252
|
+
return;
|
253
|
+
}
|
254
|
+
tmpList.push({
|
255
|
+
doc:doc,
|
256
|
+
url:obj.src||obj.href,
|
257
|
+
funs:[fn]
|
258
|
+
});
|
259
|
+
if (!doc.body) {
|
260
|
+
var html = [];
|
261
|
+
for(var p in obj){
|
262
|
+
if(p == 'tag')continue;
|
263
|
+
html.push(p + '="' + obj[p] + '"')
|
264
|
+
}
|
265
|
+
doc.write('<' + obj.tag + ' ' + html.join(' ') + ' ></'+obj.tag+'>');
|
266
|
+
return;
|
267
|
+
}
|
268
|
+
if (obj.id && doc.getElementById(obj.id)) {
|
269
|
+
return;
|
270
|
+
}
|
271
|
+
var element = doc.createElement(obj.tag);
|
272
|
+
delete obj.tag;
|
273
|
+
for (var p in obj) {
|
274
|
+
element.setAttribute(p, obj[p]);
|
275
|
+
}
|
276
|
+
element.onload = element.onreadystatechange = function () {
|
277
|
+
if (!this.readyState || /loaded|complete/.test(this.readyState)) {
|
278
|
+
item = getItem(doc,obj);
|
279
|
+
if (item.funs.length > 0) {
|
280
|
+
item.ready = 1;
|
281
|
+
for (var fi; fi = item.funs.pop();) {
|
282
|
+
fi();
|
283
|
+
}
|
284
|
+
}
|
285
|
+
element.onload = element.onreadystatechange = null;
|
286
|
+
}
|
287
|
+
};
|
288
|
+
element.onerror = function(){
|
289
|
+
throw Error('The load '+(obj.href||obj.src)+' fails,check the url')
|
290
|
+
};
|
291
|
+
doc.getElementsByTagName("head")[0].appendChild(element);
|
292
|
+
}
|
293
|
+
}()
|
294
|
+
};
|
295
|
+
utils.each(['String', 'Function', 'Array', 'Number', 'RegExp', 'Object','Boolean'], function (v) {
|
296
|
+
utils['is' + v] = function (obj) {
|
297
|
+
return Object.prototype.toString.apply(obj) == '[object ' + v + ']';
|
298
|
+
}
|
299
|
+
});
|
300
|
+
var parselist = {};
|
301
|
+
UE.parse = {
|
302
|
+
register : function(parseName,fn){
|
303
|
+
parselist[parseName] = fn;
|
304
|
+
},
|
305
|
+
load : function(opt){
|
306
|
+
utils.each(parselist,function(v){
|
307
|
+
v.call(opt,utils);
|
308
|
+
})
|
309
|
+
}
|
310
|
+
};
|
311
|
+
uParse = function(selector,opt){
|
312
|
+
utils.domReady(function(){
|
313
|
+
var contents;
|
314
|
+
if(document.querySelectorAll){
|
315
|
+
contents = document.querySelectorAll(selector)
|
316
|
+
}else{
|
317
|
+
if(/^#/.test(selector)){
|
318
|
+
contents = [document.getElementById(selector.replace(/^#/,''))]
|
319
|
+
}else if(/^\./.test(selector)){
|
320
|
+
var contents = [];
|
321
|
+
utils.each(document.getElementsByTagName('*'),function(node){
|
322
|
+
if(node.className && new RegExp('\\b' + selector.replace(/^\./,'') + '\\b','i').test(node.className)){
|
323
|
+
contents.push(node)
|
324
|
+
}
|
325
|
+
})
|
326
|
+
}else{
|
327
|
+
contents = document.getElementsByTagName(selector)
|
328
|
+
}
|
329
|
+
}
|
330
|
+
utils.each(contents,function(v){
|
331
|
+
UE.parse.load(utils.extend({root:v,selector:selector},opt))
|
332
|
+
})
|
333
|
+
})
|
334
|
+
}
|
335
|
+
})();
|
336
|
+
|
337
|
+
UE.parse.register('insertcode',function(utils){
|
338
|
+
var pres = this.root.getElementsByTagName('pre');
|
339
|
+
if(pres.length){
|
340
|
+
if(typeof XRegExp == "undefined"){
|
341
|
+
var jsurl,cssurl;
|
342
|
+
if(this.rootPath !== undefined){
|
343
|
+
jsurl = utils.removeLastbs(this.rootPath) + '/third-party/SyntaxHighlighter/shCore.js';
|
344
|
+
cssurl = utils.removeLastbs(this.rootPath) + '/third-party/SyntaxHighlighter/shCoreDefault.css';
|
345
|
+
}else{
|
346
|
+
jsurl = this.highlightJsUrl;
|
347
|
+
cssurl = this.highlightCssUrl;
|
348
|
+
}
|
349
|
+
utils.loadFile(document,{
|
350
|
+
id : "syntaxhighlighter_css",
|
351
|
+
tag : "link",
|
352
|
+
rel : "stylesheet",
|
353
|
+
type : "text/css",
|
354
|
+
href : cssurl
|
355
|
+
});
|
356
|
+
utils.loadFile(document,{
|
357
|
+
id : "syntaxhighlighter_js",
|
358
|
+
src : jsurl,
|
359
|
+
tag : "script",
|
360
|
+
type : "text/javascript",
|
361
|
+
defer : "defer"
|
362
|
+
},function(){
|
363
|
+
utils.each(pres,function(pi){
|
364
|
+
if(pi && /brush/i.test(pi.className)){
|
365
|
+
SyntaxHighlighter.highlight(pi);
|
366
|
+
}
|
367
|
+
});
|
368
|
+
});
|
369
|
+
}else{
|
370
|
+
utils.each(pres,function(pi){
|
371
|
+
if(pi && /brush/i.test(pi.className)){
|
372
|
+
SyntaxHighlighter.highlight(pi);
|
373
|
+
}
|
374
|
+
});
|
375
|
+
}
|
376
|
+
}
|
377
|
+
|
378
|
+
});
|
379
|
+
UE.parse.register('table', function (utils) {
|
380
|
+
var me = this,
|
381
|
+
root = this.root,
|
382
|
+
tables = root.getElementsByTagName('table');
|
383
|
+
if (tables.length) {
|
384
|
+
var selector = this.selector;
|
385
|
+
//追加默认的表格样式
|
386
|
+
utils.cssRule('table',
|
387
|
+
selector + ' table.noBorderTable td,' +
|
388
|
+
selector + ' table.noBorderTable th,' +
|
389
|
+
selector + ' table.noBorderTable caption{border:1px dashed #ddd !important}' +
|
390
|
+
selector + ' table.sortEnabled tr.firstRow th,' + selector + ' table.sortEnabled tr.firstRow td{padding-right:20px; background-repeat: no-repeat;' +
|
391
|
+
'background-position: center right; background-image:url(' + this.rootPath + 'themes/default/images/sortable.png);}' +
|
392
|
+
selector + ' table.sortEnabled tr.firstRow th:hover,' + selector + ' table.sortEnabled tr.firstRow td:hover{background-color: #EEE;}' +
|
393
|
+
selector + ' table{margin-bottom:10px;border-collapse:collapse;display:table;}' +
|
394
|
+
selector + ' td,' + selector + ' th{ background:white; padding: 5px 10px;border: 1px solid #DDD;}' +
|
395
|
+
selector + ' caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}' +
|
396
|
+
selector + ' th{border-top:1px solid #BBB;background:#F7F7F7;}' +
|
397
|
+
selector + ' table tr.firstRow th{border-top:2px solid #BBB;background:#F7F7F7;}' +
|
398
|
+
selector + ' tr.ue-table-interlace-color-single td{ background: #fcfcfc; }' +
|
399
|
+
selector + ' tr.ue-table-interlace-color-double td{ background: #f7faff; }' +
|
400
|
+
selector + ' td p{margin:0;padding:0;}',
|
401
|
+
document);
|
402
|
+
//填充空的单元格
|
403
|
+
|
404
|
+
utils.each('td th caption'.split(' '), function (tag) {
|
405
|
+
var cells = root.getElementsByTagName(tag);
|
406
|
+
cells.length && utils.each(cells, function (node) {
|
407
|
+
if (!node.firstChild) {
|
408
|
+
node.innerHTML = ' ';
|
409
|
+
|
410
|
+
}
|
411
|
+
})
|
412
|
+
});
|
413
|
+
|
414
|
+
//表格可排序
|
415
|
+
var tables = root.getElementsByTagName('table');
|
416
|
+
utils.each(tables, function (table) {
|
417
|
+
if (/\bsortEnabled\b/.test(table.className)) {
|
418
|
+
utils.on(table, 'click', function(e){
|
419
|
+
var target = e.target || e.srcElement,
|
420
|
+
cell = findParentByTagName(target, ['td', 'th']);
|
421
|
+
var table = findParentByTagName(target, 'table'),
|
422
|
+
colIndex = utils.indexOf(table.rows[0].cells, cell),
|
423
|
+
sortType = table.getAttribute('data-sort-type');
|
424
|
+
if(colIndex != -1) {
|
425
|
+
sortTable(table, colIndex, me.tableSortCompareFn || sortType);
|
426
|
+
updateTable(table);
|
427
|
+
}
|
428
|
+
});
|
429
|
+
}
|
430
|
+
});
|
431
|
+
|
432
|
+
//按照标签名查找父节点
|
433
|
+
function findParentByTagName(target, tagNames) {
|
434
|
+
var i, current = target;
|
435
|
+
tagNames = utils.isArray(tagNames) ? tagNames:[tagNames];
|
436
|
+
while(current){
|
437
|
+
for(i = 0;i < tagNames.length; i++) {
|
438
|
+
if(current.tagName == tagNames[i].toUpperCase()) return current;
|
439
|
+
}
|
440
|
+
current = current.parentNode;
|
441
|
+
}
|
442
|
+
return null;
|
443
|
+
}
|
444
|
+
//表格排序
|
445
|
+
function sortTable(table, sortByCellIndex, compareFn) {
|
446
|
+
var rows = table.rows,
|
447
|
+
trArray = [],
|
448
|
+
flag = rows[0].cells[0].tagName === "TH",
|
449
|
+
lastRowIndex = 0;
|
450
|
+
|
451
|
+
for (var i = 0,len = rows.length; i < len; i++) {
|
452
|
+
trArray[i] = rows[i];
|
453
|
+
}
|
454
|
+
|
455
|
+
var Fn = {
|
456
|
+
'reversecurrent': function(td1,td2){
|
457
|
+
return 1;
|
458
|
+
},
|
459
|
+
'orderbyasc': function(td1,td2){
|
460
|
+
var value1 = td1.innerText||td1.textContent,
|
461
|
+
value2 = td2.innerText||td2.textContent;
|
462
|
+
return value1.localeCompare(value2);
|
463
|
+
},
|
464
|
+
'reversebyasc': function(td1,td2){
|
465
|
+
var value1 = td1.innerHTML,
|
466
|
+
value2 = td2.innerHTML;
|
467
|
+
return value2.localeCompare(value1);
|
468
|
+
},
|
469
|
+
'orderbynum': function(td1,td2){
|
470
|
+
var value1 = td1[utils.isIE ? 'innerText':'textContent'].match(/\d+/),
|
471
|
+
value2 = td2[utils.isIE ? 'innerText':'textContent'].match(/\d+/);
|
472
|
+
if(value1) value1 = +value1[0];
|
473
|
+
if(value2) value2 = +value2[0];
|
474
|
+
return (value1||0) - (value2||0);
|
475
|
+
},
|
476
|
+
'reversebynum': function(td1,td2){
|
477
|
+
var value1 = td1[utils.isIE ? 'innerText':'textContent'].match(/\d+/),
|
478
|
+
value2 = td2[utils.isIE ? 'innerText':'textContent'].match(/\d+/);
|
479
|
+
if(value1) value1 = +value1[0];
|
480
|
+
if(value2) value2 = +value2[0];
|
481
|
+
return (value2||0) - (value1||0);
|
482
|
+
}
|
483
|
+
};
|
484
|
+
|
485
|
+
//对表格设置排序的标记data-sort-type
|
486
|
+
table.setAttribute('data-sort-type', compareFn && typeof compareFn === "string" && Fn[compareFn] ? compareFn:'');
|
487
|
+
|
488
|
+
//th不参与排序
|
489
|
+
flag && trArray.splice(0, 1);
|
490
|
+
trArray = sort(trArray,function (tr1, tr2) {
|
491
|
+
var result;
|
492
|
+
if (compareFn && typeof compareFn === "function") {
|
493
|
+
result = compareFn.call(this, tr1.cells[sortByCellIndex], tr2.cells[sortByCellIndex]);
|
494
|
+
} else if (compareFn && typeof compareFn === "number") {
|
495
|
+
result = 1;
|
496
|
+
} else if (compareFn && typeof compareFn === "string" && Fn[compareFn]) {
|
497
|
+
result = Fn[compareFn].call(this, tr1.cells[sortByCellIndex], tr2.cells[sortByCellIndex]);
|
498
|
+
} else {
|
499
|
+
result = Fn['orderbyasc'].call(this, tr1.cells[sortByCellIndex], tr2.cells[sortByCellIndex]);
|
500
|
+
}
|
501
|
+
return result;
|
502
|
+
});
|
503
|
+
var fragment = table.ownerDocument.createDocumentFragment();
|
504
|
+
for (var j = 0, len = trArray.length; j < len; j++) {
|
505
|
+
fragment.appendChild(trArray[j]);
|
506
|
+
}
|
507
|
+
var tbody = table.getElementsByTagName("tbody")[0];
|
508
|
+
if(!lastRowIndex){
|
509
|
+
tbody.appendChild(fragment);
|
510
|
+
}else{
|
511
|
+
tbody.insertBefore(fragment,rows[lastRowIndex- range.endRowIndex + range.beginRowIndex - 1])
|
512
|
+
}
|
513
|
+
}
|
514
|
+
//冒泡排序
|
515
|
+
function sort(array, compareFn){
|
516
|
+
compareFn = compareFn || function(item1, item2){ return item1.localeCompare(item2);};
|
517
|
+
for(var i= 0,len = array.length; i<len; i++){
|
518
|
+
for(var j = i,length = array.length; j<length; j++){
|
519
|
+
if(compareFn(array[i], array[j]) > 0){
|
520
|
+
var t = array[i];
|
521
|
+
array[i] = array[j];
|
522
|
+
array[j] = t;
|
523
|
+
}
|
524
|
+
}
|
525
|
+
}
|
526
|
+
return array;
|
527
|
+
}
|
528
|
+
//更新表格
|
529
|
+
function updateTable(table) {
|
530
|
+
//给第一行设置firstRow的样式名称,在排序图标的样式上使用到
|
531
|
+
if(!utils.hasClass(table.rows[0], "firstRow")) {
|
532
|
+
for(var i = 1; i< table.rows.length; i++) {
|
533
|
+
utils.removeClass(table.rows[i], "firstRow");
|
534
|
+
}
|
535
|
+
utils.addClass(table.rows[0], "firstRow");
|
536
|
+
}
|
537
|
+
}
|
538
|
+
}
|
539
|
+
});
|
540
|
+
UE.parse.register('charts',function( utils ){
|
541
|
+
|
542
|
+
utils.cssRule('chartsContainerHeight','.edui-chart-container { height:'+(this.chartContainerHeight||300)+'px}');
|
543
|
+
var resourceRoot = this.rootPath,
|
544
|
+
containers = this.root,
|
545
|
+
sources = null;
|
546
|
+
|
547
|
+
//不存在指定的根路径, 则直接退出
|
548
|
+
if ( !resourceRoot ) {
|
549
|
+
return;
|
550
|
+
}
|
551
|
+
|
552
|
+
if ( sources = parseSources() ) {
|
553
|
+
|
554
|
+
loadResources();
|
555
|
+
|
556
|
+
}
|
557
|
+
|
558
|
+
|
559
|
+
function parseSources () {
|
560
|
+
|
561
|
+
if ( !containers ) {
|
562
|
+
return null;
|
563
|
+
}
|
564
|
+
|
565
|
+
return extractChartData( containers );
|
566
|
+
|
567
|
+
}
|
568
|
+
|
569
|
+
/**
|
570
|
+
* 提取数据
|
571
|
+
*/
|
572
|
+
function extractChartData ( rootNode ) {
|
573
|
+
|
574
|
+
var data = [],
|
575
|
+
tables = rootNode.getElementsByTagName( "table" );
|
576
|
+
|
577
|
+
for ( var i = 0, tableNode; tableNode = tables[ i ]; i++ ) {
|
578
|
+
|
579
|
+
if ( tableNode.getAttribute( "data-chart" ) !== null ) {
|
580
|
+
|
581
|
+
data.push( formatData( tableNode ) );
|
582
|
+
|
583
|
+
}
|
584
|
+
|
585
|
+
}
|
586
|
+
|
587
|
+
return data.length ? data : null;
|
588
|
+
|
589
|
+
}
|
590
|
+
|
591
|
+
function formatData ( tableNode ) {
|
592
|
+
|
593
|
+
var meta = tableNode.getAttribute( "data-chart" ),
|
594
|
+
metaConfig = {},
|
595
|
+
data = [];
|
596
|
+
|
597
|
+
//提取table数据
|
598
|
+
for ( var i = 0, row; row = tableNode.rows[ i ]; i++ ) {
|
599
|
+
|
600
|
+
var rowData = [];
|
601
|
+
|
602
|
+
for ( var j = 0, cell; cell = row.cells[ j ]; j++ ) {
|
603
|
+
|
604
|
+
var value = ( cell.innerText || cell.textContent || '' );
|
605
|
+
rowData.push( cell.tagName == 'TH' ? value:(value | 0) );
|
606
|
+
|
607
|
+
}
|
608
|
+
|
609
|
+
data.push( rowData );
|
610
|
+
|
611
|
+
}
|
612
|
+
|
613
|
+
//解析元信息
|
614
|
+
meta = meta.split( ";" );
|
615
|
+
for ( var i = 0, metaData; metaData = meta[ i ]; i++ ) {
|
616
|
+
|
617
|
+
metaData = metaData.split( ":" );
|
618
|
+
metaConfig[ metaData[ 0 ] ] = metaData[ 1 ];
|
619
|
+
|
620
|
+
}
|
621
|
+
|
622
|
+
|
623
|
+
return {
|
624
|
+
table: tableNode,
|
625
|
+
meta: metaConfig,
|
626
|
+
data: data
|
627
|
+
};
|
628
|
+
|
629
|
+
}
|
630
|
+
|
631
|
+
//加载资源
|
632
|
+
function loadResources () {
|
633
|
+
|
634
|
+
loadJQuery();
|
635
|
+
|
636
|
+
}
|
637
|
+
|
638
|
+
function loadJQuery () {
|
639
|
+
|
640
|
+
//不存在jquery, 则加载jquery
|
641
|
+
if ( !window.jQuery ) {
|
642
|
+
|
643
|
+
utils.loadFile(document,{
|
644
|
+
src : resourceRoot + "/third-party/jquery-1.10.2.min.js",
|
645
|
+
tag : "script",
|
646
|
+
type : "text/javascript",
|
647
|
+
defer : "defer"
|
648
|
+
},function(){
|
649
|
+
|
650
|
+
loadHighcharts();
|
651
|
+
|
652
|
+
});
|
653
|
+
|
654
|
+
} else {
|
655
|
+
|
656
|
+
loadHighcharts();
|
657
|
+
|
658
|
+
}
|
659
|
+
|
660
|
+
}
|
661
|
+
|
662
|
+
function loadHighcharts () {
|
663
|
+
|
664
|
+
//不存在Highcharts, 则加载Highcharts
|
665
|
+
if ( !window.Highcharts ) {
|
666
|
+
|
667
|
+
utils.loadFile(document,{
|
668
|
+
src : resourceRoot + "/third-party/highcharts/highcharts.js",
|
669
|
+
tag : "script",
|
670
|
+
type : "text/javascript",
|
671
|
+
defer : "defer"
|
672
|
+
},function(){
|
673
|
+
|
674
|
+
loadTypeConfig();
|
675
|
+
|
676
|
+
});
|
677
|
+
|
678
|
+
} else {
|
679
|
+
|
680
|
+
loadTypeConfig();
|
681
|
+
|
682
|
+
}
|
683
|
+
|
684
|
+
}
|
685
|
+
|
686
|
+
//加载图表差异化配置文件
|
687
|
+
function loadTypeConfig () {
|
688
|
+
|
689
|
+
utils.loadFile(document,{
|
690
|
+
src : resourceRoot + "/dialogs/charts/chart.config.js",
|
691
|
+
tag : "script",
|
692
|
+
type : "text/javascript",
|
693
|
+
defer : "defer"
|
694
|
+
},function(){
|
695
|
+
|
696
|
+
render();
|
697
|
+
|
698
|
+
});
|
699
|
+
|
700
|
+
}
|
701
|
+
|
702
|
+
//渲染图表
|
703
|
+
function render () {
|
704
|
+
|
705
|
+
var config = null,
|
706
|
+
chartConfig = null,
|
707
|
+
container = null;
|
708
|
+
|
709
|
+
for ( var i = 0, len = sources.length; i < len; i++ ) {
|
710
|
+
|
711
|
+
config = sources[ i ];
|
712
|
+
|
713
|
+
chartConfig = analysisConfig( config );
|
714
|
+
|
715
|
+
container = createContainer( config.table );
|
716
|
+
|
717
|
+
renderChart( container, typeConfig[ config.meta.chartType ], chartConfig );
|
718
|
+
|
719
|
+
}
|
720
|
+
|
721
|
+
|
722
|
+
}
|
723
|
+
|
724
|
+
/**
|
725
|
+
* 渲染图表
|
726
|
+
* @param container 图表容器节点对象
|
727
|
+
* @param typeConfig 图表类型配置
|
728
|
+
* @param config 图表通用配置
|
729
|
+
* */
|
730
|
+
function renderChart ( container, typeConfig, config ) {
|
731
|
+
|
732
|
+
|
733
|
+
$( container ).highcharts( $.extend( {}, typeConfig, {
|
734
|
+
|
735
|
+
credits: {
|
736
|
+
enabled: false
|
737
|
+
},
|
738
|
+
exporting: {
|
739
|
+
enabled: false
|
740
|
+
},
|
741
|
+
title: {
|
742
|
+
text: config.title,
|
743
|
+
x: -20 //center
|
744
|
+
},
|
745
|
+
subtitle: {
|
746
|
+
text: config.subTitle,
|
747
|
+
x: -20
|
748
|
+
},
|
749
|
+
xAxis: {
|
750
|
+
title: {
|
751
|
+
text: config.xTitle
|
752
|
+
},
|
753
|
+
categories: config.categories
|
754
|
+
},
|
755
|
+
yAxis: {
|
756
|
+
title: {
|
757
|
+
text: config.yTitle
|
758
|
+
},
|
759
|
+
plotLines: [{
|
760
|
+
value: 0,
|
761
|
+
width: 1,
|
762
|
+
color: '#808080'
|
763
|
+
}]
|
764
|
+
},
|
765
|
+
tooltip: {
|
766
|
+
enabled: true,
|
767
|
+
valueSuffix: config.suffix
|
768
|
+
},
|
769
|
+
legend: {
|
770
|
+
layout: 'vertical',
|
771
|
+
align: 'right',
|
772
|
+
verticalAlign: 'middle',
|
773
|
+
borderWidth: 1
|
774
|
+
},
|
775
|
+
series: config.series
|
776
|
+
|
777
|
+
} ));
|
778
|
+
|
779
|
+
}
|
780
|
+
|
781
|
+
/**
|
782
|
+
* 创建图表的容器
|
783
|
+
* 新创建的容器会替换掉对应的table对象
|
784
|
+
* */
|
785
|
+
function createContainer ( tableNode ) {
|
786
|
+
|
787
|
+
var container = document.createElement( "div" );
|
788
|
+
container.className = "edui-chart-container";
|
789
|
+
|
790
|
+
tableNode.parentNode.replaceChild( container, tableNode );
|
791
|
+
|
792
|
+
return container;
|
793
|
+
|
794
|
+
}
|
795
|
+
|
796
|
+
//根据config解析出正确的类别和图表数据信息
|
797
|
+
function analysisConfig ( config ) {
|
798
|
+
|
799
|
+
var series = [],
|
800
|
+
//数据类别
|
801
|
+
categories = [],
|
802
|
+
result = [],
|
803
|
+
data = config.data,
|
804
|
+
meta = config.meta;
|
805
|
+
|
806
|
+
//数据对齐方式为相反的方式, 需要反转数据
|
807
|
+
if ( meta.dataFormat != "1" ) {
|
808
|
+
|
809
|
+
for ( var i = 0, len = data.length; i < len ; i++ ) {
|
810
|
+
|
811
|
+
for ( var j = 0, jlen = data[ i ].length; j < jlen; j++ ) {
|
812
|
+
|
813
|
+
if ( !result[ j ] ) {
|
814
|
+
result[ j ] = [];
|
815
|
+
}
|
816
|
+
|
817
|
+
result[ j ][ i ] = data[ i ][ j ];
|
818
|
+
|
819
|
+
}
|
820
|
+
|
821
|
+
}
|
822
|
+
|
823
|
+
data = result;
|
824
|
+
|
825
|
+
}
|
826
|
+
|
827
|
+
result = {};
|
828
|
+
|
829
|
+
//普通图表
|
830
|
+
if ( meta.chartType != typeConfig.length - 1 ) {
|
831
|
+
|
832
|
+
categories = data[ 0 ].slice( 1 );
|
833
|
+
|
834
|
+
for ( var i = 1, curData; curData = data[ i ]; i++ ) {
|
835
|
+
series.push( {
|
836
|
+
name: curData[ 0 ],
|
837
|
+
data: curData.slice( 1 )
|
838
|
+
} );
|
839
|
+
}
|
840
|
+
|
841
|
+
result.series = series;
|
842
|
+
result.categories = categories;
|
843
|
+
result.title = meta.title;
|
844
|
+
result.subTitle = meta.subTitle;
|
845
|
+
result.xTitle = meta.xTitle;
|
846
|
+
result.yTitle = meta.yTitle;
|
847
|
+
result.suffix = meta.suffix;
|
848
|
+
|
849
|
+
} else {
|
850
|
+
|
851
|
+
var curData = [];
|
852
|
+
|
853
|
+
for ( var i = 1, len = data[ 0 ].length; i < len; i++ ) {
|
854
|
+
|
855
|
+
curData.push( [ data[ 0 ][ i ], data[ 1 ][ i ] | 0 ] );
|
856
|
+
|
857
|
+
}
|
858
|
+
|
859
|
+
//饼图
|
860
|
+
series[ 0 ] = {
|
861
|
+
type: 'pie',
|
862
|
+
name: meta.tip,
|
863
|
+
data: curData
|
864
|
+
};
|
865
|
+
|
866
|
+
result.series = series;
|
867
|
+
result.title = meta.title;
|
868
|
+
result.suffix = meta.suffix;
|
869
|
+
|
870
|
+
}
|
871
|
+
|
872
|
+
return result;
|
873
|
+
|
874
|
+
}
|
875
|
+
|
876
|
+
});
|
877
|
+
UE.parse.register('background', function (utils) {
|
878
|
+
var me = this,
|
879
|
+
root = me.root,
|
880
|
+
p = root.getElementsByTagName('p'),
|
881
|
+
styles;
|
882
|
+
|
883
|
+
for (var i = 0,ci; ci = p[i++];) {
|
884
|
+
styles = ci.getAttribute('data-background');
|
885
|
+
if (styles){
|
886
|
+
ci.parentNode.removeChild(ci);
|
887
|
+
}
|
888
|
+
}
|
889
|
+
|
890
|
+
//追加默认的表格样式
|
891
|
+
styles && utils.cssRule('ueditor_background', me.selector + '{' + styles + '}', document);
|
892
|
+
});
|
893
|
+
UE.parse.register('list',function(utils){
|
894
|
+
var customCss = [],
|
895
|
+
customStyle = {
|
896
|
+
'cn' : 'cn-1-',
|
897
|
+
'cn1' : 'cn-2-',
|
898
|
+
'cn2' : 'cn-3-',
|
899
|
+
'num' : 'num-1-',
|
900
|
+
'num1' : 'num-2-',
|
901
|
+
'num2' : 'num-3-',
|
902
|
+
'dash' : 'dash',
|
903
|
+
'dot' : 'dot'
|
904
|
+
};
|
905
|
+
|
906
|
+
|
907
|
+
utils.extend(this,{
|
908
|
+
liiconpath : 'http://bs.baidu.com/listicon/',
|
909
|
+
listDefaultPaddingLeft : '20'
|
910
|
+
});
|
911
|
+
|
912
|
+
var root = this.root,
|
913
|
+
ols = root.getElementsByTagName('ol'),
|
914
|
+
uls = root.getElementsByTagName('ul'),
|
915
|
+
selector = this.selector;
|
916
|
+
|
917
|
+
if(ols.length){
|
918
|
+
applyStyle.call(this,ols);
|
919
|
+
}
|
920
|
+
|
921
|
+
if(uls.length){
|
922
|
+
applyStyle.call(this,uls);
|
923
|
+
}
|
924
|
+
|
925
|
+
if(ols.length || uls.length){
|
926
|
+
customCss.push(selector +' .list-paddingleft-1{padding-left:0}');
|
927
|
+
customCss.push(selector +' .list-paddingleft-2{padding-left:'+ this.listDefaultPaddingLeft+'px}');
|
928
|
+
customCss.push(selector +' .list-paddingleft-3{padding-left:'+ this.listDefaultPaddingLeft*2+'px}');
|
929
|
+
|
930
|
+
utils.cssRule('list', selector +' ol,'+selector +' ul{margin:0;padding:0;}li{clear:both;}'+customCss.join('\n'), document);
|
931
|
+
}
|
932
|
+
function applyStyle(nodes){
|
933
|
+
var T = this;
|
934
|
+
utils.each(nodes,function(list){
|
935
|
+
if(list.className && /custom_/i.test(list.className)){
|
936
|
+
var listStyle = list.className.match(/custom_(\w+)/)[1];
|
937
|
+
if(listStyle == 'dash' || listStyle == 'dot'){
|
938
|
+
utils.pushItem(customCss,selector +' li.list-' + customStyle[listStyle] + '{background-image:url(' + T.liiconpath +customStyle[listStyle]+'.gif)}');
|
939
|
+
utils.pushItem(customCss,selector +' ul.custom_'+listStyle+'{list-style:none;} '+ selector +' ul.custom_'+listStyle+' li{background-position:0 3px;background-repeat:no-repeat}');
|
940
|
+
|
941
|
+
}else{
|
942
|
+
var index = 1;
|
943
|
+
utils.each(list.childNodes,function(li){
|
944
|
+
if(li.tagName == 'LI'){
|
945
|
+
utils.pushItem(customCss,selector + ' li.list-' + customStyle[listStyle] + index + '{background-image:url(' + T.liiconpath + 'list-'+customStyle[listStyle] +index + '.gif)}');
|
946
|
+
index++;
|
947
|
+
}
|
948
|
+
});
|
949
|
+
utils.pushItem(customCss,selector + ' ol.custom_'+listStyle+'{list-style:none;}'+selector+' ol.custom_'+listStyle+' li{background-position:0 3px;background-repeat:no-repeat}');
|
950
|
+
}
|
951
|
+
switch(listStyle){
|
952
|
+
case 'cn':
|
953
|
+
utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-1{padding-left:25px}');
|
954
|
+
utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-2{padding-left:40px}');
|
955
|
+
utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-3{padding-left:55px}');
|
956
|
+
break;
|
957
|
+
case 'cn1':
|
958
|
+
utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-1{padding-left:30px}');
|
959
|
+
utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-2{padding-left:40px}');
|
960
|
+
utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-3{padding-left:55px}');
|
961
|
+
break;
|
962
|
+
case 'cn2':
|
963
|
+
utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-1{padding-left:40px}');
|
964
|
+
utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-2{padding-left:55px}');
|
965
|
+
utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-3{padding-left:68px}');
|
966
|
+
break;
|
967
|
+
case 'num':
|
968
|
+
case 'num1':
|
969
|
+
utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-1{padding-left:25px}');
|
970
|
+
break;
|
971
|
+
case 'num2':
|
972
|
+
utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-1{padding-left:35px}');
|
973
|
+
utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft-2{padding-left:40px}');
|
974
|
+
break;
|
975
|
+
case 'dash':
|
976
|
+
utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft{padding-left:35px}');
|
977
|
+
break;
|
978
|
+
case 'dot':
|
979
|
+
utils.pushItem(customCss,selector + ' li.list-'+listStyle+'-paddingleft{padding-left:20px}');
|
980
|
+
}
|
981
|
+
}
|
982
|
+
});
|
983
|
+
}
|
984
|
+
|
985
|
+
|
986
|
+
});
|
987
|
+
UE.parse.register('vedio',function(utils){
|
988
|
+
var video = this.root.getElementsByTagName('video'),
|
989
|
+
audio = this.root.getElementsByTagName('audio');
|
990
|
+
|
991
|
+
document.createElement('video');document.createElement('audio');
|
992
|
+
if(video.length || audio.length){
|
993
|
+
var sourcePath = utils.removeLastbs(this.rootPath),
|
994
|
+
jsurl = sourcePath + '/third-party/video-js/video.js',
|
995
|
+
cssurl = sourcePath + '/third-party/video-js/video-js.min.css',
|
996
|
+
swfUrl = sourcePath + '/third-party/video-js/video-js.swf';
|
997
|
+
|
998
|
+
if(window.videojs) {
|
999
|
+
videojs.autoSetup();
|
1000
|
+
} else {
|
1001
|
+
utils.loadFile(document,{
|
1002
|
+
id : "video_css",
|
1003
|
+
tag : "link",
|
1004
|
+
rel : "stylesheet",
|
1005
|
+
type : "text/css",
|
1006
|
+
href : cssurl
|
1007
|
+
});
|
1008
|
+
utils.loadFile(document,{
|
1009
|
+
id : "video_js",
|
1010
|
+
src : jsurl,
|
1011
|
+
tag : "script",
|
1012
|
+
type : "text/javascript"
|
1013
|
+
},function(){
|
1014
|
+
videojs.options.flash.swf = swfUrl;
|
1015
|
+
videojs.autoSetup();
|
1016
|
+
});
|
1017
|
+
}
|
1018
|
+
|
1019
|
+
}
|
1020
|
+
});
|
1021
|
+
|
1022
|
+
})();
|