yodel_admin 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (321) hide show
  1. data/.gitignore +6 -0
  2. data/Gemfile +4 -0
  3. data/Rakefile +1 -0
  4. data/lib/layouts/admin_list_record.html +94 -0
  5. data/lib/layouts/admin_login.html +131 -0
  6. data/lib/layouts/admin_page/admin_list_page.html +55 -0
  7. data/lib/layouts/admin_page/admin_settings_page.html +34 -0
  8. data/lib/layouts/admin_page/admin_tree_page.html +51 -0
  9. data/lib/layouts/admin_page.html +56 -0
  10. data/lib/layouts/admin_record_form.html +74 -0
  11. data/lib/migrations/01_admin_pages.rb +99 -0
  12. data/lib/migrations/02_admin_default_pages.rb +98 -0
  13. data/lib/models/admin_editor_page.rb +27 -0
  14. data/lib/models/admin_list_page.rb +121 -0
  15. data/lib/models/admin_root_page.rb +9 -0
  16. data/lib/models/admin_settings_page.rb +20 -0
  17. data/lib/models/admin_sync_page.rb +82 -0
  18. data/lib/models/admin_tree_page.rb +141 -0
  19. data/lib/public/admin/chosen/chosen-sprite.png +0 -0
  20. data/lib/public/admin/chosen/chosen.css +340 -0
  21. data/lib/public/admin/chosen/chosen.jquery.min.js +10 -0
  22. data/lib/public/admin/css/admin.css +1086 -0
  23. data/lib/public/admin/css/reset.css +48 -0
  24. data/lib/public/admin/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  25. data/lib/public/admin/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  26. data/lib/public/admin/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  27. data/lib/public/admin/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  28. data/lib/public/admin/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  29. data/lib/public/admin/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  30. data/lib/public/admin/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  31. data/lib/public/admin/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  32. data/lib/public/admin/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
  33. data/lib/public/admin/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  34. data/lib/public/admin/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
  35. data/lib/public/admin/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
  36. data/lib/public/admin/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  37. data/lib/public/admin/css/smoothness/jquery-ui-1.8.16.custom.css +380 -0
  38. data/lib/public/admin/images/add.png +0 -0
  39. data/lib/public/admin/images/clock.png +0 -0
  40. data/lib/public/admin/images/close.png +0 -0
  41. data/lib/public/admin/images/cross.png +0 -0
  42. data/lib/public/admin/images/default_icon.png +0 -0
  43. data/lib/public/admin/images/delete.png +0 -0
  44. data/lib/public/admin/images/deploy_spinner.gif +0 -0
  45. data/lib/public/admin/images/drag.png +0 -0
  46. data/lib/public/admin/images/group_icon.png +0 -0
  47. data/lib/public/admin/images/left_arrow.png +0 -0
  48. data/lib/public/admin/images/load_spinner.gif +0 -0
  49. data/lib/public/admin/images/load_spinner_selected.gif +0 -0
  50. data/lib/public/admin/images/missing_image.png +0 -0
  51. data/lib/public/admin/images/new.png +0 -0
  52. data/lib/public/admin/images/open.png +0 -0
  53. data/lib/public/admin/images/right_arrow.png +0 -0
  54. data/lib/public/admin/images/save_spinner.gif +0 -0
  55. data/lib/public/admin/images/search.png +0 -0
  56. data/lib/public/admin/images/tick.png +0 -0
  57. data/lib/public/admin/images/user_icon.png +0 -0
  58. data/lib/public/admin/images/yodel.png +0 -0
  59. data/lib/public/admin/js/admin.js +1030 -0
  60. data/lib/public/admin/js/jquery-ui-1.8.16.custom.min.js +227 -0
  61. data/lib/public/admin/js/jquery.min.js +18 -0
  62. data/lib/public/admin/js/jquery.tablesorter.min.js +4 -0
  63. data/lib/public/admin/js/json2.js +480 -0
  64. data/lib/public/admin/js/yodel_jquery.js +241 -0
  65. data/lib/public/admin/tiny_mce/jquery.tinymce.js +338 -0
  66. data/lib/public/admin/tiny_mce/langs/en.js +223 -0
  67. data/lib/public/admin/tiny_mce/license.txt +504 -0
  68. data/lib/public/admin/tiny_mce/plugins/advhr/css/advhr.css +5 -0
  69. data/lib/public/admin/tiny_mce/plugins/advhr/editor_plugin.js +1 -0
  70. data/lib/public/admin/tiny_mce/plugins/advhr/editor_plugin_src.js +57 -0
  71. data/lib/public/admin/tiny_mce/plugins/advhr/js/rule.js +43 -0
  72. data/lib/public/admin/tiny_mce/plugins/advhr/langs/en_dlg.js +7 -0
  73. data/lib/public/admin/tiny_mce/plugins/advhr/rule.htm +58 -0
  74. data/lib/public/admin/tiny_mce/plugins/advimage/css/advimage.css +13 -0
  75. data/lib/public/admin/tiny_mce/plugins/advimage/editor_plugin.js +1 -0
  76. data/lib/public/admin/tiny_mce/plugins/advimage/editor_plugin_src.js +50 -0
  77. data/lib/public/admin/tiny_mce/plugins/advimage/image.htm +235 -0
  78. data/lib/public/admin/tiny_mce/plugins/advimage/img/sample.gif +0 -0
  79. data/lib/public/admin/tiny_mce/plugins/advimage/js/image.js +458 -0
  80. data/lib/public/admin/tiny_mce/plugins/advimage/langs/en_dlg.js +45 -0
  81. data/lib/public/admin/tiny_mce/plugins/advlink/css/advlink.css +8 -0
  82. data/lib/public/admin/tiny_mce/plugins/advlink/editor_plugin.js +1 -0
  83. data/lib/public/admin/tiny_mce/plugins/advlink/editor_plugin_src.js +61 -0
  84. data/lib/public/admin/tiny_mce/plugins/advlink/js/advlink.js +532 -0
  85. data/lib/public/admin/tiny_mce/plugins/advlink/langs/en_dlg.js +54 -0
  86. data/lib/public/admin/tiny_mce/plugins/advlink/link.htm +338 -0
  87. data/lib/public/admin/tiny_mce/plugins/advlist/editor_plugin.js +1 -0
  88. data/lib/public/admin/tiny_mce/plugins/advlist/editor_plugin_src.js +176 -0
  89. data/lib/public/admin/tiny_mce/plugins/autolink/editor_plugin.js +1 -0
  90. data/lib/public/admin/tiny_mce/plugins/autolink/editor_plugin_src.js +172 -0
  91. data/lib/public/admin/tiny_mce/plugins/autoresize/editor_plugin.js +1 -0
  92. data/lib/public/admin/tiny_mce/plugins/autoresize/editor_plugin_src.js +137 -0
  93. data/lib/public/admin/tiny_mce/plugins/autosave/editor_plugin.js +1 -0
  94. data/lib/public/admin/tiny_mce/plugins/autosave/editor_plugin_src.js +431 -0
  95. data/lib/public/admin/tiny_mce/plugins/autosave/langs/en.js +4 -0
  96. data/lib/public/admin/tiny_mce/plugins/bbcode/editor_plugin.js +1 -0
  97. data/lib/public/admin/tiny_mce/plugins/bbcode/editor_plugin_src.js +120 -0
  98. data/lib/public/admin/tiny_mce/plugins/contextmenu/editor_plugin.js +1 -0
  99. data/lib/public/admin/tiny_mce/plugins/contextmenu/editor_plugin_src.js +160 -0
  100. data/lib/public/admin/tiny_mce/plugins/directionality/editor_plugin.js +1 -0
  101. data/lib/public/admin/tiny_mce/plugins/directionality/editor_plugin_src.js +82 -0
  102. data/lib/public/admin/tiny_mce/plugins/emotions/editor_plugin.js +1 -0
  103. data/lib/public/admin/tiny_mce/plugins/emotions/editor_plugin_src.js +43 -0
  104. data/lib/public/admin/tiny_mce/plugins/emotions/emotions.htm +41 -0
  105. data/lib/public/admin/tiny_mce/plugins/emotions/img/smiley-cool.gif +0 -0
  106. data/lib/public/admin/tiny_mce/plugins/emotions/img/smiley-cry.gif +0 -0
  107. data/lib/public/admin/tiny_mce/plugins/emotions/img/smiley-embarassed.gif +0 -0
  108. data/lib/public/admin/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif +0 -0
  109. data/lib/public/admin/tiny_mce/plugins/emotions/img/smiley-frown.gif +0 -0
  110. data/lib/public/admin/tiny_mce/plugins/emotions/img/smiley-innocent.gif +0 -0
  111. data/lib/public/admin/tiny_mce/plugins/emotions/img/smiley-kiss.gif +0 -0
  112. data/lib/public/admin/tiny_mce/plugins/emotions/img/smiley-laughing.gif +0 -0
  113. data/lib/public/admin/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif +0 -0
  114. data/lib/public/admin/tiny_mce/plugins/emotions/img/smiley-sealed.gif +0 -0
  115. data/lib/public/admin/tiny_mce/plugins/emotions/img/smiley-smile.gif +0 -0
  116. data/lib/public/admin/tiny_mce/plugins/emotions/img/smiley-surprised.gif +0 -0
  117. data/lib/public/admin/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif +0 -0
  118. data/lib/public/admin/tiny_mce/plugins/emotions/img/smiley-undecided.gif +0 -0
  119. data/lib/public/admin/tiny_mce/plugins/emotions/img/smiley-wink.gif +0 -0
  120. data/lib/public/admin/tiny_mce/plugins/emotions/img/smiley-yell.gif +0 -0
  121. data/lib/public/admin/tiny_mce/plugins/emotions/js/emotions.js +22 -0
  122. data/lib/public/admin/tiny_mce/plugins/emotions/langs/en_dlg.js +20 -0
  123. data/lib/public/admin/tiny_mce/plugins/example/dialog.htm +22 -0
  124. data/lib/public/admin/tiny_mce/plugins/example/editor_plugin.js +1 -0
  125. data/lib/public/admin/tiny_mce/plugins/example/editor_plugin_src.js +84 -0
  126. data/lib/public/admin/tiny_mce/plugins/example/img/example.gif +0 -0
  127. data/lib/public/admin/tiny_mce/plugins/example/js/dialog.js +19 -0
  128. data/lib/public/admin/tiny_mce/plugins/example/langs/en.js +3 -0
  129. data/lib/public/admin/tiny_mce/plugins/example/langs/en_dlg.js +3 -0
  130. data/lib/public/admin/tiny_mce/plugins/example_dependency/editor_plugin.js +1 -0
  131. data/lib/public/admin/tiny_mce/plugins/example_dependency/editor_plugin_src.js +50 -0
  132. data/lib/public/admin/tiny_mce/plugins/fullpage/css/fullpage.css +143 -0
  133. data/lib/public/admin/tiny_mce/plugins/fullpage/editor_plugin.js +1 -0
  134. data/lib/public/admin/tiny_mce/plugins/fullpage/editor_plugin_src.js +399 -0
  135. data/lib/public/admin/tiny_mce/plugins/fullpage/fullpage.htm +259 -0
  136. data/lib/public/admin/tiny_mce/plugins/fullpage/js/fullpage.js +232 -0
  137. data/lib/public/admin/tiny_mce/plugins/fullpage/langs/en_dlg.js +85 -0
  138. data/lib/public/admin/tiny_mce/plugins/fullscreen/editor_plugin.js +1 -0
  139. data/lib/public/admin/tiny_mce/plugins/fullscreen/editor_plugin_src.js +159 -0
  140. data/lib/public/admin/tiny_mce/plugins/fullscreen/fullscreen.htm +109 -0
  141. data/lib/public/admin/tiny_mce/plugins/iespell/editor_plugin.js +1 -0
  142. data/lib/public/admin/tiny_mce/plugins/iespell/editor_plugin_src.js +54 -0
  143. data/lib/public/admin/tiny_mce/plugins/inlinepopups/editor_plugin.js +1 -0
  144. data/lib/public/admin/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +699 -0
  145. data/lib/public/admin/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
  146. data/lib/public/admin/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
  147. data/lib/public/admin/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
  148. data/lib/public/admin/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
  149. data/lib/public/admin/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
  150. data/lib/public/admin/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
  151. data/lib/public/admin/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
  152. data/lib/public/admin/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +90 -0
  153. data/lib/public/admin/tiny_mce/plugins/inlinepopups/template.htm +387 -0
  154. data/lib/public/admin/tiny_mce/plugins/insertdatetime/editor_plugin.js +1 -0
  155. data/lib/public/admin/tiny_mce/plugins/insertdatetime/editor_plugin_src.js +83 -0
  156. data/lib/public/admin/tiny_mce/plugins/layer/editor_plugin.js +1 -0
  157. data/lib/public/admin/tiny_mce/plugins/layer/editor_plugin_src.js +214 -0
  158. data/lib/public/admin/tiny_mce/plugins/legacyoutput/editor_plugin.js +1 -0
  159. data/lib/public/admin/tiny_mce/plugins/legacyoutput/editor_plugin_src.js +139 -0
  160. data/lib/public/admin/tiny_mce/plugins/lists/editor_plugin.js +1 -0
  161. data/lib/public/admin/tiny_mce/plugins/lists/editor_plugin_src.js +769 -0
  162. data/lib/public/admin/tiny_mce/plugins/media/css/media.css +17 -0
  163. data/lib/public/admin/tiny_mce/plugins/media/editor_plugin.js +1 -0
  164. data/lib/public/admin/tiny_mce/plugins/media/editor_plugin_src.js +822 -0
  165. data/lib/public/admin/tiny_mce/plugins/media/js/embed.js +73 -0
  166. data/lib/public/admin/tiny_mce/plugins/media/js/media.js +389 -0
  167. data/lib/public/admin/tiny_mce/plugins/media/langs/en_dlg.js +112 -0
  168. data/lib/public/admin/tiny_mce/plugins/media/media.htm +897 -0
  169. data/lib/public/admin/tiny_mce/plugins/media/moxieplayer.swf +0 -0
  170. data/lib/public/admin/tiny_mce/plugins/nonbreaking/editor_plugin.js +1 -0
  171. data/lib/public/admin/tiny_mce/plugins/nonbreaking/editor_plugin_src.js +53 -0
  172. data/lib/public/admin/tiny_mce/plugins/noneditable/editor_plugin.js +1 -0
  173. data/lib/public/admin/tiny_mce/plugins/noneditable/editor_plugin_src.js +95 -0
  174. data/lib/public/admin/tiny_mce/plugins/pagebreak/editor_plugin.js +1 -0
  175. data/lib/public/admin/tiny_mce/plugins/pagebreak/editor_plugin_src.js +74 -0
  176. data/lib/public/admin/tiny_mce/plugins/paste/editor_plugin.js +1 -0
  177. data/lib/public/admin/tiny_mce/plugins/paste/editor_plugin_src.js +942 -0
  178. data/lib/public/admin/tiny_mce/plugins/paste/js/pastetext.js +36 -0
  179. data/lib/public/admin/tiny_mce/plugins/paste/js/pasteword.js +51 -0
  180. data/lib/public/admin/tiny_mce/plugins/paste/langs/en_dlg.js +5 -0
  181. data/lib/public/admin/tiny_mce/plugins/paste/pastetext.htm +27 -0
  182. data/lib/public/admin/tiny_mce/plugins/paste/pasteword.htm +21 -0
  183. data/lib/public/admin/tiny_mce/plugins/preview/editor_plugin.js +1 -0
  184. data/lib/public/admin/tiny_mce/plugins/preview/editor_plugin_src.js +53 -0
  185. data/lib/public/admin/tiny_mce/plugins/preview/example.html +28 -0
  186. data/lib/public/admin/tiny_mce/plugins/preview/jscripts/embed.js +73 -0
  187. data/lib/public/admin/tiny_mce/plugins/preview/preview.html +17 -0
  188. data/lib/public/admin/tiny_mce/plugins/print/editor_plugin.js +1 -0
  189. data/lib/public/admin/tiny_mce/plugins/print/editor_plugin_src.js +34 -0
  190. data/lib/public/admin/tiny_mce/plugins/save/editor_plugin.js +1 -0
  191. data/lib/public/admin/tiny_mce/plugins/save/editor_plugin_src.js +101 -0
  192. data/lib/public/admin/tiny_mce/plugins/searchreplace/css/searchreplace.css +6 -0
  193. data/lib/public/admin/tiny_mce/plugins/searchreplace/editor_plugin.js +1 -0
  194. data/lib/public/admin/tiny_mce/plugins/searchreplace/editor_plugin_src.js +61 -0
  195. data/lib/public/admin/tiny_mce/plugins/searchreplace/js/searchreplace.js +142 -0
  196. data/lib/public/admin/tiny_mce/plugins/searchreplace/langs/en_dlg.js +16 -0
  197. data/lib/public/admin/tiny_mce/plugins/searchreplace/searchreplace.htm +100 -0
  198. data/lib/public/admin/tiny_mce/plugins/spellchecker/css/content.css +1 -0
  199. data/lib/public/admin/tiny_mce/plugins/spellchecker/editor_plugin.js +1 -0
  200. data/lib/public/admin/tiny_mce/plugins/spellchecker/editor_plugin_src.js +434 -0
  201. data/lib/public/admin/tiny_mce/plugins/spellchecker/img/wline.gif +0 -0
  202. data/lib/public/admin/tiny_mce/plugins/style/css/props.css +13 -0
  203. data/lib/public/admin/tiny_mce/plugins/style/editor_plugin.js +1 -0
  204. data/lib/public/admin/tiny_mce/plugins/style/editor_plugin_src.js +55 -0
  205. data/lib/public/admin/tiny_mce/plugins/style/js/props.js +635 -0
  206. data/lib/public/admin/tiny_mce/plugins/style/langs/en_dlg.js +70 -0
  207. data/lib/public/admin/tiny_mce/plugins/style/props.htm +840 -0
  208. data/lib/public/admin/tiny_mce/plugins/tabfocus/editor_plugin.js +1 -0
  209. data/lib/public/admin/tiny_mce/plugins/tabfocus/editor_plugin_src.js +122 -0
  210. data/lib/public/admin/tiny_mce/plugins/table/cell.htm +180 -0
  211. data/lib/public/admin/tiny_mce/plugins/table/css/cell.css +17 -0
  212. data/lib/public/admin/tiny_mce/plugins/table/css/row.css +25 -0
  213. data/lib/public/admin/tiny_mce/plugins/table/css/table.css +13 -0
  214. data/lib/public/admin/tiny_mce/plugins/table/editor_plugin.js +1 -0
  215. data/lib/public/admin/tiny_mce/plugins/table/editor_plugin_src.js +1363 -0
  216. data/lib/public/admin/tiny_mce/plugins/table/js/cell.js +319 -0
  217. data/lib/public/admin/tiny_mce/plugins/table/js/merge_cells.js +27 -0
  218. data/lib/public/admin/tiny_mce/plugins/table/js/row.js +237 -0
  219. data/lib/public/admin/tiny_mce/plugins/table/js/table.js +450 -0
  220. data/lib/public/admin/tiny_mce/plugins/table/langs/en_dlg.js +75 -0
  221. data/lib/public/admin/tiny_mce/plugins/table/merge_cells.htm +32 -0
  222. data/lib/public/admin/tiny_mce/plugins/table/row.htm +158 -0
  223. data/lib/public/admin/tiny_mce/plugins/table/table.htm +188 -0
  224. data/lib/public/admin/tiny_mce/plugins/template/blank.htm +12 -0
  225. data/lib/public/admin/tiny_mce/plugins/template/css/template.css +23 -0
  226. data/lib/public/admin/tiny_mce/plugins/template/editor_plugin.js +1 -0
  227. data/lib/public/admin/tiny_mce/plugins/template/editor_plugin_src.js +159 -0
  228. data/lib/public/admin/tiny_mce/plugins/template/js/template.js +106 -0
  229. data/lib/public/admin/tiny_mce/plugins/template/langs/en_dlg.js +15 -0
  230. data/lib/public/admin/tiny_mce/plugins/template/template.htm +31 -0
  231. data/lib/public/admin/tiny_mce/plugins/visualchars/editor_plugin.js +1 -0
  232. data/lib/public/admin/tiny_mce/plugins/visualchars/editor_plugin_src.js +83 -0
  233. data/lib/public/admin/tiny_mce/plugins/wordcount/editor_plugin.js +1 -0
  234. data/lib/public/admin/tiny_mce/plugins/wordcount/editor_plugin_src.js +114 -0
  235. data/lib/public/admin/tiny_mce/plugins/xhtmlxtras/abbr.htm +142 -0
  236. data/lib/public/admin/tiny_mce/plugins/xhtmlxtras/acronym.htm +142 -0
  237. data/lib/public/admin/tiny_mce/plugins/xhtmlxtras/attributes.htm +149 -0
  238. data/lib/public/admin/tiny_mce/plugins/xhtmlxtras/cite.htm +142 -0
  239. data/lib/public/admin/tiny_mce/plugins/xhtmlxtras/css/attributes.css +11 -0
  240. data/lib/public/admin/tiny_mce/plugins/xhtmlxtras/css/popup.css +9 -0
  241. data/lib/public/admin/tiny_mce/plugins/xhtmlxtras/del.htm +162 -0
  242. data/lib/public/admin/tiny_mce/plugins/xhtmlxtras/editor_plugin.js +1 -0
  243. data/lib/public/admin/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +132 -0
  244. data/lib/public/admin/tiny_mce/plugins/xhtmlxtras/ins.htm +162 -0
  245. data/lib/public/admin/tiny_mce/plugins/xhtmlxtras/js/abbr.js +28 -0
  246. data/lib/public/admin/tiny_mce/plugins/xhtmlxtras/js/acronym.js +28 -0
  247. data/lib/public/admin/tiny_mce/plugins/xhtmlxtras/js/attributes.js +111 -0
  248. data/lib/public/admin/tiny_mce/plugins/xhtmlxtras/js/cite.js +28 -0
  249. data/lib/public/admin/tiny_mce/plugins/xhtmlxtras/js/del.js +53 -0
  250. data/lib/public/admin/tiny_mce/plugins/xhtmlxtras/js/element_common.js +229 -0
  251. data/lib/public/admin/tiny_mce/plugins/xhtmlxtras/js/ins.js +53 -0
  252. data/lib/public/admin/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js +32 -0
  253. data/lib/public/admin/tiny_mce/themes/advanced/about.htm +52 -0
  254. data/lib/public/admin/tiny_mce/themes/advanced/anchor.htm +26 -0
  255. data/lib/public/admin/tiny_mce/themes/advanced/charmap.htm +51 -0
  256. data/lib/public/admin/tiny_mce/themes/advanced/color_picker.htm +74 -0
  257. data/lib/public/admin/tiny_mce/themes/advanced/editor_template.js +1 -0
  258. data/lib/public/admin/tiny_mce/themes/advanced/editor_template_src.js +1358 -0
  259. data/lib/public/admin/tiny_mce/themes/advanced/image.htm +80 -0
  260. data/lib/public/admin/tiny_mce/themes/advanced/img/colorpicker.jpg +0 -0
  261. data/lib/public/admin/tiny_mce/themes/advanced/img/flash.gif +0 -0
  262. data/lib/public/admin/tiny_mce/themes/advanced/img/icons.gif +0 -0
  263. data/lib/public/admin/tiny_mce/themes/advanced/img/iframe.gif +0 -0
  264. data/lib/public/admin/tiny_mce/themes/advanced/img/pagebreak.gif +0 -0
  265. data/lib/public/admin/tiny_mce/themes/advanced/img/quicktime.gif +0 -0
  266. data/lib/public/admin/tiny_mce/themes/advanced/img/realmedia.gif +0 -0
  267. data/lib/public/admin/tiny_mce/themes/advanced/img/shockwave.gif +0 -0
  268. data/lib/public/admin/tiny_mce/themes/advanced/img/trans.gif +0 -0
  269. data/lib/public/admin/tiny_mce/themes/advanced/img/video.gif +0 -0
  270. data/lib/public/admin/tiny_mce/themes/advanced/img/windowsmedia.gif +0 -0
  271. data/lib/public/admin/tiny_mce/themes/advanced/js/about.js +73 -0
  272. data/lib/public/admin/tiny_mce/themes/advanced/js/anchor.js +42 -0
  273. data/lib/public/admin/tiny_mce/themes/advanced/js/charmap.js +355 -0
  274. data/lib/public/admin/tiny_mce/themes/advanced/js/color_picker.js +329 -0
  275. data/lib/public/admin/tiny_mce/themes/advanced/js/image.js +247 -0
  276. data/lib/public/admin/tiny_mce/themes/advanced/js/link.js +153 -0
  277. data/lib/public/admin/tiny_mce/themes/advanced/js/source_editor.js +56 -0
  278. data/lib/public/admin/tiny_mce/themes/advanced/langs/en.js +68 -0
  279. data/lib/public/admin/tiny_mce/themes/advanced/langs/en_dlg.js +54 -0
  280. data/lib/public/admin/tiny_mce/themes/advanced/link.htm +57 -0
  281. data/lib/public/admin/tiny_mce/themes/advanced/shortcuts.htm +47 -0
  282. data/lib/public/admin/tiny_mce/themes/advanced/skins/default/content.css +48 -0
  283. data/lib/public/admin/tiny_mce/themes/advanced/skins/default/dialog.css +117 -0
  284. data/lib/public/admin/tiny_mce/themes/advanced/skins/default/img/buttons.png +0 -0
  285. data/lib/public/admin/tiny_mce/themes/advanced/skins/default/img/items.gif +0 -0
  286. data/lib/public/admin/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
  287. data/lib/public/admin/tiny_mce/themes/advanced/skins/default/img/menu_check.gif +0 -0
  288. data/lib/public/admin/tiny_mce/themes/advanced/skins/default/img/progress.gif +0 -0
  289. data/lib/public/admin/tiny_mce/themes/advanced/skins/default/img/tabs.gif +0 -0
  290. data/lib/public/admin/tiny_mce/themes/advanced/skins/default/ui.css +214 -0
  291. data/lib/public/admin/tiny_mce/themes/advanced/skins/highcontrast/content.css +23 -0
  292. data/lib/public/admin/tiny_mce/themes/advanced/skins/highcontrast/dialog.css +105 -0
  293. data/lib/public/admin/tiny_mce/themes/advanced/skins/highcontrast/ui.css +102 -0
  294. data/lib/public/admin/tiny_mce/themes/advanced/skins/o2k7/content.css +47 -0
  295. data/lib/public/admin/tiny_mce/themes/advanced/skins/o2k7/dialog.css +117 -0
  296. data/lib/public/admin/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
  297. data/lib/public/admin/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
  298. data/lib/public/admin/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
  299. data/lib/public/admin/tiny_mce/themes/advanced/skins/o2k7/ui.css +217 -0
  300. data/lib/public/admin/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +8 -0
  301. data/lib/public/admin/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +5 -0
  302. data/lib/public/admin/tiny_mce/themes/advanced/source_editor.htm +25 -0
  303. data/lib/public/admin/tiny_mce/themes/simple/editor_template.js +1 -0
  304. data/lib/public/admin/tiny_mce/themes/simple/editor_template_src.js +84 -0
  305. data/lib/public/admin/tiny_mce/themes/simple/img/icons.gif +0 -0
  306. data/lib/public/admin/tiny_mce/themes/simple/langs/en.js +11 -0
  307. data/lib/public/admin/tiny_mce/themes/simple/skins/default/content.css +25 -0
  308. data/lib/public/admin/tiny_mce/themes/simple/skins/default/ui.css +32 -0
  309. data/lib/public/admin/tiny_mce/themes/simple/skins/o2k7/content.css +17 -0
  310. data/lib/public/admin/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
  311. data/lib/public/admin/tiny_mce/themes/simple/skins/o2k7/ui.css +35 -0
  312. data/lib/public/admin/tiny_mce/tiny_mce.js +1 -0
  313. data/lib/public/admin/tiny_mce/tiny_mce_popup.js +5 -0
  314. data/lib/public/admin/tiny_mce/tiny_mce_src.js +15519 -0
  315. data/lib/public/admin/tiny_mce/utils/editable_selects.js +70 -0
  316. data/lib/public/admin/tiny_mce/utils/form_utils.js +210 -0
  317. data/lib/public/admin/tiny_mce/utils/mctabs.js +162 -0
  318. data/lib/public/admin/tiny_mce/utils/validate.js +252 -0
  319. data/lib/yodel_admin.rb +3 -0
  320. data/yodel_admin.gemspec +22 -0
  321. metadata +365 -0
@@ -0,0 +1,241 @@
1
+ var Yodel = {};
2
+
3
+ // Security
4
+ Yodel.Security = {
5
+ login: function(credentials, path) {
6
+ var action = (path ? path : '/login');
7
+ var form = jQuery('<form action="' + action + '" metod="post"/>');
8
+ jQuery.each(credentials, function(key, value) {
9
+ form.append(jQuery('<input type="hidden" name="' + key + '" value="' + value + '"/>'));
10
+ });
11
+ form.submit();
12
+ },
13
+
14
+ remote_login: function(credentials, fns, path) {
15
+ path = path ? path : '/login.json';
16
+ var request = jQuery.post(path, credentials, 'json');
17
+ request.success(function(data, textStatus, jqXHR) {
18
+ if(fns.success)
19
+ fns.success(data);
20
+ });
21
+ request.error(function(jqXHR, textStatus, errorThrown) {
22
+ if(fns.failure) {
23
+ var json = {};
24
+ try {
25
+ json = jQuery.parseJSON(jqXHR.responseText);
26
+ } catch(err) {}
27
+ fns.failure(json);
28
+ }
29
+ });
30
+ },
31
+
32
+ Facebook: {
33
+ Window: {
34
+ width: 1000,
35
+ height: 480,
36
+ title: 'Login'
37
+ },
38
+ redirectPath: '/facebook',
39
+ redirectURI: null,
40
+ clientID: '',
41
+ scope: null
42
+ },
43
+
44
+ facebook_login: function() {
45
+ var Options = Yodel.Security.Facebook;
46
+ var url = 'https://www.facebook.com/dialog/oauth?client_id=' + Options.clientID;
47
+
48
+ if(Options.redirectURI) {
49
+ url += '&redirect_uri=' + Options.redirectURI;
50
+ } else {
51
+ url += '&redirect_uri=' + window.location.protocol + '//' + window.location.host + Options.redirectPath;
52
+ }
53
+
54
+ if(Options.scope) {
55
+ url += '&scope=' + Options.scope;
56
+ }
57
+
58
+ var windowOptionsString = 'width=' + Options.Window.width + ',height=' + Options.Window.height;
59
+ window.open(url, Options.Window.title, windowOptionsString);
60
+ }
61
+ }
62
+
63
+ jQuery('*[data-oauth-login=facebook]').live('click', function(event, element) {
64
+ Yodel.Security.facebook_login();
65
+ event.preventDefault();
66
+ });
67
+
68
+
69
+ // Record interaction
70
+ Yodel.Records = {
71
+ update: function(path, fields) {
72
+ if((path.length <= 5) || (path.substr(-5,5) != '.json'))
73
+ path = path + '.json';
74
+ jQuery.post(path, {_method: 'put', record: JSON.stringify(fields)});
75
+ }
76
+ };
77
+
78
+ jQuery('.yodel-remote-action').live('click', function(event, element) {
79
+ var action = element.attr('data-action');
80
+ if(action)
81
+ eval(action);
82
+ });
83
+
84
+
85
+ // Remote form submission
86
+ Yodel.Forms = {
87
+ clearStatusStates: function(form) {
88
+ jQuery(form).find('span[data-handles]').each(function(index, statusData) {
89
+ var status = jQuery(statusData).children().first();
90
+ if(status) {
91
+ status.html('');
92
+ status.removeClass('new');
93
+ status.removeClass('valid');
94
+ status.removeClass('invalid');
95
+ }
96
+ });
97
+ },
98
+
99
+ setState: function(fieldName, form, state, message) {
100
+ // FIXME: assumes all fields have a status element as well
101
+ // check the form contains a field element for this message
102
+ var field = jQuery(form).find('*[data-field=' + fieldName + ']').first();
103
+ if(!field[0]) {
104
+ console.log("Form does not contain a field for: " + fieldName);
105
+ return;
106
+ }
107
+
108
+ var statusData = jQuery(form).find('span[data-handles*=' + fieldName + ']').first();
109
+ var status = statusData.children().first();
110
+
111
+ // submission of a form never transitions a field to the new state
112
+ status.removeClass('new');
113
+
114
+ if(state == 'valid') {
115
+ if(!status.hasClass('invalid')) {
116
+ status.removeClass('invalid');
117
+ status.addClass('valid');
118
+ }
119
+ field.removeClass('invalid');
120
+ field.addClass('valid');
121
+ } else {
122
+ status.addClass('invalid');
123
+ status.removeClass('valid');
124
+ field.addClass('invalid');
125
+ field.removeClass('valid');
126
+ }
127
+
128
+ // either use the supplied message, or override it with
129
+ // a static message provided in the layout
130
+ var staticMessage = statusData.attr('data-' + state + '-text');
131
+ if(staticMessage)
132
+ message = staticMessage;
133
+ else
134
+ message = message || '';
135
+
136
+ // set data-errors on the field
137
+ field.attr('data-errors', message);
138
+
139
+ // insert or replace the status element's text. Statuses may
140
+ // correspond to more than one field, hence concatenating msgs.
141
+ if(message)
142
+ if(status.html() == '')
143
+ status.html(message);
144
+ else
145
+ status.html(status.html() + ', ' + message);
146
+ },
147
+
148
+ handleFailure: function(activityElement, form, data) {
149
+ var failureFunction = Yodel.Forms.callbackFunction(form, 'failure');
150
+ Yodel.Forms.hideActivityElement(activityElement);
151
+ if(failureFunction)
152
+ failureFunction(data);
153
+ },
154
+
155
+ callbackFunction: function(form, name) {
156
+ var functionName = form.attr('data-' + name + '-function');
157
+ if(functionName) {
158
+ var functionReference = eval(functionName);
159
+ if(functionReference)
160
+ return functionReference;
161
+ }
162
+ return null;
163
+ },
164
+
165
+ hideActivityElement: function(activityElement) {
166
+ if(activityElement)
167
+ activityElement.css('visibility', 'hidden');
168
+ },
169
+
170
+ submit: function(event, element) {
171
+ var form = jQuery(element);
172
+
173
+ // show the activity indicator if present
174
+ var activityElement = form.find('.yodel-form-activity')
175
+ activityElement.css('visibility', 'visible');
176
+
177
+ // create an iframe to handle the submission if necessary. iframes
178
+ // are used instead of ajax calls so file uploads can be supported
179
+ // the iframe is created once, and the form set to submit to it.
180
+ var iframeID = 'form_' + form.attr('id') + '_iframe';
181
+ var iframe = jQuery('#' + iframeID);
182
+ if(iframe.length == 0) {
183
+ form.after('<iframe id="' + iframeID + '" name="' + iframeID + '" style="display:none"></iframe>');
184
+ form.attr('target', iframeID);
185
+ iframe = jQuery('#' + iframeID);
186
+
187
+ // FIXME: handle timeouts, failed requests
188
+ iframe.load(function() {
189
+ var iframeBody = iframe.contents().find('body');
190
+ var jsonText = $("<div />").html(iframeBody.find(':contains("{")').html()).text();
191
+ var json = jQuery.parseJSON(jsonText);
192
+ setTimeout(function () { iframeBody.html(''); }, 1);
193
+
194
+ if(json.success) {
195
+ Yodel.Forms.hideActivityElement(activityElement);
196
+ var successFunction = Yodel.Forms.callbackFunction(form, 'success');
197
+ var record = json.record;
198
+
199
+ if(successFunction)
200
+ successFunction(record, json);
201
+ else
202
+ window.location = record.path;
203
+
204
+ } else {
205
+ Yodel.Forms.hideActivityElement(activityElement);
206
+ var errorsFunction = Yodel.Forms.callbackFunction(form, 'errors');
207
+ var errors = json.errors;
208
+
209
+ if(errorsFunction) {
210
+ errorsFunction(errors);
211
+ } else {
212
+ Yodel.Forms.clearStatusStates(form);
213
+ form.find('*[data-field]').each(function(index, element) {
214
+ var fieldName = jQuery(element).attr('data-field');
215
+ if(json.errors[fieldName])
216
+ Yodel.Forms.setState(fieldName, form, 'invalid', json.errors[fieldName]);
217
+ else
218
+ Yodel.Forms.setState(fieldName, form, 'valid');
219
+ });
220
+ }
221
+ }
222
+ });
223
+ }
224
+ }
225
+ }
226
+
227
+ if(jQuery.browser.msie) {
228
+ jQuery('form').live('focusin', function(focusEvent) {
229
+ var form = focusEvent.target;
230
+ if(jQuery(form).attr('data-remote') == 'true' && !form.builtSubmitEvent) {
231
+ jQuery(form).submit(function(submitEvent) {
232
+ Yodel.Forms.submit(submitEvent, submitEvent.target);
233
+ });
234
+ form.builtSubmitEvent = true;
235
+ }
236
+ });
237
+ } else {
238
+ jQuery('form[data-remote=true]').live('submit', function(event) {
239
+ Yodel.Forms.submit(event, event.target);
240
+ });
241
+ }
@@ -0,0 +1,338 @@
1
+ /**
2
+ * jquery.tinymce.js
3
+ *
4
+ * Copyright 2009, Moxiecode Systems AB
5
+ * Released under LGPL License.
6
+ *
7
+ * License: http://tinymce.moxiecode.com/license
8
+ * Contributing: http://tinymce.moxiecode.com/contributing
9
+ */
10
+
11
+ (function($) {
12
+ var undefined,
13
+ lazyLoading,
14
+ delayedInits = [],
15
+ win = window;
16
+
17
+ $.fn.tinymce = function(settings) {
18
+ var self = this, url, ed, base, pos, lang, query = "", suffix = "";
19
+
20
+ // No match then just ignore the call
21
+ if (!self.length)
22
+ return self;
23
+
24
+ // Get editor instance
25
+ if (!settings)
26
+ return tinyMCE.get(self[0].id);
27
+
28
+ self.css('visibility', 'hidden'); // Hide textarea to avoid flicker
29
+
30
+ function init() {
31
+ var editors = [], initCount = 0;
32
+
33
+ // Apply patches to the jQuery object, only once
34
+ if (applyPatch) {
35
+ applyPatch();
36
+ applyPatch = null;
37
+ }
38
+
39
+ // Create an editor instance for each matched node
40
+ self.each(function(i, node) {
41
+ var ed, id = node.id, oninit = settings.oninit;
42
+
43
+ // Generate unique id for target element if needed
44
+ if (!id)
45
+ node.id = id = tinymce.DOM.uniqueId();
46
+
47
+ // Create editor instance and render it
48
+ ed = new tinymce.Editor(id, settings);
49
+ editors.push(ed);
50
+
51
+ ed.onInit.add(function() {
52
+ var scope, func = oninit;
53
+
54
+ self.css('visibility', '');
55
+
56
+ // Run this if the oninit setting is defined
57
+ // this logic will fire the oninit callback ones each
58
+ // matched editor instance is initialized
59
+ if (oninit) {
60
+ // Fire the oninit event ones each editor instance is initialized
61
+ if (++initCount == editors.length) {
62
+ if (tinymce.is(func, "string")) {
63
+ scope = (func.indexOf(".") === -1) ? null : tinymce.resolve(func.replace(/\.\w+$/, ""));
64
+ func = tinymce.resolve(func);
65
+ }
66
+
67
+ // Call the oninit function with the object
68
+ func.apply(scope || tinymce, editors);
69
+ }
70
+ }
71
+ });
72
+ });
73
+
74
+ // Render the editor instances in a separate loop since we
75
+ // need to have the full editors array used in the onInit calls
76
+ $.each(editors, function(i, ed) {
77
+ ed.render();
78
+ });
79
+ }
80
+
81
+ // Load TinyMCE on demand, if we need to
82
+ if (!win["tinymce"] && !lazyLoading && (url = settings.script_url)) {
83
+ lazyLoading = 1;
84
+ base = url.substring(0, url.lastIndexOf("/"));
85
+
86
+ // Check if it's a dev/src version they want to load then
87
+ // make sure that all plugins, themes etc are loaded in source mode aswell
88
+ if (/_(src|dev)\.js/g.test(url))
89
+ suffix = "_src";
90
+
91
+ // Parse out query part, this will be appended to all scripts, css etc to clear browser cache
92
+ pos = url.lastIndexOf("?");
93
+ if (pos != -1)
94
+ query = url.substring(pos + 1);
95
+
96
+ // Setup tinyMCEPreInit object this will later be used by the TinyMCE
97
+ // core script to locate other resources like CSS files, dialogs etc
98
+ // You can also predefined a tinyMCEPreInit object and then it will use that instead
99
+ win.tinyMCEPreInit = win.tinyMCEPreInit || {
100
+ base : base,
101
+ suffix : suffix,
102
+ query : query
103
+ };
104
+
105
+ // url contains gzip then we assume it's a compressor
106
+ if (url.indexOf('gzip') != -1) {
107
+ lang = settings.language || "en";
108
+ url = url + (/\?/.test(url) ? '&' : '?') + "js=true&core=true&suffix=" + escape(suffix) + "&themes=" + escape(settings.theme) + "&plugins=" + escape(settings.plugins) + "&languages=" + lang;
109
+
110
+ // Check if compressor script is already loaded otherwise setup a basic one
111
+ if (!win["tinyMCE_GZ"]) {
112
+ tinyMCE_GZ = {
113
+ start : function() {
114
+ tinymce.suffix = suffix;
115
+
116
+ function load(url) {
117
+ tinymce.ScriptLoader.markDone(tinyMCE.baseURI.toAbsolute(url));
118
+ }
119
+
120
+ // Add core languages
121
+ load("langs/" + lang + ".js");
122
+
123
+ // Add themes with languages
124
+ load("themes/" + settings.theme + "/editor_template" + suffix + ".js");
125
+ load("themes/" + settings.theme + "/langs/" + lang + ".js");
126
+
127
+ // Add plugins with languages
128
+ $.each(settings.plugins.split(","), function(i, name) {
129
+ if (name) {
130
+ load("plugins/" + name + "/editor_plugin" + suffix + ".js");
131
+ load("plugins/" + name + "/langs/" + lang + ".js");
132
+ }
133
+ });
134
+ },
135
+
136
+ end : function() {
137
+ }
138
+ }
139
+ }
140
+ }
141
+
142
+ // Load the script cached and execute the inits once it's done
143
+ $.ajax({
144
+ type : "GET",
145
+ url : url,
146
+ dataType : "script",
147
+ cache : true,
148
+ success : function() {
149
+ tinymce.dom.Event.domLoaded = 1;
150
+ lazyLoading = 2;
151
+
152
+ // Execute callback after mainscript has been loaded and before the initialization occurs
153
+ if (settings.script_loaded)
154
+ settings.script_loaded();
155
+
156
+ init();
157
+
158
+ $.each(delayedInits, function(i, init) {
159
+ init();
160
+ });
161
+ }
162
+ });
163
+ } else {
164
+ // Delay the init call until tinymce is loaded
165
+ if (lazyLoading === 1)
166
+ delayedInits.push(init);
167
+ else
168
+ init();
169
+ }
170
+
171
+ return self;
172
+ };
173
+
174
+ // Add :tinymce psuedo selector this will select elements that has been converted into editor instances
175
+ // it's now possible to use things like $('*:tinymce') to get all TinyMCE bound elements.
176
+ $.extend($.expr[":"], {
177
+ tinymce : function(e) {
178
+ return e.id && !!tinyMCE.get(e.id);
179
+ }
180
+ });
181
+
182
+ // This function patches internal jQuery functions so that if
183
+ // you for example remove an div element containing an editor it's
184
+ // automatically destroyed by the TinyMCE API
185
+ function applyPatch() {
186
+ // Removes any child editor instances by looking for editor wrapper elements
187
+ function removeEditors(name) {
188
+ // If the function is remove
189
+ if (name === "remove") {
190
+ this.each(function(i, node) {
191
+ var ed = tinyMCEInstance(node);
192
+
193
+ if (ed)
194
+ ed.remove();
195
+ });
196
+ }
197
+
198
+ this.find("span.mceEditor,div.mceEditor").each(function(i, node) {
199
+ var ed = tinyMCE.get(node.id.replace(/_parent$/, ""));
200
+
201
+ if (ed)
202
+ ed.remove();
203
+ });
204
+ }
205
+
206
+ // Loads or saves contents from/to textarea if the value
207
+ // argument is defined it will set the TinyMCE internal contents
208
+ function loadOrSave(value) {
209
+ var self = this, ed;
210
+
211
+ // Handle set value
212
+ if (value !== undefined) {
213
+ removeEditors.call(self);
214
+
215
+ // Saves the contents before get/set value of textarea/div
216
+ self.each(function(i, node) {
217
+ var ed;
218
+
219
+ if (ed = tinyMCE.get(node.id))
220
+ ed.setContent(value);
221
+ });
222
+ } else if (self.length > 0) {
223
+ // Handle get value
224
+ if (ed = tinyMCE.get(self[0].id))
225
+ return ed.getContent();
226
+ }
227
+ }
228
+
229
+ // Returns tinymce instance for the specified element or null if it wasn't found
230
+ function tinyMCEInstance(element) {
231
+ var ed = null;
232
+
233
+ (element) && (element.id) && (win["tinymce"]) && (ed = tinyMCE.get(element.id));
234
+
235
+ return ed;
236
+ }
237
+
238
+ // Checks if the specified set contains tinymce instances
239
+ function containsTinyMCE(matchedSet) {
240
+ return !!((matchedSet) && (matchedSet.length) && (win["tinymce"]) && (matchedSet.is(":tinymce")));
241
+ }
242
+
243
+ // Patch various jQuery functions
244
+ var jQueryFn = {};
245
+
246
+ // Patch some setter/getter functions these will
247
+ // now be able to set/get the contents of editor instances for
248
+ // example $('#editorid').html('Content'); will update the TinyMCE iframe instance
249
+
250
+
251
+ // $.each(["text", "html", "val"], function(i, name) {
252
+ // var origFn = jQueryFn[name] = $.fn[name],
253
+ // textProc = (name === "text");
254
+ //
255
+ // $.fn[name] = function(value) {
256
+ // var self = this;
257
+ //
258
+ // if (!containsTinyMCE(self))
259
+ // return origFn.apply(self, arguments);
260
+ //
261
+ // if (value !== undefined) {
262
+ // loadOrSave.call(self.filter(":tinymce"), value);
263
+ // origFn.apply(self.not(":tinymce"), arguments);
264
+ //
265
+ // return self; // return original set for chaining
266
+ // } else {
267
+ // var ret = "";
268
+ // var args = arguments;
269
+ //
270
+ // (textProc ? self : self.eq(0)).each(function(i, node) {
271
+ // var ed = tinyMCEInstance(node);
272
+ //
273
+ // ret += ed ? (textProc ? ed.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g, "") : ed.getContent()) : origFn.apply($(node), args);
274
+ // });
275
+ //
276
+ // return ret;
277
+ // }
278
+ // };
279
+ // });
280
+
281
+ // Makes it possible to use $('#id').append("content"); to append contents to the TinyMCE editor iframe
282
+ $.each(["append", "prepend"], function(i, name) {
283
+ var origFn = jQueryFn[name] = $.fn[name],
284
+ prepend = (name === "prepend");
285
+
286
+ $.fn[name] = function(value) {
287
+ var self = this;
288
+
289
+ if (!containsTinyMCE(self))
290
+ return origFn.apply(self, arguments);
291
+
292
+ if (value !== undefined) {
293
+ self.filter(":tinymce").each(function(i, node) {
294
+ var ed = tinyMCEInstance(node);
295
+
296
+ ed && ed.setContent(prepend ? value + ed.getContent() : ed.getContent() + value);
297
+ });
298
+
299
+ origFn.apply(self.not(":tinymce"), arguments);
300
+
301
+ return self; // return original set for chaining
302
+ }
303
+ };
304
+ });
305
+
306
+ // Makes sure that the editor instance gets properly destroyed when the parent element is removed
307
+ $.each(["remove", "replaceWith", "replaceAll", "empty"], function(i, name) {
308
+ var origFn = jQueryFn[name] = $.fn[name];
309
+
310
+ $.fn[name] = function() {
311
+ removeEditors.call(this, name);
312
+
313
+ return origFn.apply(this, arguments);
314
+ };
315
+ });
316
+
317
+ jQueryFn.attr = $.fn.attr;
318
+
319
+ // Makes sure that $('#tinymce_id').attr('value') gets the editors current HTML contents
320
+ $.fn.attr = function(name, value, type) {
321
+ var self = this;
322
+
323
+ if ((!name) || (name !== "value") || (!containsTinyMCE(self)))
324
+ return jQueryFn.attr.call(self, name, value, type);
325
+
326
+ if (value !== undefined) {
327
+ loadOrSave.call(self.filter(":tinymce"), value);
328
+ jQueryFn.attr.call(self.not(":tinymce"), name, value, type);
329
+
330
+ return self; // return original set for chaining
331
+ } else {
332
+ var node = self[0], ed = tinyMCEInstance(node);
333
+
334
+ return ed ? ed.getContent() : jQueryFn.attr.call($(node), name, value, type);
335
+ }
336
+ };
337
+ }
338
+ })(jQuery);