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,91 @@
1
+ <!DOCTYPE HTML>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
5
+ <title></title>
6
+ <style type="text/css">
7
+ * {
8
+ color: #838383
9
+ }
10
+
11
+ html, body {
12
+ font-size: 12px;
13
+ width: 100%;
14
+ height: 100%;
15
+ overflow: hidden;
16
+ margin: 0px;
17
+ padding: 0px;
18
+ }
19
+
20
+ h2 {
21
+ font-size: 16px;
22
+ margin: 20px auto;
23
+ }
24
+
25
+ .content {
26
+ padding: 5px 15px 0 15px;
27
+ height: 100%;
28
+ }
29
+
30
+ dt, dd {
31
+ margin-left: 0;
32
+ padding-left: 0;
33
+ }
34
+
35
+ dt a {
36
+ display: block;
37
+ height: 30px;
38
+ line-height: 30px;
39
+ width: 55px;
40
+ background: #EFEFEF;
41
+ border: 1px solid #CCC;
42
+ padding: 0 10px;
43
+ text-decoration: none;
44
+ }
45
+
46
+ dt a:hover {
47
+ background: #e0e0e0;
48
+ border-color: #999
49
+ }
50
+
51
+ dt a:active {
52
+ background: #ccc;
53
+ border-color: #999;
54
+ color: #666;
55
+ }
56
+
57
+ dd {
58
+ line-height: 20px;
59
+ margin-top: 10px;
60
+ }
61
+
62
+ span {
63
+ padding-right: 4px;
64
+ }
65
+
66
+ input {
67
+ width: 210px;
68
+ height: 21px;
69
+ background: #FFF;
70
+ border: 1px solid #d7d7d7;
71
+ padding: 0px;
72
+ margin: 0px;
73
+ }
74
+
75
+
76
+ </style>
77
+ </head>
78
+ <body>
79
+ <div class="content">
80
+ <h2><var id="lang_showMsg"></var></h2>
81
+ <dl>
82
+ <dt>
83
+ <a href="<%= asset_path 'ueditor/third-party/snapscreen/UEditorSnapscreen.exe' %>" target="_blank" id="downlink"><var id="lang_download"></var></a>
84
+ </dt>
85
+ <dd><var id="lang_step1"></var></dd>
86
+ <dd><var id="lang_step2"></var></dd>
87
+ </dl>
88
+ </div>
89
+ <%= javascript_include_tag 'ueditor/dialogs/internal.js' %>
90
+ </body>
91
+ </html>
@@ -0,0 +1,21 @@
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
+ html,body{overflow:hidden;}
9
+ #specharsTab{width: 97%;margin: 10px auto; zoom:1;position: relative}
10
+ .tabbody {height:447px;}
11
+ .tabbody span{ margin: 5px 3px;text-align: center;display:inline-block;width: 40px;height:16px;line-height: 16px;cursor: pointer; }
12
+ </style>
13
+ </head>
14
+ <body>
15
+ <div id="specharsTab">
16
+ <div id="tabHeads" class="tabhead"></div><div id="tabBodys" class="tabbody"></div>
17
+ </div>
18
+ <%= javascript_include_tag 'ueditor/dialogs/internal.js' %>
19
+ <%= javascript_include_tag 'ueditor/dialogs/spechars/spechars.js' %>
20
+ </body>
21
+ </html>
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Created with JetBrains PhpStorm.
3
+ * User: xuheng
4
+ * Date: 12-9-26
5
+ * Time: 下午1:09
6
+ * To change this template use File | Settings | File Templates.
7
+ */
8
+ var charsContent = [
9
+ { name:"tsfh", title:lang.tsfh, content:toArray("、,。,·,ˉ,ˇ,¨,〃,々,—,~,‖,…,‘,’,“,”,〔,〕,〈,〉,《,》,「,」,『,』,〖,〗,【,】,±,×,÷,∶,∧,∨,∑,∏,∪,∩,∈,∷,√,⊥,∥,∠,⌒,⊙,∫,∮,≡,≌,≈,∽,∝,≠,≮,≯,≤,≥,∞,∵,∴,♂,♀,°,′,″,℃,$,¤,¢,£,‰,§,№,☆,★,○,●,◎,◇,◆,□,■,△,▲,※,→,←,↑,↓,〓,〡,〢,〣,〤,〥,〦,〧,〨,〩,㊣,㎎,㎏,㎜,㎝,㎞,㎡,㏄,㏎,㏑,㏒,㏕,︰,¬,¦,℡,ˊ,ˋ,˙,–,―,‥,‵,℅,℉,↖,↗,↘,↙,∕,∟,∣,≒,≦,≧,⊿,═,║,╒,╓,╔,╕,╖,╗,╘,╙,╚,╛,╜,╝,╞,╟,╠,╡,╢,╣,╤,╥,╦,╧,╨,╩,╪,╫,╬,╭,╮,╯,╰,╱,╲,╳,▁,▂,▃,▄,▅,▆,▇,�,█,▉,▊,▋,▌,▍,▎,▏,▓,▔,▕,▼,▽,◢,◣,◤,◥,☉,⊕,〒,〝,〞")},
10
+ { name:"lmsz", title:lang.lmsz, content:toArray("ⅰ,ⅱ,ⅲ,ⅳ,ⅴ,ⅵ,ⅶ,ⅷ,ⅸ,ⅹ,Ⅰ,Ⅱ,Ⅲ,Ⅳ,Ⅴ,Ⅵ,Ⅶ,Ⅷ,Ⅸ,Ⅹ,Ⅺ,Ⅻ")},
11
+ { name:"szfh", title:lang.szfh, content:toArray("⒈,⒉,⒊,⒋,⒌,⒍,⒎,⒏,⒐,⒑,⒒,⒓,⒔,⒕,⒖,⒗,⒘,⒙,⒚,⒛,⑴,⑵,⑶,⑷,⑸,⑹,⑺,⑻,⑼,⑽,⑾,⑿,⒀,⒁,⒂,⒃,⒄,⒅,⒆,⒇,①,②,③,④,⑤,⑥,⑦,⑧,⑨,⑩,㈠,㈡,㈢,㈣,㈤,㈥,㈦,㈧,㈨,㈩")},
12
+ { name:"rwfh", title:lang.rwfh, content:toArray("ぁ,あ,ぃ,い,ぅ,う,ぇ,え,ぉ,お,か,が,き,ぎ,く,ぐ,け,げ,こ,ご,さ,ざ,し,じ,す,ず,せ,ぜ,そ,ぞ,た,だ,ち,ぢ,っ,つ,づ,て,で,と,ど,な,に,ぬ,ね,の,は,ば,ぱ,ひ,び,ぴ,ふ,ぶ,ぷ,へ,べ,ぺ,ほ,ぼ,ぽ,ま,み,む,め,も,ゃ,や,ゅ,ゆ,ょ,よ,ら,り,る,れ,ろ,ゎ,わ,ゐ,ゑ,を,ん,ァ,ア,ィ,イ,ゥ,ウ,ェ,エ,ォ,オ,カ,ガ,キ,ギ,ク,グ,ケ,ゲ,コ,ゴ,サ,ザ,シ,ジ,ス,ズ,セ,ゼ,ソ,ゾ,タ,ダ,チ,ヂ,ッ,ツ,ヅ,テ,デ,ト,ド,ナ,ニ,ヌ,ネ,ノ,ハ,バ,パ,ヒ,ビ,ピ,フ,ブ,プ,ヘ,ベ,ペ,ホ,ボ,ポ,マ,ミ,ム,メ,モ,ャ,ヤ,ュ,ユ,ョ,ヨ,ラ,リ,ル,レ,ロ,ヮ,ワ,ヰ,ヱ,ヲ,ン,ヴ,ヵ,ヶ")},
13
+ { name:"xlzm", title:lang.xlzm, content:toArray("Α,Β,Γ,Δ,Ε,Ζ,Η,Θ,Ι,Κ,Λ,Μ,Ν,Ξ,Ο,Π,Ρ,Σ,Τ,Υ,Φ,Χ,Ψ,Ω,α,β,γ,δ,ε,ζ,η,θ,ι,κ,λ,μ,ν,ξ,ο,π,ρ,σ,τ,υ,φ,χ,ψ,ω")},
14
+ { name:"ewzm", title:lang.ewzm, content:toArray("А,Б,В,Г,Д,Е,Ё,Ж,З,И,Й,К,Л,М,Н,О,П,Р,С,Т,У,Ф,Х,Ц,Ч,Ш,Щ,Ъ,Ы,Ь,Э,Ю,Я,а,б,в,г,д,е,ё,ж,з,и,й,к,л,м,н,о,п,р,с,т,у,ф,х,ц,ч,ш,щ,ъ,ы,ь,э,ю,я")},
15
+ { name:"pyzm", title:lang.pyzm, content:toArray("ā,á,ǎ,à,ē,é,ě,è,ī,í,ǐ,ì,ō,ó,ǒ,ò,ū,ú,ǔ,ù,ǖ,ǘ,ǚ,ǜ,ü")},
16
+ { name:"zyzf", title:lang.zyzf, content:toArray("ㄅ,ㄆ,ㄇ,ㄈ,ㄉ,ㄊ,ㄋ,ㄌ,ㄍ,ㄎ,ㄏ,ㄐ,ㄑ,ㄒ,ㄓ,ㄔ,ㄕ,ㄖ,ㄗ,ㄘ,ㄙ,ㄚ,ㄛ,ㄜ,ㄝ,ㄞ,ㄟ,ㄠ,ㄡ,ㄢ,ㄣ,ㄤ,ㄥ,ㄦ,ㄧ,ㄨ")}
17
+ ];
18
+ (function createTab(content) {
19
+ for (var i = 0, ci; ci = content[i++];) {
20
+ var span = document.createElement("span");
21
+ span.setAttribute("tabSrc", ci.name);
22
+ span.innerHTML = ci.title;
23
+ if (i == 1)span.className = "focus";
24
+ domUtils.on(span, "click", function () {
25
+ var tmps = $G("tabHeads").children;
26
+ for (var k = 0, sk; sk = tmps[k++];) {
27
+ sk.className = "";
28
+ }
29
+ tmps = $G("tabBodys").children;
30
+ for (var k = 0, sk; sk = tmps[k++];) {
31
+ sk.style.display = "none";
32
+ }
33
+ this.className = "focus";
34
+ $G(this.getAttribute("tabSrc")).style.display = "";
35
+ });
36
+ $G("tabHeads").appendChild(span);
37
+ domUtils.insertAfter(span, document.createTextNode("\n"));
38
+ var div = document.createElement("div");
39
+ div.id = ci.name;
40
+ div.style.display = (i == 1) ? "" : "none";
41
+ var cons = ci.content;
42
+ for (var j = 0, con; con = cons[j++];) {
43
+ var charSpan = document.createElement("span");
44
+ charSpan.innerHTML = con;
45
+ domUtils.on(charSpan, "click", function () {
46
+ editor.execCommand("insertHTML", this.innerHTML);
47
+ dialog.close();
48
+ });
49
+ div.appendChild(charSpan);
50
+ }
51
+ $G("tabBodys").appendChild(div);
52
+ }
53
+ })(charsContent);
54
+ function toArray(str) {
55
+ return str.split(",");
56
+ }
@@ -0,0 +1,75 @@
1
+ .wrapper {
2
+ margin: 10px auto 0;
3
+ font-size: 12px;
4
+ overflow: hidden;
5
+ }
6
+
7
+ .clear {
8
+ clear: both;
9
+ }
10
+
11
+ .wrapper .left {
12
+ float: left;
13
+ margin-left: 10px;;
14
+ }
15
+
16
+ .wrapper .right {
17
+ float: right;
18
+ margin-right: 10px;
19
+ border-left: 2px dotted #EDEDED;
20
+ padding-left: 15px;
21
+ }
22
+
23
+ .section {
24
+ margin-bottom: 20px;
25
+ overflow: hidden;
26
+ }
27
+
28
+ .section h3 {
29
+ font-weight: bold;
30
+ padding: 5px 0;
31
+ margin-bottom: 10px;
32
+ border-bottom: 1px solid #EDEDED;
33
+ font-size: 12px;
34
+ }
35
+
36
+ .section ul {
37
+ list-style: none;
38
+ overflow: hidden;
39
+ }
40
+
41
+ .section li {
42
+ float: left;
43
+ }
44
+
45
+ .section .tone {
46
+ width: 80px;;
47
+ }
48
+
49
+ .section .preview {
50
+ width: 220px;
51
+ }
52
+
53
+ .section .preview table {
54
+ text-align: center;
55
+ vertical-align: middle;
56
+ color: #666;
57
+ }
58
+
59
+ .section .preview caption {
60
+ font-weight: bold;
61
+ }
62
+
63
+ .section .preview td {
64
+ border-width: 1px;
65
+ border-style: solid;
66
+ height: 22px;
67
+ }
68
+
69
+ .section .preview th {
70
+ border-style: solid;
71
+ border-color: #DDD;
72
+ border-width: 2px 1px 1px 1px;
73
+ height: 22px;
74
+ background-color: #F7F7F7;
75
+ }
@@ -0,0 +1,57 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title></title>
5
+ <%= stylesheet_link_tag 'ueditor/dialogs/table/edittable.css' %>
6
+ </head>
7
+ <body>
8
+ <div class="wrapper">
9
+ <div class="left">
10
+ <div class="section">
11
+ <h3><var id="lang_tableStyle"></var></h3>
12
+ <ul>
13
+ <li>
14
+ <label><input type="checkbox" id="J_title" name="style"/><var id="lang_insertCaption"></var></label>
15
+ </li>
16
+ <li>
17
+ <label><input type="checkbox" id="J_caption" name="style"/><var id="lang_insertTitle"></var></label>
18
+ </li>
19
+ </ul>
20
+ <div class="clear"></div>
21
+ </div>
22
+ <div class="section">
23
+ <h3><var id="lang_tableSize"></var></h3>
24
+ <ul>
25
+ <li>
26
+ <label><input type="radio" id="J_autoSizeContent" name="size"/><var id="lang_autoSizeContent"></var></label>
27
+ </li>
28
+ <li>
29
+ <label><input type="radio" id="J_autoSizePage" name="size"/><var id="lang_autoSizePage"></var></label>
30
+ </li>
31
+ </ul>
32
+ <div class="clear"></div>
33
+ </div>
34
+ <div class="section">
35
+ <h3><var id="lang_borderStyle"></var></h3>
36
+ <ul>
37
+ <li>
38
+ <span><var id="lang_color"></var></span>
39
+ <input type="text" class="tone" id="J_tone" readonly='readonly'/>
40
+ </li>
41
+ </ul>
42
+ <div class="clear"></div>
43
+ </div>
44
+ </div>
45
+ <div class="right">
46
+ <div class="section">
47
+ <h3><var id="lang_example"></var></h3>
48
+
49
+ <div class="preview" id="J_preview">
50
+ </div>
51
+ </div>
52
+ </div>
53
+ </div>
54
+ <%= javascript_include_tag 'ueditor/dialogs/internal.js' %>
55
+ <%= javascript_include_tag 'ueditor/dialogs/table/edittable.js' %>
56
+ </body>
57
+ </html>
@@ -0,0 +1,182 @@
1
+ /**
2
+ * Created with JetBrains PhpStorm.
3
+ * User: xuheng
4
+ * Date: 12-12-19
5
+ * Time: 下午4:55
6
+ * To change this template use File | Settings | File Templates.
7
+ */
8
+ (function () {
9
+ var title = $G("J_title"),
10
+ caption = $G("J_caption"),
11
+ autoSizeContent = $G("J_autoSizeContent"),
12
+ autoSizePage = $G("J_autoSizePage"),
13
+ tone = $G("J_tone"),
14
+ me,
15
+ preview = $G("J_preview");
16
+
17
+ var editTable = function () {
18
+ me = this;
19
+ me.init();
20
+ };
21
+ editTable.prototype = {
22
+ init:function () {
23
+ var colorPiker = new UE.ui.ColorPicker({
24
+ editor:editor
25
+ }),
26
+ colorPop = new UE.ui.Popup({
27
+ editor:editor,
28
+ content:colorPiker
29
+ });
30
+
31
+ title.checked = editor.queryCommandState("inserttitle") == -1;
32
+ caption.checked = editor.queryCommandState("insertcaption") == -1;
33
+
34
+ me.createTable(title.checked, caption.checked);
35
+ me.setAutoSize();
36
+ me.setColor(me.getColor());
37
+
38
+ domUtils.on(title, "click", me.titleHanler);
39
+ domUtils.on(caption, "click", me.captionHanler);
40
+ domUtils.on(autoSizeContent, "click", me.autoSizeContentHanler);
41
+ domUtils.on(autoSizePage, "click", me.autoSizePageHanler);
42
+
43
+ domUtils.on(tone, "click", function () {
44
+ colorPop.showAnchor(tone);
45
+ });
46
+ domUtils.on(document, 'mousedown', function () {
47
+ colorPop.hide();
48
+ });
49
+ colorPiker.addListener("pickcolor", function () {
50
+ me.setColor(arguments[1]);
51
+ colorPop.hide();
52
+ });
53
+ colorPiker.addListener("picknocolor", function () {
54
+ me.setColor("");
55
+ colorPop.hide();
56
+ });
57
+ },
58
+
59
+ createTable:function (hasTitle, hasCaption) {
60
+ var arr = [];
61
+ arr.push("<table id='J_example'>");
62
+ if (hasCaption) {
63
+ arr.push("<caption>" + lang.captionName + "</caption>")
64
+ }
65
+ if (hasTitle) {
66
+ arr.push("<tr>");
67
+ for (var j = 0; j < 5; j++) {
68
+ arr.push("<th>" + lang.titleName + "</th>")
69
+ }
70
+ arr.push("</tr>");
71
+ }
72
+ for (var i = 0; i < 6; i++) {
73
+ arr.push("<tr>");
74
+ for (var k = 0; k < 5; k++) {
75
+ arr.push("<td>" + lang.cellsName + "</td>")
76
+ }
77
+ arr.push("</tr>");
78
+ }
79
+ arr.push("</table>");
80
+ preview.innerHTML = arr.join("");
81
+ },
82
+
83
+ titleHanler:function () {
84
+ var example = $G("J_example"),
85
+ frg=document.createDocumentFragment(),
86
+ color = domUtils.getComputedStyle(domUtils.getElementsByTagName(example, "td")[0], "border-color");
87
+
88
+ if (title.checked) {
89
+ example.insertRow(0);
90
+ for (var i = 0, node; i < 5; i++) {
91
+ node = document.createElement("th");
92
+ node.innerHTML = lang.titleName;
93
+ frg.appendChild(node);
94
+ }
95
+ example.rows[0].appendChild(frg);
96
+
97
+ } else {
98
+ domUtils.remove(example.rows[0]);
99
+ }
100
+ me.setColor(color);
101
+ },
102
+ captionHanler:function () {
103
+ var example = $G("J_example");
104
+ if (caption.checked) {
105
+ var row = document.createElement('caption');
106
+ row.innerHTML = lang.captionName;
107
+ example.insertBefore(row, example.firstChild);
108
+ } else {
109
+ domUtils.remove(domUtils.getElementsByTagName(example, 'caption')[0]);
110
+ }
111
+ },
112
+ autoSizeContentHanler:function () {
113
+ var example = $G("J_example");
114
+ example.removeAttribute("width");
115
+ },
116
+ autoSizePageHanler:function () {
117
+ var example = $G("J_example");
118
+ var tds = example.getElementsByTagName(example, "td");
119
+ utils.each(tds, function (td) {
120
+ td.removeAttribute("width");
121
+ });
122
+ example.setAttribute('width', '100%');
123
+ },
124
+
125
+ getColor:function () {
126
+ var start = editor.selection.getStart(), color,
127
+ cell = domUtils.findParentByTagName(start, ["td", "th", "caption"], true);
128
+ color = domUtils.getComputedStyle(cell, "border-color");
129
+ if (!color) color = "#DDDDDD";
130
+ return color;
131
+ },
132
+ setColor:function (color) {
133
+ var example = $G("J_example"),
134
+ arr = domUtils.getElementsByTagName(example, "td").concat(
135
+ domUtils.getElementsByTagName(example, "th"),
136
+ domUtils.getElementsByTagName(example, "caption")
137
+ );
138
+
139
+ tone.value = color;
140
+ utils.each(arr, function (node) {
141
+ node.style.borderColor = color;
142
+ });
143
+
144
+ },
145
+ setAutoSize:function () {
146
+ var me = this,
147
+ start = editor.selection.getStart(),
148
+ wt = domUtils.findParentByTagName(start, "table", true).width,
149
+ flag = !wt;
150
+ if (flag) {
151
+ autoSizeContent.checked = flag;
152
+ me.autoSizeContentHanler();
153
+ } else {
154
+ autoSizePage.checked = !flag;
155
+ me.autoSizePageHanler();
156
+ }
157
+ }
158
+ };
159
+
160
+ new editTable;
161
+
162
+ dialog.onok = function () {
163
+ editor.__hasEnterExecCommand = true;
164
+
165
+ if (title.checked) {
166
+ editor.queryCommandState("inserttitle") != -1 && editor.execCommand("inserttitle")
167
+ } else {
168
+ editor.queryCommandState("deletetitle") != -1 && editor.execCommand("deletetitle");
169
+ }
170
+
171
+ if (caption.checked) {
172
+ editor.queryCommandState("insertcaption") != -1 && editor.execCommand("insertcaption")
173
+ } else {
174
+ editor.queryCommandState("deletecaption") != -1 && editor.execCommand("deletecaption");
175
+ }
176
+ editor.execCommand("edittable", tone.value);
177
+ autoSizeContent.checked ?editor.execCommand('adaptbytext') : "";
178
+ autoSizePage.checked ? editor.execCommand("adaptbywindow") : "";
179
+
180
+ editor.__hasEnterExecCommand = false;
181
+ };
182
+ })();