alchemy_cms 2.2.rc13 → 2.2.rc14
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +3 -0
- data/alchemy_cms.gemspec +1 -0
- data/app/assets/javascripts/alchemy/alchemy.base.js +95 -94
- data/app/assets/javascripts/alchemy/alchemy.buttons.js +15 -11
- data/app/assets/javascripts/alchemy/alchemy.datepicker.js +18 -18
- data/app/assets/javascripts/alchemy/alchemy.dirty.js +20 -20
- data/app/assets/javascripts/alchemy/alchemy.dragndrop.js +50 -44
- data/app/assets/javascripts/alchemy/alchemy.element_editor_selector.js +15 -12
- data/app/assets/javascripts/alchemy/alchemy.elements_window.js +47 -43
- data/app/assets/javascripts/alchemy/alchemy.file_progress.js +27 -17
- data/app/assets/javascripts/alchemy/alchemy.growler.js +19 -15
- data/app/assets/javascripts/alchemy/alchemy.html5.js +1 -2
- data/app/assets/javascripts/alchemy/alchemy.image_cropper.js +10 -11
- data/app/assets/javascripts/alchemy/alchemy.jquery_loader.js +6 -6
- data/app/assets/javascripts/alchemy/alchemy.js_extensions.js +4 -6
- data/app/assets/javascripts/alchemy/alchemy.menubar.js +16 -20
- data/app/assets/javascripts/alchemy/alchemy.page_sorter.js +18 -16
- data/app/assets/javascripts/alchemy/alchemy.preview.js +30 -30
- data/app/assets/javascripts/alchemy/alchemy.preview_window.js +50 -42
- data/app/assets/javascripts/alchemy/alchemy.routes.js.erb +11 -11
- data/app/assets/javascripts/alchemy/alchemy.swf_upload.js +83 -86
- data/app/assets/javascripts/alchemy/alchemy.uploader.js +106 -112
- data/app/assets/javascripts/alchemy/alchemy.windows.js +158 -130
- data/app/assets/stylesheets/alchemy/base.css.scss +7 -1
- data/app/assets/stylesheets/alchemy/buttons.css.scss +31 -25
- data/app/assets/stylesheets/alchemy/elements.css.scss +4 -0
- data/app/controllers/alchemy/admin/base_controller.rb +5 -1
- data/app/helpers/alchemy/admin/base_helper.rb +21 -13
- data/app/helpers/alchemy/admin/contents_helper.rb +52 -11
- data/app/helpers/alchemy/admin/elements_helper.rb +0 -1
- data/app/helpers/alchemy/admin/essences_helper.rb +5 -5
- data/app/helpers/alchemy/essences_helper.rb +1 -0
- data/app/models/alchemy/content.rb +102 -91
- data/app/models/alchemy/essence_boolean.rb +8 -0
- data/app/models/alchemy/essence_select.rb +7 -0
- data/app/sweepers/alchemy/content_sweeper.rb +2 -4
- data/app/views/alchemy/admin/clipboard/clear.js.erb +3 -2
- data/app/views/alchemy/admin/clipboard/index.html.erb +2 -2
- data/app/views/alchemy/admin/contents/create.js.erb +2 -0
- data/app/views/alchemy/admin/contents/destroy.js.coffee +4 -0
- data/app/views/alchemy/admin/contents/new.html.erb +1 -1
- data/app/views/alchemy/admin/elements/_element_foot.html.erb +3 -2
- data/app/views/alchemy/admin/elements/create.js.coffee +31 -0
- data/app/views/alchemy/admin/elements/fold.js.coffee +37 -0
- data/app/views/alchemy/admin/essence_pictures/assign.js.coffee +15 -0
- data/app/views/alchemy/admin/essence_pictures/destroy.js.coffee +19 -0
- data/app/views/alchemy/admin/essence_pictures/edit.html.erb +12 -2
- data/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb +1 -1
- data/app/views/alchemy/admin/pages/_page.html.erb +1 -1
- data/app/views/alchemy/admin/pages/destroy.js.coffee +19 -0
- data/app/views/alchemy/admin/pages/edit.html.erb +5 -5
- data/app/views/alchemy/admin/pages/update.js.coffee +36 -0
- data/app/views/alchemy/admin/resources/_form.html.erb +12 -1
- data/app/views/alchemy/admin/resources/_resource.html.erb +6 -3
- data/app/views/alchemy/admin/resources/_table.html.erb +1 -1
- data/app/views/alchemy/admin/trash/clear.js.coffee +4 -0
- data/app/views/alchemy/admin/trash/index.html.erb +4 -4
- data/app/views/alchemy/elements/_article_editor.html.erb +4 -2
- data/app/views/alchemy/elements/_article_view.html.erb +7 -7
- data/app/views/alchemy/elements/_download_editor.html.erb +4 -1
- data/app/views/alchemy/elements/_download_view.html.erb +7 -3
- data/app/views/alchemy/elements/_image_mosaic_editor.html.erb +1 -0
- data/app/views/alchemy/elements/_image_mosaic_view.html.erb +11 -9
- data/app/views/alchemy/essences/_essence_boolean_editor.html.erb +14 -0
- data/app/views/alchemy/essences/_essence_boolean_view.html.erb +1 -0
- data/app/views/alchemy/essences/_essence_date_editor.html.erb +1 -1
- data/app/views/alchemy/essences/_essence_file_editor.html.erb +1 -0
- data/app/views/alchemy/essences/_essence_html_editor.html.erb +1 -1
- data/app/views/alchemy/essences/_essence_richtext_editor.html.erb +1 -1
- data/app/views/alchemy/essences/_essence_select_editor.html.erb +35 -0
- data/app/views/alchemy/essences/_essence_select_view.html.erb +1 -0
- data/app/views/alchemy/essences/_essence_text_editor.html.erb +29 -77
- data/app/views/alchemy/essences/_essence_text_view.html.erb +2 -2
- data/config/alchemy/elements.yml +72 -44
- data/config/locales/alchemy.de.yml +46 -45
- data/config/locales/alchemy.en.yml +90 -89
- data/db/migrate/20120608085509_create_alchemy_essence_selects.rb +11 -0
- data/db/migrate/20120611221734_create_alchemy_essence_booleans.rb +11 -0
- data/lib/alchemy/authentication_helpers.rb +3 -7
- data/lib/alchemy/engine.rb +3 -4
- data/lib/alchemy/essence.rb +24 -16
- data/lib/alchemy/resource.rb +22 -3
- data/lib/alchemy/resources_helper.rb +8 -0
- data/lib/alchemy/seeder.rb +26 -1
- data/lib/alchemy/upgrader.rb +70 -1
- data/lib/alchemy/version.rb +1 -1
- data/lib/alchemy_cms.rb +1 -0
- data/spec/controllers/admin/clipboard_controller_spec.rb +16 -4
- data/spec/controllers/admin/contents_controller_spec.rb +21 -4
- data/spec/dummy/app/models/event.rb +1 -1
- data/spec/dummy/db/schema.rb +18 -1
- data/spec/helpers/admin/contents_helper_spec.rb +3 -2
- data/spec/models/clipboard_spec.rb +14 -3
- data/spec/models/essence_boolean_spec.rb +15 -0
- data/spec/models/essence_select_spec.rb +15 -0
- data/spec/models/resource_spec.rb +113 -0
- metadata +40 -12
- data/app/views/alchemy/admin/contents/destroy.js.erb +0 -7
- data/app/views/alchemy/admin/elements/create.js.erb +0 -36
- data/app/views/alchemy/admin/elements/fold.js.erb +0 -41
- data/app/views/alchemy/admin/essence_pictures/assign.js.erb +0 -16
- data/app/views/alchemy/admin/essence_pictures/destroy.js.erb +0 -20
- data/app/views/alchemy/admin/pages/destroy.js.erb +0 -12
- data/app/views/alchemy/admin/pages/update.js.erb +0 -40
- data/app/views/alchemy/admin/trash/clear.js.erb +0 -3
- data/spec/dummy/app/models/.gitkeep +0 -0
data/Rakefile
CHANGED
data/alchemy_cms.gemspec
CHANGED
@@ -33,6 +33,7 @@ Gem::Specification.new do |s|
|
|
33
33
|
s.add_runtime_dependency(%q<jquery-rails>, ["~> 2.0.0"])
|
34
34
|
s.add_runtime_dependency(%q<attachment_magic>, ["~> 0.2.1"])
|
35
35
|
s.add_runtime_dependency(%q<sass-rails>, ['~> 3.2.3'])
|
36
|
+
s.add_runtime_dependency(%q<coffee-rails>, ['~> 3.2.1'])
|
36
37
|
|
37
38
|
s.add_development_dependency(%q<bumpy>)
|
38
39
|
s.add_development_dependency(%q<capybara>)
|
@@ -2,7 +2,7 @@ if (typeof(Alchemy) === 'undefined') {
|
|
2
2
|
var Alchemy = {};
|
3
3
|
}
|
4
4
|
|
5
|
-
(function
|
5
|
+
(function($) {
|
6
6
|
|
7
7
|
// Setting jQueryUIs global animation duration
|
8
8
|
$.fx.speeds._default = 400;
|
@@ -10,38 +10,44 @@ if (typeof(Alchemy) === 'undefined') {
|
|
10
10
|
// The Alchemy JavaScript Object contains all Functions
|
11
11
|
$.extend(Alchemy, {
|
12
12
|
|
13
|
-
inPlaceEditor:function
|
13
|
+
inPlaceEditor: function(options) {
|
14
14
|
var defaults = {
|
15
|
-
save_label:'save',
|
16
|
-
cancel_label:'cancel'
|
15
|
+
save_label: 'save',
|
16
|
+
cancel_label: 'cancel'
|
17
17
|
};
|
18
18
|
var settings = jQuery.extend({}, defaults, options);
|
19
|
-
var cancel_handler = function
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
19
|
+
var cancel_handler = function(element) {
|
20
|
+
jQuery(element).css({
|
21
|
+
overflow: 'hidden'
|
22
|
+
});
|
23
|
+
return true;
|
24
|
+
};
|
25
|
+
var submit_handler = function(element, id, value) {
|
26
|
+
$(element).css({
|
27
|
+
overflow: 'hidden'
|
28
|
+
});
|
29
|
+
id = id.match(/\d+/)[0];
|
30
|
+
$.ajax({
|
31
|
+
url: Alchemy.routes.admin_picture_path(id),
|
32
|
+
type: 'PUT',
|
33
|
+
data: {
|
34
|
+
name: value,
|
35
|
+
size: Alchemy.getUrlParam('size')
|
36
|
+
}
|
37
|
+
});
|
38
|
+
return false;
|
39
|
+
};
|
40
|
+
|
41
|
+
$('#alchemy .rename').click(function() {
|
42
|
+
$(this).css({
|
43
|
+
overflow: 'visible'
|
33
44
|
});
|
34
|
-
return false;
|
35
|
-
};
|
36
|
-
|
37
|
-
$('#alchemy .rename').click(function () {
|
38
|
-
$(this).css({overflow:'visible'});
|
39
45
|
});
|
40
46
|
|
41
47
|
$('#alchemy .rename').inPlaceEdit({
|
42
|
-
submit:submit_handler,
|
43
|
-
cancel:cancel_handler,
|
44
|
-
html:' \
|
48
|
+
submit: submit_handler,
|
49
|
+
cancel: cancel_handler,
|
50
|
+
html: ' \
|
45
51
|
<div class="inplace-edit"> \
|
46
52
|
<input type="text" value="" class="thin_border field" /> \
|
47
53
|
<div class="buttons"> \
|
@@ -53,7 +59,7 @@ if (typeof(Alchemy) === 'undefined') {
|
|
53
59
|
|
54
60
|
},
|
55
61
|
|
56
|
-
pleaseWaitOverlay:function
|
62
|
+
pleaseWaitOverlay: function(show) {
|
57
63
|
if (typeof(show) == 'undefined') {
|
58
64
|
show = true;
|
59
65
|
}
|
@@ -61,24 +67,24 @@ if (typeof(Alchemy) === 'undefined') {
|
|
61
67
|
$overlay.css("visibility", show ? 'visible' : 'hidden');
|
62
68
|
},
|
63
69
|
|
64
|
-
toggleElement:function
|
65
|
-
var toggle = function
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
70
|
+
toggleElement: function(id, url, token, text) {
|
71
|
+
var toggle = function() {
|
72
|
+
$('#element_' + id + '_folder').hide();
|
73
|
+
$('#element_' + id + '_folder_spinner').show();
|
74
|
+
$.post(url, {
|
75
|
+
authenticity_token: encodeURIComponent(token)
|
76
|
+
}, function(request) {
|
77
|
+
$('#element_' + id + '_folder').show();
|
78
|
+
$('#element_' + id + '_folder_spinner').hide();
|
79
|
+
});
|
80
|
+
}
|
75
81
|
if (Alchemy.isPageDirty()) {
|
76
82
|
Alchemy.openConfirmWindow({
|
77
|
-
title:text.title,
|
78
|
-
message:text.message,
|
79
|
-
okLabel:text.okLabel,
|
80
|
-
cancelLabel:text.cancelLabel,
|
81
|
-
okCallback:toggle
|
83
|
+
title: text.title,
|
84
|
+
message: text.message,
|
85
|
+
okLabel: text.okLabel,
|
86
|
+
cancelLabel: text.cancelLabel,
|
87
|
+
okCallback: toggle
|
82
88
|
});
|
83
89
|
return false;
|
84
90
|
} else {
|
@@ -86,28 +92,27 @@ if (typeof(Alchemy) === 'undefined') {
|
|
86
92
|
}
|
87
93
|
},
|
88
94
|
|
89
|
-
ListFilter:function
|
95
|
+
ListFilter: function(selector) {
|
90
96
|
var text = $('#search_field').val().toLowerCase();
|
91
97
|
var $boxes = $(selector);
|
92
|
-
$boxes.map(function
|
98
|
+
$boxes.map(function() {
|
93
99
|
$this = $(this);
|
94
100
|
$this.css({
|
95
|
-
display
|
101
|
+
display: $this.attr('name').toLowerCase().indexOf(text) != -1 ? '' : 'none'
|
96
102
|
});
|
97
103
|
});
|
98
104
|
},
|
99
105
|
|
100
|
-
fadeImage:function
|
106
|
+
fadeImage: function(image, spinner_selector) {
|
101
107
|
try {
|
102
108
|
$(spinner_selector).hide();
|
103
109
|
$(image).fadeIn(600);
|
104
110
|
} catch (e) {
|
105
111
|
Alchemy.debug(e);
|
106
|
-
}
|
107
|
-
;
|
112
|
+
};
|
108
113
|
},
|
109
114
|
|
110
|
-
removePicture:function
|
115
|
+
removePicture: function(selector) {
|
111
116
|
var $form_field = $(selector);
|
112
117
|
var $element = $form_field.parents('.element_editor');
|
113
118
|
if ($form_field) {
|
@@ -118,16 +123,16 @@ if (typeof(Alchemy) === 'undefined') {
|
|
118
123
|
}
|
119
124
|
},
|
120
125
|
|
121
|
-
setElementSaved:function
|
126
|
+
setElementSaved: function(selector) {
|
122
127
|
var $element = $(selector);
|
123
128
|
Alchemy.setElementClean(selector);
|
124
129
|
Alchemy.enableButton('button.button', $element);
|
125
130
|
},
|
126
131
|
|
127
|
-
resizeFrame:function
|
132
|
+
resizeFrame: function() {
|
128
133
|
var options = {
|
129
|
-
left:65,
|
130
|
-
right:0
|
134
|
+
left: 65,
|
135
|
+
right: 0
|
131
136
|
};
|
132
137
|
var $mainFrame = $('#main_content');
|
133
138
|
var $topFrame = $('#top_menu');
|
@@ -138,58 +143,55 @@ if (typeof(Alchemy) === 'undefined') {
|
|
138
143
|
var width = view_width - options.left - options.right;
|
139
144
|
if ($mainFrame.length > 0) {
|
140
145
|
$mainFrame.css({
|
141
|
-
top:topFrameHeight,
|
142
|
-
width:width,
|
143
|
-
height:mainFrameHeight
|
146
|
+
top: topFrameHeight,
|
147
|
+
width: width,
|
148
|
+
height: mainFrameHeight
|
144
149
|
});
|
145
150
|
}
|
146
151
|
if ($topFrame.length > 0) {
|
147
152
|
$topFrame.css({
|
148
|
-
width:width,
|
149
|
-
height:topFrameHeight
|
153
|
+
width: width,
|
154
|
+
height: topFrameHeight
|
150
155
|
});
|
151
156
|
}
|
152
157
|
},
|
153
158
|
|
154
|
-
Tooltips:function
|
159
|
+
Tooltips: function() {
|
155
160
|
var xOffset = 10;
|
156
161
|
var yOffset = 20;
|
157
|
-
$(".tooltip").hover(function
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
$("#tooltip").remove();
|
176
|
-
});
|
177
|
-
$(".tooltip").mousemove(function (e) {
|
178
|
-
$("#tooltip")
|
179
|
-
.css("top", (e.pageY - xOffset) + "px")
|
180
|
-
.css("left", (e.pageX + yOffset) + "px");
|
162
|
+
$(".tooltip").hover(function(e) {
|
163
|
+
this.original_title = this.title;
|
164
|
+
if (this.original_title == '') {
|
165
|
+
this.tooltip_content = $(this).next('.tooltip_content').html();
|
166
|
+
} else {
|
167
|
+
this.tooltip_content = this.original_title;
|
168
|
+
}
|
169
|
+
if (this.tooltip_content != null) {
|
170
|
+
this.title = "";
|
171
|
+
$("body").append("<div id='tooltip'>" + this.tooltip_content + "</div>");
|
172
|
+
$("#tooltip").css("top", (e.pageY - xOffset) + "px").css("left", (e.pageX + yOffset) + "px").fadeIn(400);
|
173
|
+
}
|
174
|
+
}, function() {
|
175
|
+
this.title = this.original_title;
|
176
|
+
$("#tooltip").remove();
|
177
|
+
});
|
178
|
+
$(".tooltip").mousemove(function(e) {
|
179
|
+
$("#tooltip").css("top", (e.pageY - xOffset) + "px").css("left", (e.pageX + yOffset) + "px");
|
181
180
|
});
|
182
181
|
},
|
183
182
|
|
184
|
-
SelectBox:function
|
185
|
-
$(selector).sb({
|
183
|
+
SelectBox: function(selector) {
|
184
|
+
$(selector).sb({
|
185
|
+
animDuration: 0,
|
186
|
+
fixedWidth: true
|
187
|
+
});
|
186
188
|
},
|
187
189
|
|
188
|
-
Buttons:function
|
190
|
+
Buttons: function(options) {
|
189
191
|
$("button, input:submit, a.button").button(options);
|
190
192
|
},
|
191
193
|
|
192
|
-
handleEssenceCheckbox:function
|
194
|
+
handleEssenceCheckbox: function(checkbox) {
|
193
195
|
var $checkbox = $(checkbox);
|
194
196
|
if (checkbox.checked) {
|
195
197
|
$('#' + checkbox.id + '_hidden').remove();
|
@@ -198,7 +200,7 @@ if (typeof(Alchemy) === 'undefined') {
|
|
198
200
|
}
|
199
201
|
},
|
200
202
|
|
201
|
-
selectOrCreateCellTab:function
|
203
|
+
selectOrCreateCellTab: function(cell_name, label) {
|
202
204
|
if ($('#cell_' + cell_name).size() === 0) {
|
203
205
|
$('#cells').tabs('add', '#cell_' + cell_name, label);
|
204
206
|
$('#cell_' + cell_name).addClass('sortable_cell');
|
@@ -206,20 +208,19 @@ if (typeof(Alchemy) === 'undefined') {
|
|
206
208
|
$('#cells').tabs('select', 'cell_' + cell_name);
|
207
209
|
},
|
208
210
|
|
209
|
-
debug:function
|
211
|
+
debug: function(e) {
|
210
212
|
if (window['console']) {
|
211
213
|
console.debug(e);
|
212
214
|
console.trace();
|
213
215
|
}
|
214
216
|
},
|
215
217
|
|
216
|
-
getUrlParam:function
|
218
|
+
getUrlParam: function(name) {
|
217
219
|
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
|
218
|
-
if (results)
|
219
|
-
return results[1] || 0;
|
220
|
+
if (results) return results[1] || 0;
|
220
221
|
},
|
221
222
|
|
222
|
-
locale:'en'
|
223
|
+
locale: 'en'
|
223
224
|
|
224
225
|
});
|
225
226
|
|
@@ -2,29 +2,33 @@ if (typeof(Alchemy) === 'undefined') {
|
|
2
2
|
var Alchemy = {};
|
3
3
|
}
|
4
4
|
|
5
|
-
(function
|
5
|
+
(function($) {
|
6
6
|
|
7
7
|
$.extend(Alchemy, {
|
8
8
|
|
9
|
-
ButtonObserver:function
|
10
|
-
$(selector).not('.no-spinner').click(function
|
9
|
+
ButtonObserver: function(selector) {
|
10
|
+
$(selector).not('.no-spinner').click(function(event) {
|
11
11
|
Alchemy.disableButton(this);
|
12
12
|
});
|
13
13
|
},
|
14
14
|
|
15
|
-
disableButton:function
|
16
|
-
var $button = $(button),
|
15
|
+
disableButton: function(button) {
|
16
|
+
var $button = $(button),
|
17
|
+
$clone = $button.clone(),
|
18
|
+
width = $button.outerWidth(),
|
19
|
+
text = $button.text();
|
17
20
|
$button.hide().addClass('disabled');
|
18
21
|
$button.parent().append($clone);
|
19
|
-
$clone.attr({
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
$clone.attr({
|
23
|
+
disabled: true,
|
24
|
+
href: 'javascript:void(0)'
|
25
|
+
}).addClass('cloned-button').css({
|
26
|
+
width: width
|
27
|
+
}).html('<img src="/assets/alchemy/ajax_loader.gif" style="width: 16px; height: 16px">').show();
|
24
28
|
return true;
|
25
29
|
},
|
26
30
|
|
27
|
-
enableButton:function
|
31
|
+
enableButton: function(button) {
|
28
32
|
var $button = $(button).not('.no-spinner');
|
29
33
|
$button.show().removeClass('disabled');
|
30
34
|
$button.parent().find('.cloned-button').remove();
|
@@ -2,34 +2,34 @@ if (typeof(Alchemy) === 'undefined') {
|
|
2
2
|
var Alchemy = {};
|
3
3
|
}
|
4
4
|
|
5
|
-
(function
|
5
|
+
(function($) {
|
6
6
|
|
7
7
|
$.extend(Alchemy, {
|
8
8
|
|
9
|
-
Datepicker:function
|
9
|
+
Datepicker: function(selector) {
|
10
10
|
var datepicker_options = {
|
11
|
-
dateFormat:'yy-mm-dd',
|
12
|
-
changeMonth:true,
|
13
|
-
changeYear:true,
|
14
|
-
showWeek:true,
|
15
|
-
showButtonPanel:true,
|
16
|
-
showOtherMonths:true
|
11
|
+
dateFormat: 'yy-mm-dd',
|
12
|
+
changeMonth: true,
|
13
|
+
changeYear: true,
|
14
|
+
showWeek: true,
|
15
|
+
showButtonPanel: true,
|
16
|
+
showOtherMonths: true
|
17
17
|
};
|
18
18
|
if (typeof(selector) === 'undefined') {
|
19
19
|
var selector = 'input[type="date"], input.date'
|
20
20
|
}
|
21
21
|
if (Alchemy.locale === 'de') {
|
22
22
|
$.extend(datepicker_options, {
|
23
|
-
dateFormat:'dd.mm.yy',
|
24
|
-
dayNames:['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
|
25
|
-
dayNamesMin:['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
|
26
|
-
monthNames:['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
|
27
|
-
monthNamesShort:['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
|
28
|
-
closeText:'Ok',
|
29
|
-
currentText:'Heute',
|
30
|
-
weekHeader:'KW',
|
31
|
-
nextText:'nächster',
|
32
|
-
prevText:'vorheriger'
|
23
|
+
dateFormat: 'dd.mm.yy',
|
24
|
+
dayNames: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
|
25
|
+
dayNamesMin: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
|
26
|
+
monthNames: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
|
27
|
+
monthNamesShort: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
|
28
|
+
closeText: 'Ok',
|
29
|
+
currentText: 'Heute',
|
30
|
+
weekHeader: 'KW',
|
31
|
+
nextText: 'nächster',
|
32
|
+
prevText: 'vorheriger'
|
33
33
|
});
|
34
34
|
}
|
35
35
|
$(selector).datepicker(datepicker_options);
|
@@ -2,42 +2,42 @@ if (typeof(Alchemy) === 'undefined') {
|
|
2
2
|
var Alchemy = {};
|
3
3
|
}
|
4
4
|
|
5
|
-
(function
|
5
|
+
(function($) {
|
6
6
|
|
7
7
|
$.extend(Alchemy, {
|
8
8
|
|
9
|
-
ElementDirtyObserver:function
|
9
|
+
ElementDirtyObserver: function(selector) {
|
10
10
|
var $elements = $(selector);
|
11
|
-
$elements.find('textarea.default_tinymce').map(function
|
11
|
+
$elements.find('textarea.default_tinymce').map(function() {
|
12
12
|
var $this = $(this);
|
13
13
|
var ed = tinymce.get(this.id);
|
14
14
|
if (ed) {
|
15
|
-
ed.onChange.add(function
|
15
|
+
ed.onChange.add(function(ed, l) {
|
16
16
|
Alchemy.setElementDirty($this.parents('.element_editor'));
|
17
17
|
});
|
18
18
|
}
|
19
19
|
});
|
20
|
-
$elements.find('input[type="text"]').bind('change', function
|
20
|
+
$elements.find('input[type="text"]').bind('change', function() {
|
21
21
|
$(this).addClass('dirty');
|
22
22
|
Alchemy.setElementDirty($(this).parents('.element_editor'));
|
23
23
|
});
|
24
|
-
$elements.find('.element_foot input[type="checkbox"]').bind('click', function
|
24
|
+
$elements.find('.element_foot input[type="checkbox"]').bind('click', function() {
|
25
25
|
$(this).addClass('dirty');
|
26
26
|
Alchemy.setElementDirty($(this).parents('.element_editor'));
|
27
27
|
});
|
28
|
-
$elements.find('select').bind('change', function
|
28
|
+
$elements.find('select').bind('change', function() {
|
29
29
|
$(this).addClass('dirty');
|
30
30
|
Alchemy.setElementDirty($(this).parents('.element_editor'));
|
31
31
|
});
|
32
32
|
},
|
33
33
|
|
34
|
-
setElementDirty:function
|
34
|
+
setElementDirty: function(element) {
|
35
35
|
var $element = $(element);
|
36
36
|
$element.addClass('dirty');
|
37
37
|
$element.find('.element_head .icon').addClass('element_dirty');
|
38
38
|
},
|
39
39
|
|
40
|
-
setElementClean:function
|
40
|
+
setElementClean: function(element) {
|
41
41
|
var $element = $(element);
|
42
42
|
$element.removeClass('dirty');
|
43
43
|
$element.find('.element_foot input[type="checkbox"]').removeClass('dirty');
|
@@ -46,14 +46,14 @@ if (typeof(Alchemy) === 'undefined') {
|
|
46
46
|
$element.find('.element_head .icon').removeClass('element_dirty');
|
47
47
|
},
|
48
48
|
|
49
|
-
isPageDirty:function
|
49
|
+
isPageDirty: function() {
|
50
50
|
return $('#element_area').find('.element_editor.dirty').size() > 0;
|
51
51
|
},
|
52
52
|
|
53
|
-
checkPageDirtyness:function
|
53
|
+
checkPageDirtyness: function(element, text) {
|
54
54
|
var okcallback;
|
55
55
|
if ($(element).is('form')) {
|
56
|
-
okcallback = function
|
56
|
+
okcallback = function() {
|
57
57
|
var $form = $('<form action="' + element.action + '" method="POST" style="display: none"></form>');
|
58
58
|
$form.append($(element).find('input'));
|
59
59
|
$form.appendTo('body');
|
@@ -61,18 +61,18 @@ if (typeof(Alchemy) === 'undefined') {
|
|
61
61
|
$form.submit();
|
62
62
|
};
|
63
63
|
} else if ($(element).is('a')) {
|
64
|
-
okcallback = function
|
64
|
+
okcallback = function() {
|
65
65
|
Alchemy.pleaseWaitOverlay();
|
66
66
|
document.location = element.pathname;
|
67
67
|
};
|
68
68
|
}
|
69
69
|
if (Alchemy.isPageDirty()) {
|
70
70
|
Alchemy.openConfirmWindow({
|
71
|
-
title:text.title,
|
72
|
-
message:text.message,
|
73
|
-
okLabel:text.okLabel,
|
74
|
-
cancelLabel:text.cancelLabel,
|
75
|
-
okCallback:okcallback
|
71
|
+
title: text.title,
|
72
|
+
message: text.message,
|
73
|
+
okLabel: text.okLabel,
|
74
|
+
cancelLabel: text.cancelLabel,
|
75
|
+
okCallback: okcallback
|
76
76
|
});
|
77
77
|
return false;
|
78
78
|
} else {
|
@@ -80,8 +80,8 @@ if (typeof(Alchemy) === 'undefined') {
|
|
80
80
|
}
|
81
81
|
},
|
82
82
|
|
83
|
-
PageLeaveObserver:function
|
84
|
-
$('#main_navi a').click(function
|
83
|
+
PageLeaveObserver: function(texts) {
|
84
|
+
$('#main_navi a').click(function(event) {
|
85
85
|
if (!Alchemy.checkPageDirtyness(event.currentTarget, texts)) {
|
86
86
|
event.preventDefault();
|
87
87
|
}
|