redde 0.1.18 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (362) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/.hound.yml +2 -0
  4. data/.rubocop.yml +19 -0
  5. data/.travis.yml +5 -4
  6. data/Gemfile +8 -5
  7. data/MIT-LICENSE +20 -0
  8. data/README.md +96 -105
  9. data/Rakefile +20 -1
  10. data/app/assets/fonts/redde-admin.eot +0 -0
  11. data/app/assets/fonts/redde-admin.svg +12 -0
  12. data/app/assets/fonts/redde-admin.ttf +0 -0
  13. data/app/assets/fonts/redde-admin.woff +0 -0
  14. data/app/assets/images/redde/close-hover.svg +4 -0
  15. data/app/assets/images/redde/close.svg +6 -0
  16. data/app/assets/images/redde/enter.svg +4 -0
  17. data/app/assets/images/redde/eye.svg +5 -0
  18. data/app/assets/images/redde/eye_disactive.svg +5 -0
  19. data/app/assets/images/redde/main-menu/cog.svg +8 -0
  20. data/app/assets/images/redde/main-menu/cog_active.svg +8 -0
  21. data/app/assets/images/redde/main-menu/folder.svg +4 -0
  22. data/app/assets/images/redde/main-menu/folder_active.svg +4 -0
  23. data/app/assets/images/redde/main-menu/home.svg +4 -0
  24. data/app/assets/images/redde/main-menu/home_active.svg +4 -0
  25. data/app/assets/images/redde/main-menu/list.svg +4 -0
  26. data/app/assets/images/redde/main-menu/list_active.svg +4 -0
  27. data/app/assets/images/redde/next.svg +7 -0
  28. data/app/assets/images/redde/plus.svg +3 -0
  29. data/app/assets/images/redde/sel.svg +6 -0
  30. data/app/assets/images/redde/user.svg +12 -0
  31. data/app/assets/javascripts/redde/fileapi.js.coffee +17 -0
  32. data/app/assets/javascripts/redde/index.js.coffee +12 -0
  33. data/app/assets/javascripts/redde/redactor/index.coffee +8 -0
  34. data/{lib/generators/redde/layout/templates/assets/redactor/javascripts/jquery-migrate-1.2.1.js → app/assets/javascripts/redde/redactor/jquery-migrate-1.3.0.js} +215 -34
  35. data/{lib/generators/redde/layout/templates/assets/redactor/javascripts → app/assets/javascripts/redde}/redactor/redactor.js.erb +250 -250
  36. data/app/assets/javascripts/redde/sortTree/index.js.coffee +47 -0
  37. data/app/assets/javascripts/redde/sortable.coffee +47 -0
  38. data/{spec/dummy/app/assets/stylesheets/admin → app/assets/stylesheets/redde}/blocks/error-msg.sass +4 -2
  39. data/app/assets/stylesheets/redde/blocks/flash-msg.sass +22 -0
  40. data/app/assets/stylesheets/redde/blocks/list-v2.sass +96 -0
  41. data/app/assets/stylesheets/redde/blocks/photos-uploader.sass +21 -0
  42. data/app/assets/stylesheets/redde/blocks/photos.sass +56 -0
  43. data/app/assets/stylesheets/redde/blocks/redde-form.sass +55 -0
  44. data/app/assets/stylesheets/redde/blocks/sort-tree.sass +46 -0
  45. data/app/assets/stylesheets/redde/defaults/btn.sass +30 -0
  46. data/app/assets/stylesheets/redde/defaults/del.sass +23 -0
  47. data/app/assets/stylesheets/redde/defaults/index.sass +87 -0
  48. data/app/assets/stylesheets/redde/defaults/inp.sass +20 -0
  49. data/app/assets/stylesheets/redde/defaults/reset.sass +25 -0
  50. data/app/assets/stylesheets/redde/defaults/sbm.sass +32 -0
  51. data/app/assets/stylesheets/redde/defaults/sel.sass +29 -0
  52. data/app/assets/stylesheets/redde/fonts.sass +42 -0
  53. data/app/assets/stylesheets/redde/index.scss +5 -0
  54. data/app/assets/stylesheets/redde/layouts/header.sass +63 -0
  55. data/app/assets/stylesheets/redde/layouts/main-menu.sass +63 -0
  56. data/app/assets/stylesheets/redde/layouts/main.sass +48 -0
  57. data/app/assets/stylesheets/redde/layouts/page-header.sass +34 -0
  58. data/app/assets/stylesheets/redde/layouts/page-sidebar.sass +9 -0
  59. data/app/assets/stylesheets/redde/mixins.sass +10 -0
  60. data/{spec/dummy/app/assets/stylesheets → app/assets/stylesheets/redde}/redactor/index.scss +46 -49
  61. data/app/assets/stylesheets/redde-admin/blocks/list-v2.sass +96 -0
  62. data/app/assets/stylesheets/redde-admin/defaults/del.sass +23 -0
  63. data/app/controllers/admin/base_controller.rb +81 -0
  64. data/{lib/generators/redde/layout/templates/controllers → app/controllers/admin}/managers_controller.rb +10 -6
  65. data/app/controllers/admin/redde_photos_controller.rb +31 -0
  66. data/app/controllers/admin/system_commands_controller.rb +11 -0
  67. data/app/form_builders/redde_form_builder.rb +106 -0
  68. data/app/helpers/redde/admin_helper.rb +33 -0
  69. data/app/helpers/redde/form_helper.rb +59 -0
  70. data/app/helpers/redde/index_helper.rb +61 -0
  71. data/{lib/redde/concerns/layout.rb → app/models/concerns/redde/layouts.rb} +1 -1
  72. data/app/models/concerns/redde/photoable.rb +5 -0
  73. data/{lib/redde/concerns → app/models/concerns/redde}/sluggable.rb +6 -3
  74. data/app/models/concerns/redde/tree_sortable.rb +40 -0
  75. data/{lib/redde/concerns → app/models/concerns/redde}/with_photo.rb +5 -5
  76. data/app/models/redde/photo.rb +16 -0
  77. data/app/models/redde/system_command.rb +43 -0
  78. data/{lib → app/models}/redde/url_generator.rb +7 -3
  79. data/{lib/generators/redde/photo/templates/uploader.rb → app/uploaders/photo_uploader.rb} +4 -4
  80. data/app/views/admin/base/_tree_item.html.haml +10 -0
  81. data/app/views/admin/base/edit.html.haml +21 -0
  82. data/app/views/admin/base/index.html.haml +68 -0
  83. data/app/views/admin/base/tree.html.haml +14 -0
  84. data/app/views/admin/managers/edit.html.haml +11 -0
  85. data/app/views/admin/managers/index.html.haml +17 -0
  86. data/{lib/generators/redde/layout/templates/base → app/views/admin/redde}/_header.html.haml +5 -6
  87. data/app/views/admin/redde/_main_menu.html.haml +12 -0
  88. data/app/views/admin/redde/_page_header.html.haml +3 -0
  89. data/app/views/admin/redde/_sidebar.html.haml +16 -0
  90. data/{lib/generators/redde/layout/templates/base → app/views/admin/redde}/_validate.haml +2 -2
  91. data/app/views/admin/redde_photos/_photo.haml +11 -0
  92. data/app/views/admin/redde_photos/_photos.haml +28 -0
  93. data/app/views/admin/system_commands/index.html.haml +25 -0
  94. data/app/views/kaminari/redde/_first_page.html.haml +9 -0
  95. data/app/views/kaminari/redde/_gap.html.haml +8 -0
  96. data/app/views/kaminari/redde/_last_page.html.haml +9 -0
  97. data/app/views/kaminari/redde/_next_page.html.haml +9 -0
  98. data/app/views/kaminari/redde/_page.html.haml +10 -0
  99. data/app/views/kaminari/redde/_paginator.html.haml +18 -0
  100. data/app/views/kaminari/redde/_prev_page.html.haml +9 -0
  101. data/{lib/generators/redde/layout/templates → app/views}/layouts/admin.html.haml +28 -29
  102. data/{lib/generators/redde/layout/templates → app/views}/layouts/login.html.haml +32 -32
  103. data/bin/rails +12 -0
  104. data/config/locales/paginate.ru.yml +9 -0
  105. data/config/routes.rb +8 -0
  106. data/db/migrate/20160121152706_create_redde_photos.rb +16 -0
  107. data/lib/generators/redde/layout/layout_generator.rb +3 -26
  108. data/lib/generators/redde/layout/templates/assets/javascripts/admin.js +1 -0
  109. data/lib/generators/redde/layout/templates/assets/stylesheets/admin.css +15 -0
  110. data/lib/generators/redde/scaffold/scaffold_generator.rb +45 -8
  111. data/lib/generators/redde/scaffold/templates/controllers/controller.rb +2 -45
  112. data/lib/generators/redde/scaffold/templates/edit.html.haml +4 -9
  113. data/lib/generators/redde/scaffold/templates/index.html.haml +2 -6
  114. data/lib/generators/redde/scaffold/templates/ru.yml +14 -0
  115. data/lib/redde/engine.rb +16 -0
  116. data/lib/redde/version.rb +1 -1
  117. data/lib/redde.rb +20 -4
  118. data/lib/tasks/redde_tasks.rake +4 -0
  119. data/redde.gemspec +44 -22
  120. metadata +482 -455
  121. data/Guardfile +0 -24
  122. data/LICIENSE.md +0 -21
  123. data/lib/generators/redde/layout/templates/assets/images/admin/del.png +0 -0
  124. data/lib/generators/redde/layout/templates/assets/images/admin/folder_.png +0 -0
  125. data/lib/generators/redde/layout/templates/assets/javascripts/admin/index.js +0 -20
  126. data/lib/generators/redde/layout/templates/assets/redactor/javascripts/redactor/index.coffee +0 -4
  127. data/lib/generators/redde/layout/templates/assets/redactor/stylesheets/redactor/index.scss +0 -369
  128. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/error-msg.sass +0 -47
  129. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/notice.scss +0 -39
  130. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/photos.scss +0 -31
  131. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/blocks/sortable.sass +0 -44
  132. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/custom/index.scss +0 -1
  133. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/defaults/index.scss +0 -131
  134. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/defaults/input.sass +0 -35
  135. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/defaults/reset.sass +0 -33
  136. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/defaults/table.scss +0 -24
  137. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/index.scss +0 -6
  138. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/header.sass +0 -50
  139. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/launchbar.sass +0 -23
  140. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/main.sass +0 -38
  141. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/page-header.sass +0 -22
  142. data/lib/generators/redde/layout/templates/assets/stylesheets/admin/layouts/page-sidebar.sass +0 -24
  143. data/lib/generators/redde/layout/templates/base/_launchbar.html.haml +0 -11
  144. data/lib/generators/redde/layout/templates/base/_sidebar.html.haml +0 -14
  145. data/lib/generators/redde/layout/templates/controllers/base_controller.rb +0 -28
  146. data/lib/generators/redde/layout/templates/form_builders/redde_form_builder.rb +0 -63
  147. data/lib/generators/redde/layout/templates/helpers/admin_helper.rb +0 -94
  148. data/lib/generators/redde/photo/photo_generator.rb +0 -35
  149. data/lib/generators/redde/photo/templates/controller.rb +0 -20
  150. data/lib/generators/redde/photo/templates/create_photos.rb +0 -16
  151. data/lib/generators/redde/photo/templates/photo.rb +0 -4
  152. data/lib/generators/redde/photo/templates/photos/_photo.haml +0 -5
  153. data/lib/generators/redde/photo/templates/photos/_photos.haml +0 -19
  154. data/lib/generators/redde/photo/templates/photos/create.js.erb +0 -1
  155. data/lib/redde/concerns/photoable.rb +0 -17
  156. data/spec/dummy/.rspec +0 -1
  157. data/spec/dummy/README.rdoc +0 -28
  158. data/spec/dummy/Rakefile +0 -6
  159. data/spec/dummy/app/assets/images/admin/addphoto.png +0 -0
  160. data/spec/dummy/app/assets/images/admin/ajaxloader2.gif +0 -0
  161. data/spec/dummy/app/assets/images/admin/arrow_down.png +0 -0
  162. data/spec/dummy/app/assets/images/admin/arrow_enter.png +0 -0
  163. data/spec/dummy/app/assets/images/admin/arrow_right.png +0 -0
  164. data/spec/dummy/app/assets/images/admin/coins.png +0 -0
  165. data/spec/dummy/app/assets/images/admin/confirm.png +0 -0
  166. data/spec/dummy/app/assets/images/admin/del.png +0 -0
  167. data/spec/dummy/app/assets/images/admin/delete.png +0 -0
  168. data/spec/dummy/app/assets/images/admin/email.png +0 -0
  169. data/spec/dummy/app/assets/images/admin/error-label-triangle.png +0 -0
  170. data/spec/dummy/app/assets/images/admin/error.png +0 -0
  171. data/spec/dummy/app/assets/images/admin/favicon.png +0 -0
  172. data/spec/dummy/app/assets/images/admin/fio.png +0 -0
  173. data/spec/dummy/app/assets/images/admin/folder.png +0 -0
  174. data/spec/dummy/app/assets/images/admin/folder_.png +0 -0
  175. data/spec/dummy/app/assets/images/admin/icon_eye.gif +0 -0
  176. data/spec/dummy/app/assets/images/admin/lightbox/css/jquery.lightbox-0.5.css +0 -101
  177. data/spec/dummy/app/assets/images/admin/lightbox/images/lightbox-blank.gif +0 -0
  178. data/spec/dummy/app/assets/images/admin/lightbox/images/lightbox-btn-close.gif +0 -0
  179. data/spec/dummy/app/assets/images/admin/lightbox/images/lightbox-btn-next.gif +0 -0
  180. data/spec/dummy/app/assets/images/admin/lightbox/images/lightbox-btn-prev.gif +0 -0
  181. data/spec/dummy/app/assets/images/admin/lightbox/images/lightbox-ico-loading.gif +0 -0
  182. data/spec/dummy/app/assets/images/admin/lightbox/js/jquery.js +0 -32
  183. data/spec/dummy/app/assets/images/admin/lightbox/js/jquery.lightbox-0.5.js +0 -477
  184. data/spec/dummy/app/assets/images/admin/lightbox/js/jquery.lightbox-0.5.min.js +0 -42
  185. data/spec/dummy/app/assets/images/admin/lightbox/js/jquery.lightbox-0.5.pack.js +0 -14
  186. data/spec/dummy/app/assets/images/admin/logo.png +0 -0
  187. data/spec/dummy/app/assets/images/admin/logo_reddeshop.png +0 -0
  188. data/spec/dummy/app/assets/images/admin/move_handler.png +0 -0
  189. data/spec/dummy/app/assets/images/admin/phone.png +0 -0
  190. data/spec/dummy/app/assets/images/admin/photo_ico.png +0 -0
  191. data/spec/dummy/app/assets/images/admin/print.png +0 -0
  192. data/spec/dummy/app/assets/images/admin/refresh.png +0 -0
  193. data/spec/dummy/app/assets/images/admin/submit.png +0 -0
  194. data/spec/dummy/app/assets/images/admin/submit_hover.png +0 -0
  195. data/spec/dummy/app/assets/images/admin/view.png +0 -0
  196. data/spec/dummy/app/assets/images/admin/view_mk.png +0 -0
  197. data/spec/dummy/app/assets/images/redactor/icons.png +0 -0
  198. data/spec/dummy/app/assets/images/redactor/plugins/file.html +0 -3
  199. data/spec/dummy/app/assets/images/redactor/plugins/image.html +0 -39
  200. data/spec/dummy/app/assets/images/redactor/plugins/image_edit.html +0 -35
  201. data/spec/dummy/app/assets/images/redactor/plugins/link.html +0 -74
  202. data/spec/dummy/app/assets/images/redactor/plugins/table.html +0 -25
  203. data/spec/dummy/app/assets/images/redactor/plugins/video.html +0 -15
  204. data/spec/dummy/app/assets/javascripts/admin/jquery.mjs.nestedSortable.js +0 -429
  205. data/spec/dummy/app/assets/javascripts/admin.js +0 -21
  206. data/spec/dummy/app/assets/javascripts/application.js +0 -14
  207. data/spec/dummy/app/assets/javascripts/jquery-migrate-1.2.1.js +0 -521
  208. data/spec/dummy/app/assets/javascripts/redactor/langs/en.js +0 -76
  209. data/spec/dummy/app/assets/javascripts/redactor/langs/ru.js +0 -75
  210. data/spec/dummy/app/assets/javascripts/redactor/redactor.js.erb +0 -2248
  211. data/spec/dummy/app/assets/javascripts/redactor/toolbars/default.js +0 -219
  212. data/spec/dummy/app/assets/stylesheets/admin/blocks/list.scss +0 -22
  213. data/spec/dummy/app/assets/stylesheets/admin/blocks/notice.scss +0 -39
  214. data/spec/dummy/app/assets/stylesheets/admin/blocks/orders.scss +0 -22
  215. data/spec/dummy/app/assets/stylesheets/admin/blocks/paginate.sass +0 -28
  216. data/spec/dummy/app/assets/stylesheets/admin/blocks/pagination.scss +0 -28
  217. data/spec/dummy/app/assets/stylesheets/admin/blocks/partners.scss +0 -15
  218. data/spec/dummy/app/assets/stylesheets/admin/blocks/phead-tabs.sass +0 -27
  219. data/spec/dummy/app/assets/stylesheets/admin/blocks/photos.scss +0 -31
  220. data/spec/dummy/app/assets/stylesheets/admin/blocks/sortable.sass +0 -44
  221. data/spec/dummy/app/assets/stylesheets/admin/custom/index.scss +0 -1
  222. data/spec/dummy/app/assets/stylesheets/admin/defaults/index.scss +0 -131
  223. data/spec/dummy/app/assets/stylesheets/admin/defaults/input.sass +0 -35
  224. data/spec/dummy/app/assets/stylesheets/admin/defaults/reset.sass +0 -33
  225. data/spec/dummy/app/assets/stylesheets/admin/defaults/table.scss +0 -24
  226. data/spec/dummy/app/assets/stylesheets/admin/index.scss +0 -6
  227. data/spec/dummy/app/assets/stylesheets/admin/layouts/header.sass +0 -50
  228. data/spec/dummy/app/assets/stylesheets/admin/layouts/launchbar.sass +0 -23
  229. data/spec/dummy/app/assets/stylesheets/admin/layouts/login.sass +0 -25
  230. data/spec/dummy/app/assets/stylesheets/admin/layouts/main.sass +0 -38
  231. data/spec/dummy/app/assets/stylesheets/admin/layouts/page-header.sass +0 -22
  232. data/spec/dummy/app/assets/stylesheets/admin/layouts/page-sidebar.sass +0 -24
  233. data/spec/dummy/app/assets/stylesheets/admin/layouts/sidebar.sass +0 -30
  234. data/spec/dummy/app/assets/stylesheets/admin/shop/_filter.scss +0 -16
  235. data/spec/dummy/app/assets/stylesheets/admin/shop/_order-sh.scss +0 -59
  236. data/spec/dummy/app/assets/stylesheets/admin/shop/_pe.scss +0 -43
  237. data/spec/dummy/app/assets/stylesheets/redactor/wym.css +0 -136
  238. data/spec/dummy/app/controllers/admin/base_controller.rb +0 -28
  239. data/spec/dummy/app/controllers/admin/managers_controller.rb +0 -36
  240. data/spec/dummy/app/controllers/application_controller.rb +0 -6
  241. data/spec/dummy/app/controllers/articles_controller.rb +0 -8
  242. data/spec/dummy/app/controllers/managers/registrations_controller.rb +0 -21
  243. data/spec/dummy/app/helpers/admin_helper.rb +0 -94
  244. data/spec/dummy/app/models/article.rb +0 -4
  245. data/spec/dummy/app/models/article_category.rb +0 -2
  246. data/spec/dummy/app/models/photo.rb +0 -3
  247. data/spec/dummy/app/views/admin/base/_header.html.haml +0 -12
  248. data/spec/dummy/app/views/admin/base/_launchbar.html.haml +0 -11
  249. data/spec/dummy/app/views/admin/base/_sidebar.html.haml +0 -14
  250. data/spec/dummy/app/views/admin/base/_validate.haml +0 -8
  251. data/spec/dummy/app/views/admin/base/welcome.haml +0 -2
  252. data/spec/dummy/app/views/admin/photos/_photo.haml +0 -5
  253. data/spec/dummy/app/views/admin/photos/_photos.haml +0 -19
  254. data/spec/dummy/app/views/admin/photos/create.js.erb +0 -1
  255. data/spec/dummy/app/views/admin/photos/destroy.js.erb +0 -1
  256. data/spec/dummy/app/views/articles/show.html.haml +0 -2
  257. data/spec/dummy/app/views/layouts/admin.html.haml +0 -29
  258. data/spec/dummy/app/views/layouts/application.html.erb +0 -15
  259. data/spec/dummy/app/views/layouts/login.html.haml +0 -32
  260. data/spec/dummy/bin/bundle +0 -3
  261. data/spec/dummy/bin/rails +0 -4
  262. data/spec/dummy/bin/rake +0 -4
  263. data/spec/dummy/config/application.rb +0 -33
  264. data/spec/dummy/config/boot.rb +0 -5
  265. data/spec/dummy/config/database.yml +0 -25
  266. data/spec/dummy/config/environment.rb +0 -5
  267. data/spec/dummy/config/environments/development.rb +0 -29
  268. data/spec/dummy/config/environments/production.rb +0 -80
  269. data/spec/dummy/config/environments/test.rb +0 -36
  270. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  271. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  272. data/spec/dummy/config/initializers/inflections.rb +0 -16
  273. data/spec/dummy/config/initializers/mime_types.rb +0 -5
  274. data/spec/dummy/config/initializers/secret_token.rb +0 -12
  275. data/spec/dummy/config/initializers/session_store.rb +0 -3
  276. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  277. data/spec/dummy/config/locales/en.yml +0 -36
  278. data/spec/dummy/config/routes.rb +0 -4
  279. data/spec/dummy/config.ru +0 -4
  280. data/spec/dummy/db/migrate/20130908123351_create_articles.rb +0 -9
  281. data/spec/dummy/db/migrate/20140128152208_create_article_categories.rb +0 -11
  282. data/spec/dummy/db/migrate/20140607122532_create_photos.rb +0 -16
  283. data/spec/dummy/db/schema.rb +0 -98
  284. data/spec/dummy/public/404.html +0 -58
  285. data/spec/dummy/public/422.html +0 -58
  286. data/spec/dummy/public/500.html +0 -57
  287. data/spec/dummy/public/favicon.ico +0 -0
  288. data/spec/generators/layout_generator_spec.rb +0 -42
  289. data/spec/generators/photo_generator_spec.rb +0 -32
  290. data/spec/generators/scaffold_generator_spec.rb +0 -58
  291. data/spec/models/sluggable_spec.rb +0 -42
  292. data/spec/models/url_generator_spec.rb +0 -18
  293. data/spec/models/with_photo_spec.rb +0 -25
  294. data/spec/spec_helper.rb +0 -52
  295. /data/{lib/generators/redde/layout/templates/assets/redactor → app/assets}/images/.keep +0 -0
  296. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/addphoto.png +0 -0
  297. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/ajaxloader2.gif +0 -0
  298. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/arrow_down.png +0 -0
  299. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/arrow_enter.png +0 -0
  300. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/arrow_right.png +0 -0
  301. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/coins.png +0 -0
  302. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/confirm.png +0 -0
  303. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/delete.png +0 -0
  304. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/email.png +0 -0
  305. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/error.png +0 -0
  306. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/favicon.png +0 -0
  307. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/fio.png +0 -0
  308. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/icon_eye.gif +0 -0
  309. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/lightbox/css/jquery.lightbox-0.5.css +0 -0
  310. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/lightbox/images/lightbox-blank.gif +0 -0
  311. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/lightbox/images/lightbox-btn-close.gif +0 -0
  312. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/lightbox/images/lightbox-btn-next.gif +0 -0
  313. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/lightbox/images/lightbox-btn-prev.gif +0 -0
  314. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/lightbox/images/lightbox-ico-loading.gif +0 -0
  315. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/lightbox/js/jquery.js +0 -0
  316. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/lightbox/js/jquery.lightbox-0.5.js +0 -0
  317. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/lightbox/js/jquery.lightbox-0.5.min.js +0 -0
  318. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/lightbox/js/jquery.lightbox-0.5.pack.js +0 -0
  319. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/logo_reddeshop.png +0 -0
  320. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/phone.png +0 -0
  321. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/photo_ico.png +0 -0
  322. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/print.png +0 -0
  323. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/refresh.png +0 -0
  324. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/submit.png +0 -0
  325. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/submit_hover.png +0 -0
  326. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/view.png +0 -0
  327. /data/{lib/generators/redde/layout/templates → app}/assets/images/admin/view_mk.png +0 -0
  328. /data/{lib/generators/redde/layout/templates/assets/images/admin → app/assets/images/redde}/error-label-triangle.png +0 -0
  329. /data/{lib/generators/redde/layout/templates/assets/images/admin → app/assets/images/redde}/folder.png +0 -0
  330. /data/{lib/generators/redde/layout/templates/assets/images/admin → app/assets/images/redde}/logo.png +0 -0
  331. /data/{lib/generators/redde/layout/templates/assets/images/admin/move_handler.png → app/assets/images/redde/move-handler.png} +0 -0
  332. /data/{lib/generators/redde/layout/templates/assets/redactor/images → app/assets/images/redde}/redactor/icons.png +0 -0
  333. /data/{lib/generators/redde/layout/templates/assets/redactor/images → app/assets/images/redde}/redactor/plugins/file.html +0 -0
  334. /data/{lib/generators/redde/layout/templates/assets/redactor/images → app/assets/images/redde}/redactor/plugins/image.html +0 -0
  335. /data/{lib/generators/redde/layout/templates/assets/redactor/images → app/assets/images/redde}/redactor/plugins/image_edit.html +0 -0
  336. /data/{lib/generators/redde/layout/templates/assets/redactor/images → app/assets/images/redde}/redactor/plugins/link.html +0 -0
  337. /data/{lib/generators/redde/layout/templates/assets/redactor/images → app/assets/images/redde}/redactor/plugins/table.html +0 -0
  338. /data/{lib/generators/redde/layout/templates/assets/redactor/images → app/assets/images/redde}/redactor/plugins/video.html +0 -0
  339. /data/{lib/generators/redde/layout/templates/assets/redactor/javascripts → app/assets/javascripts/redde}/redactor/langs/en.js +0 -0
  340. /data/{lib/generators/redde/layout/templates/assets/redactor/javascripts → app/assets/javascripts/redde}/redactor/langs/ru.js +0 -0
  341. /data/{lib/generators/redde/layout/templates/assets/redactor/javascripts → app/assets/javascripts/redde}/redactor/toolbars/default.js +0 -0
  342. /data/{lib/generators/redde/layout/templates/assets/javascripts/admin → app/assets/javascripts/redde/sortTree}/jquery.mjs.nestedSortable.js +0 -0
  343. /data/{lib/generators/redde/layout/templates/assets/stylesheets/admin → app/assets/stylesheets/redde}/blocks/list.scss +0 -0
  344. /data/{lib/generators/redde/layout/templates/assets/stylesheets/admin → app/assets/stylesheets/redde}/blocks/orders.scss +0 -0
  345. /data/{lib/generators/redde/layout/templates/assets/stylesheets/admin → app/assets/stylesheets/redde}/blocks/paginate.sass +0 -0
  346. /data/{lib/generators/redde/layout/templates/assets/stylesheets/admin → app/assets/stylesheets/redde}/blocks/pagination.scss +0 -0
  347. /data/{lib/generators/redde/layout/templates/assets/stylesheets/admin → app/assets/stylesheets/redde}/blocks/partners.scss +0 -0
  348. /data/{lib/generators/redde/layout/templates/assets/stylesheets/admin → app/assets/stylesheets/redde}/blocks/phead-tabs.sass +0 -0
  349. /data/{lib/generators/redde/layout/templates/assets/stylesheets/admin → app/assets/stylesheets/redde}/layouts/login.sass +0 -0
  350. /data/{lib/generators/redde/layout/templates/assets/stylesheets/admin → app/assets/stylesheets/redde}/layouts/sidebar.sass +0 -0
  351. /data/{lib/generators/redde/layout/templates/assets/redactor/stylesheets → app/assets/stylesheets/redde}/redactor/wym.css +0 -0
  352. /data/{lib/generators/redde/layout/templates/assets/stylesheets/admin → app/assets/stylesheets/redde}/shop/_filter.scss +0 -0
  353. /data/{lib/generators/redde/layout/templates/assets/stylesheets/admin → app/assets/stylesheets/redde}/shop/_order-sh.scss +0 -0
  354. /data/{lib/generators/redde/layout/templates/assets/stylesheets/admin → app/assets/stylesheets/redde}/shop/_pe.scss +0 -0
  355. /data/{spec/dummy/app/assets/images → app/controllers}/.keep +0 -0
  356. /data/{lib/generators/redde/layout/templates → app}/controllers/managers/registrations_controller.rb +0 -0
  357. /data/{spec/dummy/app/models → app/helpers}/.keep +0 -0
  358. /data/{spec/dummy/lib/assets → app/mailers}/.keep +0 -0
  359. /data/{spec/dummy/log → app/models}/.keep +0 -0
  360. /data/{spec/dummy/app/assets/stylesheets/application.css.scss → app/views/.keep} +0 -0
  361. /data/{lib/generators/redde/layout/templates → app/views/admin}/base/welcome.haml +0 -0
  362. /data/{lib/generators/redde/photo/templates/photos → app/views/admin/redde_photos}/destroy.js.erb +0 -0
@@ -1,53 +1,53 @@
1
1
  var RTOOLBAR = {};
2
2
 
3
3
  (function($){
4
-
4
+
5
5
  // Plugin
6
6
  jQuery.fn.redactor = function(option)
7
7
  {
8
- return this.each(function()
8
+ return this.each(function()
9
9
  {
10
10
  var $this = $(this);
11
-
11
+
12
12
  var data = $this.data('redactor');
13
13
  if (!data) $this.data('redactor', (data = new Redactor(this, option)));
14
14
  });
15
15
  };
16
-
17
-
16
+
17
+
18
18
  // Initialization
19
19
  var Redactor = function(element, options)
20
20
  {
21
21
  // Element
22
22
  this.$el = $(element);
23
-
23
+
24
24
  // Options
25
25
  this.opts = $.extend({
26
-
26
+
27
27
  lang: 'en',
28
28
  toolbar: 'default',
29
29
 
30
30
  load: false,
31
-
31
+
32
32
  path: false,
33
- css: '<%= asset_path("redactor/wym.css") %>',
33
+ css: '<%= asset_path("redde/redactor/wym.css") %>',
34
34
  focus: true,
35
35
  resize: true,
36
36
  autoresize: false,
37
37
  fixed: false,
38
-
38
+
39
39
  autoformat: true,
40
40
  cleanUp: true,
41
41
  convertDivs: true,
42
42
  removeClasses: true,
43
43
  removeStyles: false,
44
44
  convertLinks: true,
45
-
45
+
46
46
  handler: false, // false or url
47
-
47
+
48
48
  autosave: false, // false or url
49
49
  interval: 60, // seconds
50
-
50
+
51
51
  imageGetJson: false, // url (ex. /folder/images.json ) or false
52
52
 
53
53
  imageUpload: false, // url
@@ -72,9 +72,9 @@ var RTOOLBAR = {};
72
72
 
73
73
 
74
74
  }, options, this.$el.data());
75
-
75
+
76
76
  this.dropdowns = [];
77
-
77
+
78
78
  // Init
79
79
  this.init();
80
80
  };
@@ -91,7 +91,7 @@ var RTOOLBAR = {};
91
91
  var callback;
92
92
  if (typeof(item) == 'function') callback = item;
93
93
  else callback = $.proxy(function() { this._loadFile(item, array); }, this);
94
-
94
+
95
95
  this.dynamicallyLoad(file, callback);
96
96
  },
97
97
  loadFiles: function(array)
@@ -118,7 +118,7 @@ var RTOOLBAR = {};
118
118
  script.onload = script.onreadystatechange = null;
119
119
  }
120
120
  };
121
-
121
+
122
122
  head.appendChild(script);
123
123
 
124
124
  },
@@ -159,7 +159,7 @@ var RTOOLBAR = {};
159
159
 
160
160
  // preformatter
161
161
  html = this.preformater(html);
162
-
162
+
163
163
  // conver newlines to p
164
164
  if (this.opts.autoformat) html = this.paragraphy(html);
165
165
 
@@ -168,19 +168,19 @@ var RTOOLBAR = {};
168
168
 
169
169
  // focus always on page
170
170
  $(this.doc).click($.proxy(function(e) { this.$editor.focus(); }, this));
171
-
171
+
172
172
  // cleanup
173
173
  $(this.doc).bind('paste', $.proxy(function(e)
174
- {
174
+ {
175
175
  setTimeout($.proxy(function ()
176
176
  {
177
177
  var node = $('<span id="pastemarkerend">&nbsp;</span>');
178
178
  this.insertNodeAtCaret(node.get(0));
179
-
179
+
180
180
  this.pasteCleanUp();
181
-
181
+
182
182
  }, this), 200);
183
-
183
+
184
184
 
185
185
 
186
186
  }, this));
@@ -199,7 +199,7 @@ var RTOOLBAR = {};
199
199
  .keyup($.proxy(function(e)
200
200
  {
201
201
  var key = e.keyCode || e.which;
202
-
202
+
203
203
  if (this.opts.autoformat)
204
204
  {
205
205
  // if empty
@@ -212,10 +212,10 @@ var RTOOLBAR = {};
212
212
  this.syncCode();
213
213
 
214
214
  }, this));
215
-
215
+
216
216
  // toolbar
217
217
  this.buildToolbar();
218
-
218
+
219
219
  // resizer
220
220
  if (this.opts.autoresize === false) this.buildResizer();
221
221
  else this.observeAutoResize();
@@ -228,14 +228,14 @@ var RTOOLBAR = {};
228
228
 
229
229
  // observers
230
230
  this.observeImages();
231
-
231
+
232
232
  // fullscreen on start
233
- if (this.opts.fullscreen)
233
+ if (this.opts.fullscreen)
234
234
  {
235
235
  this.opts.fullscreen = false;
236
236
  this.fullscreen();
237
237
  }
238
-
238
+
239
239
  // focus
240
240
  if (this.opts.focus) this.focus();
241
241
 
@@ -251,8 +251,8 @@ var RTOOLBAR = {};
251
251
  $(this.doc).keydown($.proxy(function(e)
252
252
  {
253
253
  var key = e.keyCode || e.which;
254
-
255
- if (e.ctrlKey)
254
+
255
+ if (e.ctrlKey)
256
256
  {
257
257
  if (key == 90) this._shortcuts(e, 'undo'); // Ctrl + z
258
258
  else if (key == 90 && e.shiftKey) this._shortcuts(e, 'redo'); // Ctrl + Shift + z
@@ -263,7 +263,7 @@ var RTOOLBAR = {};
263
263
  else if (key == 75) this._shortcuts(e, 'insertorderedlist'); // Ctrl + k
264
264
  else if (key == 76) this._shortcuts(e, 'superscript'); // Ctrl + l
265
265
  }
266
-
266
+
267
267
  if (!e.shiftKey && key == 9) this._shortcuts(e, 'indent'); // Tab
268
268
  else if (e.shiftKey && key == 9 ) this._shortcuts(e, 'outdent'); // Shift + tab
269
269
 
@@ -283,8 +283,8 @@ var RTOOLBAR = {};
283
283
  {
284
284
  if (s.src)
285
285
  {
286
-
287
- // Match redactor.js or redactor.min.js, followed by an optional querystring (often used for cache purposes)
286
+
287
+ // Match redactor.js or redactor.min.js, followed by an optional querystring (often used for cache purposes)
288
288
  var regexp = new RegExp(/\/redactor(\.min)?\.js(\?.*)?/);
289
289
  if (s.src.match(regexp)) this.opts.path = s.src.replace(regexp, '');
290
290
  }
@@ -295,7 +295,7 @@ var RTOOLBAR = {};
295
295
  {
296
296
  // container
297
297
  this.$box = $('<div class="redactor_box"></div>');
298
-
298
+
299
299
  // frame
300
300
  this.$frame = $('<iframe frameborder="0" scrolling="auto" style="height: ' + this.height + ';" class="redactor_frame"></iframe>');
301
301
 
@@ -332,7 +332,7 @@ var RTOOLBAR = {};
332
332
  frameHtml += html;
333
333
  frameHtml += '</div></body></html>';
334
334
  return frameHtml;
335
- },
335
+ },
336
336
  getDoc: function(frame)
337
337
  {
338
338
  if (frame.contentDocument) return frame.contentDocument;
@@ -347,9 +347,9 @@ var RTOOLBAR = {};
347
347
  syncCode: function()
348
348
  {
349
349
  var html = this.formating(this.$editor.html());
350
- this.$el.val(html);
350
+ this.$el.val(html);
351
351
  },
352
-
352
+
353
353
  // API functions
354
354
  setCode: function(html)
355
355
  {
@@ -373,11 +373,11 @@ var RTOOLBAR = {};
373
373
  destroy: function()
374
374
  {
375
375
  var html = this.getCode();
376
-
376
+
377
377
  this.$box.after(this.$el);
378
378
  this.$box.remove();
379
379
  this.$el.val(html).show();
380
-
380
+
381
381
  this.dropdowns.forEach(function(dropdown, i)
382
382
  {
383
383
  dropdown.remove();
@@ -405,19 +405,19 @@ var RTOOLBAR = {};
405
405
  observeImages: function()
406
406
  {
407
407
  if ($.browser.mozilla) this.doc.execCommand("enableObjectResizing", false, "false");
408
-
408
+
409
409
  $(this.doc).find('img').attr('unselectable', 'on').each($.proxy(function(i,s)
410
410
  {
411
411
  this.resizeImage(s);
412
-
412
+
413
413
  }, this));
414
-
414
+
415
415
  },
416
416
  observeScroll: function()
417
417
  {
418
418
  var scrolltop = $(document).scrollTop();
419
419
  var boxtop = this.$box.offset().top;
420
-
420
+
421
421
  if (scrolltop > boxtop)
422
422
  {
423
423
  this.fixed = true;
@@ -440,8 +440,8 @@ var RTOOLBAR = {};
440
440
  {
441
441
  this.$frame.height(this.$editor.outerHeight(true)+30);
442
442
  },
443
-
444
-
443
+
444
+
445
445
  // EXECCOMMAND
446
446
  execCommand: function(cmd, param)
447
447
  {
@@ -457,7 +457,7 @@ var RTOOLBAR = {};
457
457
  {
458
458
  this.doc.execCommand(cmd, false, param);
459
459
  }
460
-
460
+
461
461
  this.syncCode();
462
462
  this.focus();
463
463
  }
@@ -465,7 +465,7 @@ var RTOOLBAR = {};
465
465
 
466
466
  }
467
467
  },
468
-
468
+
469
469
  // FORMAT NEW LINE
470
470
  formatNewLine: function(e)
471
471
  {
@@ -473,7 +473,7 @@ var RTOOLBAR = {};
473
473
  if (parent.nodeName == 'DIV' && parent.id == 'page')
474
474
  {
475
475
  if (e.preventDefault) e.preventDefault();
476
-
476
+
477
477
  element = $(this.getCurrentNode());
478
478
  if (element.get(0).tagName == 'DIV' && (element.html() == '' || element.html() == '<br>'))
479
479
  {
@@ -490,9 +490,9 @@ var RTOOLBAR = {};
490
490
  // convert links
491
491
  if (this.opts.convertLinks) this.$editor.linkify();
492
492
  }
493
- else
493
+ else
494
494
  {
495
- this.syncCode();
495
+ this.syncCode();
496
496
  return true;
497
497
  }
498
498
  },
@@ -503,7 +503,7 @@ var RTOOLBAR = {};
503
503
  if (e.shiftKey && key == 13)
504
504
  {
505
505
  if (e.preventDefault) e.preventDefault();
506
-
506
+
507
507
  var node1 = $('<span><br /></span>');
508
508
  this.insertNodeAtCaret(node1.get(0));
509
509
  this.setFocusNode(node1.get(0));
@@ -512,26 +512,26 @@ var RTOOLBAR = {};
512
512
  return false;
513
513
  }
514
514
  },
515
-
515
+
516
516
  // FORMAT EMPTY
517
517
  formatEmpty: function(e)
518
518
  {
519
519
  var html = $.trim(this.$editor.html());
520
-
520
+
521
521
  if ($.browser.mozilla) html = html.replace(/<br>/gi, '');
522
-
522
+
523
523
  if (html === '')
524
524
  {
525
525
  if (e.preventDefault) e.preventDefault();
526
-
526
+
527
527
  var nodehtml = this.opts.allEmptyHtml;
528
528
  if ($.browser.mozilla) nodehtml = this.opts.mozillaEmptyHtml;
529
-
529
+
530
530
  var node = $(nodehtml).get(0);
531
531
  this.$editor.html(node);
532
532
  this.setFocusNode(node);
533
-
534
- this.syncCode();
533
+
534
+ this.syncCode();
535
535
  return false;
536
536
  }
537
537
  else this.syncCode();
@@ -546,7 +546,7 @@ var RTOOLBAR = {};
546
546
  if (!$.browser.mozilla) return this.opts.allEmptyHtml;
547
547
  else return this.opts.mozillaEmptyHtml;
548
548
  }
549
-
549
+
550
550
  // convert div to p
551
551
  if (this.opts.convertDivs) str = str.replace(/<div(.*?)>([\w\W]*?)<\/div>/gi, '<p>$2</p>');
552
552
 
@@ -556,7 +556,7 @@ var RTOOLBAR = {};
556
556
 
557
557
  // block elements
558
558
  var blocks = '(table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|style|script|object|input|param|p|h[1-6])';
559
-
559
+
560
560
  str += '\n';
561
561
 
562
562
  R('<br />\\s*<br />', '\n\n');
@@ -653,7 +653,7 @@ var RTOOLBAR = {};
653
653
  {
654
654
  // clean comments
655
655
  html = html.replace(/(<\!\-\-([\w\W]*?)\-\->)/ig, "");
656
-
656
+
657
657
  if (this.opts.convertDivs)
658
658
  {
659
659
  html = html.replace(/<div(.*?)>([\w\W]*?)<\/div>/gi, '<p$1>$2</p>');
@@ -673,33 +673,33 @@ var RTOOLBAR = {};
673
673
  // spans
674
674
  html = html.replace(/<span>&nbsp;<\/span>/gi, '');
675
675
  html = html.replace(/<span>([\w\W]*?)<\/span>/gi, '$1');
676
-
676
+
677
677
  return html;
678
678
  },
679
679
  removeTags: function(html)
680
680
  {
681
681
  return html.replace(/<(?!\s*\/?(code|span|div|label|a|br|p|b|i|del|strike|img|video|audio|iframe|object|embed|param|blockquote|mark|cite|small|ul|ol|li|hr|dl|dt|dd|sup|sub|big|pre|code|figure|figcaption|strong|em|table|tr|td|th|tbody|thead|tfoot|h1|h2|h3|h4|h5|h6)\b)[^>]+>/gi,"");
682
682
  },
683
-
683
+
684
684
  // PASTE CLEANUP
685
685
  pasteCleanUp: function()
686
686
  {
687
687
  var html = this.$editor.html();
688
-
688
+
689
689
  html = html.replace(/<span id="pastemarkerend">&nbsp;<\/span>/, '#marker#');
690
-
690
+
691
691
  html = this.formating(html);
692
692
  html = this.cleanUp(html);
693
-
693
+
694
694
  if (this.opts.removeClasses) html = html.replace(/ class="([\w\W]*?)"/gi, '');
695
695
  else html = this.cleanUpClasses(html);
696
-
696
+
697
697
  if (this.opts.removeStyles) html = html.replace(/ style="([\w\W]*?)"/gi, '');
698
698
  else html = this.cleanUpStyles(html);
699
699
 
700
700
  html = this.cleanUp(html);
701
701
  html = this.formating(html);
702
-
702
+
703
703
  html = html.replace(/<b(.*?)id="internal-source-marker(.*?)">([\w\W]*?)<\/b>/gi, "$3");
704
704
 
705
705
  html = html.replace(/#marker#/, '<span id="pastemarkerend">&nbsp;</span>');
@@ -712,7 +712,7 @@ var RTOOLBAR = {};
712
712
  this.syncCode();
713
713
  this.observeImages();
714
714
  },
715
-
715
+
716
716
  // TEXTAREA CODE FORMATTING
717
717
  formating: function (html)
718
718
  {
@@ -754,8 +754,8 @@ var RTOOLBAR = {};
754
754
  var bbb = etags[i];
755
755
  html = html.replace(new RegExp(bbb,'gi'), "");
756
756
  }
757
-
758
-
757
+
758
+
759
759
  // add formatting before
760
760
  var lb = '\r\n';
761
761
  var btags = ["<form","<fieldset","<legend","<object","<embed","<select","<option","<input","<textarea","<pre","<blockquote","<ul","<ol","<li","<dl","<dt","<dd","<table", "<thead","<tbody","<caption","</caption>","<th","<tr","<td","<figure"];
@@ -764,7 +764,7 @@ var RTOOLBAR = {};
764
764
  var eee = btags[i];
765
765
  html = html.replace(new RegExp(eee,'gi'),lb+eee);
766
766
  }
767
-
767
+
768
768
  // add formatting after
769
769
  var atags = ['</p>', '</div>', '</ul>', '</ol>', '</h1>', '</h2>', '</h3>', '</h4>', '</h5>', '</h6>', '<br>', '<br />', '</dl>', '</dt>', '</dd>', '</form>', '</blockquote>', '</pre>', '</legend>', '</fieldset>', '</object>', '</embed>', '</textarea>', '</select>', '</option>', '</table>', '</thead>', '</tbody>', '</tr>', '</td>', '</th>', '</figure>'];
770
770
  for (var i = 0; i < atags.length; ++i)
@@ -786,23 +786,23 @@ var RTOOLBAR = {};
786
786
  toggle: function()
787
787
  {
788
788
  var html;
789
-
789
+
790
790
  if (this.opts.visual)
791
791
  {
792
792
  this.$frame.hide();
793
-
793
+
794
794
  html = this.$editor.html();
795
795
  html = $.trim(this.formating(html));
796
-
796
+
797
797
  this.$el.val(html).show().focus();
798
-
798
+
799
799
  this.setBtnActive('html');
800
800
  this.opts.visual = false;
801
801
  }
802
802
  else
803
803
  {
804
804
  this.$el.hide();
805
-
805
+
806
806
  this.$editor.html(this.$el.val());
807
807
 
808
808
  this.$frame.show();
@@ -816,7 +816,7 @@ var RTOOLBAR = {};
816
816
  }
817
817
 
818
818
  this.focus();
819
-
819
+
820
820
  this.setBtnInactive('html');
821
821
  this.opts.visual = true;
822
822
  this.observeImages();
@@ -827,7 +827,7 @@ var RTOOLBAR = {};
827
827
  autoSave: function()
828
828
  {
829
829
  if (this.opts.autosave === false) return false;
830
-
830
+
831
831
  setInterval($.proxy(function()
832
832
  {
833
833
  $.post(this.opts.autosave, { data: this.getCode() });
@@ -839,16 +839,16 @@ var RTOOLBAR = {};
839
839
  buildToolbar: function()
840
840
  {
841
841
  if (this.opts.toolbar === false) return false;
842
-
842
+
843
843
  this.$toolbar = $('<ul>').addClass('redactor_toolbar');
844
844
  this.$box.prepend(this.$toolbar);
845
-
845
+
846
846
  $.each(RTOOLBAR[this.opts.toolbar], $.proxy(function(key,s)
847
847
  {
848
848
  if (this.opts.fileUpload === false && key == 'file') return true;
849
-
849
+
850
850
  var li = $('<li>');
851
-
851
+
852
852
  if (key == 'fullscreen') $(li).addClass('redactor_toolbar_right');
853
853
 
854
854
  var a = this.buildButton(key, s);
@@ -857,7 +857,7 @@ var RTOOLBAR = {};
857
857
  if (key == 'backcolor' || key == 'fontcolor' || typeof(s.dropdown) != 'undefined')
858
858
  {
859
859
  var dropdown = $('<div class="redactor_dropdown" style="display: none;">');
860
-
860
+
861
861
  if (key == 'backcolor' || key == 'fontcolor') dropdown = this.buildColorPicker(dropdown, key);
862
862
  else dropdown = this.buildDropdown(dropdown, s.dropdown);
863
863
 
@@ -893,7 +893,7 @@ var RTOOLBAR = {};
893
893
  function (x, d)
894
894
  {
895
895
  if (typeof(d.style) == 'undefined') d.style = '';
896
-
896
+
897
897
  var drop_a;
898
898
  if (d.name == 'separator') drop_a = $('<a class="redactor_separator_drop">');
899
899
  else
@@ -905,7 +905,7 @@ var RTOOLBAR = {};
905
905
  }
906
906
 
907
907
  $(dropdown).append(drop_a);
908
-
908
+
909
909
  }, this)
910
910
  );
911
911
 
@@ -921,7 +921,7 @@ var RTOOLBAR = {};
921
921
  else mode = 'hilitecolor';
922
922
  }
923
923
  else mode = 'forecolor';
924
-
924
+
925
925
  $(dropdown).width(210);
926
926
 
927
927
  var len = this.opts.colors.length;
@@ -955,7 +955,7 @@ var RTOOLBAR = {};
955
955
  $(this.getParentNode()).attr('color', '').css('color', '');
956
956
  this.syncCode();
957
957
  },
958
-
958
+
959
959
  // DROPDOWNS
960
960
  showDropDown: function(e, dropdown, key)
961
961
  {
@@ -965,18 +965,18 @@ var RTOOLBAR = {};
965
965
  this.getBtn(key).addClass('dropact');
966
966
 
967
967
  var left = this.getBtn(key).offset().left;
968
-
969
-
968
+
969
+
970
970
  if (this.opts.fixed && this.fixed)
971
971
  {
972
972
  $(dropdown).css({ position: 'fixed', left: left + 'px', top: '30px' }).show();
973
973
  }
974
- else
974
+ else
975
975
  {
976
976
  var top = this.$toolbar.offset().top + 30;
977
977
  $(dropdown).css({ position: 'absolute', left: left + 'px', top: top + 'px' }).show();
978
978
  }
979
-
979
+
980
980
  },
981
981
  hideAllDropDown: function()
982
982
  {
@@ -992,7 +992,7 @@ var RTOOLBAR = {};
992
992
  this.hideAllDropDown();
993
993
  }
994
994
  },
995
-
995
+
996
996
  // SELECTION AND NODE MANIPULATION
997
997
  getSelection: function ()
998
998
  {
@@ -1015,7 +1015,7 @@ var RTOOLBAR = {};
1015
1015
 
1016
1016
  var selection = this.getSelection();
1017
1017
  toStart = toStart ? 0 : 1;
1018
-
1018
+
1019
1019
  if (selection !== null)
1020
1020
  {
1021
1021
  range.selectNodeContents(node);
@@ -1030,7 +1030,7 @@ var RTOOLBAR = {};
1030
1030
  if (typeof window.getSelection != "undefined")
1031
1031
  {
1032
1032
  var sel = this.getSelection();
1033
- if (sel.rangeCount)
1033
+ if (sel.rangeCount)
1034
1034
  {
1035
1035
  var range = sel.getRangeAt(0);
1036
1036
  range.collapse(false);
@@ -1086,34 +1086,34 @@ var RTOOLBAR = {};
1086
1086
  {
1087
1087
  this.$toolbar.append($('<li>').append(this.buildButton(key, obj)));
1088
1088
  },
1089
-
1089
+
1090
1090
  // FULLSCREEN
1091
1091
  fullscreen: function()
1092
1092
  {
1093
1093
  var html;
1094
-
1094
+
1095
1095
  if (this.opts.fullscreen === false)
1096
1096
  {
1097
1097
  this.changeBtnIcon('fullscreen', 'normalscreen');
1098
1098
  this.setBtnActive('fullscreen');
1099
1099
  this.opts.fullscreen = true;
1100
-
1100
+
1101
1101
  this.height = this.$frame.css('height');
1102
1102
  this.width = (this.$box.width() - 2) + 'px';
1103
-
1103
+
1104
1104
  html = this.getCode();
1105
-
1105
+
1106
1106
  this.tmpspan = $('<span></span>');
1107
1107
  this.$box.addClass('redactor_box_fullscreen').after(this.tmpspan);
1108
-
1108
+
1109
1109
  $(document.body).prepend(this.$box).css('overflow', 'hidden');
1110
-
1111
- this.$editor = this.enable(html);
1112
-
1110
+
1111
+ this.$editor = this.enable(html);
1112
+
1113
1113
  $(this.doc).click($.proxy(this.hideAllDropDown, this));
1114
1114
  // focus always on page
1115
1115
  $(this.doc).click($.proxy(function(e) { this.$editor.focus(); }, this));
1116
-
1116
+
1117
1117
  this.observeImages();
1118
1118
  this.$box.find('.redactor_resizer').hide();
1119
1119
 
@@ -1121,35 +1121,35 @@ var RTOOLBAR = {};
1121
1121
  $(window).resize($.proxy(this.fullScreenResize, this));
1122
1122
  $(document).scrollTop(0,0);
1123
1123
  this.focus();
1124
-
1124
+
1125
1125
  }
1126
1126
  else
1127
1127
  {
1128
1128
  this.removeBtnIcon('fullscreen', 'normalscreen');
1129
1129
  this.setBtnInactive('fullscreen');
1130
1130
  this.opts.fullscreen = false;
1131
-
1131
+
1132
1132
  $(window).unbind('resize', $.proxy(this.fullScreenResize, this));
1133
1133
  $(document.body).css('overflow', '');
1134
-
1134
+
1135
1135
  html = this.getCode();
1136
-
1136
+
1137
1137
  this.$box.removeClass('redactor_box_fullscreen').css('width', 'auto');
1138
-
1138
+
1139
1139
  this.tmpspan.after(this.$box).remove();
1140
-
1140
+
1141
1141
  this.$editor = this.enable(html);
1142
-
1142
+
1143
1143
  this.observeImages();
1144
1144
  this.observeAutoResize();
1145
1145
  this.$box.find('.redactor_resizer').show();
1146
-
1146
+
1147
1147
  $(this.doc).click($.proxy(this.hideAllDropDown, this));
1148
1148
  // focus always on page
1149
1149
  $(this.doc).click($.proxy(function(e) { this.$editor.focus(); }, this));
1150
-
1150
+
1151
1151
  this.syncCode();
1152
-
1152
+
1153
1153
  this.$frame.css('height', this.height);
1154
1154
  this.$el.css('height', this.height);
1155
1155
  this.focus();
@@ -1158,12 +1158,12 @@ var RTOOLBAR = {};
1158
1158
  fullScreenResize: function()
1159
1159
  {
1160
1160
  if (this.opts.fullscreen === false) return;
1161
-
1161
+
1162
1162
  var hfix = 42;
1163
1163
  if (this.opts.air) hfix = 2;
1164
-
1165
- var height = $(window).height() - hfix;
1166
-
1164
+
1165
+ var height = $(window).height() - hfix;
1166
+
1167
1167
  this.$box.width($(window).width() - 2);
1168
1168
  this.$frame.height(height);
1169
1169
  this.$el.height(height);
@@ -1173,10 +1173,10 @@ var RTOOLBAR = {};
1173
1173
  buildResizer: function()
1174
1174
  {
1175
1175
  if (this.opts.resize === false) return false;
1176
-
1176
+
1177
1177
  this.$resizer = $('<div class="redactor_resizer">&mdash;</div>');
1178
1178
  this.$box.append(this.$resizer);
1179
-
1179
+
1180
1180
  this.$resizer.mousedown($.proxy(this.initResize, this));
1181
1181
 
1182
1182
  },
@@ -1221,11 +1221,11 @@ var RTOOLBAR = {};
1221
1221
  var y = e.pageY;
1222
1222
  if (this.null_point === false) this.null_point = y;
1223
1223
  if (this.h_new === false) this.h_new = this.element_resize.height();
1224
-
1224
+
1225
1225
  var s_new = (this.h_new + y - this.null_point) - 10;
1226
-
1226
+
1227
1227
  if (s_new <= 30) return true;
1228
-
1228
+
1229
1229
  if (s_new >= 0)
1230
1230
  {
1231
1231
  this.element_resize.get(0).style.height = s_new + 'px';
@@ -1238,10 +1238,10 @@ var RTOOLBAR = {};
1238
1238
  $(document).unbind('mousedown', this.startResizeHdl);
1239
1239
  $(document).unbind('mouseup', this.stopResizeHdl);
1240
1240
  $(this.splitter).unbind('mouseup', this.stopResizeHdl);
1241
-
1241
+
1242
1242
  this.element_resize.get(0).style.visibility = 'visible';
1243
1243
  },
1244
-
1244
+
1245
1245
  // RESIZE IMAGES
1246
1246
  resizeImage: function(resize)
1247
1247
  {
@@ -1268,17 +1268,17 @@ var RTOOLBAR = {};
1268
1268
  start_x = Math.round(e.pageX - $(resize).eq(0).offset().left);
1269
1269
  start_y = Math.round(e.pageY - $(resize).eq(0).offset().top);
1270
1270
  });
1271
-
1271
+
1272
1272
  $(resize).mouseup($.proxy(function(e)
1273
1273
  {
1274
1274
  clicked = false;
1275
1275
  this.syncCode();
1276
1276
  }, this));
1277
-
1277
+
1278
1278
  $(resize).click($.proxy(function(e)
1279
1279
  {
1280
1280
  if (clicker) this.imageEdit(e);
1281
-
1281
+
1282
1282
  }, this));
1283
1283
 
1284
1284
  $(resize).mousemove(function(e)
@@ -1286,17 +1286,17 @@ var RTOOLBAR = {};
1286
1286
  if (clicked)
1287
1287
  {
1288
1288
  clicker = false;
1289
-
1289
+
1290
1290
  var mouse_x = Math.round(e.pageX - $(this).eq(0).offset().left) - start_x;
1291
1291
  var mouse_y = Math.round(e.pageY - $(this).eq(0).offset().top) - start_y;
1292
-
1292
+
1293
1293
  var div_h = $(resize).height();
1294
-
1294
+
1295
1295
  var new_h = parseInt(div_h)+mouse_y;
1296
1296
  var new_w = new_h*ratio;
1297
-
1298
-
1299
-
1297
+
1298
+
1299
+
1300
1300
  if(x==1 || (typeof(x) == "number" && new_w < x && new_w > min_w) ){ $(resize).width(new_w); }
1301
1301
  if(y==1 || (typeof(y) == "number" && new_h < y && new_h > min_h) ){ $(resize).height(new_h); }
1302
1302
  start_x = Math.round(e.pageX - $(this).eq(0).offset().left);
@@ -1319,12 +1319,12 @@ var RTOOLBAR = {};
1319
1319
  {
1320
1320
  var rows = $('#redactor_table_rows').val();
1321
1321
  var columns = $('#redactor_table_columns').val();
1322
-
1322
+
1323
1323
  var table_box = $('<div></div>');
1324
-
1324
+
1325
1325
  var tableid = Math.floor(Math.random() * 99999);
1326
1326
  var table = $('<table id="table' + tableid + '"><tbody></tbody></table>');
1327
-
1327
+
1328
1328
  for (var i = 0; i < rows; i++)
1329
1329
  {
1330
1330
  var row = $('<tr></tr>');
@@ -1335,16 +1335,16 @@ var RTOOLBAR = {};
1335
1335
  }
1336
1336
  $(table).append(row);
1337
1337
  }
1338
-
1338
+
1339
1339
  $(table_box).append(table);
1340
1340
  var html = $(table_box).html();
1341
-
1341
+
1342
1342
  if ($.browser.msie) html += '<p></p>';
1343
1343
  else html += '<p>&nbsp;</p>';
1344
1344
 
1345
1345
  this.execCommand('inserthtml', html);
1346
1346
  this.modalClose();
1347
-
1347
+
1348
1348
  this.$table = $(this.doc).find('body').find('#table' + tableid);
1349
1349
  this.$table.click($.proxy(this.tableObserver, this));
1350
1350
  },
@@ -1354,15 +1354,15 @@ var RTOOLBAR = {};
1354
1354
 
1355
1355
  this.$table_tr = this.$table.find('tr');
1356
1356
  this.$table_td = this.$table.find('td');
1357
-
1357
+
1358
1358
  this.$table_td.removeClass('current');
1359
-
1359
+
1360
1360
  this.$tbody = $(e.target).parents('tbody');
1361
1361
  this.$thead = $(this.$table).find('thead');
1362
-
1362
+
1363
1363
  this.$current_td = $(e.target);
1364
1364
  this.$current_td.addClass('current');
1365
-
1365
+
1366
1366
  this.$current_tr = $(e.target).parents('tr');
1367
1367
  },
1368
1368
  deleteTable: function()
@@ -1379,12 +1379,12 @@ var RTOOLBAR = {};
1379
1379
  deleteColumn: function()
1380
1380
  {
1381
1381
  var index = $(this.$current_td).get(0).cellIndex;
1382
-
1382
+
1383
1383
  $(this.$table).find('tr').each(function()
1384
1384
  {
1385
1385
  $(this).find('td').eq(index).remove();
1386
1386
  });
1387
-
1387
+
1388
1388
  this.syncCode();
1389
1389
  },
1390
1390
  addHead: function()
@@ -1445,10 +1445,10 @@ var RTOOLBAR = {};
1445
1445
  this.$table_tr.each(function(i,s)
1446
1446
  {
1447
1447
  var current = $(s).find('td').eq(index);
1448
-
1448
+
1449
1449
  var td = current.clone();
1450
1450
  td.html('&nbsp;');
1451
-
1451
+
1452
1452
  if (type == 'after') $(current).after(td);
1453
1453
  else $(current).before(td);
1454
1454
 
@@ -1516,13 +1516,13 @@ var RTOOLBAR = {};
1516
1516
  var parent = $(el).parent();
1517
1517
 
1518
1518
  $(el).attr('alt', $('#redactor_file_alt').val());
1519
-
1519
+
1520
1520
  var floating = $('#redactor_form_image_align').val();
1521
-
1521
+
1522
1522
  if (floating == 'left') $(el).css({ 'float': 'left', margin: '0 10px 10px 0' });
1523
1523
  else if (floating == 'right') $(el).css({ 'float': 'right', margin: '0 0 10px 10px' });
1524
1524
  else $(el).css({ 'float': 'none', margin: '0' });
1525
-
1525
+
1526
1526
  // as link
1527
1527
  var link = $.trim($('#redactor_file_link').val());
1528
1528
  if (link !== '')
@@ -1540,7 +1540,7 @@ var RTOOLBAR = {};
1540
1540
  this.modalClose();
1541
1541
  this.observeImages();
1542
1542
  this.syncCode();
1543
-
1543
+
1544
1544
  },
1545
1545
  showImage: function()
1546
1546
  {
@@ -1552,13 +1552,13 @@ var RTOOLBAR = {};
1552
1552
  if (this.opts.imageGetJson !== false)
1553
1553
  {
1554
1554
  $.getJSON(this.opts.imageGetJson, $.proxy(function(data) {
1555
-
1555
+
1556
1556
  $.each(data, $.proxy(function(key, val)
1557
1557
  {
1558
1558
  var img = $('<img src="' + val.thumb + '" rel="' + val.image + '" />');
1559
1559
  $('#redactor_image_box').append(img);
1560
1560
  $(img).click($.proxy(this.imageSetThumb, this));
1561
-
1561
+
1562
1562
  }, this));
1563
1563
 
1564
1564
  }, this));
@@ -1567,7 +1567,7 @@ var RTOOLBAR = {};
1567
1567
  {
1568
1568
  $('#redactor_tabs a').eq(1).remove();
1569
1569
  }
1570
-
1570
+
1571
1571
  if (this.opts.imageUpload !== false)
1572
1572
  {
1573
1573
  // dragupload
@@ -1586,16 +1586,16 @@ var RTOOLBAR = {};
1586
1586
  else
1587
1587
  {
1588
1588
  $('.redactor_tab').hide();
1589
- if (this.opts.imageGetJson === false)
1589
+ if (this.opts.imageGetJson === false)
1590
1590
  {
1591
1591
  $('#redactor_tabs').remove();
1592
1592
  $('#redactor_tab3').show();
1593
1593
  }
1594
- else
1594
+ else
1595
1595
  {
1596
1596
  var tabs = $('#redactor_tabs a');
1597
1597
  tabs.eq(0).remove();
1598
- tabs.eq(1).addClass('redactor_tabs_act');
1598
+ tabs.eq(1).addClass('redactor_tabs_act');
1599
1599
  $('#redactor_tab2').show();
1600
1600
  }
1601
1601
  }
@@ -1603,7 +1603,7 @@ var RTOOLBAR = {};
1603
1603
  $('#redactor_upload_btn').click($.proxy(this.imageUploadCallbackLink, this));
1604
1604
 
1605
1605
  }, this);
1606
-
1606
+
1607
1607
  this.modalInit(RLANG.image, '<%= asset_path "redactor/plugins/image.html" %>', 570, handler, true);
1608
1608
 
1609
1609
  },
@@ -1616,21 +1616,21 @@ var RTOOLBAR = {};
1616
1616
  if ($('#redactor_file_link').val() !== '')
1617
1617
  {
1618
1618
  var data = '<img src="' + $('#redactor_file_link').val() + '" />';
1619
-
1619
+
1620
1620
  this._imageSet(data);
1621
1621
  }
1622
1622
  else this.modalClose();
1623
1623
  },
1624
1624
  imageUploadCallback: function(data)
1625
- {
1625
+ {
1626
1626
  this._imageSet(data);
1627
1627
  },
1628
1628
  _imageSet: function(html)
1629
1629
  {
1630
1630
  html = '<p>' + html + '</p>';
1631
-
1631
+
1632
1632
  this.focus();
1633
-
1633
+
1634
1634
  if ($.browser.msie)
1635
1635
  {
1636
1636
  $(this.doc.getElementById('span' + this.spanid)).after(html).remove();
@@ -1640,18 +1640,18 @@ var RTOOLBAR = {};
1640
1640
  {
1641
1641
  this.execCommand('inserthtml', html);
1642
1642
  }
1643
-
1643
+
1644
1644
  this.modalClose();
1645
1645
  this.observeImages();
1646
1646
  },
1647
-
1647
+
1648
1648
  // INSERT LINK
1649
1649
  showLink: function()
1650
1650
  {
1651
1651
  var handler = $.proxy(function()
1652
1652
  {
1653
1653
  var sel = this.getSelection();
1654
-
1654
+
1655
1655
  if ($.browser.msie)
1656
1656
  {
1657
1657
  var parent = this.getParentNode();
@@ -1665,11 +1665,11 @@ var RTOOLBAR = {};
1665
1665
  {
1666
1666
  if (this.oldIE()) var text = sel.text;
1667
1667
  else var text = sel.toString();
1668
-
1668
+
1669
1669
  var url = '';
1670
1670
 
1671
1671
  this.spanid = Math.floor(Math.random() * 99999);
1672
-
1672
+
1673
1673
  var html = '<span id="span' + this.spanid + '">' + text + '</span>';
1674
1674
  if (text != '') html = '<span id="span' + this.spanid + '">' + text + '</span>';
1675
1675
  this.execCommand('inserthtml', html);
@@ -1689,12 +1689,12 @@ var RTOOLBAR = {};
1689
1689
  var url = '';
1690
1690
  }
1691
1691
  }
1692
-
1692
+
1693
1693
  $('.redactor_link_text').val(text);
1694
1694
  $('#redactor_link_url').val(url).focus();
1695
-
1695
+
1696
1696
  $('#redactor_insert_link_btn').click($.proxy(this.insertLink, this));
1697
-
1697
+
1698
1698
  if (this.opts.linkFileUpload === false)
1699
1699
  {
1700
1700
  $('#redactor_tabs a').eq(3).remove();
@@ -1702,7 +1702,7 @@ var RTOOLBAR = {};
1702
1702
  else
1703
1703
  {
1704
1704
  // dragupload
1705
- if ($('#redactor_file').size() != 0)
1705
+ if ($('#redactor_file').size() != 0)
1706
1706
  {
1707
1707
  $('#redactor_file').dragupload(
1708
1708
  {
@@ -1710,22 +1710,22 @@ var RTOOLBAR = {};
1710
1710
  success: $.proxy(this.insertLinkFile, this)
1711
1711
  });
1712
1712
  }
1713
-
1713
+
1714
1714
  // ajax upload
1715
1715
  this.uploadInit('redactor_file', { auto: true, url: this.opts.linkFileUpload, success: $.proxy(this.insertLinkFile, this) });
1716
1716
  }
1717
1717
 
1718
1718
  }, this);
1719
-
1719
+
1720
1720
  this.modalInit(RLANG.link, '<%= asset_path "redactor/plugins/link.html" %>', 460, handler);
1721
1721
 
1722
1722
  },
1723
1723
  insertLink: function()
1724
1724
  {
1725
1725
  var tab_selected = $('#redactor_tab_selected').val();
1726
-
1726
+
1727
1727
  var link = '', text = '';
1728
-
1728
+
1729
1729
  if (tab_selected == 1) // url
1730
1730
  {
1731
1731
  link = $('#redactor_link_url').val();
@@ -1784,7 +1784,7 @@ var RTOOLBAR = {};
1784
1784
  {
1785
1785
  $('#redactor_file').dragupload(
1786
1786
  {
1787
- url: this.opts.fileUpload,
1787
+ url: this.opts.fileUpload,
1788
1788
  success: $.proxy(function(data)
1789
1789
  {
1790
1790
  this.fileUploadCallback(data);
@@ -1803,9 +1803,9 @@ var RTOOLBAR = {};
1803
1803
  fileUploadCallback: function(data)
1804
1804
  {
1805
1805
  // chrome fix
1806
- if ($.browser.webkit && !!window.chrome) data = data + '&nbsp;';
1806
+ if ($.browser.webkit && !!window.chrome) data = data + '&nbsp;';
1807
1807
 
1808
- if ($.browser.msie)
1808
+ if ($.browser.msie)
1809
1809
  {
1810
1810
  $(this.doc.getElementById('span' + this.spanid)).after(data).remove();
1811
1811
  this.syncCode();
@@ -1813,10 +1813,10 @@ var RTOOLBAR = {};
1813
1813
  else this.execCommand('inserthtml', data);
1814
1814
 
1815
1815
  this.modalClose();
1816
- },
1817
-
1818
-
1819
-
1816
+ },
1817
+
1818
+
1819
+
1820
1820
  // MODAL
1821
1821
  modalInit: function(title, url, width, handler, scroll)
1822
1822
  {
@@ -1842,7 +1842,7 @@ var RTOOLBAR = {};
1842
1842
  $('#redactor_modal_close').click($.proxy(this.modalClose, this));
1843
1843
 
1844
1844
  this.hdlModalClose = $.proxy(function(e) { if( e.keyCode == 27) this.modalClose(); }, this);
1845
-
1845
+
1846
1846
  $(document).keyup(this.hdlModalClose);
1847
1847
  $(this.doc).keyup(this.hdlModalClose);
1848
1848
 
@@ -1861,7 +1861,7 @@ var RTOOLBAR = {};
1861
1861
 
1862
1862
  $('#redactor_modal_inner').html(data);
1863
1863
  $('#redactor_modal_header').html(title);
1864
-
1864
+
1865
1865
  // tabs
1866
1866
  if ($('#redactor_tabs').size() != 0)
1867
1867
  {
@@ -1875,7 +1875,7 @@ var RTOOLBAR = {};
1875
1875
  $('.redactor_tab').hide();
1876
1876
  $('#redactor_tab' + i).show();
1877
1877
  $('#redactor_tab_selected').val(i);
1878
-
1878
+
1879
1879
  var height = $('#redactor_modal').outerHeight();
1880
1880
  $('#redactor_modal').css('margin-top', '-' + (height+10)/2 + 'px');
1881
1881
  });
@@ -1883,26 +1883,26 @@ var RTOOLBAR = {};
1883
1883
  }
1884
1884
 
1885
1885
  $('#redactor_btn_modal_close').click($.proxy(this.modalClose, this));
1886
-
1886
+
1887
1887
  // callback
1888
1888
  if (typeof(handler) == 'function') handler();
1889
-
1889
+
1890
1890
  // setup
1891
1891
  var height = $('#redactor_modal').outerHeight();
1892
-
1892
+
1893
1893
  $('#redactor_modal').css({ width: width + 'px', height: 'auto', marginTop: '-' + (height+10)/2 + 'px', marginLeft: '-' + (width+60)/2 + 'px' }).fadeIn('fast');
1894
1894
 
1895
1895
  if (scroll === true)
1896
1896
  {
1897
1897
  $('#redactor_image_box').height(300).css('overflow', 'auto');
1898
- }
1898
+ }
1899
1899
 
1900
1900
  }, this)
1901
1901
  });
1902
1902
  },
1903
1903
  modalClose: function()
1904
1904
  {
1905
-
1905
+
1906
1906
  $('#redactor_modal_close').unbind('click', this.modalClose);
1907
1907
  $('#redactor_modal').fadeOut('fast', $.proxy(function()
1908
1908
  {
@@ -1913,7 +1913,7 @@ var RTOOLBAR = {};
1913
1913
  $('#redactor_modal_overlay').hide();
1914
1914
  $('#redactor_modal_overlay').unbind('click', this.modalClose);
1915
1915
  }
1916
-
1916
+
1917
1917
  $(document).unbind('keyup', this.hdlModalClose);
1918
1918
  $(this.doc).unbind('keyup', this.hdlModalClose);
1919
1919
 
@@ -1935,7 +1935,7 @@ var RTOOLBAR = {};
1935
1935
  };
1936
1936
 
1937
1937
  $.extend(this.uploadOptions, options);
1938
-
1938
+
1939
1939
  // Test input or form
1940
1940
  if ($('#' + element).size() != 0 && $('#' + element).get(0).tagName == 'INPUT')
1941
1941
  {
@@ -1946,9 +1946,9 @@ var RTOOLBAR = {};
1946
1946
  {
1947
1947
  this.element = $('#' + element);
1948
1948
  }
1949
-
1949
+
1950
1950
  this.element_action = this.element.attr('action');
1951
-
1951
+
1952
1952
  // Auto or trigger
1953
1953
  if (this.uploadOptions.auto)
1954
1954
  {
@@ -1957,7 +1957,7 @@ var RTOOLBAR = {};
1957
1957
  this.element.submit(function(e) { return false; });
1958
1958
  this.uploadSubmit();
1959
1959
  }, this));
1960
-
1960
+
1961
1961
  }
1962
1962
  else if (this.uploadOptions.trigger)
1963
1963
  {
@@ -1971,17 +1971,17 @@ var RTOOLBAR = {};
1971
1971
  uploadFrame : function()
1972
1972
  {
1973
1973
  this.id = 'f' + Math.floor(Math.random() * 99999);
1974
-
1974
+
1975
1975
  var d = document.createElement('div');
1976
1976
  var iframe = '<iframe style="display:none" src="about:blank" id="'+this.id+'" name="'+this.id+'"></iframe>';
1977
1977
  d.innerHTML = iframe;
1978
1978
  document.body.appendChild(d);
1979
-
1979
+
1980
1980
  // Start
1981
1981
  if (this.uploadOptions.start) this.uploadOptions.start();
1982
-
1982
+
1983
1983
  $('#' + this.id).load($.proxy(this.uploadLoaded, this));
1984
-
1984
+
1985
1985
  return this.id;
1986
1986
  },
1987
1987
  uploadForm : function(f, name)
@@ -1991,7 +1991,7 @@ var RTOOLBAR = {};
1991
1991
  var formId = 'redactorUploadForm' + this.id;
1992
1992
  var fileId = 'redactorUploadFile' + this.id;
1993
1993
  this.form = $('<form action="' + this.uploadOptions.url + '" method="POST" target="' + name + '" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
1994
-
1994
+
1995
1995
  var oldElement = this.uploadOptions.input;
1996
1996
  var newElement = $(oldElement).clone();
1997
1997
  $(oldElement).attr('id', fileId);
@@ -2000,8 +2000,8 @@ var RTOOLBAR = {};
2000
2000
  $(this.form).css('position', 'absolute');
2001
2001
  $(this.form).css('top', '-2000px');
2002
2002
  $(this.form).css('left', '-2000px');
2003
- $(this.form).appendTo('body');
2004
-
2003
+ $(this.form).appendTo('body');
2004
+
2005
2005
  this.form.submit();
2006
2006
  }
2007
2007
  else
@@ -2010,10 +2010,10 @@ var RTOOLBAR = {};
2010
2010
  f.attr('method', 'POST');
2011
2011
  f.attr('enctype', 'multipart/form-data');
2012
2012
  f.attr('action', this.uploadOptions.url);
2013
-
2013
+
2014
2014
  this.element.submit();
2015
2015
  }
2016
-
2016
+
2017
2017
  },
2018
2018
  uploadLoaded : function()
2019
2019
  {
@@ -2022,17 +2022,17 @@ var RTOOLBAR = {};
2022
2022
  if (i.contentDocument) var d = i.contentDocument;
2023
2023
  else if (i.contentWindow) var d = i.contentWindow.document;
2024
2024
  else var d = window.frames[this.id].document;
2025
-
2025
+
2026
2026
  if (d.location.href == "about:blank") return true;
2027
-
2027
+
2028
2028
  // Success
2029
2029
  if (this.uploadOptions.success) this.uploadOptions.success(d.body.innerHTML);
2030
-
2030
+
2031
2031
  this.element.attr('action', this.element_action);
2032
2032
  this.element.attr('target', '');
2033
-
2033
+
2034
2034
  },
2035
-
2035
+
2036
2036
  // UTILITY
2037
2037
  markerIE: function()
2038
2038
  {
@@ -2044,7 +2044,7 @@ var RTOOLBAR = {};
2044
2044
  if ($.browser.msie && parseInt($.browser.version, 10) < 9) return true;
2045
2045
  return false;
2046
2046
  },
2047
- outerHTML: function(s)
2047
+ outerHTML: function(s)
2048
2048
  {
2049
2049
  return $("<p>").append($(s).eq(0).clone()).html();
2050
2050
  },
@@ -2054,50 +2054,50 @@ var RTOOLBAR = {};
2054
2054
  }
2055
2055
 
2056
2056
  };
2057
-
2058
-
2057
+
2058
+
2059
2059
  // API
2060
- $.fn.getDoc = function()
2060
+ $.fn.getDoc = function()
2061
2061
  {
2062
2062
  return $(this.data('redactor').doc);
2063
2063
  };
2064
-
2065
- $.fn.getFrame = function()
2064
+
2065
+ $.fn.getFrame = function()
2066
2066
  {
2067
2067
  return this.data('redactor').$frame;
2068
2068
  };
2069
-
2070
- $.fn.getEditor = function()
2069
+
2070
+ $.fn.getEditor = function()
2071
2071
  {
2072
2072
  return this.data('redactor').$editor;
2073
2073
  };
2074
-
2075
- $.fn.getCode = function()
2074
+
2075
+ $.fn.getCode = function()
2076
2076
  {
2077
2077
  return this.data('redactor').getCode();
2078
2078
  };
2079
-
2079
+
2080
2080
  $.fn.setCode = function(html)
2081
2081
  {
2082
2082
  this.data('redactor').setCode(html);
2083
2083
  };
2084
-
2084
+
2085
2085
  $.fn.insertHtml = function(html)
2086
2086
  {
2087
2087
  this.data('redactor').insertHtml(html);
2088
2088
  };
2089
-
2089
+
2090
2090
  $.fn.destroyEditor = function()
2091
2091
  {
2092
2092
  this.data('redactor').destroy();
2093
2093
  this.removeData('redactor');
2094
2094
  };
2095
-
2095
+
2096
2096
  $.fn.setFocus = function()
2097
2097
  {
2098
2098
  this.data('redactor').focus();
2099
2099
  };
2100
-
2100
+
2101
2101
  $.fn.execCommand = function(cmd, param)
2102
2102
  {
2103
2103
  this.data('redactor').execCommand(cmd, param);
@@ -2107,66 +2107,66 @@ var RTOOLBAR = {};
2107
2107
 
2108
2108
  /*
2109
2109
  Plugin Drag and drop Upload v1.0.1
2110
- http://imperavi.com/
2110
+ http://imperavi.com/
2111
2111
  Copyright 2012, Imperavi Ltd.
2112
2112
  */
2113
2113
  (function($){
2114
-
2115
- // Initialization
2114
+
2115
+ // Initialization
2116
2116
  $.fn.dragupload = function(options)
2117
- {
2117
+ {
2118
2118
  return this.each(function() {
2119
2119
  var obj = new Construct(this, options);
2120
2120
  obj.init();
2121
2121
  });
2122
2122
  };
2123
-
2124
- // Options and variables
2123
+
2124
+ // Options and variables
2125
2125
  function Construct(el, options) {
2126
2126
 
2127
2127
  this.opts = $.extend({
2128
-
2128
+
2129
2129
  url: false,
2130
2130
  success: false,
2131
2131
  preview: false,
2132
-
2132
+
2133
2133
  text: RLANG.drop_file_here,
2134
2134
  atext: RLANG.or_choose
2135
-
2135
+
2136
2136
  }, options);
2137
-
2137
+
2138
2138
  this.$el = $(el);
2139
2139
  }
2140
2140
 
2141
2141
  // Functionality
2142
2142
  Construct.prototype = {
2143
2143
  init: function()
2144
- {
2145
- if (!$.browser.opera && !$.browser.msie)
2146
- {
2144
+ {
2145
+ if (!$.browser.opera && !$.browser.msie)
2146
+ {
2147
2147
 
2148
2148
  this.droparea = $('<div class="redactor_droparea"></div>');
2149
- this.dropareabox = $('<div class="redactor_dropareabox">' + this.opts.text + '</div>');
2149
+ this.dropareabox = $('<div class="redactor_dropareabox">' + this.opts.text + '</div>');
2150
2150
  this.dropalternative = $('<div class="redactor_dropalternative">' + this.opts.atext + '</div>');
2151
-
2151
+
2152
2152
  this.droparea.append(this.dropareabox);
2153
-
2153
+
2154
2154
  this.$el.before(this.droparea);
2155
2155
  this.$el.before(this.dropalternative);
2156
2156
 
2157
2157
  // drag over
2158
2158
  this.dropareabox.bind('dragover', $.proxy(function() { return this.ondrag(); }, this));
2159
-
2159
+
2160
2160
  // drag leave
2161
2161
  this.dropareabox.bind('dragleave', $.proxy(function() { return this.ondragleave(); }, this));
2162
-
2162
+
2163
2163
  // drop
2164
2164
  this.dropareabox.get(0).ondrop = $.proxy(function(event)
2165
2165
  {
2166
2166
  event.preventDefault();
2167
-
2167
+
2168
2168
  this.dropareabox.removeClass('hover').addClass('drop');
2169
-
2169
+
2170
2170
  var file = event.dataTransfer.files[0];
2171
2171
 
2172
2172
  var fd = new FormData();
@@ -2212,14 +2212,14 @@ var RTOOLBAR = {};
2212
2212
  var url1 = /(^|&lt;|\s)(www\..+?\..+?)(\s|&gt;|$)/g,
2213
2213
  url2 = /(^|&lt;|\s)(((https?|ftp):\/\/|mailto:).+?)(\s|&gt;|$)/g,
2214
2214
 
2215
- linkifyThis = function ()
2215
+ linkifyThis = function ()
2216
2216
  {
2217
2217
  var childNodes = this.childNodes,
2218
2218
  i = childNodes.length;
2219
2219
  while(i--)
2220
2220
  {
2221
2221
  var n = childNodes[i];
2222
- if (n.nodeType == 3)
2222
+ if (n.nodeType == 3)
2223
2223
  {
2224
2224
  var html = n.nodeValue;
2225
2225
  if (html)
@@ -2239,7 +2239,7 @@ var RTOOLBAR = {};
2239
2239
  }
2240
2240
  }
2241
2241
  };
2242
-
2242
+
2243
2243
  $.fn.linkify = function ()
2244
2244
  {
2245
2245
  this.each(linkifyThis);