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
Binary file
|
@@ -0,0 +1,65 @@
|
|
1
|
+
/*
|
2
|
+
* 图表配置文件
|
3
|
+
* */
|
4
|
+
|
5
|
+
|
6
|
+
//不同类型的配置
|
7
|
+
var typeConfig = [
|
8
|
+
{
|
9
|
+
chart: {
|
10
|
+
type: 'line'
|
11
|
+
},
|
12
|
+
plotOptions: {
|
13
|
+
line: {
|
14
|
+
dataLabels: {
|
15
|
+
enabled: false
|
16
|
+
},
|
17
|
+
enableMouseTracking: true
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}, {
|
21
|
+
chart: {
|
22
|
+
type: 'line'
|
23
|
+
},
|
24
|
+
plotOptions: {
|
25
|
+
line: {
|
26
|
+
dataLabels: {
|
27
|
+
enabled: true
|
28
|
+
},
|
29
|
+
enableMouseTracking: false
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}, {
|
33
|
+
chart: {
|
34
|
+
type: 'area'
|
35
|
+
}
|
36
|
+
}, {
|
37
|
+
chart: {
|
38
|
+
type: 'bar'
|
39
|
+
}
|
40
|
+
}, {
|
41
|
+
chart: {
|
42
|
+
type: 'column'
|
43
|
+
}
|
44
|
+
}, {
|
45
|
+
chart: {
|
46
|
+
plotBackgroundColor: null,
|
47
|
+
plotBorderWidth: null,
|
48
|
+
plotShadow: false
|
49
|
+
},
|
50
|
+
plotOptions: {
|
51
|
+
pie: {
|
52
|
+
allowPointSelect: true,
|
53
|
+
cursor: 'pointer',
|
54
|
+
dataLabels: {
|
55
|
+
enabled: true,
|
56
|
+
color: '#000000',
|
57
|
+
connectorColor: '#000000',
|
58
|
+
formatter: function() {
|
59
|
+
return '<b>'+ this.point.name +'</b>: '+ ( Math.round( this.point.percentage*100 ) / 100 ) +' %';
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
|
+
];
|
@@ -0,0 +1,165 @@
|
|
1
|
+
html, body {
|
2
|
+
width: 100%;
|
3
|
+
height: 100%;
|
4
|
+
margin: 0;
|
5
|
+
padding: 0;
|
6
|
+
overflow-x: hidden;
|
7
|
+
}
|
8
|
+
|
9
|
+
.main {
|
10
|
+
width: 100%;
|
11
|
+
overflow: hidden;
|
12
|
+
}
|
13
|
+
|
14
|
+
.table-view {
|
15
|
+
height: 100%;
|
16
|
+
float: left;
|
17
|
+
margin: 20px;
|
18
|
+
width: 40%;
|
19
|
+
}
|
20
|
+
|
21
|
+
.table-view .table-container {
|
22
|
+
width: 100%;
|
23
|
+
margin-bottom: 50px;
|
24
|
+
overflow: scroll;
|
25
|
+
}
|
26
|
+
|
27
|
+
.table-view th {
|
28
|
+
padding: 5px 10px;
|
29
|
+
background-color: #F7F7F7;
|
30
|
+
}
|
31
|
+
|
32
|
+
.table-view td {
|
33
|
+
width: 50px;
|
34
|
+
text-align: center;
|
35
|
+
padding:0;
|
36
|
+
}
|
37
|
+
|
38
|
+
.table-container input {
|
39
|
+
width: 40px;
|
40
|
+
padding: 5px;
|
41
|
+
border: none;
|
42
|
+
outline: none;
|
43
|
+
}
|
44
|
+
|
45
|
+
.table-view caption {
|
46
|
+
font-size: 18px;
|
47
|
+
text-align: left;
|
48
|
+
}
|
49
|
+
|
50
|
+
.charts-view {
|
51
|
+
/*margin-left: 49%!important;*/
|
52
|
+
width: 50%;
|
53
|
+
margin-left: 49%;
|
54
|
+
height: 400px;
|
55
|
+
}
|
56
|
+
|
57
|
+
.charts-container {
|
58
|
+
border-left: 1px solid #c3c3c3;
|
59
|
+
}
|
60
|
+
|
61
|
+
.charts-format fieldset {
|
62
|
+
padding-left: 20px;
|
63
|
+
margin-bottom: 50px;
|
64
|
+
}
|
65
|
+
|
66
|
+
.charts-format legend {
|
67
|
+
padding-left: 10px;
|
68
|
+
padding-right: 10px;
|
69
|
+
}
|
70
|
+
|
71
|
+
.format-item-container {
|
72
|
+
padding: 20px;
|
73
|
+
}
|
74
|
+
|
75
|
+
.format-item-container label {
|
76
|
+
display: block;
|
77
|
+
margin: 10px 0;
|
78
|
+
}
|
79
|
+
|
80
|
+
.charts-format .data-item {
|
81
|
+
border: 1px solid black;
|
82
|
+
outline: none;
|
83
|
+
padding: 2px 3px;
|
84
|
+
}
|
85
|
+
|
86
|
+
/* 图表类型 */
|
87
|
+
|
88
|
+
.charts-type {
|
89
|
+
margin-top: 50px;
|
90
|
+
height: 300px;
|
91
|
+
}
|
92
|
+
|
93
|
+
.scroll-view {
|
94
|
+
border: 1px solid #c3c3c3;
|
95
|
+
border-left: none;
|
96
|
+
border-right: none;
|
97
|
+
overflow: hidden;
|
98
|
+
}
|
99
|
+
|
100
|
+
.scroll-container {
|
101
|
+
margin: 20px;
|
102
|
+
width: 100%;
|
103
|
+
overflow: hidden;
|
104
|
+
}
|
105
|
+
|
106
|
+
.scroll-bed {
|
107
|
+
width: 10000px;
|
108
|
+
_margin-top: 20px;
|
109
|
+
-webkit-transition: margin-left .5s ease;
|
110
|
+
-moz-transition: margin-left .5s ease;
|
111
|
+
transition: margin-left .5s ease;
|
112
|
+
}
|
113
|
+
|
114
|
+
.view-box {
|
115
|
+
display: inline-block;
|
116
|
+
*display: inline;
|
117
|
+
*zoom: 1;
|
118
|
+
margin-right: 20px;
|
119
|
+
border: 2px solid white;
|
120
|
+
line-height: 0;
|
121
|
+
overflow: hidden;
|
122
|
+
cursor: pointer;
|
123
|
+
}
|
124
|
+
|
125
|
+
.view-box img {
|
126
|
+
border: 1px solid #cecece;
|
127
|
+
}
|
128
|
+
|
129
|
+
.view-box.selected {
|
130
|
+
border-color: #7274A7;
|
131
|
+
}
|
132
|
+
|
133
|
+
.button-container {
|
134
|
+
margin-bottom: 20px;
|
135
|
+
text-align: center;
|
136
|
+
}
|
137
|
+
|
138
|
+
.button-container a {
|
139
|
+
display: inline-block;
|
140
|
+
width: 100px;
|
141
|
+
height: 25px;
|
142
|
+
line-height: 25px;
|
143
|
+
border: 1px solid #c2ccd1;
|
144
|
+
margin-right: 30px;
|
145
|
+
text-decoration: none;
|
146
|
+
color: black;
|
147
|
+
-webkit-border-radius: 2px;
|
148
|
+
-moz-border-radius: 2px;
|
149
|
+
border-radius: 2px;
|
150
|
+
}
|
151
|
+
|
152
|
+
.button-container a:HOVER {
|
153
|
+
background: #fcfcfc;
|
154
|
+
}
|
155
|
+
|
156
|
+
.button-container a:ACTIVE {
|
157
|
+
border-top-color: #c2ccd1;
|
158
|
+
box-shadow:inset 0 5px 4px -4px rgba(49, 49, 64, 0.1);
|
159
|
+
}
|
160
|
+
|
161
|
+
.edui-charts-not-data {
|
162
|
+
height: 100px;
|
163
|
+
line-height: 100px;
|
164
|
+
text-align: center;
|
165
|
+
}
|
@@ -0,0 +1,89 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>chart</title>
|
5
|
+
<meta chartset="utf-8">
|
6
|
+
<link rel="stylesheet" type="text/css" href="charts.css">
|
7
|
+
<script type="text/javascript" src="../internal.js"></script>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<div class="main">
|
11
|
+
<div class="table-view">
|
12
|
+
<h3><var id="lang_data_source"></var></h3>
|
13
|
+
<div id="tableContainer" class="table-container"></div>
|
14
|
+
<h3><var id="lang_chart_format"></var></h3>
|
15
|
+
<form name="data-form">
|
16
|
+
<div class="charts-format">
|
17
|
+
<fieldset>
|
18
|
+
<legend><var id="lang_data_align"></var></legend>
|
19
|
+
<div class="format-item-container">
|
20
|
+
<label>
|
21
|
+
<input type="radio" class="format-ctrl not-pie-item" name="charts-format" value="1" checked="checked">
|
22
|
+
<var id="lang_chart_align_same"></var>
|
23
|
+
</label>
|
24
|
+
<label>
|
25
|
+
<input type="radio" class="format-ctrl not-pie-item" name="charts-format" value="-1">
|
26
|
+
<var id="lang_chart_align_reverse"></var>
|
27
|
+
</label>
|
28
|
+
<br>
|
29
|
+
</div>
|
30
|
+
</fieldset>
|
31
|
+
<fieldset>
|
32
|
+
<legend><var id="lang_chart_title"></var></legend>
|
33
|
+
<div class="format-item-container">
|
34
|
+
<label>
|
35
|
+
<var id="lang_chart_main_title"></var><input type="text" name="title" class="data-item">
|
36
|
+
</label>
|
37
|
+
<label>
|
38
|
+
<var id="lang_chart_sub_title"></var><input type="text" name="sub-title" class="data-item not-pie-item">
|
39
|
+
</label>
|
40
|
+
<label>
|
41
|
+
<var id="lang_chart_x_title"></var><input type="text" name="x-title" class="data-item not-pie-item">
|
42
|
+
</label>
|
43
|
+
<label>
|
44
|
+
<var id="lang_chart_y_title"></var><input type="text" name="y-title" class="data-item not-pie-item">
|
45
|
+
</label>
|
46
|
+
</div>
|
47
|
+
</fieldset>
|
48
|
+
<fieldset>
|
49
|
+
<legend><var id="lang_chart_tip"></var></legend>
|
50
|
+
<div class="format-item-container">
|
51
|
+
<label>
|
52
|
+
<var id="lang_cahrt_tip_prefix"></var>
|
53
|
+
<input type="text" id="tipInput" name="tip" class="data-item" disabled="disabled">
|
54
|
+
</label>
|
55
|
+
<p><var id="lang_cahrt_tip_description"></var></p>
|
56
|
+
</div>
|
57
|
+
</fieldset>
|
58
|
+
<fieldset>
|
59
|
+
<legend><var id="lang_chart_data_unit"></var></legend>
|
60
|
+
<div class="format-item-container">
|
61
|
+
<label><var id="lang_chart_data_unit_title"></var><input type="text" name="unit" class="data-item"></label>
|
62
|
+
<p><var id="lang_chart_data_unit_description"></var></p>
|
63
|
+
</div>
|
64
|
+
</fieldset>
|
65
|
+
</div>
|
66
|
+
</form>
|
67
|
+
</div>
|
68
|
+
<div class="charts-view">
|
69
|
+
<div id="chartsContainer" class="charts-container"></div>
|
70
|
+
<div id="chartsType" class="charts-type">
|
71
|
+
<h3><var id="lang_chart_type"></var></h3>
|
72
|
+
<div class="scroll-view">
|
73
|
+
<div class="scroll-container">
|
74
|
+
<div id="scrollBed" class="scroll-bed"></div>
|
75
|
+
</div>
|
76
|
+
<div id="buttonContainer" class="button-container">
|
77
|
+
<a href="#" data-title="prev"><var id="lang_prev_btn"></var></a>
|
78
|
+
<a href="#" data-title="next"><var id="lang_next_btn"></var></a>
|
79
|
+
</div>
|
80
|
+
</div>
|
81
|
+
</div>
|
82
|
+
</div>
|
83
|
+
</div>
|
84
|
+
<script src="../../third-party/jquery-1.10.2.min.js"></script>
|
85
|
+
<script src="../../third-party/highcharts/highcharts.js"></script>
|
86
|
+
<script src="chart.config.js"></script>
|
87
|
+
<script src="charts.js"></script>
|
88
|
+
</body>
|
89
|
+
</html>
|
@@ -0,0 +1,519 @@
|
|
1
|
+
/*
|
2
|
+
* 图片转换对话框脚本
|
3
|
+
**/
|
4
|
+
|
5
|
+
var tableData = [],
|
6
|
+
//编辑器页面table
|
7
|
+
editorTable = null,
|
8
|
+
chartsConfig = window.typeConfig,
|
9
|
+
resizeTimer = null,
|
10
|
+
//初始默认图表类型
|
11
|
+
currentChartType = 0;
|
12
|
+
|
13
|
+
window.onload = function () {
|
14
|
+
|
15
|
+
editorTable = domUtils.findParentByTagName( editor.selection.getRange().startContainer, 'table', true);
|
16
|
+
|
17
|
+
//未找到表格, 显示错误页面
|
18
|
+
if ( !editorTable ) {
|
19
|
+
document.body.innerHTML = "<div class='edui-charts-not-data'>未找到数据</div>";
|
20
|
+
return;
|
21
|
+
}
|
22
|
+
|
23
|
+
//初始化图表类型选择
|
24
|
+
initChartsTypeView();
|
25
|
+
renderTable( editorTable );
|
26
|
+
initEvent();
|
27
|
+
initUserConfig( editorTable.getAttribute( "data-chart" ) );
|
28
|
+
$( "#scrollBed .view-box:eq("+ currentChartType +")" ).trigger( "click" );
|
29
|
+
updateViewType( currentChartType );
|
30
|
+
|
31
|
+
dialog.addListener( "resize", function () {
|
32
|
+
|
33
|
+
if ( resizeTimer != null ) {
|
34
|
+
window.clearTimeout( resizeTimer );
|
35
|
+
}
|
36
|
+
|
37
|
+
resizeTimer = window.setTimeout( function () {
|
38
|
+
|
39
|
+
resizeTimer = null;
|
40
|
+
|
41
|
+
renderCharts();
|
42
|
+
|
43
|
+
}, 500 );
|
44
|
+
|
45
|
+
} );
|
46
|
+
|
47
|
+
};
|
48
|
+
|
49
|
+
function initChartsTypeView () {
|
50
|
+
|
51
|
+
var contents = [];
|
52
|
+
|
53
|
+
for ( var i = 0, len = chartsConfig.length; i<len; i++ ) {
|
54
|
+
|
55
|
+
contents.push( '<div class="view-box" data-chart-type="'+ i +'"><img width="300" src="images/charts'+ i +'.png"></div>' );
|
56
|
+
|
57
|
+
}
|
58
|
+
|
59
|
+
$( "#scrollBed" ).html( contents.join( "" ) );
|
60
|
+
|
61
|
+
}
|
62
|
+
|
63
|
+
//渲染table, 以便用户修改数据
|
64
|
+
function renderTable ( table ) {
|
65
|
+
|
66
|
+
var tableHtml = [];
|
67
|
+
|
68
|
+
//构造数据
|
69
|
+
for ( var i = 0, row; row = table.rows[ i ]; i++ ) {
|
70
|
+
|
71
|
+
tableData[ i ] = [];
|
72
|
+
tableHtml[ i ] = [];
|
73
|
+
|
74
|
+
for ( var j = 0, cell; cell = row.cells[ j ]; j++ ) {
|
75
|
+
|
76
|
+
var value = getCellValue( cell );
|
77
|
+
|
78
|
+
if ( i > 0 && j > 0 ) {
|
79
|
+
value = +value;
|
80
|
+
}
|
81
|
+
|
82
|
+
if ( i === 0 || j === 0 ) {
|
83
|
+
tableHtml[ i ].push( '<th>'+ value +'</th>' );
|
84
|
+
} else {
|
85
|
+
tableHtml[ i ].push( '<td><input type="text" class="data-item" value="'+ value +'"></td>' );
|
86
|
+
}
|
87
|
+
|
88
|
+
tableData[ i ][ j ] = value;
|
89
|
+
|
90
|
+
}
|
91
|
+
|
92
|
+
tableHtml[ i ] = tableHtml[ i ].join( "" );
|
93
|
+
|
94
|
+
}
|
95
|
+
|
96
|
+
//draw 表格
|
97
|
+
$( "#tableContainer" ).html( '<table id="showTable" border="1"><tbody><tr>'+ tableHtml.join( "</tr><tr>" ) +'</tr></tbody></table>' );
|
98
|
+
|
99
|
+
}
|
100
|
+
|
101
|
+
/*
|
102
|
+
* 根据表格已有的图表属性初始化当前图表属性
|
103
|
+
*/
|
104
|
+
function initUserConfig ( config ) {
|
105
|
+
|
106
|
+
var parsedConfig = {};
|
107
|
+
|
108
|
+
if ( !config ) {
|
109
|
+
return;
|
110
|
+
}
|
111
|
+
|
112
|
+
config = config.split( ";" );
|
113
|
+
|
114
|
+
$.each( config, function ( index, item ) {
|
115
|
+
|
116
|
+
item = item.split( ":" );
|
117
|
+
parsedConfig[ item[ 0 ] ] = item[ 1 ];
|
118
|
+
|
119
|
+
} );
|
120
|
+
|
121
|
+
setUserConfig( parsedConfig );
|
122
|
+
|
123
|
+
}
|
124
|
+
|
125
|
+
function initEvent () {
|
126
|
+
|
127
|
+
var cacheValue = null,
|
128
|
+
//图表类型数
|
129
|
+
typeViewCount = chartsConfig.length- 1,
|
130
|
+
$chartsTypeViewBox = $( '#scrollBed .view-box' );
|
131
|
+
|
132
|
+
$( ".charts-format" ).delegate( ".format-ctrl", "change", function () {
|
133
|
+
|
134
|
+
renderCharts();
|
135
|
+
|
136
|
+
} )
|
137
|
+
|
138
|
+
$( ".table-view" ).delegate( ".data-item", "focus", function () {
|
139
|
+
|
140
|
+
cacheValue = this.value;
|
141
|
+
|
142
|
+
} ).delegate( ".data-item", "blur", function () {
|
143
|
+
|
144
|
+
if ( this.value !== cacheValue ) {
|
145
|
+
renderCharts();
|
146
|
+
}
|
147
|
+
|
148
|
+
cacheValue = null;
|
149
|
+
|
150
|
+
} );
|
151
|
+
|
152
|
+
$( "#buttonContainer" ).delegate( "a", "click", function (e) {
|
153
|
+
|
154
|
+
e.preventDefault();
|
155
|
+
|
156
|
+
if ( this.getAttribute( "data-title" ) === 'prev' ) {
|
157
|
+
|
158
|
+
if ( currentChartType > 0 ) {
|
159
|
+
currentChartType--;
|
160
|
+
updateViewType( currentChartType );
|
161
|
+
}
|
162
|
+
|
163
|
+
} else {
|
164
|
+
|
165
|
+
if ( currentChartType < typeViewCount ) {
|
166
|
+
currentChartType++;
|
167
|
+
updateViewType( currentChartType );
|
168
|
+
}
|
169
|
+
|
170
|
+
}
|
171
|
+
|
172
|
+
} );
|
173
|
+
|
174
|
+
//图表类型变化
|
175
|
+
$( '#scrollBed' ).delegate( ".view-box", "click", function (e) {
|
176
|
+
|
177
|
+
var index = $( this ).attr( "data-chart-type" );
|
178
|
+
$chartsTypeViewBox.removeClass( "selected" );
|
179
|
+
$( $chartsTypeViewBox[ index ] ).addClass( "selected" );
|
180
|
+
|
181
|
+
currentChartType = index | 0;
|
182
|
+
|
183
|
+
//饼图, 禁用部分配置
|
184
|
+
if ( currentChartType === chartsConfig.length - 1 ) {
|
185
|
+
|
186
|
+
disableNotPieConfig();
|
187
|
+
|
188
|
+
//启用完整配置
|
189
|
+
} else {
|
190
|
+
|
191
|
+
enableNotPieConfig();
|
192
|
+
|
193
|
+
}
|
194
|
+
|
195
|
+
renderCharts();
|
196
|
+
|
197
|
+
} );
|
198
|
+
|
199
|
+
}
|
200
|
+
|
201
|
+
function renderCharts () {
|
202
|
+
|
203
|
+
var data = collectData();
|
204
|
+
|
205
|
+
$('#chartsContainer').highcharts( $.extend( {}, chartsConfig[ currentChartType ], {
|
206
|
+
|
207
|
+
credits: {
|
208
|
+
enabled: false
|
209
|
+
},
|
210
|
+
exporting: {
|
211
|
+
enabled: false
|
212
|
+
},
|
213
|
+
title: {
|
214
|
+
text: data.title,
|
215
|
+
x: -20 //center
|
216
|
+
},
|
217
|
+
subtitle: {
|
218
|
+
text: data.subTitle,
|
219
|
+
x: -20
|
220
|
+
},
|
221
|
+
xAxis: {
|
222
|
+
title: {
|
223
|
+
text: data.xTitle
|
224
|
+
},
|
225
|
+
categories: data.categories
|
226
|
+
},
|
227
|
+
yAxis: {
|
228
|
+
title: {
|
229
|
+
text: data.yTitle
|
230
|
+
},
|
231
|
+
plotLines: [{
|
232
|
+
value: 0,
|
233
|
+
width: 1,
|
234
|
+
color: '#808080'
|
235
|
+
}]
|
236
|
+
},
|
237
|
+
tooltip: {
|
238
|
+
enabled: true,
|
239
|
+
valueSuffix: data.suffix
|
240
|
+
},
|
241
|
+
legend: {
|
242
|
+
layout: 'vertical',
|
243
|
+
align: 'right',
|
244
|
+
verticalAlign: 'middle',
|
245
|
+
borderWidth: 1
|
246
|
+
},
|
247
|
+
series: data.series
|
248
|
+
|
249
|
+
} ));
|
250
|
+
|
251
|
+
}
|
252
|
+
|
253
|
+
function updateViewType ( index ) {
|
254
|
+
|
255
|
+
$( "#scrollBed" ).css( 'marginLeft', -index*324+'px' );
|
256
|
+
|
257
|
+
}
|
258
|
+
|
259
|
+
function collectData () {
|
260
|
+
|
261
|
+
var form = document.forms[ 'data-form' ],
|
262
|
+
data = null;
|
263
|
+
|
264
|
+
if ( currentChartType !== chartsConfig.length - 1 ) {
|
265
|
+
|
266
|
+
data = getSeriesAndCategories();
|
267
|
+
$.extend( data, getUserConfig() );
|
268
|
+
|
269
|
+
//饼图数据格式
|
270
|
+
} else {
|
271
|
+
data = getSeriesForPieChart();
|
272
|
+
data.title = form[ 'title' ].value;
|
273
|
+
data.suffix = form[ 'unit' ].value;
|
274
|
+
}
|
275
|
+
|
276
|
+
return data;
|
277
|
+
|
278
|
+
}
|
279
|
+
|
280
|
+
/**
|
281
|
+
* 获取用户配置信息
|
282
|
+
*/
|
283
|
+
function getUserConfig () {
|
284
|
+
|
285
|
+
var form = document.forms[ 'data-form' ],
|
286
|
+
info = {
|
287
|
+
title: form[ 'title' ].value,
|
288
|
+
subTitle: form[ 'sub-title' ].value,
|
289
|
+
xTitle: form[ 'x-title' ].value,
|
290
|
+
yTitle: form[ 'y-title' ].value,
|
291
|
+
suffix: form[ 'unit' ].value,
|
292
|
+
//数据对齐方式
|
293
|
+
tableDataFormat: getTableDataFormat (),
|
294
|
+
//饼图提示文字
|
295
|
+
tip: $( "#tipInput" ).val()
|
296
|
+
};
|
297
|
+
|
298
|
+
return info;
|
299
|
+
|
300
|
+
}
|
301
|
+
|
302
|
+
function setUserConfig ( config ) {
|
303
|
+
|
304
|
+
var form = document.forms[ 'data-form' ];
|
305
|
+
|
306
|
+
config.title && ( form[ 'title' ].value = config.title );
|
307
|
+
config.subTitle && ( form[ 'sub-title' ].value = config.subTitle );
|
308
|
+
config.xTitle && ( form[ 'x-title' ].value = config.xTitle );
|
309
|
+
config.yTitle && ( form[ 'y-title' ].value = config.yTitle );
|
310
|
+
config.suffix && ( form[ 'unit' ].value = config.suffix );
|
311
|
+
config.dataFormat == "-1" && ( form[ 'charts-format' ][ 1 ].checked = true );
|
312
|
+
config.tip && ( form[ 'tip' ].value = config.tip );
|
313
|
+
currentChartType = config.chartType || 0;
|
314
|
+
|
315
|
+
}
|
316
|
+
|
317
|
+
function getSeriesAndCategories () {
|
318
|
+
|
319
|
+
var form = document.forms[ 'data-form' ],
|
320
|
+
series = [],
|
321
|
+
categories = [],
|
322
|
+
tmp = [],
|
323
|
+
tableData = getTableData();
|
324
|
+
|
325
|
+
//反转数据
|
326
|
+
if ( getTableDataFormat() === "-1" ) {
|
327
|
+
|
328
|
+
for ( var i = 0, len = tableData.length; i < len; i++ ) {
|
329
|
+
|
330
|
+
for ( var j = 0, jlen = tableData[ i ].length; j < jlen; j++ ) {
|
331
|
+
|
332
|
+
if ( !tmp[ j ] ) {
|
333
|
+
tmp[ j ] = [];
|
334
|
+
}
|
335
|
+
|
336
|
+
tmp[ j ][ i ] = tableData[ i ][ j ];
|
337
|
+
|
338
|
+
}
|
339
|
+
|
340
|
+
}
|
341
|
+
|
342
|
+
tableData = tmp;
|
343
|
+
|
344
|
+
}
|
345
|
+
|
346
|
+
categories = tableData[0].slice( 1 );
|
347
|
+
|
348
|
+
for ( var i = 1, data; data = tableData[ i ]; i++ ) {
|
349
|
+
|
350
|
+
series.push( {
|
351
|
+
name: data[ 0 ],
|
352
|
+
data: data.slice( 1 )
|
353
|
+
} );
|
354
|
+
|
355
|
+
}
|
356
|
+
|
357
|
+
return {
|
358
|
+
series: series,
|
359
|
+
categories: categories
|
360
|
+
};
|
361
|
+
|
362
|
+
}
|
363
|
+
|
364
|
+
/*
|
365
|
+
* 获取数据源数据对齐方式
|
366
|
+
*/
|
367
|
+
function getTableDataFormat () {
|
368
|
+
|
369
|
+
var form = document.forms[ 'data-form' ],
|
370
|
+
items = form['charts-format'];
|
371
|
+
|
372
|
+
return items[ 0 ].checked ? items[ 0 ].value : items[ 1 ].value;
|
373
|
+
|
374
|
+
}
|
375
|
+
|
376
|
+
/*
|
377
|
+
* 禁用非饼图类型的配置项
|
378
|
+
*/
|
379
|
+
function disableNotPieConfig() {
|
380
|
+
|
381
|
+
updateConfigItem( 'disable' );
|
382
|
+
|
383
|
+
}
|
384
|
+
|
385
|
+
/*
|
386
|
+
* 启用非饼图类型的配置项
|
387
|
+
*/
|
388
|
+
function enableNotPieConfig() {
|
389
|
+
|
390
|
+
updateConfigItem( 'enable' );
|
391
|
+
|
392
|
+
}
|
393
|
+
|
394
|
+
function updateConfigItem ( value ) {
|
395
|
+
|
396
|
+
var table = $( "#showTable" )[ 0 ],
|
397
|
+
isDisable = value === 'disable' ? true : false;
|
398
|
+
|
399
|
+
//table中的input处理
|
400
|
+
for ( var i = 2 , row; row = table.rows[ i ]; i++ ) {
|
401
|
+
|
402
|
+
for ( var j = 1, cell; cell = row.cells[ j ]; j++ ) {
|
403
|
+
|
404
|
+
$( "input", cell ).attr( "disabled", isDisable );
|
405
|
+
|
406
|
+
}
|
407
|
+
|
408
|
+
}
|
409
|
+
|
410
|
+
//其他项处理
|
411
|
+
$( "input.not-pie-item" ).attr( "disabled", isDisable );
|
412
|
+
$( "#tipInput" ).attr( "disabled", !isDisable )
|
413
|
+
|
414
|
+
}
|
415
|
+
|
416
|
+
/*
|
417
|
+
* 获取饼图数据
|
418
|
+
* 饼图的数据只取第一行的
|
419
|
+
**/
|
420
|
+
function getSeriesForPieChart () {
|
421
|
+
|
422
|
+
var series = {
|
423
|
+
type: 'pie',
|
424
|
+
name: $("#tipInput").val(),
|
425
|
+
data: []
|
426
|
+
},
|
427
|
+
tableData = getTableData();
|
428
|
+
|
429
|
+
|
430
|
+
for ( var j = 1, jlen = tableData[ 0 ].length; j < jlen; j++ ) {
|
431
|
+
|
432
|
+
var title = tableData[ 0 ][ j ],
|
433
|
+
val = tableData[ 1 ][ j ];
|
434
|
+
|
435
|
+
series.data.push( [ title, val ] );
|
436
|
+
|
437
|
+
}
|
438
|
+
|
439
|
+
return {
|
440
|
+
series: [ series ]
|
441
|
+
};
|
442
|
+
|
443
|
+
}
|
444
|
+
|
445
|
+
function getTableData () {
|
446
|
+
|
447
|
+
var table = document.getElementById( "showTable" ),
|
448
|
+
xCount = table.rows[0].cells.length - 1,
|
449
|
+
values = getTableInputValue();
|
450
|
+
|
451
|
+
for ( var i = 0, value; value = values[ i ]; i++ ) {
|
452
|
+
|
453
|
+
tableData[ Math.floor( i / xCount ) + 1 ][ i % xCount + 1 ] = values[ i ];
|
454
|
+
|
455
|
+
}
|
456
|
+
|
457
|
+
return tableData;
|
458
|
+
|
459
|
+
}
|
460
|
+
|
461
|
+
function getTableInputValue () {
|
462
|
+
|
463
|
+
var table = document.getElementById( "showTable" ),
|
464
|
+
inputs = table.getElementsByTagName( "input" ),
|
465
|
+
values = [];
|
466
|
+
|
467
|
+
for ( var i = 0, input; input = inputs[ i ]; i++ ) {
|
468
|
+
values.push( input.value | 0 );
|
469
|
+
}
|
470
|
+
|
471
|
+
return values;
|
472
|
+
|
473
|
+
}
|
474
|
+
|
475
|
+
function getCellValue ( cell ) {
|
476
|
+
|
477
|
+
var value = utils.trim( ( cell.innerText || cell.textContent || '' ) );
|
478
|
+
|
479
|
+
return value.replace( new RegExp( UE.dom.domUtils.fillChar, 'g' ), '' ).replace( /^\s+|\s+$/g, '' );
|
480
|
+
|
481
|
+
}
|
482
|
+
|
483
|
+
|
484
|
+
//dialog确认事件
|
485
|
+
dialog.onok = function () {
|
486
|
+
|
487
|
+
//收集信息
|
488
|
+
var form = document.forms[ 'data-form' ],
|
489
|
+
info = getUserConfig();
|
490
|
+
|
491
|
+
//添加图表类型
|
492
|
+
info.chartType = currentChartType;
|
493
|
+
|
494
|
+
//同步表格数据到编辑器
|
495
|
+
syncTableData();
|
496
|
+
|
497
|
+
//执行图表命令
|
498
|
+
editor.execCommand( 'charts', info );
|
499
|
+
|
500
|
+
};
|
501
|
+
|
502
|
+
/*
|
503
|
+
* 同步图表编辑视图的表格数据到编辑器里的原始表格
|
504
|
+
*/
|
505
|
+
function syncTableData () {
|
506
|
+
|
507
|
+
var tableData = getTableData();
|
508
|
+
|
509
|
+
for ( var i = 1, row; row = editorTable.rows[ i ]; i++ ) {
|
510
|
+
|
511
|
+
for ( var j = 1, cell; cell = row.cells[ j ]; j++ ) {
|
512
|
+
|
513
|
+
cell.innerHTML = tableData[ i ] [ j ];
|
514
|
+
|
515
|
+
}
|
516
|
+
|
517
|
+
}
|
518
|
+
|
519
|
+
}
|