knitkit 3.0.0 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. checksums.yaml +4 -4
  2. data/{public → app/assets}/images/check.png +0 -0
  3. data/{public → app/assets}/images/credit_card.png +0 -0
  4. data/{public → app/assets}/images/inline_edit/close.png +0 -0
  5. data/{public → app/assets}/images/knitkit/icons/document.png +0 -0
  6. data/{public → app/assets}/images/knitkit/icons/multi_doc.png +0 -0
  7. data/{public → app/assets}/images/knitkit/logo.png +0 -0
  8. data/{public → app/assets}/images/knitkit/splash/images/add-site.png +0 -0
  9. data/app/assets/images/knitkit/splash/images/add_website_105x105-active.png +0 -0
  10. data/app/assets/images/knitkit/splash/images/add_website_105x105.png +0 -0
  11. data/{public → app/assets}/images/knitkit/splash/images/adjust-site.png +0 -0
  12. data/{public → app/assets}/images/knitkit/splash/images/browse-site.png +0 -0
  13. data/app/assets/images/knitkit/splash/images/browse_db_105x105-active.png +0 -0
  14. data/app/assets/images/knitkit/splash/images/browse_db_105x105.png +0 -0
  15. data/app/assets/images/knitkit/splash/images/console_105x105-active.png +0 -0
  16. data/app/assets/images/knitkit/splash/images/console_105x105.png +0 -0
  17. data/{public → app/assets}/images/knitkit/splash/images/find-themes.png +0 -0
  18. data/app/assets/images/knitkit/splash/images/find_themes_105x105-active.png +0 -0
  19. data/app/assets/images/knitkit/splash/images/find_themes_105x105.png +0 -0
  20. data/app/assets/images/knitkit/splash/images/learn_more_105x105-active.png +0 -0
  21. data/app/assets/images/knitkit/splash/images/learn_more_105x105.png +0 -0
  22. data/{public → app/assets}/images/knitkit/splash/images/settings.png +0 -0
  23. data/{public → app/assets}/images/knitkit/splash/images/tutorials.png +0 -0
  24. data/app/assets/images/knitkit/splash/splash.png +0 -0
  25. data/app/assets/images/widgets/manage_profile/contact_information.png +0 -0
  26. data/app/assets/images/widgets/manage_profile/password.png +0 -0
  27. data/app/assets/images/widgets/manage_profile/user_information.png +0 -0
  28. data/app/assets/javascripts/erp_app/desktop/applications/knitkit/app.js +24 -0
  29. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/articles_grid_panel.js +15 -12
  30. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/center_region.js +69 -48
  31. data/app/assets/javascripts/erp_app/desktop/applications/knitkit/comments_grid_panel.js +214 -0
  32. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/east_region.js +0 -0
  33. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/file_assets_panel.js +17 -19
  34. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/image_assets_data_view.js +13 -3
  35. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/image_assets_panel.js +59 -48
  36. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/east_region/widgets_panel.js +0 -0
  37. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/inquiries_grid_panel.js +2 -2
  38. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/module.js +2 -2
  39. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/publish_window.js +0 -0
  40. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/published_grid_panel.js +1 -1
  41. data/app/assets/javascripts/erp_app/desktop/applications/knitkit/splash_screen.js +268 -0
  42. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/top_menu/main_menu.js +85 -33
  43. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/top_menu/websites_combo.js +0 -0
  44. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/versions_grid_panel.js +5 -28
  45. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/article.js +22 -8
  46. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/document.js +143 -25
  47. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/host.js +5 -1
  48. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/menu.js +2 -0
  49. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/section.js +181 -65
  50. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/helpers/website_nav_items.js +0 -0
  51. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/hosts_tree_panel.js +0 -0
  52. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/menu_tree_panel.js +0 -0
  53. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/site_contents_tree_panel.js +121 -116
  54. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/themes_tree_panel.js +101 -10
  55. data/{public → app/assets}/javascripts/erp_app/desktop/applications/knitkit/west_region/west_region.js +9 -5
  56. data/app/assets/javascripts/knitkit-web.js +22 -0
  57. data/app/assets/javascripts/knitkit/additional-methods.min.js +4 -0
  58. data/app/assets/javascripts/knitkit/bootstrap.min.js +7 -0
  59. data/app/assets/javascripts/knitkit/captcha.js +154 -0
  60. data/{public → app/assets}/javascripts/knitkit/confirm-bootstrap.js +1 -1
  61. data/{public → app/assets}/javascripts/knitkit/inline_editing.js +1 -1
  62. data/{public → app/assets}/javascripts/knitkit/jquery.maskedinput.min.js +0 -0
  63. data/app/assets/javascripts/knitkit/jquery.validate.min.js +4 -0
  64. data/app/assets/javascripts/knitkit/js.cookie.js +145 -0
  65. data/{public → app/assets}/javascripts/knitkit/theme.js +0 -0
  66. data/app/assets/stylesheets/erp_app/desktop/applications/knitkit/app.css +12 -0
  67. data/{public → app/assets}/stylesheets/erp_app/desktop/applications/knitkit/knitkit.css +23 -33
  68. data/app/assets/stylesheets/erp_app/shared/knitkit_shared.css +21 -0
  69. data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.eot +0 -0
  70. data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.svg +288 -0
  71. data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.ttf +0 -0
  72. data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.woff +0 -0
  73. data/app/assets/stylesheets/fonts/glyphicons-halflings-regular.woff2 +0 -0
  74. data/app/assets/stylesheets/knitkit-web.css +16 -0
  75. data/app/assets/stylesheets/knitkit/bootstrap.min.css +5 -0
  76. data/app/assets/stylesheets/knitkit/captcha.css +59 -0
  77. data/app/assets/stylesheets/knitkit/custom.css +144 -0
  78. data/{public → app/assets}/stylesheets/knitkit/inline_editing.css +0 -0
  79. data/app/assets/stylesheets/knitkit/submenu.css +93 -0
  80. data/app/controllers/api/v1/websites_controller.rb +14 -0
  81. data/app/controllers/captcha_controller.rb +53 -0
  82. data/app/controllers/knitkit/base_controller.rb +1 -5
  83. data/app/controllers/knitkit/erp_app/desktop/app_controller.rb +2 -9
  84. data/app/controllers/knitkit/erp_app/desktop/articles_controller.rb +20 -7
  85. data/app/controllers/knitkit/erp_app/desktop/file_assets_controller.rb +38 -28
  86. data/app/controllers/knitkit/erp_app/desktop/image_assets_controller.rb +16 -9
  87. data/app/controllers/knitkit/erp_app/desktop/online_document_sections_controller.rb +69 -15
  88. data/app/controllers/knitkit/erp_app/desktop/position_controller.rb +45 -58
  89. data/app/controllers/knitkit/erp_app/desktop/theme_controller.rb +64 -29
  90. data/app/controllers/knitkit/erp_app/desktop/website_controller.rb +36 -13
  91. data/app/controllers/knitkit/erp_app/desktop/website_host_controller.rb +12 -0
  92. data/app/controllers/knitkit/erp_app/desktop/website_nav_controller.rb +4 -11
  93. data/app/controllers/knitkit/erp_app/desktop/website_nav_item_controller.rb +2 -9
  94. data/app/controllers/knitkit/erp_app/desktop/website_section_controller.rb +56 -20
  95. data/app/controllers/knitkit/online_document_sections_controller.rb +9 -3
  96. data/app/mailers/website_inquiry_mailer.rb +11 -3
  97. data/app/models/content.rb +16 -6
  98. data/app/models/documented_item.rb +12 -1
  99. data/app/models/online_document_section.rb +54 -20
  100. data/app/models/published_website.rb +16 -0
  101. data/app/models/theme.rb +53 -47
  102. data/app/models/website.rb +172 -191
  103. data/app/models/website_section.rb +64 -30
  104. data/app/views/knitkit/blogs/show.html.erb +5 -2
  105. data/app/views/layouts/knitkit/base.html.erb +54 -51
  106. data/app/views/menus/knitkit/_default_menu.html.erb +11 -11
  107. data/app/views/menus/knitkit/_default_section_menu.html.erb +2 -2
  108. data/app/views/menus/knitkit/_default_sub_menu.erb +27 -0
  109. data/app/views/menus/knitkit/_default_sub_section_menu.html.erb +30 -0
  110. data/app/views/website_inquiry_mailer/inquiry.html.erb +266 -0
  111. data/app/widgets/contact_us/base.rb +26 -16
  112. data/app/widgets/contact_us/javascript/contact_us.js +1 -1
  113. data/app/widgets/contact_us/views/error.html.erb +7 -3
  114. data/app/widgets/contact_us/views/index.html.erb +36 -28
  115. data/app/widgets/google_map/javascript/google_map.js +1 -1
  116. data/app/widgets/google_map/views/index.html.erb +1 -1
  117. data/app/widgets/login/javascript/login.js +1 -1
  118. data/app/widgets/login/views/index.html.erb +1 -1
  119. data/app/widgets/manage_profile/base.rb +141 -112
  120. data/app/widgets/manage_profile/javascript/manage_profile.js +2 -2
  121. data/app/widgets/manage_profile/views/_password_form.html.erb +1 -1
  122. data/app/widgets/manage_profile/views/_user_information_form.html.erb +1 -30
  123. data/app/widgets/manage_profile/views/index.html.erb +42 -40
  124. data/app/widgets/reset_password/base.rb +39 -8
  125. data/app/widgets/reset_password/javascript/reset_password.js +1 -1
  126. data/app/widgets/reset_password/views/index.html.erb +3 -3
  127. data/app/widgets/reset_password/views/invalid_reset_token.html.erb +7 -0
  128. data/app/widgets/reset_password/views/layouts/base.html.erb +1 -1
  129. data/app/widgets/reset_password/views/reset_password.html.erb +39 -0
  130. data/app/widgets/reset_password/views/reset_success.html.erb +5 -0
  131. data/app/widgets/search/base.rb +5 -5
  132. data/app/widgets/search/javascript/search.js +6 -6
  133. data/app/widgets/search/views/_inline_search_form.html.erb +23 -12
  134. data/app/widgets/search/views/_search_form.html.erb +34 -30
  135. data/app/widgets/search/views/layouts/base.html.erb +6 -1
  136. data/app/widgets/signup/base.rb +73 -30
  137. data/app/widgets/signup/javascript/signup.js +1 -1
  138. data/app/widgets/signup/views/_signup_form.html.erb +2 -1
  139. data/app/widgets/signup/views/layouts/base.html.erb +1 -1
  140. data/app/widgets/signup/views/success.html.erb +2 -3
  141. data/config/routes.rb +25 -4
  142. data/db/data_migrations/20110509223702_add_publisher_role.rb +0 -2
  143. data/db/data_migrations/20110816153456_add_knitkit_application.rb +7 -15
  144. data/db/data_migrations/20120127150505_create_website_default_configuration.rb +63 -3
  145. data/db/data_migrations/20150118180450_add_website_member_roles.rb +12 -0
  146. data/db/data_migrations/20150414150359_nest_knitkit_security_roles.rb +35 -0
  147. data/db/data_migrations/20150414173437_move_website_roles_under_website_builder.rb +19 -0
  148. data/db/migrate/20110211002317_setup_knitkit.rb +86 -39
  149. data/lib/knitkit.rb +8 -2
  150. data/lib/knitkit/config.rb +2 -3
  151. data/lib/knitkit/engine.rb +35 -4
  152. data/lib/knitkit/extensions.rb +2 -1
  153. data/lib/knitkit/extensions/action_controller/theme_support/acts_as_themed_controller.rb +1 -1
  154. data/lib/knitkit/extensions/action_mailer/theme_support/acts_as_themed_mailer.rb +1 -1
  155. data/lib/knitkit/extensions/compass_ae/mailers/user_mailer.rb +31 -0
  156. data/lib/knitkit/extensions/compass_ae/widgets/base.rb +1 -1
  157. data/lib/knitkit/extensions/railties/action_controller/captcha_helper.rb +43 -0
  158. data/lib/knitkit/extensions/railties/action_view/helpers/content_helper.rb +1 -1
  159. data/lib/knitkit/extensions/railties/action_view/helpers/menu_helper.rb +11 -1
  160. data/lib/knitkit/extensions/railties/theme_support/asset_tag_helper.rb +83 -0
  161. data/lib/knitkit/routing_filter/section_router.rb +24 -14
  162. data/lib/knitkit/version.rb +1 -1
  163. data/lib/tasks/knitkit_tasks.rake +89 -4
  164. data/lib/tasks/theme_parser.rake +85 -0
  165. data/public/fonts/glyphicons-halflings-regular.eot +0 -0
  166. data/public/fonts/glyphicons-halflings-regular.svg +288 -0
  167. data/public/fonts/glyphicons-halflings-regular.ttf +0 -0
  168. data/public/fonts/glyphicons-halflings-regular.woff +0 -0
  169. data/public/fonts/glyphicons-halflings-regular.woff2 +0 -0
  170. data/public/paypal-button.min.js +7 -0
  171. metadata +161 -82
  172. data/app/assets/javascripts/knitkit/application.js +0 -9
  173. data/app/assets/stylesheets/knitkit/application.css +0 -7
  174. data/app/mailers/document_mailer.rb +0 -10
  175. data/app/views/document_mailer/email_document.html.erb +0 -12
  176. data/app/views/knitkit/mobile/index.html.erb +0 -162
  177. data/app/views/knitkit/online_document_sections/index.html.erb +0 -279
  178. data/app/views/layouts/knitkit/online_document_sections.html.erb +0 -80
  179. data/app/views/website_inquiry_mailer/inquiry.erb +0 -24
  180. data/db/data_migrations/20120127150506_add_primary_host_to_website_configuration.rb +0 -33
  181. data/db/data_migrations/20120316150424_add_is_template_to_default_website_config.rb +0 -16
  182. data/db/data_migrations/20120809020508_update_website_and_configuration.rb +0 -82
  183. data/db/data_migrations/20121129185611_upgrade_website_role_iid.rb +0 -20
  184. data/db/migrate/20130405184234_add_use_markdown_to_section.rb +0 -19
  185. data/db/migrate/20131112013052_add_knitkit_missing_indexes.rb +0 -33
  186. data/db/migrate/20140622212723_update_website_inquiries.rb +0 -22
  187. data/db/migrate/20140911185022_add_publishing_to_website.rb +0 -5
  188. data/db/migrate/20141013073349_add_custom_fields_to_documents.rb +0 -12
  189. data/db/migrate/20141016101936_upgrade_remove_dynamic_attributes.rb +0 -13
  190. data/lib/knitkit/extensions/railties/theme_support/theme_file_resolver.rb +0 -49
  191. data/public/images/knitkit/close_window.png +0 -0
  192. data/public/images/knitkit/splash/splash.png +0 -0
  193. data/public/javascripts/erp_app/desktop/applications/knitkit/comments_grid_panel.js +0 -215
  194. data/public/javascripts/erp_app/desktop/applications/knitkit/select_roles_window.js +0 -108
  195. data/public/javascripts/erp_app/desktop/applications/knitkit/splash_screen.js +0 -170
  196. data/public/javascripts/knitkit/bootstrap-datepicker.js +0 -474
  197. data/public/javascripts/knitkit/bootstrap.min.js +0 -7
  198. data/public/javascripts/knitkit/mobile/app/view/Main.js +0 -108
  199. data/public/javascripts/knitkit/mobile/ux/slidenavigation/View.js +0 -734
  200. data/public/stylesheets/knitkit/bootstrap-responsive.min.css +0 -10
  201. data/public/stylesheets/knitkit/bootstrap.min.css +0 -7
  202. data/public/stylesheets/knitkit/custom.css +0 -122
  203. data/public/stylesheets/knitkit/datepicker.css +0 -182
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 35f3ceea0007821006cbca76128f3c66aea5eff0
4
- data.tar.gz: 391fe91b89b348a7700d28f9764c959a8028d8d0
3
+ metadata.gz: a9519e8e75b013f60179c1b6e027d8256aae8657
4
+ data.tar.gz: 29965c46fb5fd3b235e17aa45c53d43082809f59
5
5
  SHA512:
6
- metadata.gz: 21e28ca0baca8b9f90e040a47ffa9a68f6279b3b3970b3c50463894933aaa830b622140c7146175f5b9369aee14b526778b1e5fd9e6c2b8414d3316b04140ffc
7
- data.tar.gz: 73a2a52a625f305e5382ed4131e471839e81ce5fd844e1cc7ea8aad4b9fbb5e5d0e3dea631f298e5f870f3e01231c4ddf9eb6457a9c3d5a54a3519090f5fc8f3
6
+ metadata.gz: 2b2d4d334fd89d292716c1f88e47ef81074a0949103de7ef7c8a8c6ac1a4b1d2ce31448ed20acb59a7517dd967c22649e1e754b681ddacb86b6ba27370efa523
7
+ data.tar.gz: 88b683d037a27785f13ebf4e5b117e5f843824c42c170b99e09f95081d66f4fc690b56991827037edf29c558db2a4f72ced52ec02feb15b9082d9dd18d2bd1f8
File without changes
@@ -0,0 +1,24 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require ./module
14
+ //= require ./articles_grid_panel
15
+ //= require ./center_region
16
+ //= require ./comments_grid_panel
17
+ //= require ./inquiries_grid_panel
18
+ //= require ./publish_window
19
+ //= require ./published_grid_panel
20
+ //= require ./splash_screen
21
+ //= require ./versions_grid_panel
22
+ //= require_tree ./east_region
23
+ //= require_tree ./top_menu
24
+ //= require_tree ./west_region
@@ -29,11 +29,11 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.ArticlesGridPanel", {
29
29
 
30
30
  editArticle: function (record) {
31
31
  var self = this;
32
- var itemId = 'editArticle-' + record.get('id');
32
+ var itemId = 'editArticle-' + record.get('recordId');
33
33
  var editArticleWindow = Ext.ComponentQuery.query('#' + itemId).first();
34
34
 
35
35
  if (Compass.ErpApp.Utility.isBlank(editArticleWindow)) {
36
- var editArticleWindow = Ext.create("Ext.window.Window", {
36
+ editArticleWindow = Ext.create("Ext.window.Window", {
37
37
  layout: 'fit',
38
38
  width: 375,
39
39
  title: 'Edit Article',
@@ -110,7 +110,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.ArticlesGridPanel", {
110
110
  allowBlank: false,
111
111
  name: 'id',
112
112
  itemId: 'record_id',
113
- value: record.data.id
113
+ value: record.get('recordId')
114
114
  }
115
115
  ]
116
116
  },
@@ -233,7 +233,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.ArticlesGridPanel", {
233
233
  flex: 1,
234
234
  items: [
235
235
  {
236
- icon: '/images/icons/edit/edit_16x16.png',
236
+ icon: '/assets/icons/edit/edit_16x16.png',
237
237
  iconCls: 'actioncolumn_hover',
238
238
  tooltip: 'Edit',
239
239
  handler: function (grid, rowIndex, colIndex) {
@@ -255,7 +255,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.ArticlesGridPanel", {
255
255
  flex: 1,
256
256
  items: [
257
257
  {
258
- icon: '/images/icons/document_text/document_text_16x16.png',
258
+ icon: '/assets/icons/document/document_16x16.png',
259
259
  iconCls: 'actioncolumn_hover',
260
260
  tooltip: 'Comments',
261
261
  handler: function (grid, rowIndex, colIndex) {
@@ -278,7 +278,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.ArticlesGridPanel", {
278
278
  flex: 1,
279
279
  items: [
280
280
  {
281
- icon: '/images/icons/edit/edit_16x16.png',
281
+ icon: '/assets/icons/edit/edit_16x16.png',
282
282
  iconCls: 'actioncolumn_hover',
283
283
  tooltip: 'Edit Excerpt',
284
284
  handler: function (grid, rowIndex, colIndex) {
@@ -301,7 +301,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.ArticlesGridPanel", {
301
301
  flex: 1,
302
302
  items: [
303
303
  {
304
- icon: '/images/icons/edit/edit_16x16.png',
304
+ icon: '/assets/icons/edit/edit_16x16.png',
305
305
  iconCls: 'actioncolumn_hover',
306
306
  tooltip: 'Edit Content',
307
307
  handler: function (grid, rowIndex, colIndex) {
@@ -324,7 +324,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.ArticlesGridPanel", {
324
324
  flex: 1,
325
325
  items: [
326
326
  {
327
- icon: '/images/icons/delete/delete_16x16.png',
327
+ icon: '/assets/icons/delete/delete_16x16.png',
328
328
  iconCls: 'actioncolumn_hover',
329
329
  tooltip: 'Delete',
330
330
  handler: function (grid, rowIndex, colIndex) {
@@ -353,10 +353,12 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.ArticlesGridPanel", {
353
353
  text: 'New Article',
354
354
  iconCls: 'icon-add',
355
355
  handler: function () {
356
- Ext.create('widget.window', {
356
+ var addArticleWindow = Ext.create('widget.window', {
357
+ modal: true,
357
358
  title: 'New Article',
358
359
  buttonAlign: 'center',
359
- items: new Ext.FormPanel({
360
+ items: {
361
+ xtype: 'form',
360
362
  labelWidth: 110,
361
363
  frame: false,
362
364
  bodyStyle: 'padding:5px 5px 0',
@@ -404,7 +406,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.ArticlesGridPanel", {
404
406
  // id: 'tag_list'
405
407
  }
406
408
  ]
407
- }),
409
+ },
408
410
  buttons: [
409
411
  {
410
412
  text: 'Submit',
@@ -707,4 +709,5 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.ArticlesGridPanel", {
707
709
 
708
710
  this.callParent([config]);
709
711
  }
710
- });
712
+ })
713
+ ;
@@ -47,8 +47,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
47
47
 
48
48
  /* sections */
49
49
 
50
- saveSectionLayout: function (id, comp, content) {
51
- jcomp = comp;
50
+ saveSectionLayout: function (id, codeMirrorComp, content) {
52
51
  var self = this;
53
52
  this.setWindowStatus('Saving...');
54
53
  Ext.Ajax.request({
@@ -71,7 +70,8 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
71
70
  else {
72
71
  Ext.Msg.alert('Error', obj.message);
73
72
  }
74
- comp.codeMirrorInstance.focus();
73
+
74
+ codeMirrorComp.focus();
75
75
  },
76
76
  failure: function (response) {
77
77
  self.clearWindowStatus();
@@ -90,8 +90,9 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
90
90
  layout: 'border',
91
91
  title: sectionName,
92
92
  save: function (comp) {
93
- var content = comp.down('codemirror').getValue();
94
- self.saveSectionLayout(websiteSectionId, comp, content);
93
+ var codeMirrorComp = comp.down('codemirror');
94
+ var content = codeMirrorComp.getValue();
95
+ self.saveSectionLayout(websiteSectionId, codeMirrorComp, content);
95
96
  },
96
97
  closable: true,
97
98
  itemId: itemId,
@@ -101,8 +102,8 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
101
102
  tbarItems: tbarItems,
102
103
  disableSave: true,
103
104
  listeners: {
104
- save: function (comp, content) {
105
- self.saveSectionLayout(websiteSectionId, comp, content);
105
+ save: function (codeMirrorComp, content) {
106
+ self.saveSectionLayout(websiteSectionId, codeMirrorComp, content);
106
107
  }
107
108
  },
108
109
  xtype: 'codemirror',
@@ -230,7 +231,8 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
230
231
  if (!obj.success) {
231
232
  Ext.Msg.alert('Error', obj.message);
232
233
  }
233
- comp.codeMirrorInstance.focus();
234
+
235
+ comp.focus();
234
236
  },
235
237
  failure: function (response) {
236
238
  self.clearWindowStatus();
@@ -266,8 +268,9 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
266
268
  itemId: itemId,
267
269
  layout: 'fit',
268
270
  save: function (comp) {
269
- var content = comp.down('codemirror').getValue();
270
- self.saveTemplateFile(node.data.id, comp, content);
271
+ var codeMirrorComp = comp.down('codemirror');
272
+ var content = codeMirrorComp.getValue();
273
+ self.saveTemplateFile(node.data.id, codeMirrorComp, content);
271
274
  },
272
275
  items: [
273
276
  {
@@ -275,8 +278,8 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
275
278
  disableSave: true,
276
279
  xtype: 'codemirror',
277
280
  listeners: {
278
- save: function (comp, content) {
279
- self.saveTemplateFile(node.data.id, comp, content);
281
+ save: function (codeMirrorComp, content) {
282
+ self.saveTemplateFile(node.data.id, codeMirrorComp, content);
280
283
  }
281
284
  },
282
285
  mode: mode,
@@ -342,7 +345,6 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
342
345
  if (Compass.ErpApp.Utility.isBlank(item)) {
343
346
  var ckEditor = Ext.create("Compass.ErpApp.Shared.CKeditor", {
344
347
  autoHeight: true,
345
- //value:content,
346
348
  ckEditorConfig: {
347
349
  extraPlugins: self.ckEditorExtraPlugins,
348
350
  toolbar: self.ckEditorToolbar
@@ -356,7 +358,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
356
358
  var dataTransfer = dropEvent.dataTransfer;
357
359
  var files = dataTransfer.files;
358
360
  for (var i = 0; i < files.length; i++) {
359
- var loadMask = new Ext.LoadMask(ckeditorPanel, {msg:"Please wait..."});
361
+ var loadMask = new Ext.LoadMask(ckeditorPanel, {msg: "Please wait..."});
360
362
  loadMask.show();
361
363
 
362
364
  var file = files[i];
@@ -369,35 +371,35 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
369
371
  headers: {'Content-Type': file.type},
370
372
  url: '/knitkit/erp_app/desktop/image_assets/shared/upload_file',
371
373
  jsonData: bin,
372
- params:{
374
+ params: {
373
375
  name: file.name,
374
376
  directory: 'root_node',
375
377
  is_drag_drop: true
376
378
  },
377
- success: function(result){
379
+ success: function (result) {
378
380
  loadMask.hide();
379
381
  resultObj = Ext.JSON.decode(result.responseText);
380
- if(resultObj.success){
381
- ckeditorPanel.insertHtml('<img src='+resultObj.url+' height="200" width="200" />');
382
+ if (resultObj.success) {
383
+ ckeditorPanel.insertHtml('<img src=' + resultObj.url + ' height="200" width="200" />');
382
384
  var sharedImageAssetsDataView = self.up('#knitkit').down('knitkit_ImageAssetsPanel').sharedImageAssetsDataView,
383
385
  sharedImageAssetsTreePanel = self.up('#knitkit').down('knitkit_ImageAssetsPanel').sharedImageAssetsTreePanel;
384
386
 
385
387
  sharedImageAssetsDataView.getStore().load({
386
- params:{
388
+ params: {
387
389
  directory: sharedImageAssetsDataView.directory
388
390
  }
389
391
  });
390
392
  sharedImageAssetsTreePanel.getStore().load({
391
- callback:function(){
393
+ callback: function () {
392
394
  sharedImageAssetsTreePanel.getView().refresh();
393
395
  }
394
396
  });
395
397
  }
396
- else{
398
+ else {
397
399
  Ext.Msg.alert('Error', 'Could not upload image');
398
400
  }
399
401
  },
400
- failure: function(result){
402
+ failure: function (result) {
401
403
  loadMask.hide();
402
404
  Ext.Msg.alert('Error', 'Could not upload image');
403
405
  }
@@ -468,6 +470,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
468
470
  }
469
471
 
470
472
  this.workArea.setActiveTab(item);
473
+
471
474
  },
472
475
 
473
476
  /* image */
@@ -476,7 +479,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
476
479
  var self = this;
477
480
  var fileName = node.data.id.split('/').pop().split('.')[0];
478
481
  var fileType = node.data.id.split('.').pop();
479
- var itemId = fileName + themeId;
482
+ var itemId = Compass.ErpApp.Utility.Encryption.MD5(node.data.id);
480
483
  var item = this.workArea.query('#' + itemId).first();
481
484
 
482
485
  if (Compass.ErpApp.Utility.isBlank(item)) {
@@ -488,10 +491,10 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
488
491
  html: '<img src="' + node.data.url + '" />'
489
492
  });
490
493
 
491
- this.workArea.add(item);
494
+ self.workArea.add(item);
492
495
  }
493
496
 
494
- this.workArea.setActiveTab(item);
497
+ self.workArea.setActiveTab(item);
495
498
  return false;
496
499
  },
497
500
 
@@ -561,14 +564,14 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
561
564
  this.workArea.setActiveTab(item);
562
565
  },
563
566
 
564
- openIframeInTab : function( title, url ) {
567
+ openIframeInTab: function (title, url) {
565
568
 
566
569
  var item = Ext.create('Ext.panel.Panel', {
567
- iframeId:'themes_iframe',
570
+ iframeId: 'themes_iframe',
568
571
  closable: true,
569
572
  layout: 'fit',
570
573
  title: title,
571
- html:'<iframe height="100%" width="100%" frameBorder="0" src="'+url+'"></iframe>'
574
+ html: '<iframe height="100%" width="100%" frameBorder="0" src="' + url + '"></iframe>'
572
575
  });
573
576
 
574
577
  this.workArea.add(item);
@@ -597,7 +600,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
597
600
  var dataTransfer = dropEvent.dataTransfer;
598
601
  var files = dataTransfer.files;
599
602
  for (var i = 0; i < files.length; i++) {
600
- var loadMask = new Ext.LoadMask(ckeditorPanel, {msg:"Please wait..."});
603
+ var loadMask = new Ext.LoadMask(ckeditorPanel, {msg: "Please wait..."});
601
604
  loadMask.show();
602
605
 
603
606
  var file = files[i];
@@ -610,35 +613,35 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
610
613
  headers: {'Content-Type': file.type},
611
614
  url: '/knitkit/erp_app/desktop/image_assets/shared/upload_file',
612
615
  jsonData: bin,
613
- params:{
616
+ params: {
614
617
  name: file.name,
615
618
  directory: 'root_node',
616
619
  is_drag_drop: true
617
620
  },
618
- success: function(result){
621
+ success: function (result) {
619
622
  loadMask.hide();
620
623
  resultObj = Ext.JSON.decode(result.responseText);
621
- if(resultObj.success){
622
- ckeditorPanel.insertHtml('<img src='+resultObj.url+' height="200" width="200" />');
624
+ if (resultObj.success) {
625
+ ckeditorPanel.insertHtml('<img src=' + resultObj.url + ' height="200" width="200" />');
623
626
  var sharedImageAssetsDataView = self.up('#knitkit').down('knitkit_ImageAssetsPanel').sharedImageAssetsDataView,
624
627
  sharedImageAssetsTreePanel = self.up('#knitkit').down('knitkit_ImageAssetsPanel').sharedImageAssetsTreePanel;
625
628
 
626
629
  sharedImageAssetsDataView.getStore().load({
627
- params:{
630
+ params: {
628
631
  directory: sharedImageAssetsDataView.directory
629
632
  }
630
633
  });
631
634
  sharedImageAssetsTreePanel.getStore().load({
632
- callback:function(){
635
+ callback: function () {
633
636
  sharedImageAssetsTreePanel.getView().refresh();
634
637
  }
635
638
  });
636
639
  }
637
- else{
640
+ else {
638
641
  Ext.Msg.alert('Error', 'Could not upload image');
639
642
  }
640
643
  },
641
- failure: function(result){
644
+ failure: function (result) {
642
645
  loadMask.hide();
643
646
  Ext.Msg.alert('Error', 'Could not upload image');
644
647
  }
@@ -719,7 +722,7 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
719
722
  cardPanel.removeAll(true);
720
723
  cardPanel.add({
721
724
  xtype: 'panel',
722
- html: comment
725
+ html: '<div style="padding:10px;">'+comment+'</div>'
723
726
  });
724
727
  cardPanel.getLayout().setActiveItem(0);
725
728
  },
@@ -858,10 +861,6 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
858
861
  activeTab.query('codemirror')[0].insertContent(content);
859
862
  }
860
863
  }
861
- return false;
862
- this.workArea.add(item);
863
-
864
- this.workArea.setActiveTab(item);
865
864
  },
866
865
 
867
866
  insertHtmlIntoActiveCkEditorOrCodemirror: function (html) {
@@ -913,16 +912,29 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
913
912
  handler: function (item) {
914
913
  currentItem.tab.setClosable(item.checked);
915
914
  }
915
+ },
916
+ '-',
917
+ {
918
+ text: 'Enabled',
919
+ checked: true,
920
+ hideOnClick: true,
921
+ handler: function (item) {
922
+ currentItem.tab.setDisabled(!item.checked);
923
+ }
916
924
  }
917
925
  ],
918
926
  listeners: {
919
- aftermenu: function () {
920
- currentItem = null;
921
- },
922
927
  beforemenu: function (menu, item) {
923
- var menuitem = menu.child('*[text="Closable"]');
928
+ var enabled = menu.child('[text="Enabled"]');
929
+ menu.child('[text="Closable"]').setChecked(item.closable);
930
+ if (item.tab.active) {
931
+ enabled.disable();
932
+ } else {
933
+ enabled.enable();
934
+ enabled.setChecked(!item.tab.isDisabled());
935
+ }
936
+
924
937
  currentItem = item;
925
- menuitem.setChecked(item.closable);
926
938
  }
927
939
  }
928
940
  }),
@@ -932,6 +944,15 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
932
944
  },
933
945
  remove: function () {
934
946
  this.smartRenameTabs();
947
+ },
948
+ tabchange: function (tabPanel, newPanel, oldPanel, eOpts) {
949
+ // check if the panel has ckEditor
950
+ var ckEditor = newPanel.down('ckeditor');
951
+ if (ckEditor) {
952
+ CKEDITOR.domReady(function () {
953
+ ckEditor.ckEditorInstance.focus();
954
+ });
955
+ }
935
956
  }
936
957
  },
937
958
 
@@ -996,4 +1017,4 @@ Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.CenterRegion", {
996
1017
 
997
1018
  this.callParent([config]);
998
1019
  }
999
- });
1020
+ });