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,42 @@
1
+ /**
2
+ * Created with JetBrains PhpStorm.
3
+ * User: xuheng
4
+ * Date: 12-8-8
5
+ * Time: 下午2:00
6
+ * To change this template use File | Settings | File Templates.
7
+ */
8
+ var templates = [
9
+ {
10
+ "pre":"pre0.png",
11
+ 'title':lang.blank,
12
+ 'preHtml':'<p class="ue_t">&nbsp;欢迎使用UEditor!</p>',
13
+ "html":'<p class="ue_t">欢迎使用UEditor!</p>'
14
+
15
+ },
16
+ {
17
+ "pre":"pre1.png",
18
+ 'title':lang.blog,
19
+ 'preHtml':'<h1 label="Title center" name="tc" style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;text-align:center;margin:0px 0px 20px;"><span style="color:#c0504d;">深入理解Range</span></h1><p style="text-align:center;"><strong class=" ">UEditor二次开发</strong></p><h3><span class=" " style="font-family:幼圆">什么是Range</span></h3><p style="text-indent:2em;">对于“插入”选项卡上的库,在设计时都充分考虑了其中的项与文档整体外观的协调性。 </p><br /><h3><span class=" " style="font-family:幼圆">Range能干什么</span></h3><p style="text-indent:2em;">在“开始”选项卡上,通过从快速样式库中为所选文本选择一种外观,您可以方便地更改文档中所选文本的格式。</p>',
20
+ "html":'<h1 class="ue_t" label="Title center" name="tc" style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;text-align:center;margin:0px 0px 20px;"><span style="color:#c0504d;">[键入文档标题]</span></h1><p style="text-align:center;"><strong class="ue_t">[键入文档副标题]</strong></p><h3><span class="ue_t" style="font-family:幼圆">[标题 1]</span></h3><p class="ue_t" style="text-indent:2em;">对于“插入”选项卡上的库,在设计时都充分考虑了其中的项与文档整体外观的协调性。 您可以使用这些库来插入表格、页眉、页脚、列表、封面以及其他文档构建基块。 您创建的图片、图表或关系图也将与当前的文档外观协调一致。</p><h3><span class="ue_t" style="font-family:幼圆">[标题 2]</span></h3><p class="ue_t" style="text-indent:2em;">在“开始”选项卡上,通过从快速样式库中为所选文本选择一种外观,您可以方便地更改文档中所选文本的格式。 您还可以使用“开始”选项卡上的其他控件来直接设置文本格式。大多数控件都允许您选择是使用当前主题外观,还是使用某种直接指定的格式。 </p><h3><span class="ue_t" style="font-family:幼圆">[标题 3]</span></h3><p class="ue_t">对于“插入”选项卡上的库,在设计时都充分考虑了其中的项与文档整体外观的协调性。 您可以使用这些库来插入表格、页眉、页脚、列表、封面以及其他文档构建基块。 您创建的图片、图表或关系图也将与当前的文档外观协调一致。</p><p class="ue_t"><br /></p>'
21
+
22
+ },
23
+ {
24
+ "pre":"pre2.png",
25
+ 'title':lang.resume,
26
+ 'preHtml':'<h1 label="Title left" name="tl" style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;margin:0px 0px 10px;"><span style="color:#e36c09;" class=" ">WEB前端开发简历</span></h1><table width="100%" border="1" bordercolor="#95B3D7" style="border-collapse:collapse;"><tbody><tr><td width="100" style="text-align:center;"><p><span style="background-color:transparent;">插</span><br /></p><p>入</p><p>照</p><p>片</p></td><td><p><span style="background-color:transparent;"> 联系电话:</span><span class="ue_t" style="background-color:transparent;">[键入您的电话]</span><br /></p><p><span style="background-color:transparent;"> 电子邮件:</span><span class="ue_t" style="background-color:transparent;">[键入您的电子邮件地址]</span><br /></p><p><span style="background-color:transparent;"> 家庭住址:</span><span class="ue_t" style="background-color:transparent;">[键入您的地址]</span><br /></p></td></tr></tbody></table><h3><span style="color:#E36C09;font-size:20px;">目标职位</span></h3><p style="text-indent:2em;" class=" ">WEB前端研发工程师</p><h3><span style="color:#e36c09;font-size:20px;">学历</span></h3><p><span style="display:none;line-height:0px;" id="_baidu_bookmark_start_26"></span></p><ol style="list-style-type:decimal;"><li><p><span class="ue_t">[起止时间]</span> <span class="ue_t">[学校名称] </span> <span class="ue_t">[所学专业]</span> <span class="ue_t">[所获学位]</span></p></li></ol><h3><span style="color:#e36c09;font-size:20px;" class="ue_t">工作经验</span></h3><p><br /></p>',
27
+ "html":'<h1 label="Title left" name="tl" style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;margin:0px 0px 10px;"><span style="color:#e36c09;" class="ue_t">[此处键入简历标题]</span></h1><p><span style="color:#e36c09;"><br /></span></p><table width="100%" border="1" bordercolor="#95B3D7" style="border-collapse:collapse;"><tbody><tr><td width="200" style="text-align:center;" class="ue_t">【此处插入照片】</td><td><p><br /></p><p> 联系电话:<span class="ue_t">[键入您的电话]</span></p><p><br /></p><p> 电子邮件:<span class="ue_t">[键入您的电子邮件地址]</span></p><p><br /></p><p> 家庭住址:<span class="ue_t">[键入您的地址]</span></p><p><br /></p></td></tr></tbody></table><h3><span style="color:#e36c09;font-size:20px;">目标职位</span></h3><p style="text-indent:2em;" class="ue_t">[此处键入您的期望职位]</p><h3><span style="color:#e36c09;font-size:20px;">学历</span></h3><p><span style="display:none;line-height:0px;" id="_baidu_bookmark_start_26"></span></p><ol style="list-style-type:decimal;"><li><p><span class="ue_t">[键入起止时间]</span> <span class="ue_t">[键入学校名称] </span> <span class="ue_t">[键入所学专业]</span> <span class="ue_t">[键入所获学位]</span></p></li><li><p><span class="ue_t">[键入起止时间]</span> <span class="ue_t">[键入学校名称]</span> <span class="ue_t">[键入所学专业]</span> <span class="ue_t">[键入所获学位]</span></p></li></ol><h3><span style="color:#e36c09;font-size:20px;" class="ue_t">工作经验</span></h3><ol style="list-style-type:decimal;"><li><p><span class="ue_t">[键入起止时间]</span> <span class="ue_t">[键入公司名称]</span> <span class="ue_t">[键入职位名称]</span> </p></li><ol style="list-style-type:lower-alpha;"><li><p><span class="ue_t">[键入负责项目]</span> <span class="ue_t">[键入项目简介]</span></p></li><li><p><span class="ue_t">[键入负责项目]</span> <span class="ue_t">[键入项目简介]</span></p></li></ol><li><p><span class="ue_t">[键入起止时间]</span> <span class="ue_t">[键入公司名称]</span> <span class="ue_t">[键入职位名称]</span> </p></li><ol style="list-style-type:lower-alpha;"><li><p><span class="ue_t">[键入负责项目]</span> <span class="ue_t">[键入项目简介]</span></p></li></ol></ol><p><span style="color:#e36c09;font-size:20px;">掌握技能</span></p><p style="text-indent:2em;"> &nbsp;<span class="ue_t">[这里可以键入您所掌握的技能]</span><br /></p>'
28
+
29
+ },
30
+ {
31
+ "pre":"pre3.png",
32
+ 'title':lang.richText,
33
+ 'preHtml':'<h1 label="Title center" name="tc" style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;text-align:center;margin:0px 0px 20px;" class="ue_t">[此处键入文章标题]</h1><p><img src="http://img.baidu.com/hi/youa/y_0034.gif" width="150" height="100" border="0" hspace="0" vspace="0" style="width:150px;height:100px;float:left;" />图文混排方法</p><p>图片居左,文字围绕图片排版</p><p>方法:在文字前面插入图片,设置居左对齐,然后即可在右边输入多行文</p><p><br /></p><p><img src="http://img.baidu.com/hi/youa/y_0040.gif" width="100" height="100" border="0" hspace="0" vspace="0" style="width:100px;height:100px;float:right;" /></p><p>还有没有什么其他的环绕方式呢?这里是居右环绕</p><p><br /></p><p>欢迎大家多多尝试,为UEditor提供更多高质量模板!</p>',
34
+ "html":'<p><br /></p><h1 label="Title center" name="tc" style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;text-align:center;margin:0px 0px 20px;" class="ue_t">[此处键入文章标题]</h1><p><img src="http://img.baidu.com/hi/youa/y_0034.gif" width="300" height="200" border="0" hspace="0" vspace="0" style="width:300px;height:200px;float:left;" />图文混排方法</p><p>1. 图片居左,文字围绕图片排版</p><p>方法:在文字前面插入图片,设置居左对齐,然后即可在右边输入多行文本</p><p><br /></p><p>2. 图片居右,文字围绕图片排版</p><p>方法:在文字前面插入图片,设置居右对齐,然后即可在左边输入多行文本</p><p><br /></p><p>3. 图片居中环绕排版</p><p>方法:亲,这个真心没有办法。。。</p><p><br /></p><p><br /></p><p><img src="http://img.baidu.com/hi/youa/y_0040.gif" width="300" height="300" border="0" hspace="0" vspace="0" style="width:300px;height:300px;float:right;" /></p><p>还有没有什么其他的环绕方式呢?这里是居右环绕</p><p><br /></p><p>欢迎大家多多尝试,为UEditor提供更多高质量模板!</p><p><br /></p><p>占位</p><p><br /></p><p>占位</p><p><br /></p><p>占位</p><p><br /></p><p>占位</p><p><br /></p><p>占位</p><p><br /></p><p><br /></p>'
35
+ },
36
+ {
37
+ "pre":"pre4.png",
38
+ 'title':lang.sciPapers,
39
+ 'preHtml':'<h2 style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;margin:0px 0px 10px;text-align:center;" class="ue_t">[键入文章标题]</h2><p><strong><span style="font-size:12px;">摘要</span></strong><span style="font-size:12px;" class="ue_t">:这里可以输入很长很长很长很长很长很长很长很长很差的摘要</span></p><p style="line-height:1.5em;"><strong>标题 1</strong></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">这里可以输入很多内容,可以图文混排,可以有列表等。</span></p><p style="line-height:1.5em;"><strong>标题 2</strong></p><ol style="list-style-type:lower-alpha;"><li><p class="ue_t">列表 1</p></li><li><p class="ue_t">列表 2</p></li><ol style="list-style-type:lower-roman;"><li><p class="ue_t">多级列表 1</p></li><li><p class="ue_t">多级列表 2</p></li></ol><li><p class="ue_t">列表 3<br /></p></li></ol><p style="line-height:1.5em;"><strong>标题 3</strong></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">来个文字图文混排的</span></p><p style="text-indent:2em;"><br /></p>',
40
+ 'html':'<h2 style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;margin:0px 0px 10px;text-align:center;" class="ue_t">[键入文章标题]</h2><p><strong><span style="font-size:12px;">摘要</span></strong><span style="font-size:12px;" class="ue_t">:这里可以输入很长很长很长很长很长很长很长很长很差的摘要</span></p><p style="line-height:1.5em;"><strong>标题 1</strong></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">这里可以输入很多内容,可以图文混排,可以有列表等。</span></p><p style="line-height:1.5em;"><strong>标题 2</strong></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">来个列表瞅瞅:</span></p><ol style="list-style-type:lower-alpha;"><li><p class="ue_t">列表 1</p></li><li><p class="ue_t">列表 2</p></li><ol style="list-style-type:lower-roman;"><li><p class="ue_t">多级列表 1</p></li><li><p class="ue_t">多级列表 2</p></li></ol><li><p class="ue_t">列表 3<br /></p></li></ol><p style="line-height:1.5em;"><strong>标题 3</strong></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">来个文字图文混排的</span></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">这里可以多行</span></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">右边是图片</span></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">绝对没有问题的,不信你也可以试试看</span></p><p><br /></p>'
41
+ }
42
+ ];
@@ -0,0 +1,18 @@
1
+ .wrap{ padding: 5px;font-size: 14px;}
2
+ .left{width:425px;float: left;}
3
+ .right{width:160px;border: 1px solid #ccc;float: right;padding: 5px;margin-right: 5px;}
4
+ .right .pre{height: 332px;overflow-y: auto;}
5
+ .right .preitem{border: white 1px solid;margin: 5px 0;padding: 2px 0;}
6
+ .right .preitem:hover{background-color: lemonChiffon;cursor: pointer;border: #ccc 1px solid;}
7
+ .right .preitem img{display: block;margin: 0 auto;width:100px;}
8
+ .clear{clear: both;}
9
+ .top{height:26px;line-height: 26px;padding: 5px;}
10
+ .bottom{height:320px;width:100%;margin: 0 auto;}
11
+ .transparent{ background: url("images/bg.gif") repeat;}
12
+ .bottom table tr td{border:1px dashed #ccc;}
13
+ #colorPicker{width: 17px;height: 17px;border: 1px solid #CCC;display: inline-block;border-radius: 3px;box-shadow: 2px 2px 5px #D3D6DA;}
14
+ .border_style1{padding:2px;border: 1px solid #ccc;border-radius: 5px;box-shadow:2px 2px 5px #d3d6da;}
15
+ p{margin: 5px 0}
16
+ table{clear:both;margin-bottom:10px;border-collapse:collapse;word-break:break-all;}
17
+ li{clear:both}
18
+ ol{padding-left:40px; }
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE HTML>
2
+ <html>
3
+ <head>
4
+ <title></title>
5
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
6
+ <%= stylesheet_link_tag 'ueditor/dialogs/template/template.css' %>
7
+ </head>
8
+ <body>
9
+ <div class="wrap">
10
+ <div class="left">
11
+ <div class="top">
12
+ <label><var id="lang_template_clear"></var>:<input id="issave" type="checkbox"></label>
13
+ </div>
14
+ <div class="bottom border_style1" id="preview"></div>
15
+ </div>
16
+ <fieldset class="right border_style1">
17
+ <legend><var id="lang_template_select"></var></legend>
18
+ <div class="pre" id="preitem"></div>
19
+ </fieldset>
20
+ <div class="clear"></div>
21
+ </div>
22
+ <%= javascript_include_tag 'ueditor/dialogs/internal.js' %>
23
+ <%= javascript_include_tag 'ueditor/dialogs/template/config.js' %>
24
+ <%= javascript_include_tag 'ueditor/dialogs/template/template.js' %>
25
+ </body>
26
+ </html>
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Created with JetBrains PhpStorm.
3
+ * User: xuheng
4
+ * Date: 12-8-8
5
+ * Time: 下午2:09
6
+ * To change this template use File | Settings | File Templates.
7
+ */
8
+ (function () {
9
+ var me = editor,
10
+ preview = $G( "preview" ),
11
+ preitem = $G( "preitem" ),
12
+ tmps = templates,
13
+ currentTmp;
14
+ var initPre = function () {
15
+ var str = "";
16
+ for ( var i = 0, tmp; tmp = tmps[i++]; ) {
17
+ str += '<div class="preitem" onclick="pre(' + i + ')"><img src="' + "images/" + tmp.pre + '" ' + (tmp.title ? "alt=" + tmp.title + " title=" + tmp.title + "" : "") + '></div>';
18
+ }
19
+ preitem.innerHTML = str;
20
+ };
21
+ var pre = function ( n ) {
22
+ var tmp = tmps[n - 1];
23
+ currentTmp = tmp;
24
+ clearItem();
25
+ domUtils.setStyles( preitem.childNodes[n - 1], {
26
+ "background-color":"lemonChiffon",
27
+ "border":"#ccc 1px solid"
28
+ } );
29
+ preview.innerHTML = tmp.preHtml ? tmp.preHtml : "";
30
+ };
31
+ var clearItem = function () {
32
+ var items = preitem.children;
33
+ for ( var i = 0, item; item = items[i++]; ) {
34
+ domUtils.setStyles( item, {
35
+ "background-color":"",
36
+ "border":"white 1px solid"
37
+ } );
38
+ }
39
+ };
40
+ dialog.onok = function () {
41
+ if ( !$G( "issave" ).checked ){
42
+ me.execCommand( "cleardoc" );
43
+ }
44
+ var obj = {
45
+ html:currentTmp && currentTmp.html
46
+ };
47
+ me.execCommand( "template", obj );
48
+ };
49
+ initPre();
50
+ window.pre = pre;
51
+ pre(2)
52
+
53
+ })();
@@ -0,0 +1,59 @@
1
+ @charset "utf-8";
2
+ .wrapper{ width: 570px;_width:575px;margin: 10px auto; zoom:1;position: relative}
3
+ .tabbody{height:335px;}
4
+ .panel { position: absolute;width:100%; height:100%;background: #fff;}
5
+ .panel table td{vertical-align: middle;}
6
+ #videoUrl {
7
+ width: 490px;
8
+ height: 21px;
9
+ line-height: 21px;
10
+ margin: 8px 5px;
11
+ background: #FFF;
12
+ border: 1px solid #d7d7d7;
13
+ }
14
+ #videoSearchTxt{margin-left:15px;background: #FFF;width:200px;height:21px;line-height:21px;border: 1px solid #d7d7d7;}
15
+ #searchList{width: 570px;overflow: auto;zoom:1;height: 270px;}
16
+ #searchList div{float: left;width: 120px;height: 135px;margin: 5px 15px;}
17
+ #searchList img{margin: 2px 8px;cursor: pointer;border: 2px solid #fff} /*不用缩略图*/
18
+ #searchList p{margin-left: 10px;}
19
+ #videoType{
20
+ width: 65px;
21
+ height: 23px;
22
+ line-height: 22px;
23
+ border: 1px solid #d7d7d7;
24
+ }
25
+ #videoSearchBtn,#videoSearchReset{
26
+ /*width: 80px;*/
27
+ height: 25px;
28
+ line-height: 25px;
29
+ background: #eee;
30
+ border: 1px solid #d7d7d7;
31
+ cursor: pointer;
32
+ padding: 0 5px;
33
+ }
34
+
35
+
36
+
37
+ #preview{width: 420px; margin-left: 10px; _margin-left:5px; height: 280px;background-color: #ddd;float: left}
38
+ #videoInfo {width: 120px;float: left;margin-left: 10px;_margin-left:7px;}
39
+ fieldset{
40
+ border: 1px solid #ddd;
41
+ padding-left: 5px;
42
+ margin-bottom: 20px;
43
+ padding-bottom: 5px;
44
+ width: 115px;
45
+ }
46
+ fieldset legend{font-weight: bold;}
47
+ fieldset p{line-height: 30px;}
48
+ fieldset input.txt{
49
+ width: 65px;
50
+ height: 21px;
51
+ line-height: 21px;
52
+ margin: 8px 5px;
53
+ background: #FFF;
54
+ border: 1px solid #d7d7d7;
55
+ }
56
+ label.url{font-weight: bold;margin-left: 5px;color: #06c;}
57
+ #videoFloat div{cursor:pointer;opacity: 0.5;filter: alpha(opacity = 50);margin:9px;_margin:5px;width:38px;height:36px;float:left;}
58
+ #videoFloat .focus{opacity: 1;filter: alpha(opacity = 100)}
59
+ span.view{display: inline-block;width: 30px;float: right;cursor: pointer;color: blue}
@@ -0,0 +1,78 @@
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/dialogs/video/video.css' %>
8
+ </head>
9
+ <body>
10
+ <div class="wrapper">
11
+ <div id="videoTab">
12
+ <div id="tabHeads" class="tabhead">
13
+ <span tabSrc="video" class="focus"><var id="lang_tab_insertV"></var></span>
14
+ <span tabSrc="videoSearch"><var id="lang_tab_searchV"></var></span>
15
+ </div>
16
+ <div id="tabBodys" class="tabbody">
17
+ <div id="video" class="panel">
18
+ <table>
19
+ <tr>
20
+ <td><label for="videoUrl" class="url"><var id="lang_video_url"></var></label></td>
21
+ <td><input id="videoUrl" type="text"></td>
22
+ </tr>
23
+ </table>
24
+ <div id="preview"></div>
25
+ <div id="videoInfo">
26
+ <fieldset>
27
+ <legend><var id="lang_video_size"></var></legend>
28
+ <table>
29
+ <tr>
30
+ <td><label for="videoWidth"><var id="lang_videoW"></var></label></td>
31
+ <td><input class="txt" id="videoWidth" type="text"/></td>
32
+ </tr>
33
+ <tr>
34
+ <td><label for="videoHeight"><var id="lang_videoH"></var></label></td>
35
+ <td><input class="txt" id="videoHeight" type="text"/></td>
36
+ </tr>
37
+ </table>
38
+ </fieldset>
39
+ <fieldset>
40
+ <legend><var id="lang_alignment"></var></legend>
41
+ <div id="videoFloat"></div>
42
+ </fieldset>
43
+ </div>
44
+ </div>
45
+ <div id="videoSearch" class="panel" style="display: none">
46
+ <table style="margin-top: 5px;">
47
+ <tr>
48
+ <td><input id="videoSearchTxt" type="text"/></td>
49
+ <td>
50
+ <select id="videoType">
51
+ <option value="0"></option>
52
+ <option value="29"></option>
53
+ <option value="1"></option>
54
+ <option value="5"></option>
55
+ <option value="15"></option>
56
+ <option value="21"></option>
57
+ <option value="31"></option>
58
+ </select>
59
+ </td>
60
+ <td><input id="videoSearchBtn" type="button"/></td>
61
+ <td><input id="videoSearchReset" type="button"/></td>
62
+ </tr>
63
+ </table>
64
+ <div id="searchList"></div>
65
+ </div>
66
+ </div>
67
+ </div>
68
+ </div>
69
+ <%= javascript_include_tag 'ueditor/dialogs/internal.js' %>
70
+ <%= javascript_include_tag 'ueditor/dialogs/video/video.js' %>
71
+ <script type="text/javascript">
72
+ window.onload = function () {
73
+ video.init();
74
+ $focus($G("videoUrl"));
75
+ };
76
+ </script>
77
+ </body>
78
+ </html>
@@ -0,0 +1,409 @@
1
+ /**
2
+ * Created by JetBrains PhpStorm.
3
+ * User: taoqili
4
+ * Date: 12-2-20
5
+ * Time: 上午11:19
6
+ * To change this template use File | Settings | File Templates.
7
+ */
8
+ var video = {};
9
+
10
+ (function () {
11
+ video.align_directions = {
12
+ center: "<%= asset_path 'ueditor/dialogs/video/images/center_focus.jpg' %>",
13
+ left: "<%= asset_path 'ueditor/dialogs/video/images/left_focus.jpg' %>",
14
+ none: "<%= asset_path 'ueditor/dialogs/video/images/none_focus.jpg' %>",
15
+ right: "<%= asset_path 'ueditor/dialogs/video/images/right_focus.jpg' %>"
16
+ };
17
+ video.init = function () {
18
+ switchTab("videoTab");
19
+ createAlignButton(["videoFloat"]);
20
+ addUrlChangeListener($G("videoUrl"));
21
+ addOkListener();
22
+ addSearchListener();
23
+
24
+ //编辑视频时初始化相关信息
25
+ (function () {
26
+ var img = editor.selection.getRange().getClosedNode(), url;
27
+ if (img && img.className == "edui-faked-video") {
28
+ $G("videoUrl").value = url = img.getAttribute("_url");
29
+ $G("videoWidth").value = img.width;
30
+ $G("videoHeight").value = img.height;
31
+ var align = domUtils.getComputedStyle(img, "float"),
32
+ parentAlign = domUtils.getComputedStyle(img.parentNode, "text-align");
33
+ updateAlignButton(parentAlign === "center" ? "center" : align);
34
+ }
35
+ createPreviewVideo(url);
36
+ })();
37
+ };
38
+ /**
39
+ * 监听确认和取消两个按钮事件,用户执行插入或者清空正在播放的视频实例操作
40
+ */
41
+ function addOkListener() {
42
+ dialog.onok = function () {
43
+ $G("preview").innerHTML = "";
44
+ var currentTab = findFocus("tabHeads", "tabSrc");
45
+ switch (currentTab) {
46
+ case "video":
47
+ return insertSingle();
48
+ break;
49
+ case "videoSearch":
50
+ return insertSearch("searchList");
51
+ break;
52
+ }
53
+ };
54
+ dialog.oncancel = function () {
55
+ $G("preview").innerHTML = "";
56
+ };
57
+ }
58
+
59
+ function selectTxt(node) {
60
+ if (node.select) {
61
+ node.select();
62
+ } else {
63
+ var r = node.createTextRange && node.createTextRange();
64
+ r.select();
65
+ }
66
+ }
67
+
68
+ /**
69
+ * 依据传入的align值更新按钮信息
70
+ * @param align
71
+ */
72
+ function updateAlignButton(align) {
73
+ var aligns = $G("videoFloat").children;
74
+ for (var i = 0, ci; ci = aligns[i++];) {
75
+ if (ci.getAttribute("name") == align) {
76
+ if (ci.className != "focus") {
77
+ ci.className = "focus";
78
+ }
79
+ } else {
80
+ if (ci.className == "focus") {
81
+ ci.className = "";
82
+ }
83
+ }
84
+ }
85
+ }
86
+
87
+ /**
88
+ * 将单个视频信息插入编辑器中
89
+ */
90
+ function insertSingle() {
91
+ var width = $G("videoWidth"),
92
+ height = $G("videoHeight"),
93
+ url = $G('videoUrl').value,
94
+ align = findFocus("videoFloat", "name");
95
+ if (!url) return false;
96
+ if (!checkNum([width, height])) return false;
97
+ editor.execCommand('insertvideo', {
98
+ url: convert_url(url),
99
+ width: width.value,
100
+ height: height.value,
101
+ align: align
102
+ });
103
+ }
104
+
105
+ /**
106
+ * 将元素id下的所有代表视频的图片插入编辑器中
107
+ * @param id
108
+ */
109
+ function insertSearch(id) {
110
+ var imgs = domUtils.getElementsByTagName($G(id), "img"),
111
+ videoObjs = [];
112
+ for (var i = 0, img; img = imgs[i++];) {
113
+ if (img.getAttribute("selected")) {
114
+ videoObjs.push({
115
+ url: img.getAttribute("ue_video_url"),
116
+ width: 420,
117
+ height: 280,
118
+ align: "none"
119
+ });
120
+ }
121
+ }
122
+ editor.execCommand('insertvideo', videoObjs);
123
+ }
124
+
125
+ /**
126
+ * 找到id下具有focus类的节点并返回该节点下的某个属性
127
+ * @param id
128
+ * @param returnProperty
129
+ */
130
+ function findFocus(id, returnProperty) {
131
+ var tabs = $G(id).children,
132
+ property;
133
+ for (var i = 0, ci; ci = tabs[i++];) {
134
+ if (ci.className == "focus") {
135
+ property = ci.getAttribute(returnProperty);
136
+ break;
137
+ }
138
+ }
139
+ return property;
140
+ }
141
+
142
+ function convert_url(s) {
143
+ return s.replace(/http:\/\/www\.tudou\.com\/programs\/view\/([\w\-]+)\/?/i, "http://www.tudou.com/v/$1")
144
+ .replace(/http:\/\/www\.youtube\.com\/watch\?v=([\w\-]+)/i, "http://www.youtube.com/v/$1")
145
+ .replace(/http:\/\/v\.youku\.com\/v_show\/id_([\w\-=]+)\.html/i, "http://player.youku.com/player.php/sid/$1")
146
+ .replace(/http:\/\/www\.56\.com\/u\d+\/v_([\w\-]+)\.html/i, "http://player.56.com/v_$1.swf")
147
+ .replace(/http:\/\/www.56.com\/w\d+\/play_album\-aid\-\d+_vid\-([^.]+)\.html/i, "http://player.56.com/v_$1.swf")
148
+ .replace(/http:\/\/v\.ku6\.com\/.+\/([^.]+)\.html/i, "http://player.ku6.com/refer/$1/v.swf");
149
+ }
150
+
151
+ /**
152
+ * 检测传入的所有input框中输入的长宽是否是正数
153
+ * @param nodes input框集合,
154
+ */
155
+ function checkNum(nodes) {
156
+ for (var i = 0, ci; ci = nodes[i++];) {
157
+ var value = ci.value;
158
+ if (!isNumber(value) && value) {
159
+ alert(lang.numError);
160
+ ci.value = "";
161
+ ci.focus();
162
+ return false;
163
+ }
164
+ }
165
+ return true;
166
+ }
167
+
168
+ /**
169
+ * 数字判断
170
+ * @param value
171
+ */
172
+ function isNumber(value) {
173
+ return /(0|^[1-9]\d*$)/.test(value);
174
+ }
175
+
176
+ /**
177
+ * tab切换
178
+ * @param tabParentId
179
+ * @param keepFocus 当此值为真时,切换按钮上会保留focus的样式
180
+ */
181
+ function switchTab(tabParentId, keepFocus) {
182
+ var tabElements = $G(tabParentId).children,
183
+ tabHeads = tabElements[0].children,
184
+ tabBodys = tabElements[1].children;
185
+ for (var i = 0, length = tabHeads.length; i < length; i++) {
186
+ var head = tabHeads[i];
187
+ domUtils.on(head, "click", function () {
188
+ //head样式更改
189
+ for (var k = 0, len = tabHeads.length; k < len; k++) {
190
+ if (!keepFocus)tabHeads[k].className = "";
191
+ }
192
+ this.className = "focus";
193
+ //body显隐
194
+ var tabSrc = this.getAttribute("tabSrc");
195
+ for (var j = 0, length = tabBodys.length; j < length; j++) {
196
+ var body = tabBodys[j],
197
+ id = body.getAttribute("id");
198
+
199
+ if (id == tabSrc) {
200
+ body.style.display = "";
201
+ if (id == "videoSearch") {
202
+ selectTxt($G("videoSearchTxt"));
203
+ }
204
+ if (id == "video") {
205
+ selectTxt($G("videoUrl"));
206
+ }
207
+
208
+ } else {
209
+ body.style.display = "none";
210
+ }
211
+ }
212
+ });
213
+ }
214
+ }
215
+
216
+ /**
217
+ * 创建图片浮动选择按钮
218
+ * @param ids
219
+ */
220
+ function createAlignButton(ids) {
221
+ for (var i = 0, ci; ci = ids[i++];) {
222
+ var floatContainer = $G(ci),
223
+ nameMaps = {"none": lang['default'], "left": lang.floatLeft, "right": lang.floatRight, "center": lang.block};
224
+ for (var j in nameMaps) {
225
+ var div = document.createElement("div");
226
+ div.setAttribute("name", j);
227
+ if (j == "none") div.className = "focus";
228
+ div.style.cssText = "background:url(" + video.align_directions[j] + ");";
229
+ div.setAttribute("title", nameMaps[j]);
230
+ floatContainer.appendChild(div);
231
+ }
232
+ switchSelect(ci);
233
+ }
234
+ }
235
+
236
+ /**
237
+ * 选择切换
238
+ * @param selectParentId
239
+ */
240
+ function switchSelect(selectParentId) {
241
+ var selects = $G(selectParentId).children;
242
+ for (var i = 0, ci; ci = selects[i++];) {
243
+ domUtils.on(ci, "click", function () {
244
+ for (var j = 0, cj; cj = selects[j++];) {
245
+ cj.className = "";
246
+ cj.removeAttribute && cj.removeAttribute("class");
247
+ }
248
+ this.className = "focus";
249
+ })
250
+ }
251
+ }
252
+
253
+ /**
254
+ * 监听url改变事件
255
+ * @param url
256
+ */
257
+ function addUrlChangeListener(url) {
258
+ if (browser.ie) {
259
+ url.onpropertychange = function () {
260
+ createPreviewVideo(this.value);
261
+ }
262
+ } else {
263
+ url.addEventListener("input", function () {
264
+ createPreviewVideo(this.value);
265
+ }, false);
266
+ }
267
+ }
268
+
269
+ /**
270
+ * 根据url生成视频预览
271
+ * @param url
272
+ */
273
+ function createPreviewVideo(url) {
274
+
275
+ if (!url)return;
276
+ var matches = url.match(/youtu.be\/(\w+)$/) || url.match(/youtube\.com\/watch\?v=(\w+)/) || url.match(/youtube.com\/v\/(\w+)/),
277
+ youku = url.match(/youku\.com\/v_show\/id_(\w+)/),
278
+ youkuPlay = /player\.youku\.com/ig.test(url);
279
+ if (!youkuPlay) {
280
+ if (matches) {
281
+ url = "https://www.youtube.com/v/" + matches[1] + "?version=3&feature=player_embedded";
282
+ } else if (youku) {
283
+ url = "http://player.youku.com/player.php/sid/" + youku[1] + "/v.swf"
284
+ } else if (!endWith(url, [".swf", ".flv", ".wmv"])) {
285
+ $G("preview").innerHTML = lang.urlError;
286
+ return;
287
+ }
288
+ } else {
289
+ url = url.replace(/\?f=.*/, "");
290
+ }
291
+ $G("preview").innerHTML = '<embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"' +
292
+ ' src="' + url + '"' +
293
+ ' width="' + 420 + '"' +
294
+ ' height="' + 280 + '"' +
295
+ ' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" ></embed>';
296
+ }
297
+
298
+ /**
299
+ * 末尾字符检测
300
+ * @param str
301
+ * @param endStrArr
302
+ */
303
+ function endWith(str, endStrArr) {
304
+ for (var i = 0, len = endStrArr.length; i < len; i++) {
305
+ var tmp = endStrArr[i];
306
+ if (str.length - tmp.length < 0) return false;
307
+
308
+ if (str.substring(str.length - tmp.length) == tmp) {
309
+ return true;
310
+ }
311
+ }
312
+ return false;
313
+ }
314
+
315
+ /**
316
+ * ajax获取视频信息
317
+ */
318
+ function getMovie() {
319
+ var keywordInput = $G("videoSearchTxt");
320
+ if (!keywordInput.getAttribute("hasClick") || !keywordInput.value) {
321
+ selectTxt(keywordInput);
322
+ return;
323
+ }
324
+ $G("searchList").innerHTML = lang.loading;
325
+ var keyword = keywordInput.value,
326
+ type = $G("videoType").value,
327
+ str = "";
328
+ ajax.request(editor.options.getMovieUrl, {
329
+ searchKey: keyword,
330
+ videoType: type,
331
+ onsuccess: function (xhr) {
332
+ try {
333
+ var info = eval("(" + xhr.responseText + ")");
334
+ } catch (e) {
335
+ return;
336
+ }
337
+
338
+ var videos = info.multiPageResult.results;
339
+ var html = ["<table width='530'>"];
340
+ for (var i = 0, ci; ci = videos[i++];) {
341
+ html.push(
342
+ "<tr>" +
343
+ "<td><img title='" + lang.clickToSelect + "' ue_video_url='" + ci.outerPlayerUrl + "' alt='" + ci.tags + "' width='106' height='80' src='" + ci.picUrl + "' /> </td>" +
344
+ "<td>" +
345
+ "<p><a target='_blank' title='" + lang.goToSource + "' href='" + ci.itemUrl + "'>" + ci.title.substr(0, 30) + "</a></p>" +
346
+ "<p style='height: 62px;line-height: 20px' title='" + ci.description + "'> " + ci.description.substr(0, 95) + " </p>" +
347
+ "</td>" +
348
+ "</tr>"
349
+ );
350
+ }
351
+ html.push("</table>");
352
+ $G("searchList").innerHTML = str = html.length == 2 ? lang.noVideo : html.join("");
353
+ var imgs = domUtils.getElementsByTagName($G("searchList"), "img");
354
+ if (!imgs)return;
355
+ for (var i = 0, img; img = imgs[i++];) {
356
+ domUtils.on(img, "click", function () {
357
+ changeSelected(this);
358
+ })
359
+ }
360
+ }
361
+ });
362
+ }
363
+
364
+ /**
365
+ * 改变对象o的选中状态
366
+ * @param o
367
+ */
368
+ function changeSelected(o) {
369
+ if (o.getAttribute("selected")) {
370
+ o.removeAttribute("selected");
371
+ o.style.cssText = "filter:alpha(Opacity=100);-moz-opacity:1;opacity: 1;border: 2px solid #fff";
372
+ } else {
373
+ o.setAttribute("selected", "true");
374
+ o.style.cssText = "filter:alpha(Opacity=50);-moz-opacity:0.5;opacity: 0.5;border:2px solid blue;";
375
+ }
376
+ }
377
+
378
+ /**
379
+ * 视频搜索相关注册事件
380
+ */
381
+ function addSearchListener() {
382
+ domUtils.on($G("videoSearchBtn"), "click", getMovie);
383
+ domUtils.on($G("videoSearchTxt"), "click", function () {
384
+ if (this.value == lang.static.videoSearchTxt.value) {
385
+ this.value = "";
386
+ }
387
+ this.setAttribute("hasClick", "true");
388
+ selectTxt(this);
389
+ });
390
+ $G("videoSearchTxt").onkeyup = function () {
391
+ this.setAttribute("hasClick", "true");
392
+ this.onkeyup = null;
393
+ };
394
+ domUtils.on($G("videoSearchReset"), "click", function () {
395
+ var txt = $G("videoSearchTxt");
396
+ txt.value = "";
397
+ selectTxt(txt);
398
+ $G("searchList").innerHTML = "";
399
+ });
400
+ domUtils.on($G("videoType"), "change", getMovie);
401
+ domUtils.on($G("videoSearchTxt"), "keyup", function (evt) {
402
+ if (evt.keyCode == 13) {
403
+ getMovie();
404
+ }
405
+ })
406
+ }
407
+
408
+
409
+ })();