forgeos_cms 1.9.0 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. data/COPYING +339 -0
  2. data/COPYING.LESSER +165 -0
  3. data/README.textile +3 -13
  4. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/bubble-quantity-products.png +0 -0
  5. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/check-checked.png +0 -0
  6. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/check-unchecked.png +0 -0
  7. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/context.gif +0 -0
  8. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/create.png +0 -0
  9. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/dark-blue-minus.png +0 -0
  10. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/dark-blue-plus.png +0 -0
  11. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/dot.gif +0 -0
  12. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/f.png +0 -0
  13. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/fminus.gif +0 -0
  14. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/fminus_rtl.gif +0 -0
  15. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/folder.png +0 -0
  16. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/fplus.gif +0 -0
  17. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/fplus_rtl.gif +0 -0
  18. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/lastli.gif +0 -0
  19. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/lastli_rtl.gif +0 -0
  20. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/li.gif +0 -0
  21. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/remove.png +0 -0
  22. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/rename.png +0 -0
  23. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/throbber.gif +0 -0
  24. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/brown-minus.png +0 -0
  25. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/brown-plus.png +0 -0
  26. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/bubble-quantity-products.png +0 -0
  27. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/context.gif +0 -0
  28. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/create.png +0 -0
  29. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/dot.gif +0 -0
  30. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/f.png +0 -0
  31. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/fminus.gif +0 -0
  32. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/fminus_rtl.gif +0 -0
  33. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/fplus.gif +0 -0
  34. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/fplus_rtl.gif +0 -0
  35. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/lastli.gif +0 -0
  36. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/lastli_rtl.gif +0 -0
  37. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/li.gif +0 -0
  38. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/remove.png +0 -0
  39. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/rename.png +0 -0
  40. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/throbber.gif +0 -0
  41. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/big-drag-and-drop.png +0 -0
  42. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/bubble-quantity-products.png +0 -0
  43. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/check-checked.png +0 -0
  44. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/check-unchecked.png +0 -0
  45. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/context.gif +0 -0
  46. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/create.png +0 -0
  47. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/dark-blue-minus.png +0 -0
  48. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/dark-blue-plus.png +0 -0
  49. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/dot.gif +0 -0
  50. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/drag-drop.png +0 -0
  51. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/f.png +0 -0
  52. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/fminus.gif +0 -0
  53. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/fminus_rtl.gif +0 -0
  54. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/folder.png +0 -0
  55. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/fplus.gif +0 -0
  56. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/fplus_rtl.gif +0 -0
  57. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/lastli.gif +0 -0
  58. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/lastli_rtl.gif +0 -0
  59. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/li.gif +0 -0
  60. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/remove.png +0 -0
  61. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/rename.png +0 -0
  62. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/throbber.gif +0 -0
  63. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/brown-minus.png +0 -0
  64. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/brown-plus.png +0 -0
  65. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/bubble-quantity-products.png +0 -0
  66. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/context.gif +0 -0
  67. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/create.png +0 -0
  68. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/dot.gif +0 -0
  69. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/f.png +0 -0
  70. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/fminus.gif +0 -0
  71. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/fminus_rtl.gif +0 -0
  72. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/fplus.gif +0 -0
  73. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/fplus_rtl.gif +0 -0
  74. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/lastli.gif +0 -0
  75. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/lastli_rtl.gif +0 -0
  76. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/li.gif +0 -0
  77. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/remove.png +0 -0
  78. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/rename.png +0 -0
  79. data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/throbber.gif +0 -0
  80. data/app/assets/javascripts/forgeos/admin/functions/forgeos_cms/trees.js +1 -1
  81. data/app/assets/javascripts/forgeos/admin/inits/forgeos_cms/menus.js +70 -42
  82. data/app/assets/javascripts/forgeos/admin/inits/forgeos_cms/trees.js +38 -66
  83. data/app/assets/stylesheets/forgeos/admin/forgeos_cms/_blocks.css.sass +0 -6
  84. data/app/assets/stylesheets/forgeos/jstree/themes/association_page/style.css.sass +24 -195
  85. data/app/assets/stylesheets/forgeos/jstree/themes/block_category/style.css.sass +8 -8
  86. data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/style.css.sass +15 -91
  87. data/app/assets/stylesheets/forgeos/jstree/themes/page_category/style.css.sass +8 -8
  88. data/app/controllers/admin/actualities_controller.rb +1 -1
  89. data/app/controllers/admin/carousels_controller.rb +1 -1
  90. data/app/controllers/admin/menus_controller.rb +1 -1
  91. data/app/controllers/admin/newsletters_controller.rb +1 -1
  92. data/app/controllers/admin/pages_controller.rb +2 -2
  93. data/app/controllers/admin/static_content_blocks_controller.rb +1 -1
  94. data/app/controllers/admin/widgets_controller.rb +1 -1
  95. data/app/controllers/forgeos/application_controller.rb +4 -4
  96. data/app/helpers/admin/base_helper.rb +16 -0
  97. data/app/views/admin/actualities/index.json.erb +8 -9
  98. data/app/views/admin/blocks/_associated_pages.html.haml +20 -21
  99. data/app/views/admin/blocks/_tabs.html.haml +7 -6
  100. data/app/views/admin/carousels/_attachments_popups.html.haml +1 -1
  101. data/app/views/admin/carousels/_form.html.haml +2 -2
  102. data/app/views/admin/carousels/show.html.haml +2 -2
  103. data/app/views/admin/categories/_block.html.haml +1 -1
  104. data/app/views/admin/menus/_empty_menu_link.html.haml +1 -2
  105. data/app/views/admin/menus/_form.html.haml +3 -3
  106. data/app/views/admin/menus/_form_menu_links.html.haml +5 -7
  107. data/app/views/admin/menus/_lang_switcher.html.haml +2 -2
  108. data/app/views/admin/menus/_types_popups.html.haml +10 -9
  109. data/app/views/admin/menus/index.json.erb +7 -9
  110. data/app/views/admin/newsletters/index.json.erb +4 -4
  111. data/app/views/admin/pages/_block_popup.html.haml +6 -5
  112. data/app/views/admin/pages/_blocks.html.haml +1 -1
  113. data/app/views/admin/pages/_form.html.haml +14 -5
  114. data/app/views/admin/pages/_general.html.haml +0 -5
  115. data/app/views/admin/pages/_tabs_show.html.haml +1 -9
  116. data/app/views/admin/pages/index.json.erb +7 -5
  117. data/app/views/admin/pages/new.html.haml +0 -1
  118. data/app/views/admin/pages/show.html.haml +7 -33
  119. data/app/views/admin/static_content_blocks/_form.html.haml +2 -2
  120. data/app/views/admin/static_content_blocks/index.html.haml +1 -1
  121. data/app/views/admin/static_content_blocks/index.json.erb +4 -4
  122. data/app/views/admin/widget_actualities/_form.html.haml +5 -5
  123. data/app/views/admin/widget_actualities/_form_item.html.haml +4 -4
  124. data/app/views/admin/widget_actualities/edit.html.haml +1 -1
  125. data/app/views/admin/widget_actualities/new.html.haml +1 -1
  126. data/app/views/admin/widget_actualities/show.html.haml +4 -4
  127. data/app/views/admin/widget_faqs/_form.html.haml +3 -11
  128. data/app/views/admin/widget_faqs/edit.html.haml +2 -2
  129. data/app/views/admin/widget_faqs/new.html.haml +2 -2
  130. data/app/views/admin/widgets/_tabs.html.haml +4 -3
  131. data/app/views/admin/widgets/index.html.haml +1 -1
  132. data/app/views/admin/widgets/index.json.erb +7 -8
  133. data/config/routes.rb +1 -1
  134. metadata +104 -89
  135. data/app/views/admin/widget_actualities/_tabs.html.haml +0 -8
  136. data/app/views/admin/widget_faqs/_tabs.html.haml +0 -8
@@ -4,5 +4,5 @@ function init_association_page_tree(selector, object_name){
4
4
  }
5
5
  // initialize block category associations
6
6
  function init_association_block_category_tree(selector, object_name){
7
- init_association_category_tree(selector, object_name, 'block_category', 'association_categories');
7
+ init_association_category_tree(selector, object_name, 'category', 'association_categories');
8
8
  }
@@ -1,6 +1,35 @@
1
1
  jQuery(document).ready(function(){
2
+ //init the menu modify tree
3
+ jQuery("#menu-tree").bind('loaded.jstree', function(e, data) {
4
+ jQuery(e.target).find('ins').remove();
5
+ }).bind('move_node.jstree', function(e, data){
6
+ var menu = jQuery(e.target).children('ul');
7
+ var parent_node = jQuery(data.rslt.obj).parents('li:first');
8
+
9
+ // update names, ids, parent_ids and positions
10
+ update_menu_names_and_ids(menu, 'menu[menu_links_attributes]', 'menu_menu_links_attributes_');
11
+ update_menu_positions(menu);
12
+
13
+ // open parent of moved node
14
+ if (parent_node) toggle_menu_link(parent_node, 'open');
15
+ }).jstree({
16
+ "themes": {
17
+ "theme": 'menu-tree'
18
+ },
19
+ "plugins": ['crrm','themes','html_data']
20
+ });
21
+
22
+ //init the menu modify tree
23
+ jQuery("#menu-tree-ro").jstree({
24
+ "themes": {
25
+ "theme": 'menu-tree'
26
+ },
27
+ "plugins": ['themes','html_data']
28
+ });
29
+
2
30
  // Add root menu link
3
- jQuery('.button-menu-link').live('click',function(){
31
+ jQuery('.button-menu-link').live('click',function(e){
32
+ e.preventDefault();
4
33
  var menu = jQuery('#menu-tree').children('ul');
5
34
  var new_menu_link = '<li class="file last closed">';
6
35
  new_menu_link += jQuery('#empty_menu_link').html().replace(/EMPTY_ID/g, false_id).replace(/EMPTY_NAME/g, false_id);
@@ -14,7 +43,7 @@ jQuery(document).ready(function(){
14
43
  });
15
44
 
16
45
  // Add sub menu link
17
- jQuery('.tree-menu-tree li .menu_link .action-links .add-green-plus').live('click',function(){
46
+ jQuery('.jstree-menu-tree li .menu_link .action-links .add-green-plus').live('click',function(){
18
47
  var current_menu_link = jQuery(this).parents('li:first');
19
48
 
20
49
  // get list of the current menu_link or create one
@@ -56,7 +85,8 @@ jQuery(document).ready(function(){
56
85
  });
57
86
 
58
87
  // Edition mode in menu link edit
59
- jQuery('.tree-menu-tree li .menu_link .action-links .edit-link, .tree-menu-tree li .menu_link .actions .back-link, .tree-menu-tree li .menu_link .editing .save').live('click',function(){
88
+ jQuery('.jstree-menu-tree li .menu_link .action-links .edit-link, .jstree-menu-tree li .menu_link .actions .back-link, .jstree-menu-tree li .menu_link .editing .save').live('click',function(e){
89
+ e.preventDefault();
60
90
  var menu_link = jQuery(this).parents('li:first');
61
91
  var link = jQuery(menu_link).find('a.tree-link:first');
62
92
  var link_span = jQuery(link).find('.name');
@@ -74,15 +104,15 @@ jQuery(document).ready(function(){
74
104
  var back_link = jQuery(this).hasClass('back-link');
75
105
 
76
106
  // back-link is pressed then reset icon else update icon
77
- if (back_link)
107
+ if (back_link) {
78
108
  update_menu_span_icon(link_span, edition_span);
79
- else
109
+ } else {
80
110
  update_menu_span_icon(edition_span, link_span);
111
+ }
81
112
 
82
113
  // back-link is pressed then reset attributes else update attributes
83
114
  jQuery(edition_block).find('input, textarea, select').each(function(){
84
- switch(get_rails_element_id(jQuery(this)))
85
- {
115
+ switch(get_rails_element_id(jQuery(this))) {
86
116
  // TODO: interactivity
87
117
  case 'title':
88
118
  if (back_link){
@@ -90,14 +120,14 @@ jQuery(document).ready(function(){
90
120
  jQuery(this).val(link_span.html());
91
121
 
92
122
  // and edition link title
93
- if (edition_span.hasClass('external'))
123
+ if (edition_span.hasClass('external')) {
94
124
  // edition link url
95
125
  edition_link.html(link.attr('href'));
96
- else
126
+ } else {
97
127
  // target name
98
128
  edition_link.html(jQuery(edition_block).find('.linked-to').html());
99
- }
100
- else{
129
+ }
130
+ } else {
101
131
  // update view link title
102
132
  link_span.html(jQuery(this).val());
103
133
  jQuery(edition_block).find('.linked-to').html(edition_link.html());
@@ -109,20 +139,19 @@ jQuery(document).ready(function(){
109
139
  // reset url hidden field and edition link url
110
140
  jQuery(this).val(link.attr('href'));
111
141
  edition_link.attr('href', link.attr('href'));
112
- }
113
- else
142
+ } else {
114
143
  // update view link url
115
144
  link.attr('href', edition_link.attr('href'));
145
+ }
116
146
  break;
117
147
 
118
148
  case 'active':
119
149
  status_span = link.find('.status');
120
- if (back_link){
150
+ if (back_link) {
121
151
  // update select
122
152
  jQuery(this).val(status_span.hasClass('see-on') ? 1 : 0);
123
153
  rebuild_custom_select('.select-status');
124
- }
125
- else {
154
+ } else {
126
155
  // set visible or not
127
156
  status_span.removeClass((jQuery(this).val() == '1') ? 'see-off' : 'see-on');
128
157
  status_span.addClass((jQuery(this).val() == '1') ? 'see-on' : 'see-off');
@@ -135,7 +164,8 @@ jQuery(document).ready(function(){
135
164
  });
136
165
 
137
166
  // Remove menu link
138
- jQuery('.tree-menu-tree li .menu_link .action-links .destroy-link').live('click',function(){
167
+ jQuery('.jstree-menu-tree li .menu_link .action-links .destroy-link').live('click',function(e){
168
+ e.preventDefault();
139
169
  var menu_link = jQuery(this).parents('li:first');
140
170
 
141
171
  // set the menu link and all its children to deleted
@@ -169,21 +199,22 @@ jQuery(document).ready(function(){
169
199
  }
170
200
  },
171
201
  open: function(e,ui){
172
- eval(jQuery('#table-files').data('dataTables_init_function')+'()');
202
+ eval(jQuery('#table-menu_links').data('dataTables_init_function')+'()');
173
203
  }
174
204
  });
175
205
 
176
206
  // Change menu link type
177
- jQuery('.tree-menu-tree li .menu_link .editing .change-type').live('click',function(){
207
+ jQuery('.jstree-menu-tree li .menu_link .editing .change-type').live('click',function(e){
208
+ e.preventDefault();
178
209
  var edition_block = jQuery(this).parents('.editing');
179
- var link_type = jQuery(edition_block).find('.input-type');
180
-
181
- var title = jQuery(edition_block).find('.input-title');
182
- var url = jQuery(edition_block).find('.input-url');
183
- var span = jQuery(edition_block).find('.linked-to-span');
184
- var link = jQuery(edition_block).find('.linked-to-span a');
185
- var target_id = jQuery(edition_block).find('.input-target-id');
186
- var target_type = jQuery(edition_block).find('.input-target-type');
210
+ var link_type = edition_block.find('.input-type');
211
+
212
+ var title = edition_block.find('.input-title');
213
+ var url = edition_block.find('.input-url');
214
+ var span = edition_block.find('.linked-to-span');
215
+ var link = edition_block.find('.linked-to-span a');
216
+ var target_id = edition_block.find('.input-target-id');
217
+ var target_type = edition_block.find('.input-target-type');
187
218
  var overlay_url = jQuery('#overlay-url');
188
219
 
189
220
  // on open - show overlay and hide other overlays
@@ -191,21 +222,20 @@ jQuery(document).ready(function(){
191
222
  var overlay_tab;
192
223
  var overlay_type = 'target-link';
193
224
 
194
- switch(link_type.val())
195
- {
225
+ switch(link_type.val()) {
196
226
  case 'PageLink':
197
227
  overlay_tab = 'page';
198
- update_current_dataTable_source('#table-files','/admin/pages.json?mode=menu_link');
228
+ update_current_dataTable_source('#table-menu_links','/admin/pages.json?mode=menu_link');
199
229
  break;
200
230
 
201
231
  case 'ProductLink':
202
232
  overlay_tab = 'product';
203
- update_current_dataTable_source('#table-files','/admin/products.json?mode=menu_link');
233
+ update_current_dataTable_source('#table-menu_links','/admin/products.json?mode=menu_link');
204
234
  break;
205
235
 
206
236
  case 'CategoryLink':
207
237
  overlay_tab = 'category';
208
- update_current_dataTable_source('#table-files',"/admin/categories.json?mode=menu_link&types[]=page&types[]=product");
238
+ update_current_dataTable_source('#table-menu_links',"/admin/categories.json?mode=menu_link&types[]=page&types[]=product");
209
239
  break;
210
240
 
211
241
  default:
@@ -213,7 +243,7 @@ jQuery(document).ready(function(){
213
243
  overlay_type = 'external-link';
214
244
  // set overlay input value
215
245
  overlay_url.val(url.val());
216
- }
246
+ }
217
247
 
218
248
  toggleSelectedOverlay('#inner-lightbox.backgrounds .' + overlay_tab);
219
249
  toggle_menu_types_overlays(overlay_type);
@@ -222,7 +252,7 @@ jQuery(document).ready(function(){
222
252
  // on OK button pressed - update link, hidden fields and close dialog
223
253
  jQuery('#menuLinkTypeDialog').dialog('option', 'buttons', {
224
254
  "Ok": function(){
225
- var current_tab = jQuery('#inner-lightbox.backgrounds .selected');
255
+ var current_tab = jQuery('#inner-lightbox .selected');
226
256
 
227
257
  span.removeClass('external page product category');
228
258
 
@@ -238,15 +268,14 @@ jQuery(document).ready(function(){
238
268
  'hidden_target_type': ''
239
269
  }
240
270
  );
241
- }
242
- else{
243
- dataTableSelectRows('#table-files:visible',function(current_table,indexes){
271
+ } else {
272
+ dataTableSelectRows('#table-menu_links:visible',function(current_table,indexes){
244
273
  var row = current_table.fnGetData(indexes[0]);
245
274
  var id = row.slice(-2,-1)[0];
246
275
  var name = row.slice(-3,-2)[0];
247
276
  var target = row.slice(-1)[0];
248
277
 
249
- var type;
278
+ var type = '';
250
279
  if (current_tab.hasClass('page'))
251
280
  type = 'page';
252
281
  else if (current_tab.hasClass('product'))
@@ -282,13 +311,12 @@ jQuery(document).ready(function(){
282
311
  });
283
312
 
284
313
  //add hover on menu list elments
285
- jQuery('.tree-menu-tree').find('li').live('mouseover',function(){
314
+ jQuery('.jstree-menu-tree').find('li').live('mouseover',function(){
286
315
  jQuery('.action-links').hide();
287
316
  jQuery(this).find('.action-links:first').show();
288
-
289
317
  });
290
318
 
291
- jQuery('.tree-menu-tree').find('li').live('mouseout',function(){
292
- jQuery('.action-links').hide();
319
+ jQuery('.jstree-menu-tree').find('li').live('mouseout',function(){
320
+ jQuery('.action-links').hide();
293
321
  });
294
322
  });
@@ -1,19 +1,4 @@
1
1
  jQuery(document).ready(function(){
2
- //init the tree for pages, blocks, widgets
3
- jQuery("#page-tree").tree({
4
- ui: {
5
- theme_path: '/stylesheets/jstree/themes/',
6
- theme_name : 'product_category',
7
- selected_parent_close: false
8
- },
9
- callback: {
10
- onload: function(TREE_OBJ){
11
- tree_id = jQuery(TREE_OBJ.container).attr('id');
12
- jQuery(TREE_OBJ.container).removeClass('tree-default');
13
- }
14
- }
15
- });
16
-
17
2
  // init the category tress
18
3
  init_category_tree("#page-tree",'PageCategory','/admin/page_categories.json');
19
4
  init_category_tree("#block-tree",'StaticContentCategory','/admin/static_content_categories.json');
@@ -32,63 +17,50 @@ jQuery(document).ready(function(){
32
17
  init_association_page_tree('#association-widget-faq-page-tree', 'widget_faq');
33
18
 
34
19
  //init the tree of blocks
35
- jQuery('.blocks-tree').tree({
36
- ui: {
37
- theme_path: '/stylesheets/jstree/themes/',
38
- theme_name : 'block_category',
20
+ jQuery('.blocks-tree').bind('select_node.jstree', function(e, data){
21
+ var jnode = jQuery(data.rslt.obj);
22
+ var link = jnode.find('a:first');
23
+ if(!link.hasClass('active')){
24
+ putInBlockList(link.attr('title'), link.text(), jnode.attr('id').substr(6));
25
+ closeDialogBox();
26
+ jQuery('.selectedPageCol').removeClass('selectedPageCol');
27
+ }
28
+ return false;
29
+ }).jstree({
30
+ "themes": {
31
+ "theme": 'block_category'
32
+ },
33
+ "ui": {
39
34
  selected_parent_close: false
40
35
  },
41
- callback: {
42
- onload: function(TREE_OBJ){
43
- tree_id = jQuery(TREE_OBJ.container).attr('id');
44
- jQuery(TREE_OBJ.container).removeClass('tree-default');
45
- },
46
- onselect: function(NODE,TREE_OBJ){
47
- /*
48
- *Add click function on .small-icons.block items
49
- *Those items are li in blocks/widget tree (in dialog box)
50
- *and close the dialogg box
51
- **/
52
- var link = jQuery(NODE).find('a:first');
53
- if(!link.hasClass('active')){
54
- putInBlockList(link.attr('title'), link.text(), jQuery(NODE).attr('id').substr(6));
55
- closeDialogBox();
56
- jQuery('.selectedPageCol').removeClass('selectedPageCol');
57
- }
58
- return false;
59
- }
60
- }
36
+ "plugins": ['html_data', 'ui', 'themes']
61
37
  });
62
38
 
63
39
  //init the tree of pages
64
- jQuery(".pages-tree").tree({
65
- ui: {
66
- theme_path: '/stylesheets/jstree/themes/',
67
- theme_name : 'page_category',
40
+ jQuery(".pages-tree").bind('select_node.jstree', function(e, data){
41
+ var jnode = jQuery(data.rslt.obj);
42
+ var link = jnode.children('a');
43
+ if(!link.hasClass('active')){
44
+ var url = link.attr('href');
45
+ var block_id = url.split('/')[5];
46
+ var page_id = get_rails_element_id(jnode);
47
+ jQuery.ajax({
48
+ "url": url,
49
+ "complete": putInPageList(link.text(), link.attr('title'), block_id, page_id),
50
+ "data": { authenticity_token: encodeURIComponent(window._forgeos_js_vars.token) },
51
+ "dataType":'text',
52
+ "type":'post'
53
+ });
54
+ closeDialogBox();
55
+ }
56
+ return false;
57
+ }).jstree({
58
+ "themes": {
59
+ "theme": 'page_category'
60
+ },
61
+ "ui": {
68
62
  selected_parent_close: false
69
63
  },
70
- callback: {
71
- onload: function(TREE_OBJ){
72
- tree_id = jQuery(TREE_OBJ.container).attr('id');
73
- jQuery(TREE_OBJ.container).removeClass('tree-default');
74
- },
75
- onselect: function(NODE,TREE_OBJ){
76
- var link = jQuery(NODE).children('a');
77
- if(!link.hasClass('active')){
78
- var url = jQuery(link).attr('href');
79
- var block_id = url.split('/')[5];
80
- var page_id = get_rails_element_id(NODE);
81
- jQuery.ajax({
82
- url: url,
83
- complete: putInPageList(jQuery(link).text(), jQuery(link).attr('title'), block_id, page_id),
84
- data: 'authenticity_token=' + encodeURIComponent(window._forgeos_js_vars.token),
85
- dataType:'text',
86
- type:'post'
87
- });
88
- closeDialogBox();
89
- }
90
- return false;
91
- }
92
- }
64
+ "plugins": ['html_data', 'ui', 'themes']
93
65
  });
94
66
  });
@@ -1,11 +1,5 @@
1
1
  #page_content_tbl, #page_content
2
2
  width: 650px !important
3
- #blocks-header
4
- a
5
- padding: 0 10px
6
- &:hover, &.selected
7
- color: $white
8
- background-color: $lightGray
9
3
  .blocks-tree.hidden
10
4
  display: none
11
5
  .block-container.widget-modify