ueditor_rails4 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (227) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.markdown +45 -0
  4. data/Rakefile +40 -0
  5. data/app/assets/images/ueditor/themes/default/anchor.gif +0 -0
  6. data/app/assets/images/ueditor/themes/default/arrow.png +0 -0
  7. data/app/assets/images/ueditor/themes/default/button-bg.gif +0 -0
  8. data/app/assets/images/ueditor/themes/default/cancelbutton.gif +0 -0
  9. data/app/assets/images/ueditor/themes/default/cursor_h.gif +0 -0
  10. data/app/assets/images/ueditor/themes/default/cursor_h.png +0 -0
  11. data/app/assets/images/ueditor/themes/default/cursor_v.gif +0 -0
  12. data/app/assets/images/ueditor/themes/default/cursor_v.png +0 -0
  13. data/app/assets/images/ueditor/themes/default/dialog-title-bg.png +0 -0
  14. data/app/assets/images/ueditor/themes/default/filescan.png +0 -0
  15. data/app/assets/images/ueditor/themes/default/highlighted.gif +0 -0
  16. data/app/assets/images/ueditor/themes/default/icons-all.gif +0 -0
  17. data/app/assets/images/ueditor/themes/default/icons.gif +0 -0
  18. data/app/assets/images/ueditor/themes/default/icons.png +0 -0
  19. data/app/assets/images/ueditor/themes/default/lock.gif +0 -0
  20. data/app/assets/images/ueditor/themes/default/neweditor-tab-bg.png +0 -0
  21. data/app/assets/images/ueditor/themes/default/pagebreak.gif +0 -0
  22. data/app/assets/images/ueditor/themes/default/scale.png +0 -0
  23. data/app/assets/images/ueditor/themes/default/spacer.gif +0 -0
  24. data/app/assets/images/ueditor/themes/default/sparator_v.png +0 -0
  25. data/app/assets/images/ueditor/themes/default/toolbar_bg.png +0 -0
  26. data/app/assets/images/ueditor/themes/default/unhighlighted.gif +0 -0
  27. data/app/assets/images/ueditor/themes/default/upload.png +0 -0
  28. data/app/assets/images/ueditor/themes/default/videologo.gif +0 -0
  29. data/app/assets/images/ueditor/themes/default/word.gif +0 -0
  30. data/app/assets/images/ueditor/themes/default/wordpaste.png +0 -0
  31. data/app/assets/images/ueditor_rails/dialogs/attachment/fileTypeImages/icon_chm.gif +0 -0
  32. data/app/assets/images/ueditor_rails/dialogs/attachment/fileTypeImages/icon_default.png +0 -0
  33. data/app/assets/images/ueditor_rails/dialogs/attachment/fileTypeImages/icon_doc.gif +0 -0
  34. data/app/assets/images/ueditor_rails/dialogs/attachment/fileTypeImages/icon_exe.gif +0 -0
  35. data/app/assets/images/ueditor_rails/dialogs/attachment/fileTypeImages/icon_mp3.gif +0 -0
  36. data/app/assets/images/ueditor_rails/dialogs/attachment/fileTypeImages/icon_mv.gif +0 -0
  37. data/app/assets/images/ueditor_rails/dialogs/attachment/fileTypeImages/icon_pdf.gif +0 -0
  38. data/app/assets/images/ueditor_rails/dialogs/attachment/fileTypeImages/icon_ppt.gif +0 -0
  39. data/app/assets/images/ueditor_rails/dialogs/attachment/fileTypeImages/icon_psd.gif +0 -0
  40. data/app/assets/images/ueditor_rails/dialogs/attachment/fileTypeImages/icon_rar.gif +0 -0
  41. data/app/assets/images/ueditor_rails/dialogs/attachment/fileTypeImages/icon_txt.gif +0 -0
  42. data/app/assets/images/ueditor_rails/dialogs/attachment/fileTypeImages/icon_xls.gif +0 -0
  43. data/app/assets/images/ueditor_rails/dialogs/image/center_focus.jpg +0 -0
  44. data/app/assets/images/ueditor_rails/dialogs/image/left_focus.jpg +0 -0
  45. data/app/assets/images/ueditor_rails/dialogs/image/none_focus.jpg +0 -0
  46. data/app/assets/images/ueditor_rails/dialogs/image/right_focus.jpg +0 -0
  47. data/app/assets/images/ueditor_rails/dialogs/scrawl/addimg.png +0 -0
  48. data/app/assets/images/ueditor_rails/dialogs/scrawl/brush.png +0 -0
  49. data/app/assets/images/ueditor_rails/dialogs/scrawl/delimg.png +0 -0
  50. data/app/assets/images/ueditor_rails/dialogs/scrawl/delimgH.png +0 -0
  51. data/app/assets/images/ueditor_rails/dialogs/scrawl/empty.png +0 -0
  52. data/app/assets/images/ueditor_rails/dialogs/scrawl/emptyH.png +0 -0
  53. data/app/assets/images/ueditor_rails/dialogs/scrawl/eraser.png +0 -0
  54. data/app/assets/images/ueditor_rails/dialogs/scrawl/redo.png +0 -0
  55. data/app/assets/images/ueditor_rails/dialogs/scrawl/redoH.png +0 -0
  56. data/app/assets/images/ueditor_rails/dialogs/scrawl/scale.png +0 -0
  57. data/app/assets/images/ueditor_rails/dialogs/scrawl/scaleH.png +0 -0
  58. data/app/assets/images/ueditor_rails/dialogs/scrawl/size.png +0 -0
  59. data/app/assets/images/ueditor_rails/dialogs/scrawl/undo.png +0 -0
  60. data/app/assets/images/ueditor_rails/dialogs/scrawl/undoH.png +0 -0
  61. data/app/assets/javascripts/ueditor_rails/_config.js.erb +211 -0
  62. data/app/assets/javascripts/ueditor_rails/dialogs/attachment.js +5 -0
  63. data/app/assets/javascripts/ueditor_rails/dialogs/attachment/_callbacks.js +166 -0
  64. data/app/assets/javascripts/ueditor_rails/dialogs/attachment/_file_type_maps.js.erb +14 -0
  65. data/app/assets/javascripts/ueditor_rails/dialogs/image.js.erb +724 -0
  66. data/app/assets/javascripts/ueditor_rails/dialogs/scrawl.js +655 -0
  67. data/app/assets/javascripts/ueditor_rails/dialogs/wordimage.js +154 -0
  68. data/app/assets/javascripts/ueditor_rails/init.js +12 -0
  69. data/app/assets/stylesheets/ueditor/themes/default/dialogbase.css.erb +100 -0
  70. data/app/assets/stylesheets/ueditor/themes/default/ueditor.css +1582 -0
  71. data/app/assets/stylesheets/ueditor/themes/iframe.css +1 -0
  72. data/app/assets/stylesheets/ueditor_rails/dialogs/attachment.css.erb +161 -0
  73. data/app/assets/stylesheets/ueditor_rails/dialogs/image.css.erb +69 -0
  74. data/app/assets/stylesheets/ueditor_rails/dialogs/scrawl.css.erb +72 -0
  75. data/app/controllers/ueditor_rails/application_controller.rb +5 -0
  76. data/app/controllers/ueditor_rails/dialogs_controller.rb +21 -0
  77. data/app/controllers/ueditor_rails/libs_controller.rb +33 -0
  78. data/app/helpers/ueditor_rails/application_helper.rb +27 -0
  79. data/app/views/ueditor_rails/dialogs/attachment.html.erb +124 -0
  80. data/app/views/ueditor_rails/dialogs/image.html.erb +203 -0
  81. data/app/views/ueditor_rails/dialogs/scrawl.html.erb +96 -0
  82. data/app/views/ueditor_rails/dialogs/wordimage.html.erb +155 -0
  83. data/config/routes.rb +11 -0
  84. data/lib/generators/ueditor_rails/USAGE +8 -0
  85. data/lib/generators/ueditor_rails/install_generator.rb +15 -0
  86. data/lib/generators/ueditor_rails/templates/ueditor_config.js.erb +216 -0
  87. data/lib/tasks/ueditor_rails_tasks.rake +4 -0
  88. data/lib/ueditor_rails/engine.rb +17 -0
  89. data/lib/ueditor_rails/helpers/form_builder.rb +11 -0
  90. data/lib/ueditor_rails/helpers/form_helper.rb +37 -0
  91. data/lib/ueditor_rails/helpers/view_helper.rb +21 -0
  92. data/lib/ueditor_rails/util.rb +42 -0
  93. data/lib/ueditor_rails/version.rb +3 -0
  94. data/lib/ueditor_rails4.rb +32 -0
  95. data/test/dummy/README.rdoc +261 -0
  96. data/test/dummy/Rakefile +7 -0
  97. data/test/dummy/app/assets/javascripts/application.js +16 -0
  98. data/test/dummy/app/assets/javascripts/posts.js +2 -0
  99. data/test/dummy/app/assets/javascripts/ueditor_config.js.erb +208 -0
  100. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  101. data/test/dummy/app/assets/stylesheets/posts.css +4 -0
  102. data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
  103. data/test/dummy/app/controllers/application_controller.rb +3 -0
  104. data/test/dummy/app/controllers/posts_controller.rb +83 -0
  105. data/test/dummy/app/helpers/application_helper.rb +2 -0
  106. data/test/dummy/app/helpers/posts_helper.rb +2 -0
  107. data/test/dummy/app/models/post.rb +3 -0
  108. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  109. data/test/dummy/app/views/posts/_form.html.erb +25 -0
  110. data/test/dummy/app/views/posts/edit.html.erb +6 -0
  111. data/test/dummy/app/views/posts/index.html.erb +29 -0
  112. data/test/dummy/app/views/posts/new.html.erb +5 -0
  113. data/test/dummy/app/views/posts/show.html.erb +14 -0
  114. data/test/dummy/config.ru +4 -0
  115. data/test/dummy/config/application.rb +61 -0
  116. data/test/dummy/config/boot.rb +10 -0
  117. data/test/dummy/config/database.yml +25 -0
  118. data/test/dummy/config/environment.rb +5 -0
  119. data/test/dummy/config/environments/development.rb +37 -0
  120. data/test/dummy/config/environments/production.rb +67 -0
  121. data/test/dummy/config/environments/test.rb +37 -0
  122. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  123. data/test/dummy/config/initializers/inflections.rb +15 -0
  124. data/test/dummy/config/initializers/mime_types.rb +5 -0
  125. data/test/dummy/config/initializers/secret_token.rb +7 -0
  126. data/test/dummy/config/initializers/session_store.rb +8 -0
  127. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  128. data/test/dummy/config/locales/en.yml +5 -0
  129. data/test/dummy/config/routes.rb +8 -0
  130. data/test/dummy/db/migrate/20130327173045_create_posts.rb +10 -0
  131. data/test/dummy/db/schema.rb +23 -0
  132. data/test/dummy/public/404.html +26 -0
  133. data/test/dummy/public/422.html +26 -0
  134. data/test/dummy/public/500.html +25 -0
  135. data/test/dummy/public/favicon.ico +0 -0
  136. data/test/dummy/script/rails +6 -0
  137. data/test/dummy/test/fixtures/posts.yml +9 -0
  138. data/test/dummy/test/functional/posts_controller_test.rb +49 -0
  139. data/test/dummy/test/unit/helpers/posts_helper_test.rb +4 -0
  140. data/test/dummy/test/unit/post_test.rb +7 -0
  141. data/test/functional/ueditor_rails/dialogs_controller_test.rb +16 -0
  142. data/test/functional/ueditor_rails/libs_controller_test.rb +21 -0
  143. data/test/integration/navigation_test.rb +10 -0
  144. data/test/test_helper.rb +15 -0
  145. data/test/ueditor_rails_test.rb +7 -0
  146. data/vendor/assets/javascripts/ueditor/dialogs/anchor/anchor.html.erb +57 -0
  147. data/vendor/assets/javascripts/ueditor/dialogs/background/background.css +24 -0
  148. data/vendor/assets/javascripts/ueditor/dialogs/background/background.html.erb +55 -0
  149. data/vendor/assets/javascripts/ueditor/dialogs/background/background.js +348 -0
  150. data/vendor/assets/javascripts/ueditor/dialogs/emotion/emotion.css.erb +43 -0
  151. data/vendor/assets/javascripts/ueditor/dialogs/emotion/emotion.html.erb +54 -0
  152. data/vendor/assets/javascripts/ueditor/dialogs/emotion/emotion.js +186 -0
  153. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/0.gif +0 -0
  154. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/bface.gif +0 -0
  155. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/cface.gif +0 -0
  156. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/fface.gif +0 -0
  157. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/jxface2.gif +0 -0
  158. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/neweditor-tab-bg.png +0 -0
  159. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/tface.gif +0 -0
  160. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/wface.gif +0 -0
  161. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/yface.gif +0 -0
  162. data/vendor/assets/javascripts/ueditor/dialogs/gmap/gmap.html.erb +89 -0
  163. data/vendor/assets/javascripts/ueditor/dialogs/help/help.css +7 -0
  164. data/vendor/assets/javascripts/ueditor/dialogs/help/help.html.erb +84 -0
  165. data/vendor/assets/javascripts/ueditor/dialogs/help/help.js +54 -0
  166. data/vendor/assets/javascripts/ueditor/dialogs/highlightcode/highlightcode.html.erb +131 -0
  167. data/vendor/assets/javascripts/ueditor/dialogs/insertframe/insertframe.html.erb +98 -0
  168. data/vendor/assets/javascripts/ueditor/dialogs/internal.js +79 -0
  169. data/vendor/assets/javascripts/ueditor/dialogs/link/link.html.erb +141 -0
  170. data/vendor/assets/javascripts/ueditor/dialogs/map/map.html.erb +105 -0
  171. data/vendor/assets/javascripts/ueditor/dialogs/music/music.css +30 -0
  172. data/vendor/assets/javascripts/ueditor/dialogs/music/music.html.erb +32 -0
  173. data/vendor/assets/javascripts/ueditor/dialogs/music/music.js +192 -0
  174. data/vendor/assets/javascripts/ueditor/dialogs/searchreplace/searchreplace.html.erb +74 -0
  175. data/vendor/assets/javascripts/ueditor/dialogs/searchreplace/searchreplace.js +160 -0
  176. data/vendor/assets/javascripts/ueditor/dialogs/snapscreen/snapscreen.html.erb +91 -0
  177. data/vendor/assets/javascripts/ueditor/dialogs/spechars/spechars.html.erb +21 -0
  178. data/vendor/assets/javascripts/ueditor/dialogs/spechars/spechars.js +56 -0
  179. data/vendor/assets/javascripts/ueditor/dialogs/table/dragicon.png +0 -0
  180. data/vendor/assets/javascripts/ueditor/dialogs/table/edittable.css +75 -0
  181. data/vendor/assets/javascripts/ueditor/dialogs/table/edittable.html.erb +57 -0
  182. data/vendor/assets/javascripts/ueditor/dialogs/table/edittable.js +182 -0
  183. data/vendor/assets/javascripts/ueditor/dialogs/table/edittd.html.erb +51 -0
  184. data/vendor/assets/javascripts/ueditor/dialogs/table/edittip.html.erb +33 -0
  185. data/vendor/assets/javascripts/ueditor/dialogs/tangram.js +1238 -0
  186. data/vendor/assets/javascripts/ueditor/dialogs/template/config.js +42 -0
  187. data/vendor/assets/javascripts/ueditor/dialogs/template/images/bg.gif +0 -0
  188. data/vendor/assets/javascripts/ueditor/dialogs/template/images/pre0.png +0 -0
  189. data/vendor/assets/javascripts/ueditor/dialogs/template/images/pre1.png +0 -0
  190. data/vendor/assets/javascripts/ueditor/dialogs/template/images/pre2.png +0 -0
  191. data/vendor/assets/javascripts/ueditor/dialogs/template/images/pre3.png +0 -0
  192. data/vendor/assets/javascripts/ueditor/dialogs/template/images/pre4.png +0 -0
  193. data/vendor/assets/javascripts/ueditor/dialogs/template/template.css +18 -0
  194. data/vendor/assets/javascripts/ueditor/dialogs/template/template.html.erb +26 -0
  195. data/vendor/assets/javascripts/ueditor/dialogs/template/template.js +53 -0
  196. data/vendor/assets/javascripts/ueditor/dialogs/video/images/center_focus.jpg +0 -0
  197. data/vendor/assets/javascripts/ueditor/dialogs/video/images/left_focus.jpg +0 -0
  198. data/vendor/assets/javascripts/ueditor/dialogs/video/images/none_focus.jpg +0 -0
  199. data/vendor/assets/javascripts/ueditor/dialogs/video/images/right_focus.jpg +0 -0
  200. data/vendor/assets/javascripts/ueditor/dialogs/video/video.css +59 -0
  201. data/vendor/assets/javascripts/ueditor/dialogs/video/video.html.erb +78 -0
  202. data/vendor/assets/javascripts/ueditor/dialogs/video/video.js.erb +409 -0
  203. data/vendor/assets/javascripts/ueditor/dialogs/webapp/webapp.html.erb +64 -0
  204. data/vendor/assets/javascripts/ueditor/editor_all.js.erb +19133 -0
  205. data/vendor/assets/javascripts/ueditor/lang/zh-cn/images/copy.png +0 -0
  206. data/vendor/assets/javascripts/ueditor/lang/zh-cn/images/imglabel.png +0 -0
  207. data/vendor/assets/javascripts/ueditor/lang/zh-cn/images/localimage.png +0 -0
  208. data/vendor/assets/javascripts/ueditor/lang/zh-cn/images/music.png +0 -0
  209. data/vendor/assets/javascripts/ueditor/lang/zh-cn/images/upload.png +0 -0
  210. data/vendor/assets/javascripts/ueditor/lang/zh-cn/zh-cn.js +492 -0
  211. data/vendor/assets/javascripts/ueditor/third-party/SyntaxHighlighter/shCore.js +3655 -0
  212. data/vendor/assets/javascripts/ueditor/third-party/SyntaxHighlighter/shCoreDefault.css +316 -0
  213. data/vendor/assets/javascripts/ueditor/third-party/codemirror/codemirror.css +104 -0
  214. data/vendor/assets/javascripts/ueditor/third-party/codemirror/codemirror.js +3581 -0
  215. data/vendor/assets/javascripts/ueditor/third-party/fClipboard_ueditor.swf +0 -0
  216. data/vendor/assets/javascripts/ueditor/third-party/imageUploader.swf +0 -0
  217. data/vendor/assets/javascripts/ueditor/third-party/snapscreen/UEditorSnapscreen.exe +0 -0
  218. data/vendor/assets/javascripts/ueditor/third-party/swfupload/fileprogress.js +215 -0
  219. data/vendor/assets/javascripts/ueditor/third-party/swfupload/swfupload.cookies.js +53 -0
  220. data/vendor/assets/javascripts/ueditor/third-party/swfupload/swfupload.js +1132 -0
  221. data/vendor/assets/javascripts/ueditor/third-party/swfupload/swfupload.proxy.js +96 -0
  222. data/vendor/assets/javascripts/ueditor/third-party/swfupload/swfupload.queue.js +98 -0
  223. data/vendor/assets/javascripts/ueditor/third-party/swfupload/swfupload.speed.js +346 -0
  224. data/vendor/assets/javascripts/ueditor/third-party/swfupload/swfupload.swf +0 -0
  225. data/vendor/assets/javascripts/ueditor/third-party/swfupload/swfupload_fp9.swf +0 -0
  226. data/vendor/assets/javascripts/ueditor/uparse.js +348 -0
  227. metadata +363 -0
@@ -0,0 +1,203 @@
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
+ <title></title>
6
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
7
+ <%= stylesheet_link_tag 'ueditor_rails/dialogs/image' %>
8
+ </head>
9
+ <body>
10
+ <div class="wrapper">
11
+ <div id="imageTab">
12
+ <div id="tabHeads" class="tabhead">
13
+ <span tabSrc="remote" class="focus"><var id="lang_tab_remote"></var></span>
14
+ <span tabSrc="local"><var id="lang_tab_local"></var></span>
15
+ <span tabSrc="imgManager"><var id="lang_tab_imgManager"></var></span>
16
+ <span tabSrc="imgSearch"><var id="lang_tab_imgSearch"></var></span>
17
+ </div>
18
+ <div id="tabBodys" class="tabbody">
19
+ <div id="remote" class="panel">
20
+ <table cellpadding="0" cellspacing="0">
21
+ <tr>
22
+ <td class="label"><label for="url"><var id="lang_input_url"></var></label></td>
23
+ <td><input id="url" type="text"/></td>
24
+ </tr>
25
+ <tr>
26
+ <td class="label"><label for="width"><var id="lang_input_width"></var></label></td>
27
+ <td><input type="text" id="width"/> px</td>
28
+ </tr>
29
+ <tr>
30
+ <td class="label"><label for="height"><var id="lang_input_height"></var></label></td>
31
+ <td><input type="text" id="height"/> px</td>
32
+ </tr>
33
+ <tr>
34
+ <td class="label"><label for="border"><var id="lang_input_border"></var></label></td>
35
+ <td><input type="text" id="border"/> px</td>
36
+ </tr>
37
+ <tr>
38
+ <td class="label"><label for="vhSpace"><var id="lang_input_vhspace"></var></label></td>
39
+ <td><input type="text" id="vhSpace"/> px</td>
40
+ </tr>
41
+ <tr>
42
+ <td class="label"><label for="title"><var id="lang_input_title"></var></label></td>
43
+ <td><input type="text" id="title"/></td>
44
+ </tr>
45
+ <tr>
46
+ <td class="label"><var id="lang_input_remoteAlign"></var></td>
47
+ <td id="remoteFloat"></td>
48
+ </tr>
49
+ </table>
50
+
51
+ <div id="preview"></div>
52
+ <div class="lock"><input id="lock" type="checkbox" checked="checked"></div>
53
+ </div>
54
+ <div id="local" class="panel">
55
+ <div id="flashContainer"></div>
56
+ <div><div id="upload" style="display: none" ></div><div id="duiqi"></div><div id="localFloat"></div></div>
57
+
58
+ <div class="saveDir">
59
+ <var id="lang_savePath" ></var>:<select id="savePath">
60
+ <option value="1">default</option>
61
+ </select>
62
+ </div>
63
+ </div>
64
+ <div id="imgManager" class="panel">
65
+ <div id="imageList"><var id="lang_imgLoading"></var></div>
66
+ </div>
67
+ <div id="imgSearch" class="panel">
68
+ <table style="margin-top: 5px;">
69
+ <tr>
70
+ <td width="200"><input id="imgSearchTxt" type="text" /></td>
71
+ <td width="65">
72
+ <select id="imgType">
73
+ <!--具体内容值将由国际化组件动态填充-->
74
+ <option value="&s=4&z=0"></option>
75
+ <option value="&s=1&z=19"></option>
76
+ <option value="&s=2&z=0"></option>
77
+ <option value="&s=3&z=0"></option>
78
+ </select>
79
+ </td>
80
+ <td width="80"><input id="imgSearchBtn" type="button" /></td>
81
+ <td width="80"><input id="imgSearchReset" type="button" /></td>
82
+ </tr>
83
+ </table>
84
+ <div id="searchList"></div>
85
+ </div>
86
+ <iframe id="maskIframe" src="about:blank" scrolling="no" frameborder="no"></iframe>
87
+ </div>
88
+ </div>
89
+ </div>
90
+
91
+ <%= javascript_include_tag 'ueditor/dialogs/internal' %>
92
+ <%= javascript_include_tag 'ueditor_rails/dialogs/image.js' %>
93
+ <script type="text/javascript">
94
+ //全局变量
95
+ var imageUrls = [], //用于保存从服务器返回的图片信息数组
96
+ selectedImageCount = 0; //当前已选择的但未上传的图片数量
97
+
98
+ editor.setOpt({
99
+ imageFieldName:"upfile",
100
+ compressSide:0,
101
+ maxImageSideLength:900
102
+ });
103
+ utils.domReady(function(){
104
+ var flashOptions = {
105
+ container:"flashContainer", //flash容器id
106
+ url:editor.options.imageUrl, // 上传处理页面的url地址
107
+ ext:"{}", //可向服务器提交的自定义参数列表
108
+ fileType:'{"description":"'+lang.fileType+'", "extension":"*.gif;*.jpeg;*.png;*.jpg"}', //上传文件格式限制
109
+ flashUrl:'<%= swf_imageuploader_path %>', //上传用的flash组件地址
110
+ width:608, //flash的宽度
111
+ height:272, //flash的高度
112
+ gridWidth:121, // 每一个预览图片所占的宽度
113
+ gridHeight:120, // 每一个预览图片所占的高度
114
+ picWidth:100, // 单张预览图片的宽度
115
+ picHeight:100, // 单张预览图片的高度
116
+ uploadDataFieldName:editor.options.imageFieldName, // POST请求中图片数据的key
117
+ picDescFieldName:'pictitle', // POST请求中图片描述的key
118
+ maxSize:4, // 文件的最大体积,单位M
119
+ compressSize:2, // 上传前如果图片体积超过该值,会先压缩,单位M
120
+ maxNum:1, // 单次最大可上传多少个文件
121
+ compressSide:editor.options.compressSide, //等比压缩的基准,0为按照最长边,1为按照宽度,2为按照高度
122
+ compressLength:editor.options.maxImageSideLength //能接受的最大边长,超过该值Flash会自动等比压缩
123
+ };
124
+ //回调函数集合,支持传递函数名的字符串、函数句柄以及函数本身三种类型
125
+ var callbacks = {
126
+ // 选择文件的回调
127
+ selectFileCallback: function(selectFiles){
128
+ utils.each(selectFiles,function(file){
129
+ var tmp = {};
130
+ tmp.id = file.index;
131
+ tmp.data = {};
132
+ postConfig.push(tmp);
133
+ });
134
+ selectedImageCount += selectFiles.length;
135
+ if(selectedImageCount) baidu.g("upload").style.display = "";
136
+ dialog.buttons[0].setDisabled(true); //初始化时置灰确定按钮
137
+ },
138
+ // 删除文件的回调
139
+ deleteFileCallback: function(delFiles){
140
+ for(var i = 0,len = delFiles.length;i<len;i++){
141
+ var index = delFiles[i].index;
142
+ postConfig.splice(index,1);
143
+ }
144
+ selectedImageCount -= delFiles.length;
145
+ if (!selectedImageCount) {
146
+ baidu.g("upload").style.display = "none";
147
+ dialog.buttons[0].setDisabled(false); //没有选择图片时重新点亮按钮
148
+ }
149
+ },
150
+
151
+ // 单个文件上传完成的回调
152
+ uploadCompleteCallback: function(data){
153
+ try{
154
+ var info = eval("(" + data.info + ")");
155
+ info && imageUrls.push(info);
156
+ selectedImageCount--;
157
+ }catch(e){}
158
+
159
+ },
160
+ // 单个文件上传失败的回调,
161
+ uploadErrorCallback: function (data){
162
+ if(!data.info){
163
+ alert(lang.netError);
164
+ }
165
+ //console && console.log(data);
166
+ },
167
+ // 全部上传完成时的回调
168
+ allCompleteCallback: function(){
169
+ dialog.buttons[0].setDisabled(false); //上传完毕后点亮按钮
170
+ },
171
+ // 文件超出限制的最大体积时的回调
172
+ //exceedFileCallback: 'exceedFileCallback',
173
+ // 开始上传某个文件时的回调
174
+ startUploadCallback: function(){
175
+ var config = postConfig.shift();
176
+ //也可以在这里更改
177
+ //if(config.id==2){ //设置第三张图片的对应参数
178
+ // config.data={"myParam":"value"}
179
+ // }
180
+ flashObj.addCustomizedParams(config.id,config.data);
181
+ }
182
+ };
183
+ imageUploader.init(flashOptions,callbacks);
184
+ $G("upload").onclick = function () {
185
+ /**
186
+ * 接口imageUploader.setPostParams()可以在提交时设置本次上传提交的参数(包括所有图片)
187
+ * 参数为json对象{"key1":"value1","key2":"value2"},其中key即为向后台post提交的name,value即为值。
188
+ * 其中有一个特殊的保留key值为action,若设置,可以更改本次提交的处理地址
189
+ */
190
+ var postParams = {
191
+ "<%= request_forgery_protection_token %>":"<%= form_authenticity_token %>",
192
+ "dir":baidu.g("savePath").value
193
+ };
194
+ imageUploader.setPostParams(postParams);
195
+ flashObj.upload();
196
+ this.style.display = "none";
197
+ $G("savePath").parentNode.style.display = "none";
198
+ };
199
+
200
+ });
201
+ </script>
202
+ </body>
203
+ </html>
@@ -0,0 +1,96 @@
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
+ <%= stylesheet_link_tag 'ueditor_rails/dialogs/scrawl.css' %>
8
+ </head>
9
+ <body>
10
+ <div class="main" id="J_wrap">
11
+ <div class="hot">
12
+ <div class="drawBoard border_style1">
13
+ <canvas id="J_brushBoard" class="brushBorad" width="360" height="300"></canvas>
14
+ <div id="J_picBoard" class="picBoard" style="width: 360px;height: 300px"></div>
15
+ </div>
16
+ <div id="J_operateBar" class="operateBar">
17
+ <span id="J_previousStep" class="previousStep">
18
+ <em class="icon"></em>
19
+ <em class="text"><var id="lang_input_previousStep"></var></em>
20
+ </span>
21
+ <span id="J_nextStep" class="nextStep">
22
+ <em class="icon"></em>
23
+ <em class="text"><var id="lang_input_nextsStep"></var></em>
24
+ </span>
25
+ <span id="J_clearBoard" class="clearBoard">
26
+ <em class="icon"></em>
27
+ <em class="text"><var id="lang_input_clear"></var></em>
28
+ </span>
29
+ <span id="J_sacleBoard" class="scaleBoard">
30
+ <em class="icon"></em>
31
+ <em class="text"><var id="lang_input_ScalePic"></var></em>
32
+ </span>
33
+ </div>
34
+ </div>
35
+ <div class="drawToolbar border_style1">
36
+ <div id="J_colorBar" class="colorBar"></div>
37
+ <div id="J_brushBar" class="sectionBar">
38
+ <em class="brushIcon"></em>
39
+ <a href="javascript:void(0)" class="size1">1</a>
40
+ <a href="javascript:void(0)" class="size2">3</a>
41
+ <a href="javascript:void(0)" class="size3">5</a>
42
+ <a href="javascript:void(0)" class="size4">7</a>
43
+ </div>
44
+ <div id="J_eraserBar" class="sectionBar">
45
+ <em class="eraserIcon"></em>
46
+ <a href="javascript:void(0)" class="size1">1</a>
47
+ <a href="javascript:void(0)" class="size2">3</a>
48
+ <a href="javascript:void(0)" class="size3">5</a>
49
+ <a href="javascript:void(0)" class="size4">7</a>
50
+ </div>
51
+ <div class="sectionBar">
52
+ <div class="addImgH">
53
+ <em class="icon"></em>
54
+ <em class="text"><var id="lang_input_addPic"></var></em>
55
+
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
+ <%= javascript_include_tag 'ueditor/dialogs/internal.js' %>
74
+ <%= javascript_include_tag 'ueditor_rails/dialogs/scrawl.js' %>
75
+ <script type="text/javascript">
76
+ var settings = {
77
+ drawBrushSize: 3, //画笔初始大小
78
+ drawBrushColor: "#4bacc6", //画笔初始颜色
79
+ colorList: ['c00000', 'ff0000', 'ffc000', 'ffff00', '92d050', '00b050', '00b0f0', '0070c0', '002060', '7030a0', 'ffffff',
80
+ '000000', 'eeece1', '1f497d', '4f81bd', 'c0504d', '9bbb59', '8064a2', '4bacc6', 'f79646'], //画笔选择颜色
81
+ saveNum: 10 //撤销次数
82
+ };
83
+
84
+ var scrawlObj = new scrawl(settings);
85
+ scrawlObj.isCancelScrawl = false;
86
+
87
+ dialog.onok = function () {
88
+ exec(scrawlObj);
89
+ return false;
90
+ };
91
+ dialog.oncancel = function () {
92
+ scrawlObj.isCancelScrawl = true;
93
+ };
94
+ </script>
95
+ </body>
96
+ </html>
@@ -0,0 +1,155 @@
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
+ <title></title>
6
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
7
+ <style type="text/css">
8
+ .wrapper {
9
+ width: 600px;
10
+ padding: 10px;
11
+ height: 352px;
12
+ overflow: hidden;
13
+ position: relative;
14
+ border-bottom: 1px solid #d7d7d7
15
+ }
16
+
17
+ .localPath input {
18
+ float: left;
19
+ width: 350px;
20
+ line-height: 20px;
21
+ height: 20px;
22
+ }
23
+
24
+ #clipboard {
25
+ float: left;
26
+ width: 70px;
27
+ height: 30px;
28
+ }
29
+
30
+ .description {
31
+ color: #0066cc;
32
+ margin-top: 2px;
33
+ width: 450px;
34
+ height: 45px;
35
+ float: left;
36
+ line-height: 22px
37
+ }
38
+
39
+ #upload {
40
+ width: 100px;
41
+ height: 30px;
42
+ float: right;
43
+ margin: 10px 2px 0 0;
44
+ cursor: pointer;
45
+ }
46
+
47
+ #msg {
48
+ width: 140px;
49
+ height: 30px;
50
+ line-height: 25px;
51
+ float: left;
52
+ color: red
53
+ }
54
+ </style>
55
+ </head>
56
+ <body>
57
+ <div class="wrapper">
58
+ <div class="localPath">
59
+ <input id="localPath" type="text" readonly/>
60
+
61
+ <div id="clipboard"></div>
62
+ <div id="msg"></div>
63
+ </div>
64
+ <div id="flashContainer"></div>
65
+ <div>
66
+ <div id="upload" style="display: none"><img id="uploadBtn"></div>
67
+ <div class="description">
68
+ <span style="color: red"><var id="lang_resave"></var>: </span><var id="lang_step"></var>
69
+ </div>
70
+ </div>
71
+ </div>
72
+ <%= javascript_include_tag 'ueditor/dialogs/internal.js' %>
73
+ <%= javascript_include_tag 'ueditor/dialogs/tangram.js' %>
74
+ <%= javascript_include_tag 'ueditor_rails/dialogs/wordimage.js' %>
75
+ <script type="text/javascript">
76
+ //全局变量
77
+ var imageUrls = [], //用于保存从服务器返回的图片信息数组
78
+ selectedImageCount = 0; //当前已选择的但未上传的图片数量
79
+ editor.setOpt({
80
+ wordImageFieldName: "upfile",
81
+ compressSide: 0,
82
+ maxImageSideLength: 900
83
+ });
84
+ utils.domReady(function () {
85
+ //创建Flash相关的参数集合
86
+ var flashOptions = {
87
+ container: "flashContainer", //flash容器id
88
+ url: editor.options.wordImageUrl, // 上传处理页面的url地址
89
+ ext: '{""}', //可向服务器提交的自定义参数列表
90
+ fileType: '{"description":"' + lang.fileType + '", "extension":"*.gif;*.jpeg;*.png;*.jpg"}', //上传文件格式限制
91
+ flashUrl: '<%= swf_imageuploader_path %>', //上传用的flash组件地址
92
+ width: 600, //flash的宽度
93
+ height: 272, //flash的高度
94
+ gridWidth: 120, // 每一个预览图片所占的宽度
95
+ gridHeight: 120, // 每一个预览图片所占的高度
96
+ picWidth: 100, // 单张预览图片的宽度
97
+ picHeight: 100, // 单张预览图片的高度
98
+ uploadDataFieldName: editor.options.wordImageFieldName, // POST请求中图片数据的key
99
+ picDescFieldName: 'pictitle', // POST请求中图片描述的key
100
+ maxSize: 2, // 文件的最大体积,单位M
101
+ compressSize: 1, // 上传前如果图片体积超过该值,会先压缩,单位M
102
+ maxNum: 32, // 单次最大可上传多少个文件
103
+ compressSide: editor.options.compressSide, //等比压缩的基准,0为按照最长边,1为按照宽度,2为按照高度
104
+ compressLength: editor.options.maxImageSideLength //能接受的最大边长,超过该值Flash会自动等比压缩
105
+ };
106
+ //回调函数集合,支持传递函数名的字符串、函数句柄以及函数本身三种类型
107
+ var callbacks = {
108
+ selectFileCallback: function (selectFiles) { // 选择文件的回调
109
+ selectedImageCount += selectFiles.length;
110
+ if (selectedImageCount) baidu.g("upload").style.display = "";
111
+ dialog.buttons[0].setDisabled(true); //初始化时置灰确定按钮
112
+ },
113
+ deleteFileCallback: function (delFiles) { // 删除文件的回调
114
+ selectedImageCount -= delFiles.length;
115
+ if (!selectedImageCount) {
116
+ baidu.g("upload").style.display = "none";
117
+ dialog.buttons[0].setDisabled(false); //没有选择图片时重新点亮按钮
118
+ }
119
+ },
120
+ uploadCompleteCallback: function (data) { // 单个文件上传完成的回调
121
+ try {
122
+ var info = eval("(" + data.info + ")");
123
+ info && imageUrls.push(info);
124
+ selectedImageCount--;
125
+ } catch (e) {
126
+ }
127
+ },
128
+ uploadErrorCallback: function (data) { // 单个文件上传失败的回调,
129
+ console && console.log(data);
130
+ },
131
+ allCompleteCallback: function () { // 全部上传完成时的回调
132
+ dialog.buttons[0].setDisabled(false); //上传完毕后点亮按钮
133
+ }
134
+ //exceedFileCallback: 'exceedFileCallback', // 文件超出限制的最大体积时的回调
135
+ //startUploadCallback: startUploadCallback // 开始上传某个文件时的回调
136
+ };
137
+ wordImage.init(flashOptions, callbacks);
138
+ });
139
+ $G("upload").onclick = function () {
140
+ /**
141
+ * 接口imageUploader.setPostParams()可以在提交时设置本次上传提交的参数(包括所有图片)
142
+ * 参数为json对象{"key1":"value1","key2":"value2"},其中key即为向后台post提交的name,value即为值。
143
+ * 其中有一个特殊的保留key值为action,若设置,可以更改本次提交的处理地址
144
+ */
145
+ var postParams = {
146
+ "<%= request_forgery_protection_token %>": "<%= form_authenticity_token %>",
147
+ };
148
+ wordImage.setPostParams(postParams);
149
+ flashObj.upload();
150
+ };
151
+
152
+ </script>
153
+
154
+ </body>
155
+ </html>