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 @@
1
+ /*可以在这里添加你自己的css*/
@@ -0,0 +1,161 @@
1
+ * {
2
+ margin: 0;
3
+ padding: 0;
4
+ }
5
+
6
+ .wrapper {
7
+ width: 460px;
8
+ height: 340px;
9
+ border: 1px solid #ddd;
10
+ margin: 8px;
11
+ overflow-y: hidden;
12
+ }
13
+
14
+ .controller {
15
+ height: 30px;
16
+ padding-top: 10px;
17
+ padding-left: 6px;
18
+ }
19
+
20
+ #divStatus {
21
+ display: inline-block;
22
+ width: 336px;
23
+ color: #aaa;
24
+ font-size: 12px;
25
+ }
26
+
27
+ #startUpload {
28
+ cursor: pointer;
29
+ margin-right: 10px;
30
+ float: right;
31
+ display: inline-block;
32
+ width: 100px;
33
+ height: 30px
34
+ }
35
+
36
+ div.fieldset {
37
+ border: 1px solid #afe14c;
38
+ padding: 10px 10px;
39
+ }
40
+
41
+ div.fieldset span.legend {
42
+ position: relative;
43
+ top: -20px;
44
+ }
45
+
46
+ div.flash {
47
+ width: 420px;
48
+ height: 236px;
49
+ margin: 2px 5px 8px 9px;
50
+ border-color: #D9E4FF;
51
+ overflow-y: auto;
52
+ -moz-border-radius-topleft: 5px;
53
+ -webkit-border-top-left-radius: 5px;
54
+ -moz-border-radius-topright: 5px;
55
+ -webkit-border-top-right-radius: 5px;
56
+ -moz-border-radius-bottomleft: 5px;
57
+ -webkit-border-bottom-left-radius: 5px;
58
+ -moz-border-radius-bottomright: 5px;
59
+ -webkit-border-bottom-right-radius: 5px;
60
+
61
+ }
62
+
63
+ .progressWrapper {
64
+ width: 412px;
65
+ overflow: hidden;
66
+ }
67
+
68
+ .progressContainer {
69
+ margin: 0 0px 5px 0;
70
+ /*padding: 3px 0 3px 4px;*/
71
+ border: solid 1px #E8E8E8;
72
+ background-color: #F7F7F7;
73
+ overflow: hidden;
74
+ }
75
+
76
+ /* Message */
77
+ .message {
78
+ margin: 1em 0;
79
+ padding: 10px 20px;
80
+ border: solid 1px #FFDD99;
81
+ background-color: #FFFFCC;
82
+ overflow: hidden;
83
+ }
84
+
85
+ /* Error */
86
+ .red {
87
+ border: solid 1px #B50000;
88
+ background-color: #FFEBEB;
89
+ }
90
+
91
+ /* Current */
92
+ .green {
93
+ border: solid 1px #DDF0DD;
94
+ background-color: #EBFFEB;
95
+ }
96
+
97
+ /* Complete */
98
+ .blue {
99
+ border: solid 1px #CEE2F2;
100
+ background-color: #F0F5FF;
101
+ }
102
+
103
+ .progressName {
104
+ font-size: 10px;
105
+ color: #555;
106
+ width: 360px;
107
+ height: 14px;
108
+ text-align: left;
109
+ white-space: nowrap;
110
+ overflow: hidden;
111
+ }
112
+
113
+ .progressBarInProgress,
114
+ .progressBarComplete,
115
+ .progressBarError {
116
+ font-size: 0;
117
+ width: 0%;
118
+ height: 2px;
119
+ background-color: blue;
120
+ margin-top: 2px;
121
+ }
122
+
123
+ .progressBarComplete {
124
+ width: 100%;
125
+ background-color: green;
126
+ visibility: hidden;
127
+ }
128
+
129
+ .progressBarError {
130
+ width: 100%;
131
+ background-color: red;
132
+ visibility: hidden;
133
+ }
134
+
135
+ a.progressCancel {
136
+ font-size: 0;
137
+ display: block;
138
+ height: 14px;
139
+ width: 14px;
140
+ background: url(<%= asset_path 'ueditor/themes/default/cancelbutton.gif' %>) -14px 0 no-repeat;
141
+ float: right;
142
+ }
143
+
144
+ a.progressCancel:hover {
145
+ background-position: 0 0;
146
+ }
147
+
148
+ .progressBarStatus {
149
+ margin-top: 2px;
150
+ width: 337px;
151
+ font-size: 7pt;
152
+ text-align: left;
153
+ white-space: nowrap;
154
+ }
155
+
156
+ /* -- SWFUpload Object Styles ------------------------------- */
157
+ .swfupload {
158
+ vertical-align: top;
159
+ }
160
+
161
+
@@ -0,0 +1,69 @@
1
+ @charset "utf-8";
2
+ .wrapper{ width: 623px;margin: 10px auto;zoom:1;position: relative;}
3
+ .tabbody{ height:325px;_height:330px;}/*tab样式框大小*/
4
+ .panel { position: absolute;width:100%; height:100%;background: #fff;}
5
+
6
+ #remote{ z-index: 200;}
7
+ #remote table{border-collapse: collapse;width: 620px; height: 300px; margin-top: 5px;}
8
+ #remote td.label{text-align: center;width: 80px; }
9
+ #remote td{height: 40px;}
10
+ td input {
11
+ width: 150px;
12
+ height: 21px;
13
+ line-height: 21px;
14
+ background: #FFF;
15
+ border: 1px solid #d7d7d7;
16
+ }
17
+ #url {width: 520px;margin-bottom: 2px;}
18
+ #preview{width: 260px; height: 260px; position: absolute;top:50px; left: 341px; z-index: 9999;background-color: #eee}
19
+ .lock{
20
+ position: absolute;
21
+ width: 45px;
22
+ height: 40px;
23
+ top: 68px;
24
+ left: 260px;
25
+ background: url(<%= asset_path 'ueditor/themes/default/lock.gif' %>) 3px -4px no-repeat;
26
+ line-height: 40px;
27
+ padding-top:10px;
28
+ }
29
+ .saveDir{
30
+ /*width: 132px;*/
31
+ /*text-align: right;*/
32
+ height: 40px;
33
+ line-height: 40px;
34
+ margin-left: 30px;
35
+ float: left;
36
+ }
37
+ .saveDir select{
38
+ height: 30px;
39
+ }
40
+ #duiqi{ width: 62px; height: 38px;float: left}
41
+ #remoteFloat div,#localFloat div{cursor:pointer;opacity: 0.5;filter: alpha(opacity = 50);margin-left:1px;width:38px;height:36px;float:left;}
42
+ #remoteFloat .focus,#localFloat .focus{opacity: 1;filter: alpha(opacity = 100)}
43
+ #maskIframe{ width: 620px; height: 325px; position: absolute;z-index: 100; }
44
+ #flashContainer { margin: 6px;position: relative;}
45
+ #upload{width: 100px;height: 30px;float: right; margin:3px 6px 0 0;cursor: pointer;}
46
+ #imageList{width: 620px;height: 315px; margin-top: 10px;overflow:hidden;overflow-y: auto;}
47
+ #imageList img{cursor: pointer ;border: 2px solid #fff}
48
+ #imgManager #imageList div{float: left;width: 100px;height: 100px;margin: 5px 10px;}
49
+ #imgSearchTxt{padding-left:2px;margin-left:15px;background: #FFF;width:200px;height:21px;line-height:21px;border: 1px solid #d7d7d7;}
50
+ #searchList{width: 620px;overflow: auto;zoom:1;height: 270px;}
51
+ #searchList div{float: left;width: 116px;height: 135px;margin: 5px 15px;_margin:5px 10px;}
52
+ #searchList img{margin: 2px 8px;cursor: pointer;border: 2px solid #fff} /*不用缩略图*/
53
+ #searchList p{margin-left: 10px;_margin-left:8px;}
54
+ #imgType{
55
+ width: 65px;
56
+ height: 23px;
57
+ line-height: 22px;
58
+ border: 1px solid #d7d7d7;
59
+ }
60
+ #imgSearchBtn,#imgSearchReset{
61
+ width: 100%;
62
+ height: 25px;
63
+ margin: 0 3px;
64
+ line-height: 25px;
65
+ background: #eee;
66
+ border: 1px solid #d7d7d7;
67
+ cursor: pointer
68
+ }
69
+ .msg{margin-left: 5px;}
@@ -0,0 +1,72 @@
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('<%= asset_path 'ueditor_rails/dialogs/scrawl/size.png' %>') 1px center no-repeat ;}
26
+ .size2{background: url('<%= asset_path 'ueditor_rails/dialogs/scrawl/size.png' %>') -10px center no-repeat;}
27
+ .size3{background: url('<%= asset_path 'ueditor_rails/dialogs/scrawl/size.png' %>') -22px center no-repeat;}
28
+ .size4{background: url('<%= asset_path 'ueditor_rails/dialogs/scrawl/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('<%= asset_path 'ueditor_rails/dialogs/scrawl/undoH.png' %>');cursor: pointer;}
41
+ .previousStepH .text{color:#888;cursor:pointer;}
42
+ .previousStep .icon{display: inline-block;width:16px;height:16px;background-image: url('<%= asset_path 'ueditor_rails/dialogs/scrawl/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('<%= asset_path 'ueditor_rails/dialogs/scrawl/redoH.png' %>');cursor: pointer;}
46
+ .nextStepH .text{color:#888;cursor:pointer;}
47
+ .nextStep .icon{display: inline-block;width:16px;height:16px;background-image: url('<%= asset_path 'ueditor_rails/dialogs/scrawl/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('<%= asset_path 'ueditor_rails/dialogs/scrawl/emptyH.png' %>');cursor: pointer;}
51
+ .clearBoardH .text{color:#888;cursor:pointer;}
52
+ .clearBoard .icon{display: inline-block;width:16px;height:16px;background-image: url('<%= asset_path 'ueditor_rails/dialogs/scrawl/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('<%= asset_path 'ueditor_rails/dialogs/scrawl/scaleH.png' %>');cursor: pointer;}
56
+ .scaleBoardH .text{color:#888;cursor:pointer;}
57
+ .scaleBoard .icon{display: inline-block;width:16px;height:16px;background-image: url('<%= asset_path 'ueditor_rails/dialogs/scrawl/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('<%= asset_path 'ueditor_rails/dialogs/scrawl/delimgH.png' %>');cursor: pointer;}
61
+ .removeImgH .text{color:#888;cursor:pointer;}
62
+ .removeImg .icon{display: inline-block;width:16px;height:16px;background-image: url('<%= asset_path 'ueditor_rails/dialogs/scrawl/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('<%= asset_path 'ueditor_rails/dialogs/scrawl/addimg.png' %>')}
66
+ .addImgH .text{color:#888;cursor:pointer;}
67
+ /*icon
68
+ */
69
+ .brushIcon{display: inline-block;width:16px;height:16px;background-image: url('<%= asset_path 'ueditor_rails/dialogs/scrawl/brush.png' %>')}
70
+ .eraserIcon{display: inline-block;width:16px;height:16px;background-image: url('<%= asset_path 'ueditor_rails/dialogs/scrawl/eraser.png' %>')}
71
+
72
+
@@ -0,0 +1,5 @@
1
+ module UeditorRails
2
+ class ApplicationController < ActionController::Base
3
+ layout false
4
+ end
5
+ end
@@ -0,0 +1,21 @@
1
+ require_dependency "ueditor_rails/application_controller"
2
+
3
+ module UeditorRails
4
+ class DialogsController < ApplicationController
5
+ def attachment
6
+
7
+ end
8
+
9
+ def image
10
+
11
+ end
12
+
13
+ def wordimage
14
+
15
+ end
16
+
17
+ def scrawl
18
+
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,33 @@
1
+ require_dependency "ueditor_rails/application_controller"
2
+
3
+ module UeditorRails
4
+ class LibsController < ApplicationController
5
+ after_filter :set_expires_at
6
+
7
+ def swf_image_uploader
8
+ send_file UeditorRails.ueditor_base_path.join('third-party/imageUploader.swf'),
9
+ :disposition => 'inline', :type => 'application/x-shockwave-flash'
10
+ end
11
+
12
+ def swf_upload
13
+ send_file UeditorRails.ueditor_base_path.join('third-party/swfupload/swfupload.swf'),
14
+ :disposition => 'inline', :type => 'application/x-shockwave-flash'
15
+ end
16
+
17
+ def swf_upload_fp9
18
+ send_file UeditorRails.ueditor_base_path.join('third-party/swfupload/swfupload_fp9.swf'),
19
+ :disposition => 'inline', :type => 'application/x-shockwave-flash'
20
+ end
21
+
22
+ def fclipboard_ueditor
23
+ send_file UeditorRails.ueditor_base_path.join('third-party/fClipboard_ueditor.swf'),
24
+ :disposition => 'inline', :type => 'application/x-shockwave-flash'
25
+ end
26
+
27
+ protected
28
+
29
+ def set_expires_at
30
+ response.headers['Expires'] = CGI.rfc1123_date(Time.now + 1.weeks)
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,27 @@
1
+ module UeditorRails
2
+ module ApplicationHelper
3
+ def swfupload_path
4
+ UeditorRails.enable_cross_domain ?
5
+ UeditorRails::Engine.routes.url_helpers.libs_swf_upload_path :
6
+ asset_path('ueditor/third-party/swfupload/swfupload.swf')
7
+ end
8
+
9
+ def swfupload_fp9_path
10
+ UeditorRails.enable_cross_domain ?
11
+ UeditorRails::Engine.routes.url_helpers.libs_swf_upload_fp9_path :
12
+ asset_path('ueditor/third-party/swfupload/swfupload_fp9.swf')
13
+ end
14
+
15
+ def swf_imageuploader_path
16
+ UeditorRails.enable_cross_domain ?
17
+ UeditorRails::Engine.routes.url_helpers.libs_swf_image_uploader_path :
18
+ asset_path('ueditor/third-party/imageUploader.swf')
19
+ end
20
+
21
+ def fclipboard_ueditor_path
22
+ UeditorRails.enable_cross_domain ?
23
+ UeditorRails::Engine.routes.url_helpers.libs_fclipboard_ueditor_path :
24
+ asset_path('ueditor/third-party/fClipboard_ueditor.swf')
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,124 @@
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/attachment' %>
8
+ </head>
9
+ <body>
10
+ <div class="wrapper">
11
+ <div class="controller">
12
+ <!--<span id="divStatus"></span>-->
13
+ <span id="spanButtonPlaceHolder"></span>
14
+ </div>
15
+ <div class="fieldset flash" id="fsUploadProgress"></div>
16
+ <span id="startUpload" style="display: none;"></span>
17
+
18
+ </div>
19
+
20
+ <%= javascript_include_tag 'ueditor/dialogs/internal' %>
21
+ <%= javascript_include_tag 'ueditor_rails/dialogs/attachment.js' %>
22
+ <script type="text/javascript">
23
+ var swfupload,
24
+ filesList=[];
25
+ editor.setOpt({
26
+ fileFieldName:"upfile"
27
+ });
28
+ window.onload = function () {
29
+ var settings = {
30
+ upload_url:editor.options.fileUrl, //附件上传服务器地址
31
+ file_post_name:editor.options.fileFieldName, //向后台提交的表单名
32
+ flash_url:"<%= swfupload_path %>",
33
+ flash9_url:"<%= swfupload_fp9_path %>",
34
+ post_params:{"<%= request_forgery_protection_token %>":"<%= form_authenticity_token %>"}, //解决session丢失问题
35
+ file_size_limit:"100 MB", //文件大小限制,此处仅是前端flash选择时候的限制,具体还需要和后端结合判断
36
+ file_types:"*.*", //允许的扩展名,多个扩展名之间用分号隔开,支持*通配符
37
+ file_types_description:"All Files", //扩展名描述
38
+ file_upload_limit:100, //单次可同时上传的文件数目
39
+ file_queue_limit:10, //队列中可同时上传的文件数目
40
+ custom_settings:{ //自定义设置,用户可在此向服务器传递自定义变量
41
+ progressTarget:"fsUploadProgress",
42
+ startUploadId:"startUpload"
43
+ },
44
+ debug:false,
45
+
46
+ // 按钮设置
47
+ button_image_url:"<%= asset_path 'ueditor/themes/default/filescan.png' %>",
48
+ button_width:"100",
49
+ button_height:"25",
50
+ button_placeholder_id:"spanButtonPlaceHolder",
51
+ button_text:'<span class="theFont">'+lang.browseFiles+'</span>',
52
+ button_text_style:".theFont { font-size:14px;}",
53
+ button_text_left_padding:10,
54
+ button_text_top_padding:4,
55
+
56
+ // 所有回调函数 in handlers.js
57
+ swfupload_preload_handler:preLoad,
58
+ swfupload_load_failed_handler:loadFailed,
59
+ file_queued_handler:fileQueued,
60
+ file_queue_error_handler:fileQueueError,
61
+ //选择文件完成回调
62
+ file_dialog_complete_handler:function(numFilesSelected, numFilesQueued) {
63
+ var me = this; //此处的this是swfupload对象
64
+ if (numFilesQueued > 0) {
65
+ dialog.buttons[0].setDisabled(true);
66
+ var start = $G(this.customSettings.startUploadId);
67
+ start.style.display = "";
68
+ start.onclick = function(){
69
+ me.startUpload();
70
+ start.style.display = "none";
71
+ }
72
+ }
73
+ },
74
+ upload_start_handler:uploadStart,
75
+ upload_progress_handler:uploadProgress,
76
+ upload_error_handler:uploadError,
77
+ upload_success_handler:function (file, serverData) {
78
+ try{
79
+ var info = eval("("+serverData+")");
80
+ }catch(e){}
81
+ var progress = new FileProgress(file, this.customSettings.progressTarget);
82
+ if(info.state=="SUCCESS"){
83
+ progress.setComplete();
84
+ progress.setStatus("<span style='color: #0b0;font-weight: bold'>"+lang.uploadSuccess+"</span>");
85
+ filesList.push({url:info.url,type:info.fileType,original:info.original});
86
+ progress.toggleCancel(true,this,lang.delSuccessFile);
87
+ }else{
88
+ progress.setError();
89
+ progress.setStatus(info.state);
90
+ progress.toggleCancel(true,this,lang.delFailSaveFile);
91
+ }
92
+
93
+ },
94
+ //上传完成回调
95
+ upload_complete_handler:uploadComplete,
96
+ //队列完成回调
97
+ queue_complete_handler:function(numFilesUploaded){
98
+ dialog.buttons[0].setDisabled(false);
99
+ // var status = $G("divStatus");
100
+ // var num = status.innerHTML.match(/\d+/g);
101
+ // status.innerHTML = ((num && num[0] ?parseInt(num[0]):0) + numFilesUploaded) +lang.statusPrompt;
102
+ }
103
+ };
104
+ swfupload = new SWFUpload( settings );
105
+ //点击OK按钮
106
+ dialog.onok = function(){
107
+ var map = fileTypeMaps,
108
+ str="";
109
+ for(var i=0,ci;ci=filesList[i++];){
110
+ var src = map[(ci.type||'default')];
111
+ str += "<p style='line-height: 16px;'><img src='"+ src + "' data_ue_src='"+src+"' />" +
112
+ "<a href='"+editor.options.filePath + ci.url+"'>" + ci.original + "</a></p>";
113
+ }
114
+ editor.execCommand("insertHTML",str);
115
+ swfupload.destroy();
116
+ };
117
+ dialog.oncancel = function(){
118
+ swfupload.destroy();
119
+ }
120
+ };
121
+ </script>
122
+
123
+ </body>
124
+ </html>