forgeos_cms 1.9.0 → 1.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +339 -0
- data/COPYING.LESSER +165 -0
- data/README.textile +3 -13
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/bubble-quantity-products.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/check-checked.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/check-unchecked.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/context.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/create.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/dark-blue-minus.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/dark-blue-plus.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/dot.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/f.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/fminus.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/fminus_rtl.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/folder.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/fplus.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/fplus_rtl.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/lastli.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/lastli_rtl.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/li.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/remove.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/rename.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/association_page/throbber.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/brown-minus.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/brown-plus.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/bubble-quantity-products.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/context.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/create.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/dot.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/f.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/fminus.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/fminus_rtl.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/fplus.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/fplus_rtl.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/lastli.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/lastli_rtl.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/li.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/remove.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/rename.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/block_category/throbber.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/big-drag-and-drop.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/bubble-quantity-products.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/check-checked.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/check-unchecked.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/context.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/create.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/dark-blue-minus.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/dark-blue-plus.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/dot.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/drag-drop.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/f.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/fminus.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/fminus_rtl.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/folder.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/fplus.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/fplus_rtl.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/lastli.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/lastli_rtl.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/li.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/remove.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/rename.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/menu-tree/throbber.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/brown-minus.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/brown-plus.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/bubble-quantity-products.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/context.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/create.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/dot.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/f.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/fminus.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/fminus_rtl.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/fplus.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/fplus_rtl.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/lastli.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/lastli_rtl.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/li.gif +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/remove.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/rename.png +0 -0
- data/app/assets/{stylesheets → images}/forgeos/jstree/themes/page_category/throbber.gif +0 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_cms/trees.js +1 -1
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_cms/menus.js +70 -42
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_cms/trees.js +38 -66
- data/app/assets/stylesheets/forgeos/admin/forgeos_cms/_blocks.css.sass +0 -6
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/style.css.sass +24 -195
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/style.css.sass +8 -8
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/style.css.sass +15 -91
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/style.css.sass +8 -8
- data/app/controllers/admin/actualities_controller.rb +1 -1
- data/app/controllers/admin/carousels_controller.rb +1 -1
- data/app/controllers/admin/menus_controller.rb +1 -1
- data/app/controllers/admin/newsletters_controller.rb +1 -1
- data/app/controllers/admin/pages_controller.rb +2 -2
- data/app/controllers/admin/static_content_blocks_controller.rb +1 -1
- data/app/controllers/admin/widgets_controller.rb +1 -1
- data/app/controllers/forgeos/application_controller.rb +4 -4
- data/app/helpers/admin/base_helper.rb +16 -0
- data/app/views/admin/actualities/index.json.erb +8 -9
- data/app/views/admin/blocks/_associated_pages.html.haml +20 -21
- data/app/views/admin/blocks/_tabs.html.haml +7 -6
- data/app/views/admin/carousels/_attachments_popups.html.haml +1 -1
- data/app/views/admin/carousels/_form.html.haml +2 -2
- data/app/views/admin/carousels/show.html.haml +2 -2
- data/app/views/admin/categories/_block.html.haml +1 -1
- data/app/views/admin/menus/_empty_menu_link.html.haml +1 -2
- data/app/views/admin/menus/_form.html.haml +3 -3
- data/app/views/admin/menus/_form_menu_links.html.haml +5 -7
- data/app/views/admin/menus/_lang_switcher.html.haml +2 -2
- data/app/views/admin/menus/_types_popups.html.haml +10 -9
- data/app/views/admin/menus/index.json.erb +7 -9
- data/app/views/admin/newsletters/index.json.erb +4 -4
- data/app/views/admin/pages/_block_popup.html.haml +6 -5
- data/app/views/admin/pages/_blocks.html.haml +1 -1
- data/app/views/admin/pages/_form.html.haml +14 -5
- data/app/views/admin/pages/_general.html.haml +0 -5
- data/app/views/admin/pages/_tabs_show.html.haml +1 -9
- data/app/views/admin/pages/index.json.erb +7 -5
- data/app/views/admin/pages/new.html.haml +0 -1
- data/app/views/admin/pages/show.html.haml +7 -33
- data/app/views/admin/static_content_blocks/_form.html.haml +2 -2
- data/app/views/admin/static_content_blocks/index.html.haml +1 -1
- data/app/views/admin/static_content_blocks/index.json.erb +4 -4
- data/app/views/admin/widget_actualities/_form.html.haml +5 -5
- data/app/views/admin/widget_actualities/_form_item.html.haml +4 -4
- data/app/views/admin/widget_actualities/edit.html.haml +1 -1
- data/app/views/admin/widget_actualities/new.html.haml +1 -1
- data/app/views/admin/widget_actualities/show.html.haml +4 -4
- data/app/views/admin/widget_faqs/_form.html.haml +3 -11
- data/app/views/admin/widget_faqs/edit.html.haml +2 -2
- data/app/views/admin/widget_faqs/new.html.haml +2 -2
- data/app/views/admin/widgets/_tabs.html.haml +4 -3
- data/app/views/admin/widgets/index.html.haml +1 -1
- data/app/views/admin/widgets/index.json.erb +7 -8
- data/config/routes.rb +1 -1
- metadata +104 -89
- data/app/views/admin/widget_actualities/_tabs.html.haml +0 -8
- data/app/views/admin/widget_faqs/_tabs.html.haml +0 -8
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -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, '
|
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('.
|
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('.
|
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('.
|
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-
|
202
|
+
eval(jQuery('#table-menu_links').data('dataTables_init_function')+'()');
|
173
203
|
}
|
174
204
|
});
|
175
205
|
|
176
206
|
// Change menu link type
|
177
|
-
jQuery('.
|
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 =
|
180
|
-
|
181
|
-
var title =
|
182
|
-
var url =
|
183
|
-
var span =
|
184
|
-
var link =
|
185
|
-
var target_id =
|
186
|
-
var 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-
|
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-
|
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-
|
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
|
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
|
-
|
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('.
|
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
|
-
|
292
|
-
|
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').
|
36
|
-
|
37
|
-
|
38
|
-
|
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
|
-
|
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").
|
65
|
-
|
66
|
-
|
67
|
-
|
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
|
-
|
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
|
});
|