ueditor.rails 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (223) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/config.mindpin.default.coffee +59 -0
  3. data/app/assets/javascripts/ueditor.js +3 -2
  4. data/app/assets/stylesheets/ueditor/themes/mindpin/css/ueditor.css +1945 -0
  5. data/app/assets/stylesheets/ueditor/themes/mindpin/dialogbase.css +100 -0
  6. data/app/assets/stylesheets/ueditor/themes/mindpin/images/anchor.gif +0 -0
  7. data/app/assets/stylesheets/ueditor/themes/mindpin/images/arrow.png +0 -0
  8. data/app/assets/stylesheets/ueditor/themes/mindpin/images/arrow_down.png +0 -0
  9. data/app/assets/stylesheets/ueditor/themes/mindpin/images/arrow_up.png +0 -0
  10. data/app/assets/stylesheets/ueditor/themes/mindpin/images/button-bg.gif +0 -0
  11. data/app/assets/stylesheets/ueditor/themes/mindpin/images/cancelbutton.gif +0 -0
  12. data/app/assets/stylesheets/ueditor/themes/mindpin/images/charts.png +0 -0
  13. data/app/assets/stylesheets/ueditor/themes/mindpin/images/cursor_h.gif +0 -0
  14. data/app/assets/stylesheets/ueditor/themes/mindpin/images/cursor_h.png +0 -0
  15. data/app/assets/stylesheets/ueditor/themes/mindpin/images/cursor_v.gif +0 -0
  16. data/app/assets/stylesheets/ueditor/themes/mindpin/images/cursor_v.png +0 -0
  17. data/app/assets/stylesheets/ueditor/themes/mindpin/images/dialog-title-bg.png +0 -0
  18. data/{vendor/assets/javascripts/ueditor/dialogs/attachment/images/alignicon.png → app/assets/stylesheets/ueditor/themes/mindpin/images/filescan.png} +0 -0
  19. data/app/assets/stylesheets/ueditor/themes/mindpin/images/highlighted.gif +0 -0
  20. data/app/assets/stylesheets/ueditor/themes/mindpin/images/icons-all.gif +0 -0
  21. data/app/assets/stylesheets/ueditor/themes/mindpin/images/icons.gif +0 -0
  22. data/app/assets/stylesheets/ueditor/themes/mindpin/images/icons.png +0 -0
  23. data/{vendor/assets/javascripts/ueditor/dialogs/attachment/images/bg.png → app/assets/stylesheets/ueditor/themes/mindpin/images/loaderror.png} +0 -0
  24. data/app/assets/stylesheets/ueditor/themes/mindpin/images/loading.gif +0 -0
  25. data/{vendor/assets/javascripts/ueditor/dialogs/attachment/images/alignicon.gif → app/assets/stylesheets/ueditor/themes/mindpin/images/lock.gif} +0 -0
  26. data/{vendor/assets/javascripts/ueditor/dialogs/emotion → app/assets/stylesheets/ueditor/themes/mindpin}/images/neweditor-tab-bg.png +0 -0
  27. data/app/assets/stylesheets/ueditor/themes/mindpin/images/pagebreak.gif +0 -0
  28. data/app/assets/stylesheets/ueditor/themes/mindpin/images/scale.png +0 -0
  29. data/{vendor/assets/javascripts/ueditor/dialogs/video/images/bg.png → app/assets/stylesheets/ueditor/themes/mindpin/images/sortable.png} +0 -0
  30. data/app/assets/stylesheets/ueditor/themes/mindpin/images/spacer.gif +0 -0
  31. data/app/assets/stylesheets/ueditor/themes/mindpin/images/sparator_v.png +0 -0
  32. data/app/assets/stylesheets/ueditor/themes/mindpin/images/table-cell-align.png +0 -0
  33. data/app/assets/stylesheets/ueditor/themes/mindpin/images/tangram-colorpicker.png +0 -0
  34. data/app/assets/stylesheets/ueditor/themes/mindpin/images/toolbar_bg.png +0 -0
  35. data/app/assets/stylesheets/ueditor/themes/mindpin/images/unhighlighted.gif +0 -0
  36. data/app/assets/stylesheets/ueditor/themes/mindpin/images/upload.png +0 -0
  37. data/app/assets/stylesheets/ueditor/themes/mindpin/images/videologo.gif +0 -0
  38. data/{vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_chm.gif → app/assets/stylesheets/ueditor/themes/mindpin/images/word.gif} +0 -0
  39. data/app/assets/stylesheets/ueditor/themes/mindpin/images/wordpaste.png +0 -0
  40. data/lib/ueditor/version.rb +1 -1
  41. data/test/dummy/log/development.log +105 -0
  42. data/test/dummy/tmp/cache/assets/development/sprockets/02b56f18dcd4ddec585a02528773c04b +0 -0
  43. data/test/dummy/tmp/cache/assets/development/sprockets/067a099f2392ac9d679fb27d72421548 +0 -0
  44. data/test/dummy/tmp/cache/assets/development/sprockets/07898ec696d976eeafb61ef6bb48e097 +0 -0
  45. data/test/dummy/tmp/cache/assets/development/sprockets/19694ecb6829b547affeb420f6c4f4ba +0 -0
  46. data/test/dummy/tmp/cache/assets/development/sprockets/22b4a109d4f3136884f5b96c0dafe5c4 +0 -0
  47. data/test/dummy/tmp/cache/assets/development/sprockets/2e810e09180be475ce270590eb6d79bf +0 -0
  48. data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  49. data/test/dummy/tmp/cache/assets/development/sprockets/31b24023d7695b6c40fbe8b2d903e8db +0 -0
  50. data/test/dummy/tmp/cache/assets/development/sprockets/32e4b0cbcc7942738eb80e9c571e09ad +0 -0
  51. data/test/dummy/tmp/cache/assets/development/sprockets/3e6fbffe890d9471ace4284a35cf833e +0 -0
  52. data/test/dummy/tmp/cache/assets/development/sprockets/50a23c1131cabc18af0d7ce21df229ea +0 -0
  53. data/test/dummy/tmp/cache/assets/development/sprockets/792425c63374a4c75ca043ceeb960991 +0 -0
  54. data/test/dummy/tmp/cache/assets/development/sprockets/8165d0bcd2b5c04b4a98f4f0cbabef64 +0 -0
  55. data/test/dummy/tmp/cache/assets/development/sprockets/9bf28bcb944fe3baabaabb97036a4d6c +0 -0
  56. data/test/dummy/tmp/cache/assets/development/sprockets/9df06b25c7118a2446ff210358a7150a +0 -0
  57. data/test/dummy/tmp/cache/assets/development/sprockets/a0a5d0da6dc7907299fb15adbabc87e5 +0 -0
  58. data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  59. data/test/dummy/tmp/cache/assets/development/sprockets/d3a9a64bc190424c032a25d0b7ee0ed1 +0 -0
  60. data/test/dummy/tmp/cache/assets/development/sprockets/eb17dc3da27134989a88ec01caa61d78 +0 -0
  61. data/test/dummy/tmp/cache/assets/development/sprockets/ef01c1c9fa9a8ace471702975febabf5 +0 -0
  62. data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  63. data/test/dummy/tmp/cache/assets/development/sprockets/fa046bb067616da9d14862739bf2c67c +0 -0
  64. data/vendor/assets/javascripts/ueditor/index.html +0 -19
  65. data/vendor/assets/javascripts/ueditor/themes/iframe.css +0 -1
  66. data/vendor/assets/javascripts/ueditor/ueditor.all.js +2854 -12684
  67. data/vendor/assets/javascripts/ueditor/ueditor.all.min.js +10 -709
  68. data/vendor/assets/javascripts/ueditor/ueditor.config.js +2 -147
  69. data/vendor/assets/javascripts/ueditor/ueditor.parse.js +11 -602
  70. data/vendor/assets/javascripts/ueditor/ueditor.parse.min.js +1 -28
  71. metadata +82 -161
  72. data/app/assets/javascripts/default.config.js +0 -381
  73. data/vendor/assets/javascripts/ueditor/dialogs/anchor/anchor.html +0 -40
  74. data/vendor/assets/javascripts/ueditor/dialogs/attachment/attachment.css +0 -681
  75. data/vendor/assets/javascripts/ueditor/dialogs/attachment/attachment.html +0 -60
  76. data/vendor/assets/javascripts/ueditor/dialogs/attachment/attachment.js +0 -754
  77. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_default.png +0 -0
  78. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_doc.gif +0 -0
  79. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_exe.gif +0 -0
  80. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_jpg.gif +0 -0
  81. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_mp3.gif +0 -0
  82. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_mv.gif +0 -0
  83. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_pdf.gif +0 -0
  84. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_ppt.gif +0 -0
  85. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_psd.gif +0 -0
  86. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_rar.gif +0 -0
  87. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_txt.gif +0 -0
  88. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_xls.gif +0 -0
  89. data/vendor/assets/javascripts/ueditor/dialogs/attachment/images/file-icons.gif +0 -0
  90. data/vendor/assets/javascripts/ueditor/dialogs/attachment/images/file-icons.png +0 -0
  91. data/vendor/assets/javascripts/ueditor/dialogs/attachment/images/icons.gif +0 -0
  92. data/vendor/assets/javascripts/ueditor/dialogs/attachment/images/icons.png +0 -0
  93. data/vendor/assets/javascripts/ueditor/dialogs/attachment/images/image.png +0 -0
  94. data/vendor/assets/javascripts/ueditor/dialogs/attachment/images/progress.png +0 -0
  95. data/vendor/assets/javascripts/ueditor/dialogs/attachment/images/success.gif +0 -0
  96. data/vendor/assets/javascripts/ueditor/dialogs/attachment/images/success.png +0 -0
  97. data/vendor/assets/javascripts/ueditor/dialogs/background/background.css +0 -94
  98. data/vendor/assets/javascripts/ueditor/dialogs/background/background.html +0 -56
  99. data/vendor/assets/javascripts/ueditor/dialogs/background/background.js +0 -376
  100. data/vendor/assets/javascripts/ueditor/dialogs/background/images/bg.png +0 -0
  101. data/vendor/assets/javascripts/ueditor/dialogs/background/images/success.png +0 -0
  102. data/vendor/assets/javascripts/ueditor/dialogs/charts/chart.config.js +0 -65
  103. data/vendor/assets/javascripts/ueditor/dialogs/charts/charts.css +0 -165
  104. data/vendor/assets/javascripts/ueditor/dialogs/charts/charts.html +0 -89
  105. data/vendor/assets/javascripts/ueditor/dialogs/charts/charts.js +0 -519
  106. data/vendor/assets/javascripts/ueditor/dialogs/charts/images/charts0.png +0 -0
  107. data/vendor/assets/javascripts/ueditor/dialogs/charts/images/charts1.png +0 -0
  108. data/vendor/assets/javascripts/ueditor/dialogs/charts/images/charts2.png +0 -0
  109. data/vendor/assets/javascripts/ueditor/dialogs/charts/images/charts3.png +0 -0
  110. data/vendor/assets/javascripts/ueditor/dialogs/charts/images/charts4.png +0 -0
  111. data/vendor/assets/javascripts/ueditor/dialogs/charts/images/charts5.png +0 -0
  112. data/vendor/assets/javascripts/ueditor/dialogs/emotion/emotion.css +0 -43
  113. data/vendor/assets/javascripts/ueditor/dialogs/emotion/emotion.html +0 -54
  114. data/vendor/assets/javascripts/ueditor/dialogs/emotion/emotion.js +0 -186
  115. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/0.gif +0 -0
  116. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/bface.gif +0 -0
  117. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/cface.gif +0 -0
  118. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/fface.gif +0 -0
  119. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/jxface2.gif +0 -0
  120. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/tface.gif +0 -0
  121. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/wface.gif +0 -0
  122. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/yface.gif +0 -0
  123. data/vendor/assets/javascripts/ueditor/dialogs/gmap/gmap.html +0 -89
  124. data/vendor/assets/javascripts/ueditor/dialogs/help/help.css +0 -7
  125. data/vendor/assets/javascripts/ueditor/dialogs/help/help.html +0 -82
  126. data/vendor/assets/javascripts/ueditor/dialogs/help/help.js +0 -56
  127. data/vendor/assets/javascripts/ueditor/dialogs/image/image.css +0 -894
  128. data/vendor/assets/javascripts/ueditor/dialogs/image/image.html +0 -120
  129. data/vendor/assets/javascripts/ueditor/dialogs/image/image.js +0 -1139
  130. data/vendor/assets/javascripts/ueditor/dialogs/image/images/alignicon.jpg +0 -0
  131. data/vendor/assets/javascripts/ueditor/dialogs/image/images/bg.png +0 -0
  132. data/vendor/assets/javascripts/ueditor/dialogs/image/images/icons.gif +0 -0
  133. data/vendor/assets/javascripts/ueditor/dialogs/image/images/icons.png +0 -0
  134. data/vendor/assets/javascripts/ueditor/dialogs/image/images/image.png +0 -0
  135. data/vendor/assets/javascripts/ueditor/dialogs/image/images/progress.png +0 -0
  136. data/vendor/assets/javascripts/ueditor/dialogs/image/images/success.gif +0 -0
  137. data/vendor/assets/javascripts/ueditor/dialogs/image/images/success.png +0 -0
  138. data/vendor/assets/javascripts/ueditor/dialogs/insertframe/insertframe.html +0 -98
  139. data/vendor/assets/javascripts/ueditor/dialogs/map/map.html +0 -135
  140. data/vendor/assets/javascripts/ueditor/dialogs/map/show.html +0 -118
  141. data/vendor/assets/javascripts/ueditor/dialogs/music/music.css +0 -30
  142. data/vendor/assets/javascripts/ueditor/dialogs/music/music.html +0 -32
  143. data/vendor/assets/javascripts/ueditor/dialogs/music/music.js +0 -192
  144. data/vendor/assets/javascripts/ueditor/dialogs/preview/preview.html +0 -40
  145. data/vendor/assets/javascripts/ueditor/dialogs/scrawl/images/addimg.png +0 -0
  146. data/vendor/assets/javascripts/ueditor/dialogs/scrawl/images/brush.png +0 -0
  147. data/vendor/assets/javascripts/ueditor/dialogs/scrawl/images/delimg.png +0 -0
  148. data/vendor/assets/javascripts/ueditor/dialogs/scrawl/images/delimgH.png +0 -0
  149. data/vendor/assets/javascripts/ueditor/dialogs/scrawl/images/empty.png +0 -0
  150. data/vendor/assets/javascripts/ueditor/dialogs/scrawl/images/emptyH.png +0 -0
  151. data/vendor/assets/javascripts/ueditor/dialogs/scrawl/images/eraser.png +0 -0
  152. data/vendor/assets/javascripts/ueditor/dialogs/scrawl/images/redo.png +0 -0
  153. data/vendor/assets/javascripts/ueditor/dialogs/scrawl/images/redoH.png +0 -0
  154. data/vendor/assets/javascripts/ueditor/dialogs/scrawl/images/scale.png +0 -0
  155. data/vendor/assets/javascripts/ueditor/dialogs/scrawl/images/scaleH.png +0 -0
  156. data/vendor/assets/javascripts/ueditor/dialogs/scrawl/images/size.png +0 -0
  157. data/vendor/assets/javascripts/ueditor/dialogs/scrawl/images/undo.png +0 -0
  158. data/vendor/assets/javascripts/ueditor/dialogs/scrawl/images/undoH.png +0 -0
  159. data/vendor/assets/javascripts/ueditor/dialogs/scrawl/scrawl.css +0 -72
  160. data/vendor/assets/javascripts/ueditor/dialogs/scrawl/scrawl.html +0 -95
  161. data/vendor/assets/javascripts/ueditor/dialogs/scrawl/scrawl.js +0 -671
  162. data/vendor/assets/javascripts/ueditor/dialogs/searchreplace/searchreplace.html +0 -102
  163. data/vendor/assets/javascripts/ueditor/dialogs/searchreplace/searchreplace.js +0 -164
  164. data/vendor/assets/javascripts/ueditor/dialogs/snapscreen/snapscreen.html +0 -58
  165. data/vendor/assets/javascripts/ueditor/dialogs/spechars/spechars.html +0 -21
  166. data/vendor/assets/javascripts/ueditor/dialogs/spechars/spechars.js +0 -57
  167. data/vendor/assets/javascripts/ueditor/dialogs/table/dragicon.png +0 -0
  168. data/vendor/assets/javascripts/ueditor/dialogs/table/edittable.css +0 -84
  169. data/vendor/assets/javascripts/ueditor/dialogs/table/edittable.html +0 -64
  170. data/vendor/assets/javascripts/ueditor/dialogs/table/edittable.js +0 -237
  171. data/vendor/assets/javascripts/ueditor/dialogs/table/edittd.html +0 -61
  172. data/vendor/assets/javascripts/ueditor/dialogs/table/edittip.html +0 -33
  173. data/vendor/assets/javascripts/ueditor/dialogs/template/config.js +0 -42
  174. data/vendor/assets/javascripts/ueditor/dialogs/template/images/bg.gif +0 -0
  175. data/vendor/assets/javascripts/ueditor/dialogs/template/images/pre0.png +0 -0
  176. data/vendor/assets/javascripts/ueditor/dialogs/template/images/pre1.png +0 -0
  177. data/vendor/assets/javascripts/ueditor/dialogs/template/images/pre2.png +0 -0
  178. data/vendor/assets/javascripts/ueditor/dialogs/template/images/pre3.png +0 -0
  179. data/vendor/assets/javascripts/ueditor/dialogs/template/images/pre4.png +0 -0
  180. data/vendor/assets/javascripts/ueditor/dialogs/template/template.css +0 -18
  181. data/vendor/assets/javascripts/ueditor/dialogs/template/template.html +0 -26
  182. data/vendor/assets/javascripts/ueditor/dialogs/template/template.js +0 -53
  183. data/vendor/assets/javascripts/ueditor/dialogs/video/images/center_focus.jpg +0 -0
  184. data/vendor/assets/javascripts/ueditor/dialogs/video/images/file-icons.gif +0 -0
  185. data/vendor/assets/javascripts/ueditor/dialogs/video/images/file-icons.png +0 -0
  186. data/vendor/assets/javascripts/ueditor/dialogs/video/images/icons.gif +0 -0
  187. data/vendor/assets/javascripts/ueditor/dialogs/video/images/icons.png +0 -0
  188. data/vendor/assets/javascripts/ueditor/dialogs/video/images/image.png +0 -0
  189. data/vendor/assets/javascripts/ueditor/dialogs/video/images/left_focus.jpg +0 -0
  190. data/vendor/assets/javascripts/ueditor/dialogs/video/images/none_focus.jpg +0 -0
  191. data/vendor/assets/javascripts/ueditor/dialogs/video/images/progress.png +0 -0
  192. data/vendor/assets/javascripts/ueditor/dialogs/video/images/right_focus.jpg +0 -0
  193. data/vendor/assets/javascripts/ueditor/dialogs/video/images/success.gif +0 -0
  194. data/vendor/assets/javascripts/ueditor/dialogs/video/images/success.png +0 -0
  195. data/vendor/assets/javascripts/ueditor/dialogs/video/video.css +0 -635
  196. data/vendor/assets/javascripts/ueditor/dialogs/video/video.html +0 -86
  197. data/vendor/assets/javascripts/ueditor/dialogs/video/video.js +0 -789
  198. data/vendor/assets/javascripts/ueditor/dialogs/webapp/webapp.html +0 -53
  199. data/vendor/assets/javascripts/ueditor/dialogs/wordimage/fClipboard_ueditor.swf +0 -0
  200. data/vendor/assets/javascripts/ueditor/dialogs/wordimage/imageUploader.swf +0 -0
  201. data/vendor/assets/javascripts/ueditor/dialogs/wordimage/tangram.js +0 -1495
  202. data/vendor/assets/javascripts/ueditor/dialogs/wordimage/wordimage.html +0 -111
  203. data/vendor/assets/javascripts/ueditor/dialogs/wordimage/wordimage.js +0 -157
  204. data/vendor/assets/javascripts/ueditor/lang/en/en.js +0 -684
  205. data/vendor/assets/javascripts/ueditor/lang/en/images/addimage.png +0 -0
  206. data/vendor/assets/javascripts/ueditor/lang/en/images/alldeletebtnhoverskin.png +0 -0
  207. data/vendor/assets/javascripts/ueditor/lang/en/images/alldeletebtnupskin.png +0 -0
  208. data/vendor/assets/javascripts/ueditor/lang/en/images/background.png +0 -0
  209. data/vendor/assets/javascripts/ueditor/lang/en/images/button.png +0 -0
  210. data/vendor/assets/javascripts/ueditor/lang/en/images/copy.png +0 -0
  211. data/vendor/assets/javascripts/ueditor/lang/en/images/deletedisable.png +0 -0
  212. data/vendor/assets/javascripts/ueditor/lang/en/images/deleteenable.png +0 -0
  213. data/vendor/assets/javascripts/ueditor/lang/en/images/listbackground.png +0 -0
  214. data/vendor/assets/javascripts/ueditor/lang/en/images/localimage.png +0 -0
  215. data/vendor/assets/javascripts/ueditor/lang/en/images/music.png +0 -0
  216. data/vendor/assets/javascripts/ueditor/lang/en/images/rotateleftdisable.png +0 -0
  217. data/vendor/assets/javascripts/ueditor/lang/en/images/rotateleftenable.png +0 -0
  218. data/vendor/assets/javascripts/ueditor/lang/en/images/rotaterightdisable.png +0 -0
  219. data/vendor/assets/javascripts/ueditor/lang/en/images/rotaterightenable.png +0 -0
  220. data/vendor/assets/javascripts/ueditor/lang/en/images/upload.png +0 -0
  221. data/vendor/assets/javascripts/ueditor/third-party/zeroclipboard/ZeroClipboard.js +0 -1256
  222. data/vendor/assets/javascripts/ueditor/third-party/zeroclipboard/ZeroClipboard.min.js +0 -9
  223. data/vendor/assets/javascripts/ueditor/third-party/zeroclipboard/ZeroClipboard.swf +0 -0
@@ -1,40 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2
- "http://www.w3.org/TR/html4/loose.dtd">
3
- <html>
4
- <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6
- <style>
7
- html,body{
8
- height:100%;
9
- width:100%;
10
- padding:0;
11
- margin:0;
12
- }
13
- #preview{
14
- width:100%;
15
- height:100%;
16
- padding:0;
17
- margin:0;
18
- }
19
- #preview *{font-family:sans-serif;font-size:16px;}
20
- </style>
21
- <script type="text/javascript" src="../internal.js"></script>
22
- <script src="../../ueditor.parse.js"></script>
23
- <title></title>
24
- </head>
25
- <body class="view">
26
- <div id="preview" style="margin:8px">
27
-
28
- </div>
29
- </body>
30
- <script>
31
- document.getElementById('preview').innerHTML = editor.getContent();
32
- uParse('#preview',{
33
- rootPath : '../../',
34
- chartContainerHeight:500
35
- })
36
- dialog.oncancel = function(){
37
- document.getElementById('preview').innerHTML = '';
38
- }
39
- </script>
40
- </html>
@@ -1,72 +0,0 @@
1
- /*common
2
- */
3
- body{margin: 0;}
4
- table{width:100%;}
5
- table td{padding:2px 4px;vertical-align: middle;}
6
- a{text-decoration: none;}
7
- em{font-style: normal;}
8
- .border_style1{border: 1px solid #ccc;border-radius: 5px;box-shadow:2px 2px 5px #d3d6da;}
9
- /*module
10
- */
11
- .main{margin: 8px;overflow: hidden;}
12
-
13
- .hot{float:left;height:335px;}
14
- .drawBoard{position: relative; cursor: crosshair;}
15
- .brushBorad{position: absolute;left:0;top:0;z-index: 998;}
16
- .picBoard{border: none;text-align: center;line-height: 300px;cursor: default;}
17
- .operateBar{margin-top:10px;font-size:12px;text-align: center;}
18
- .operateBar span{margin-left: 10px;}
19
-
20
- .drawToolbar{float:right;width:110px;height:300px;overflow: hidden;}
21
- .colorBar{margin-top:10px;font-size: 12px;text-align: center;}
22
- .colorBar a{display:block;width: 10px;height: 10px;border:1px solid #1006F1;border-radius: 3px; box-shadow:2px 2px 5px #d3d6da;opacity: 0.3}
23
- .sectionBar{margin-top:15px;font-size: 12px;text-align: center;}
24
- .sectionBar a{display:inline-block;width:10px;height:12px;color: #888;text-indent: -999px;opacity: 0.3}
25
- .size1{background: url('images/size.png') 1px center no-repeat ;}
26
- .size2{background: url('images/size.png') -10px center no-repeat;}
27
- .size3{background: url('images/size.png') -22px center no-repeat;}
28
- .size4{background: url('images/size.png') -35px center no-repeat;}
29
-
30
- .addImgH{position: relative;}
31
- .addImgH_form{position: absolute;left: 18px;top: -1px;width: 75px;height: 21px;opacity: 0;cursor: pointer;}
32
- .addImgH_form input{width: 100%;}
33
- /*scrawl遮罩层
34
- */
35
- .maskLayerNull{display: none;}
36
- .maskLayer{position: absolute;top:0;left:0;width: 100%; height: 100%;opacity: 0.7;
37
- background-color: #fff;text-align:center;font-weight:bold;line-height:300px;z-index: 1000;}
38
- /*btn state
39
- */
40
- .previousStepH .icon{display: inline-block;width:16px;height:16px;background-image: url('images/undoH.png');cursor: pointer;}
41
- .previousStepH .text{color:#888;cursor:pointer;}
42
- .previousStep .icon{display: inline-block;width:16px;height:16px;background-image: url('images/undo.png');cursor:default;}
43
- .previousStep .text{color:#ccc;cursor:default;}
44
-
45
- .nextStepH .icon{display: inline-block;width:16px;height:16px;background-image: url('images/redoH.png');cursor: pointer;}
46
- .nextStepH .text{color:#888;cursor:pointer;}
47
- .nextStep .icon{display: inline-block;width:16px;height:16px;background-image: url('images/redo.png');cursor:default;}
48
- .nextStep .text{color:#ccc;cursor:default;}
49
-
50
- .clearBoardH .icon{display: inline-block;width:16px;height:16px;background-image: url('images/emptyH.png');cursor: pointer;}
51
- .clearBoardH .text{color:#888;cursor:pointer;}
52
- .clearBoard .icon{display: inline-block;width:16px;height:16px;background-image: url('images/empty.png');cursor:default;}
53
- .clearBoard .text{color:#ccc;cursor:default;}
54
-
55
- .scaleBoardH .icon{display: inline-block;width:16px;height:16px;background-image: url('images/scaleH.png');cursor: pointer;}
56
- .scaleBoardH .text{color:#888;cursor:pointer;}
57
- .scaleBoard .icon{display: inline-block;width:16px;height:16px;background-image: url('images/scale.png');cursor:default;}
58
- .scaleBoard .text{color:#ccc;cursor:default;}
59
-
60
- .removeImgH .icon{display: inline-block;width:16px;height:16px;background-image: url('images/delimgH.png');cursor: pointer;}
61
- .removeImgH .text{color:#888;cursor:pointer;}
62
- .removeImg .icon{display: inline-block;width:16px;height:16px;background-image: url('images/delimg.png');cursor:default;}
63
- .removeImg .text{color:#ccc;cursor:default;}
64
-
65
- .addImgH .icon{vertical-align:top;display: inline-block;width:16px;height:16px;background-image: url('images/addimg.png')}
66
- .addImgH .text{color:#888;cursor:pointer;}
67
- /*icon
68
- */
69
- .brushIcon{display: inline-block;width:16px;height:16px;background-image: url('images/brush.png')}
70
- .eraserIcon{display: inline-block;width:16px;height:16px;background-image: url('images/eraser.png')}
71
-
72
-
@@ -1,95 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title></title>
5
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6
- <meta name="robots" content="noindex, nofollow"/>
7
- <script type="text/javascript" src="../internal.js"></script>
8
- <link rel="stylesheet" type="text/css" href="scrawl.css">
9
- </head>
10
- <body>
11
- <div class="main" id="J_wrap">
12
- <div class="hot">
13
- <div class="drawBoard border_style1">
14
- <canvas id="J_brushBoard" class="brushBorad" width="360" height="300"></canvas>
15
- <div id="J_picBoard" class="picBoard" style="width: 360px;height: 300px"></div>
16
- </div>
17
- <div id="J_operateBar" class="operateBar">
18
- <span id="J_previousStep" class="previousStep">
19
- <em class="icon"></em>
20
- <em class="text"><var id="lang_input_previousStep"></var></em>
21
- </span>
22
- <span id="J_nextStep" class="nextStep">
23
- <em class="icon"></em>
24
- <em class="text"><var id="lang_input_nextsStep"></var></em>
25
- </span>
26
- <span id="J_clearBoard" class="clearBoard">
27
- <em class="icon"></em>
28
- <em class="text"><var id="lang_input_clear"></var></em>
29
- </span>
30
- <span id="J_sacleBoard" class="scaleBoard">
31
- <em class="icon"></em>
32
- <em class="text"><var id="lang_input_ScalePic"></var></em>
33
- </span>
34
- </div>
35
- </div>
36
- <div class="drawToolbar border_style1">
37
- <div id="J_colorBar" class="colorBar"></div>
38
- <div id="J_brushBar" class="sectionBar">
39
- <em class="brushIcon"></em>
40
- <a href="javascript:void(0)" class="size1">1</a>
41
- <a href="javascript:void(0)" class="size2">3</a>
42
- <a href="javascript:void(0)" class="size3">5</a>
43
- <a href="javascript:void(0)" class="size4">7</a>
44
- </div>
45
- <div id="J_eraserBar" class="sectionBar">
46
- <em class="eraserIcon"></em>
47
- <a href="javascript:void(0)" class="size1">1</a>
48
- <a href="javascript:void(0)" class="size2">3</a>
49
- <a href="javascript:void(0)" class="size3">5</a>
50
- <a href="javascript:void(0)" class="size4">7</a>
51
- </div>
52
- <div class="sectionBar">
53
- <div id="J_addImg" class="addImgH">
54
- <em class="icon"></em>
55
- <em class="text"><var id="lang_input_addPic"></var></em>
56
- <form method="post" id="fileForm" enctype="multipart/form-data" class="addImgH_form" target="up">
57
- <input type="file" name="upfile" id="J_imgTxt"
58
- accept="image/gif,image/jpeg,image/png,image/jpg,image/bmp"/>
59
- </form>
60
- <iframe name="up" style="display: none"></iframe>
61
- </div>
62
- </div>
63
- <div class="sectionBar">
64
- <span id="J_removeImg" class="removeImg">
65
- <em class="icon"></em>
66
- <em class="text"><var id="lang_input_removePic"></var></em>
67
- </span>
68
- </div>
69
- </div>
70
- </div>
71
- <div id="J_maskLayer" class="maskLayerNull"></div>
72
-
73
- <script type="text/javascript" src="scrawl.js"></script>
74
- <script type="text/javascript">
75
- var settings = {
76
- drawBrushSize:3, //画笔初始大小
77
- drawBrushColor:"#4bacc6", //画笔初始颜色
78
- colorList:['c00000', 'ff0000', 'ffc000', 'ffff00', '92d050', '00b050', '00b0f0', '0070c0', '002060', '7030a0', 'ffffff',
79
- '000000', 'eeece1', '1f497d', '4f81bd', 'c0504d', '9bbb59', '8064a2', '4bacc6', 'f79646'], //画笔选择颜色
80
- saveNum:10 //撤销次数
81
- };
82
-
83
- var scrawlObj = new scrawl( settings );
84
- scrawlObj.isCancelScrawl = false;
85
-
86
- dialog.onok = function () {
87
- exec( scrawlObj );
88
- return false;
89
- };
90
- dialog.oncancel = function () {
91
- scrawlObj.isCancelScrawl = true;
92
- };
93
- </script>
94
- </body>
95
- </html>
@@ -1,671 +0,0 @@
1
- /**
2
- * Created with JetBrains PhpStorm.
3
- * User: xuheng
4
- * Date: 12-5-22
5
- * Time: 上午11:38
6
- * To change this template use File | Settings | File Templates.
7
- */
8
- var scrawl = function (options) {
9
- options && this.initOptions(options);
10
- };
11
- (function () {
12
- var canvas = $G("J_brushBoard"),
13
- context = canvas.getContext('2d'),
14
- drawStep = [], //undo redo存储
15
- drawStepIndex = 0; //undo redo指针
16
-
17
- scrawl.prototype = {
18
- isScrawl:false, //是否涂鸦
19
- brushWidth:-1, //画笔粗细
20
- brushColor:"", //画笔颜色
21
-
22
- initOptions:function (options) {
23
- var me = this;
24
- me.originalState(options);//初始页面状态
25
- me._buildToolbarColor(options.colorList);//动态生成颜色选择集合
26
-
27
- me._addBoardListener(options.saveNum);//添加画板处理
28
- me._addOPerateListener(options.saveNum);//添加undo redo clearBoard处理
29
- me._addColorBarListener();//添加颜色选择处理
30
- me._addBrushBarListener();//添加画笔大小处理
31
- me._addEraserBarListener();//添加橡皮大小处理
32
- me._addAddImgListener();//添加增添背景图片处理
33
- me._addRemoveImgListenter();//删除背景图片处理
34
- me._addScalePicListenter();//添加缩放处理
35
- me._addClearSelectionListenter();//添加清楚选中状态处理
36
-
37
- me._originalColorSelect(options.drawBrushColor);//初始化颜色选中
38
- me._originalBrushSelect(options.drawBrushSize);//初始化画笔选中
39
- me._clearSelection();//清楚选中状态
40
- },
41
-
42
- originalState:function (options) {
43
- var me = this;
44
-
45
- me.brushWidth = options.drawBrushSize;//同步画笔粗细
46
- me.brushColor = options.drawBrushColor;//同步画笔颜色
47
-
48
- context.lineWidth = me.brushWidth;//初始画笔大小
49
- context.strokeStyle = me.brushColor;//初始画笔颜色
50
- context.fillStyle = "transparent";//初始画布背景颜色
51
- context.lineCap = "round";//去除锯齿
52
- context.fill();
53
- },
54
- _buildToolbarColor:function (colorList) {
55
- var tmp = null, arr = [];
56
- arr.push("<table id='J_colorList'>");
57
- for (var i = 0, color; color = colorList[i++];) {
58
- if ((i - 1) % 5 == 0) {
59
- if (i != 1) {
60
- arr.push("</tr>");
61
- }
62
- arr.push("<tr>");
63
- }
64
- tmp = '#' + color;
65
- arr.push("<td><a title='" + tmp + "' href='javascript:void(0)' style='background-color:" + tmp + "'></a></td>");
66
- }
67
- arr.push("</tr></table>");
68
- $G("J_colorBar").innerHTML = arr.join("");
69
- },
70
-
71
- _addBoardListener:function (saveNum) {
72
- var me = this,
73
- margin = 0,
74
- startX = -1,
75
- startY = -1,
76
- isMouseDown = false,
77
- isMouseMove = false,
78
- isMouseUp = false,
79
- buttonPress = 0, button, flag = '';
80
-
81
- margin = parseInt(domUtils.getComputedStyle($G("J_wrap"), "margin-left"));
82
- drawStep.push(context.getImageData(0, 0, context.canvas.width, context.canvas.height));
83
- drawStepIndex += 1;
84
-
85
- domUtils.on(canvas, ["mousedown", "mousemove", "mouseup", "mouseout"], function (e) {
86
- button = browser.webkit ? e.which : buttonPress;
87
- switch (e.type) {
88
- case 'mousedown':
89
- buttonPress = 1;
90
- flag = 1;
91
- isMouseDown = true;
92
- isMouseUp = false;
93
- isMouseMove = false;
94
- me.isScrawl = true;
95
- startX = e.clientX - margin;//10为外边距总和
96
- startY = e.clientY - margin;
97
- context.beginPath();
98
- break;
99
- case 'mousemove' :
100
- if (!flag && button == 0) {
101
- return;
102
- }
103
- if (!flag && button) {
104
- startX = e.clientX - margin;//10为外边距总和
105
- startY = e.clientY - margin;
106
- context.beginPath();
107
- flag = 1;
108
- }
109
- if (isMouseUp || !isMouseDown) {
110
- return;
111
- }
112
- var endX = e.clientX - margin,
113
- endY = e.clientY - margin;
114
-
115
- context.moveTo(startX, startY);
116
- context.lineTo(endX, endY);
117
- context.stroke();
118
- startX = endX;
119
- startY = endY;
120
- isMouseMove = true;
121
- break;
122
- case 'mouseup':
123
- buttonPress = 0;
124
- if (!isMouseDown)return;
125
- if (!isMouseMove) {
126
- context.arc(startX, startY, context.lineWidth, 0, Math.PI * 2, false);
127
- context.fillStyle = context.strokeStyle;
128
- context.fill();
129
- }
130
- context.closePath();
131
- me._saveOPerate(saveNum);
132
- isMouseDown = false;
133
- isMouseMove = false;
134
- isMouseUp = true;
135
- startX = -1;
136
- startY = -1;
137
- break;
138
- case 'mouseout':
139
- flag = '';
140
- buttonPress = 0;
141
- if (button == 1) return;
142
- context.closePath();
143
- break;
144
- }
145
- });
146
- },
147
- _addOPerateListener:function (saveNum) {
148
- var me = this;
149
- domUtils.on($G("J_previousStep"), "click", function () {
150
- if (drawStepIndex > 1) {
151
- drawStepIndex -= 1;
152
- context.clearRect(0, 0, context.canvas.width, context.canvas.height);
153
- context.putImageData(drawStep[drawStepIndex - 1], 0, 0);
154
- me.btn2Highlight("J_nextStep");
155
- drawStepIndex == 1 && me.btn2disable("J_previousStep");
156
- }
157
- });
158
- domUtils.on($G("J_nextStep"), "click", function () {
159
- if (drawStepIndex > 0 && drawStepIndex < drawStep.length) {
160
- context.clearRect(0, 0, context.canvas.width, context.canvas.height);
161
- context.putImageData(drawStep[drawStepIndex], 0, 0);
162
- drawStepIndex += 1;
163
- me.btn2Highlight("J_previousStep");
164
- drawStepIndex == drawStep.length && me.btn2disable("J_nextStep");
165
- }
166
- });
167
- domUtils.on($G("J_clearBoard"), "click", function () {
168
- context.clearRect(0, 0, context.canvas.width, context.canvas.height);
169
- drawStep = [];
170
- me._saveOPerate(saveNum);
171
- drawStepIndex = 1;
172
- me.isScrawl = false;
173
- me.btn2disable("J_previousStep");
174
- me.btn2disable("J_nextStep");
175
- me.btn2disable("J_clearBoard");
176
- });
177
- },
178
- _addColorBarListener:function () {
179
- var me = this;
180
- domUtils.on($G("J_colorBar"), "click", function (e) {
181
- var target = me.getTarget(e),
182
- color = target.title;
183
- if (!!color) {
184
- me._addColorSelect(target);
185
-
186
- me.brushColor = color;
187
- context.globalCompositeOperation = "source-over";
188
- context.lineWidth = me.brushWidth;
189
- context.strokeStyle = color;
190
- }
191
- });
192
- },
193
- _addBrushBarListener:function () {
194
- var me = this;
195
- domUtils.on($G("J_brushBar"), "click", function (e) {
196
- var target = me.getTarget(e),
197
- size = browser.ie ? target.innerText : target.text;
198
- if (!!size) {
199
- me._addBESelect(target);
200
-
201
- context.globalCompositeOperation = "source-over";
202
- context.lineWidth = parseInt(size);
203
- context.strokeStyle = me.brushColor;
204
- me.brushWidth = context.lineWidth;
205
- }
206
- });
207
- },
208
- _addEraserBarListener:function () {
209
- var me = this;
210
- domUtils.on($G("J_eraserBar"), "click", function (e) {
211
- var target = me.getTarget(e),
212
- size = browser.ie ? target.innerText : target.text;
213
- if (!!size) {
214
- me._addBESelect(target);
215
-
216
- context.lineWidth = parseInt(size);
217
- context.globalCompositeOperation = "destination-out";
218
- context.strokeStyle = "#FFF";
219
- }
220
- });
221
- },
222
- _addAddImgListener:function () {
223
- var file = $G("J_imgTxt");
224
- if (!window.FileReader) {
225
- $G("J_addImg").style.display = 'none';
226
- $G("J_removeImg").style.display = 'none';
227
- $G("J_sacleBoard").style.display = 'none';
228
- }
229
- domUtils.on(file, "change", function (e) {
230
- var frm = file.parentNode;
231
- addMaskLayer(lang.backgroundUploading);
232
-
233
- var target = e.target || e.srcElement,
234
- reader = new FileReader();
235
- reader.onload = function(evt){
236
- var target = evt.target || evt.srcElement;
237
- ue_callback(target.result, 'SUCCESS');
238
- };
239
- reader.readAsDataURL(target.files[0]);
240
- frm.reset();
241
- });
242
- },
243
- _addRemoveImgListenter:function () {
244
- var me = this;
245
- domUtils.on($G("J_removeImg"), "click", function () {
246
- $G("J_picBoard").innerHTML = "";
247
- me.btn2disable("J_removeImg");
248
- me.btn2disable("J_sacleBoard");
249
- });
250
- },
251
- _addScalePicListenter:function () {
252
- domUtils.on($G("J_sacleBoard"), "click", function () {
253
- var picBoard = $G("J_picBoard"),
254
- scaleCon = $G("J_scaleCon"),
255
- img = picBoard.children[0];
256
-
257
- if (img) {
258
- if (!scaleCon) {
259
- picBoard.style.cssText = "position:relative;z-index:999;"+picBoard.style.cssText;
260
- img.style.cssText = "position: absolute;top:" + (canvas.height - img.height) / 2 + "px;left:" + (canvas.width - img.width) / 2 + "px;";
261
- var scale = new ScaleBoy();
262
- picBoard.appendChild(scale.init());
263
- scale.startScale(img);
264
- } else {
265
- if (scaleCon.style.visibility == "visible") {
266
- scaleCon.style.visibility = "hidden";
267
- picBoard.style.position = "";
268
- picBoard.style.zIndex = "";
269
- } else {
270
- scaleCon.style.visibility = "visible";
271
- picBoard.style.cssText += "position:relative;z-index:999";
272
- }
273
- }
274
- }
275
- });
276
- },
277
- _addClearSelectionListenter:function () {
278
- var doc = document;
279
- domUtils.on(doc, 'mousemove', function (e) {
280
- if (browser.ie && browser.version < 11)
281
- doc.selection.clear();
282
- else
283
- window.getSelection().removeAllRanges();
284
- });
285
- },
286
- _clearSelection:function () {
287
- var list = ["J_operateBar", "J_colorBar", "J_brushBar", "J_eraserBar", "J_picBoard"];
288
- for (var i = 0, group; group = list[i++];) {
289
- domUtils.unSelectable($G(group));
290
- }
291
- },
292
-
293
- _saveOPerate:function (saveNum) {
294
- var me = this;
295
- if (drawStep.length <= saveNum) {
296
- if(drawStepIndex<drawStep.length){
297
- me.btn2disable("J_nextStep");
298
- drawStep.splice(drawStepIndex);
299
- }
300
- drawStep.push(context.getImageData(0, 0, context.canvas.width, context.canvas.height));
301
- drawStepIndex = drawStep.length;
302
- } else {
303
- drawStep.shift();
304
- drawStep.push(context.getImageData(0, 0, context.canvas.width, context.canvas.height));
305
- drawStepIndex = drawStep.length;
306
- }
307
- me.btn2Highlight("J_previousStep");
308
- me.btn2Highlight("J_clearBoard");
309
- },
310
-
311
- _originalColorSelect:function (title) {
312
- var colorList = $G("J_colorList").getElementsByTagName("td");
313
- for (var j = 0, cell; cell = colorList[j++];) {
314
- if (cell.children[0].title.toLowerCase() == title) {
315
- cell.children[0].style.opacity = 1;
316
- }
317
- }
318
- },
319
- _originalBrushSelect:function (text) {
320
- var brushList = $G("J_brushBar").children;
321
- for (var i = 0, ele; ele = brushList[i++];) {
322
- if (ele.tagName.toLowerCase() == "a") {
323
- var size = browser.ie ? ele.innerText : ele.text;
324
- if (size.toLowerCase() == text) {
325
- ele.style.opacity = 1;
326
- }
327
- }
328
- }
329
- },
330
- _addColorSelect:function (target) {
331
- var me = this,
332
- colorList = $G("J_colorList").getElementsByTagName("td"),
333
- eraserList = $G("J_eraserBar").children,
334
- brushList = $G("J_brushBar").children;
335
-
336
- for (var i = 0, cell; cell = colorList[i++];) {
337
- cell.children[0].style.opacity = 0.3;
338
- }
339
- for (var k = 0, ele; ele = brushList[k++];) {
340
- if (ele.tagName.toLowerCase() == "a") {
341
- ele.style.opacity = 0.3;
342
- var size = browser.ie ? ele.innerText : ele.text;
343
- if (size.toLowerCase() == this.brushWidth) {
344
- ele.style.opacity = 1;
345
- }
346
- }
347
- }
348
- for (var j = 0, node; node = eraserList[j++];) {
349
- if (node.tagName.toLowerCase() == "a") {
350
- node.style.opacity = 0.3;
351
- }
352
- }
353
-
354
- target.style.opacity = 1;
355
- target.blur();
356
- },
357
- _addBESelect:function (target) {
358
- var brushList = $G("J_brushBar").children;
359
- var eraserList = $G("J_eraserBar").children;
360
-
361
- for (var i = 0, ele; ele = brushList[i++];) {
362
- if (ele.tagName.toLowerCase() == "a") {
363
- ele.style.opacity = 0.3;
364
- }
365
- }
366
- for (var j = 0, node; node = eraserList[j++];) {
367
- if (node.tagName.toLowerCase() == "a") {
368
- node.style.opacity = 0.3;
369
- }
370
- }
371
-
372
- target.style.opacity = 1;
373
- target.blur();
374
- },
375
- getCanvasData:function () {
376
- var picContainer = $G("J_picBoard"),
377
- img = picContainer.children[0];
378
- if (img) {
379
- var x, y;
380
- if (img.style.position == "absolute") {
381
- x = parseInt(img.style.left);
382
- y = parseInt(img.style.top);
383
- } else {
384
- x = (picContainer.offsetWidth - img.width) / 2;
385
- y = (picContainer.offsetHeight - img.height) / 2;
386
- }
387
- context.globalCompositeOperation = "destination-over";
388
- context.drawImage(img, x, y, img.width, img.height);
389
- } else {
390
- context.globalCompositeOperation = "destination-atop";
391
- context.fillStyle = "#fff";//重置画布背景白色
392
- context.fillRect(0, 0, canvas.width, canvas.height);
393
- }
394
- try {
395
- return canvas.toDataURL("image/png").substring(22);
396
- } catch (e) {
397
- return "";
398
- }
399
- },
400
- btn2Highlight:function (id) {
401
- var cur = $G(id);
402
- cur.className.indexOf("H") == -1 && (cur.className += "H");
403
- },
404
- btn2disable:function (id) {
405
- var cur = $G(id);
406
- cur.className.indexOf("H") != -1 && (cur.className = cur.className.replace("H", ""));
407
- },
408
- getTarget:function (evt) {
409
- return evt.target || evt.srcElement;
410
- }
411
- };
412
- })();
413
-
414
- var ScaleBoy = function () {
415
- this.dom = null;
416
- this.scalingElement = null;
417
- };
418
- (function () {
419
- function _appendStyle() {
420
- var doc = document,
421
- head = doc.getElementsByTagName('head')[0],
422
- style = doc.createElement('style'),
423
- cssText = '.scale{visibility:hidden;cursor:move;position:absolute;left:0;top:0;width:100px;height:50px;background-color:#fff;font-size:0;line-height:0;opacity:.4;filter:Alpha(opacity=40);}'
424
- + '.scale span{position:absolute;left:0;top:0;width:6px;height:6px;background-color:#006DAE;}'
425
- + '.scale .hand0, .scale .hand7{cursor:nw-resize;}'
426
- + '.scale .hand1, .scale .hand6{left:50%;margin-left:-3px;cursor:n-resize;}'
427
- + '.scale .hand2, .scale .hand4, .scale .hand7{left:100%;margin-left:-6px;}'
428
- + '.scale .hand3, .scale .hand4{top:50%;margin-top:-3px;cursor:w-resize;}'
429
- + '.scale .hand5, .scale .hand6, .scale .hand7{margin-top:-6px;top:100%;}'
430
- + '.scale .hand2, .scale .hand5{cursor:ne-resize;}';
431
- style.type = 'text/css';
432
-
433
- try {
434
- style.appendChild(doc.createTextNode(cssText));
435
- } catch (e) {
436
- style.styleSheet.cssText = cssText;
437
- }
438
- head.appendChild(style);
439
- }
440
-
441
- function _getDom() {
442
- var doc = document,
443
- hand,
444
- arr = [],
445
- scale = doc.createElement('div');
446
-
447
- scale.id = 'J_scaleCon';
448
- scale.className = 'scale';
449
- for (var i = 0; i < 8; i++) {
450
- arr.push("<span class='hand" + i + "'></span>");
451
- }
452
- scale.innerHTML = arr.join("");
453
- return scale;
454
- }
455
-
456
- var rect = [
457
- //[left, top, width, height]
458
- [1, 1, -1, -1],
459
- [0, 1, 0, -1],
460
- [0, 1, 1, -1],
461
- [1, 0, -1, 0],
462
- [0, 0, 1, 0],
463
- [1, 0, -1, 1],
464
- [0, 0, 0, 1],
465
- [0, 0, 1, 1]
466
- ];
467
- ScaleBoy.prototype = {
468
- init:function () {
469
- _appendStyle();
470
- var me = this,
471
- scale = me.dom = _getDom();
472
-
473
- me.scaleMousemove.fp = me;
474
- domUtils.on(scale, 'mousedown', function (e) {
475
- var target = e.target || e.srcElement;
476
- me.start = {x:e.clientX, y:e.clientY};
477
- if (target.className.indexOf('hand') != -1) {
478
- me.dir = target.className.replace('hand', '');
479
- }
480
- domUtils.on(document.body, 'mousemove', me.scaleMousemove);
481
- e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true;
482
- });
483
- domUtils.on(document.body, 'mouseup', function (e) {
484
- if (me.start) {
485
- domUtils.un(document.body, 'mousemove', me.scaleMousemove);
486
- if (me.moved) {
487
- me.updateScaledElement({position:{x:scale.style.left, y:scale.style.top}, size:{w:scale.style.width, h:scale.style.height}});
488
- }
489
- delete me.start;
490
- delete me.moved;
491
- delete me.dir;
492
- }
493
- });
494
- return scale;
495
- },
496
- startScale:function (objElement) {
497
- var me = this, Idom = me.dom;
498
-
499
- Idom.style.cssText = 'visibility:visible;top:' + objElement.style.top + ';left:' + objElement.style.left + ';width:' + objElement.offsetWidth + 'px;height:' + objElement.offsetHeight + 'px;';
500
- me.scalingElement = objElement;
501
- },
502
- updateScaledElement:function (objStyle) {
503
- var cur = this.scalingElement,
504
- pos = objStyle.position,
505
- size = objStyle.size;
506
- if (pos) {
507
- typeof pos.x != 'undefined' && (cur.style.left = pos.x);
508
- typeof pos.y != 'undefined' && (cur.style.top = pos.y);
509
- }
510
- if (size) {
511
- size.w && (cur.style.width = size.w);
512
- size.h && (cur.style.height = size.h);
513
- }
514
- },
515
- updateStyleByDir:function (dir, offset) {
516
- var me = this,
517
- dom = me.dom, tmp;
518
-
519
- rect['def'] = [1, 1, 0, 0];
520
- if (rect[dir][0] != 0) {
521
- tmp = parseInt(dom.style.left) + offset.x;
522
- dom.style.left = me._validScaledProp('left', tmp) + 'px';
523
- }
524
- if (rect[dir][1] != 0) {
525
- tmp = parseInt(dom.style.top) + offset.y;
526
- dom.style.top = me._validScaledProp('top', tmp) + 'px';
527
- }
528
- if (rect[dir][2] != 0) {
529
- tmp = dom.clientWidth + rect[dir][2] * offset.x;
530
- dom.style.width = me._validScaledProp('width', tmp) + 'px';
531
- }
532
- if (rect[dir][3] != 0) {
533
- tmp = dom.clientHeight + rect[dir][3] * offset.y;
534
- dom.style.height = me._validScaledProp('height', tmp) + 'px';
535
- }
536
- if (dir === 'def') {
537
- me.updateScaledElement({position:{x:dom.style.left, y:dom.style.top}});
538
- }
539
- },
540
- scaleMousemove:function (e) {
541
- var me = arguments.callee.fp,
542
- start = me.start,
543
- dir = me.dir || 'def',
544
- offset = {x:e.clientX - start.x, y:e.clientY - start.y};
545
-
546
- me.updateStyleByDir(dir, offset);
547
- arguments.callee.fp.start = {x:e.clientX, y:e.clientY};
548
- arguments.callee.fp.moved = 1;
549
- },
550
- _validScaledProp:function (prop, value) {
551
- var ele = this.dom,
552
- wrap = $G("J_picBoard");
553
-
554
- value = isNaN(value) ? 0 : value;
555
- switch (prop) {
556
- case 'left':
557
- return value < 0 ? 0 : (value + ele.clientWidth) > wrap.clientWidth ? wrap.clientWidth - ele.clientWidth : value;
558
- case 'top':
559
- return value < 0 ? 0 : (value + ele.clientHeight) > wrap.clientHeight ? wrap.clientHeight - ele.clientHeight : value;
560
- case 'width':
561
- return value <= 0 ? 1 : (value + ele.offsetLeft) > wrap.clientWidth ? wrap.clientWidth - ele.offsetLeft : value;
562
- case 'height':
563
- return value <= 0 ? 1 : (value + ele.offsetTop) > wrap.clientHeight ? wrap.clientHeight - ele.offsetTop : value;
564
- }
565
- }
566
- };
567
- })();
568
-
569
- //后台回调
570
- function ue_callback(url, state) {
571
- var doc = document,
572
- picBorard = $G("J_picBoard"),
573
- img = doc.createElement("img");
574
-
575
- //图片缩放
576
- function scale(img, max, oWidth, oHeight) {
577
- var width = 0, height = 0, percent, ow = img.width || oWidth, oh = img.height || oHeight;
578
- if (ow > max || oh > max) {
579
- if (ow >= oh) {
580
- if (width = ow - max) {
581
- percent = (width / ow).toFixed(2);
582
- img.height = oh - oh * percent;
583
- img.width = max;
584
- }
585
- } else {
586
- if (height = oh - max) {
587
- percent = (height / oh).toFixed(2);
588
- img.width = ow - ow * percent;
589
- img.height = max;
590
- }
591
- }
592
- }
593
- }
594
-
595
- //移除遮罩层
596
- removeMaskLayer();
597
- //状态响应
598
- if (state == "SUCCESS") {
599
- picBorard.innerHTML = "";
600
- img.onload = function () {
601
- scale(this, 300);
602
- picBorard.appendChild(img);
603
-
604
- var obj = new scrawl();
605
- obj.btn2Highlight("J_removeImg");
606
- //trace 2457
607
- obj.btn2Highlight("J_sacleBoard");
608
- };
609
- img.src = url;
610
- } else {
611
- alert(state);
612
- }
613
- }
614
- //去掉遮罩层
615
- function removeMaskLayer() {
616
- var maskLayer = $G("J_maskLayer");
617
- maskLayer.className = "maskLayerNull";
618
- maskLayer.innerHTML = "";
619
- dialog.buttons[0].setDisabled(false);
620
- }
621
- //添加遮罩层
622
- function addMaskLayer(html) {
623
- var maskLayer = $G("J_maskLayer");
624
- dialog.buttons[0].setDisabled(true);
625
- maskLayer.className = "maskLayer";
626
- maskLayer.innerHTML = html;
627
- }
628
- //执行确认按钮方法
629
- function exec(scrawlObj) {
630
- if (scrawlObj.isScrawl) {
631
- addMaskLayer(lang.scrawlUpLoading);
632
- var base64 = scrawlObj.getCanvasData();
633
- if (!!base64) {
634
- var options = {
635
- timeout:100000,
636
- onsuccess:function (xhr) {
637
- if (!scrawlObj.isCancelScrawl) {
638
- var responseObj;
639
- responseObj = eval("(" + xhr.responseText + ")");
640
- if (responseObj.state == "SUCCESS") {
641
- var imgObj = {},
642
- url = editor.options.scrawlUrlPrefix + responseObj.url;
643
- imgObj.src = url;
644
- imgObj._src = url;
645
- imgObj.alt = responseObj.original || '';
646
- imgObj.title = responseObj.title || '';
647
- editor.execCommand("insertImage", imgObj);
648
- dialog.close();
649
- } else {
650
- alert(responseObj.state);
651
- }
652
-
653
- }
654
- },
655
- onerror:function () {
656
- alert(lang.imageError);
657
- dialog.close();
658
- }
659
- };
660
- options[editor.getOpt('scrawlFieldName')] = base64;
661
-
662
- var actionUrl = editor.getActionUrl(editor.getOpt('scrawlActionName')),
663
- params = utils.serializeParam(editor.queryCommandValue('serverparam')) || '',
664
- url = utils.formatUrl(actionUrl + (actionUrl.indexOf('?') == -1 ? '?':'&') + params);
665
- ajax.request(url, options);
666
- }
667
- } else {
668
- addMaskLayer(lang.noScarwl + "&nbsp;&nbsp;&nbsp;<input type='button' value='" + lang.continueBtn + "' onclick='removeMaskLayer()'/>");
669
- }
670
- }
671
-