scrivito_sdk 0.66.0 → 0.70.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/scrivito/blobs_controller.rb +5 -0
- data/app/controllers/scrivito/objs_controller.rb +2 -1
- data/app/controllers/scrivito/ui_controller.rb +33 -3
- data/app/helpers/scrivito_helper.rb +14 -20
- data/app/views/scrivito/objs/update.json.jbuilder +1 -1
- data/app/views/scrivito/ui/index.html.erb +1 -1
- data/app/views/scrivito/webservice/_workspace.json.jbuilder +2 -1
- data/config/ca-bundle.crt +1 -1
- data/config/precedence_routes.rb +3 -2
- data/lib/assets/javascripts/scrivito.js +46 -0
- data/lib/assets/javascripts/scrivito_ui.js +931 -501
- data/lib/assets/stylesheets/scrivito.css +1 -0
- data/lib/assets/stylesheets/scrivito_ui.css +1 -1
- data/lib/generators/scrivito/install/templates/app/views/page/index.html.erb +3 -3
- data/lib/generators/scrivito/page/page_generator.rb +3 -0
- data/lib/generators/scrivito/page/templates/model.erb +3 -0
- data/lib/generators/scrivito/widget/templates/model.erb +3 -0
- data/lib/generators/scrivito/widget/widget_generator.rb +3 -0
- data/lib/scrivito/attribute_content.rb +93 -60
- data/lib/scrivito/attribute_definition.rb +3 -3
- data/lib/scrivito/attribute_serializer.rb +2 -2
- data/lib/scrivito/backend/obj_data_cache.rb +22 -9
- data/lib/scrivito/basic_obj.rb +238 -130
- data/lib/scrivito/basic_widget.rb +32 -20
- data/lib/scrivito/binary.rb +74 -45
- data/lib/scrivito/binary_routing.rb +52 -0
- data/lib/scrivito/cache_middleware.rb +0 -5
- data/lib/scrivito/client_attribute_serializer.rb +134 -0
- data/lib/scrivito/cms_backend.rb +51 -33
- data/lib/scrivito/cms_data_cache.rb +1 -0
- data/lib/scrivito/cms_dispatch_controller.rb +1 -1
- data/lib/scrivito/cms_env.rb +1 -11
- data/lib/scrivito/cms_field_tag.rb +10 -7
- data/lib/scrivito/cms_rest_api/rate_limit.rb +5 -5
- data/lib/scrivito/cms_rest_api/request_timer.rb +27 -0
- data/lib/scrivito/cms_rest_api/widget_extractor.rb +8 -6
- data/lib/scrivito/cms_rest_api.rb +107 -54
- data/lib/scrivito/cms_routing.rb +13 -25
- data/lib/scrivito/configuration.rb +5 -2
- data/lib/scrivito/controller_actions.rb +68 -7
- data/lib/scrivito/controller_runtime.rb +8 -0
- data/lib/scrivito/date_attribute.rb +8 -0
- data/lib/scrivito/errors.rb +6 -3
- data/lib/scrivito/generator_helper.rb +13 -0
- data/lib/scrivito/image_tag.rb +24 -30
- data/lib/scrivito/layout_tags.rb +12 -6
- data/lib/scrivito/link.rb +46 -30
- data/lib/scrivito/log_subscriber.rb +15 -0
- data/lib/scrivito/membership.rb +3 -3
- data/lib/scrivito/membership_collection.rb +10 -10
- data/lib/scrivito/meta_data_collection.rb +22 -0
- data/lib/scrivito/model_library.rb +7 -1
- data/lib/scrivito/obj_collection.rb +18 -16
- data/lib/scrivito/obj_params_parser.rb +1 -1
- data/lib/scrivito/obj_search_enumerator.rb +35 -35
- data/lib/scrivito/page_config.rb +55 -0
- data/lib/scrivito/request_homepage.rb +23 -0
- data/lib/scrivito/routing_helper.rb +8 -8
- data/lib/scrivito/sdk_engine.rb +2 -3
- data/lib/scrivito/ui_config.rb +85 -0
- data/lib/scrivito/user.rb +30 -23
- data/lib/scrivito/user_definition.rb +48 -47
- data/lib/scrivito/widget_tag.rb +11 -0
- data/lib/scrivito/workspace.rb +93 -35
- data/lib/scrivito/workspace_selection_middleware.rb +8 -1
- data/lib/scrivito_sdk.rb +24 -24
- metadata +24 -33
- data/lib/assets/javascripts/scrivito_sdk.js +0 -57
- data/lib/assets/stylesheets/scrivito_sdk.css +0 -1
- data/lib/scrivito/client_config.rb +0 -113
- data/lib/scrivito/editing_context_helper.rb +0 -19
- data/lib/scrivito/named_link.rb +0 -39
@@ -26089,37 +26089,127 @@ helpers = helpers || Handlebars.helpers; data = data || {};
|
|
26089
26089
|
var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
|
26090
26090
|
|
26091
26091
|
|
26092
|
-
buffer += "<div class=\"scrivito_changes_overview scrivito_modal_large scrivito_adjust_dialog\" >\n\n <div class=\"
|
26092
|
+
buffer += "<div class=\"scrivito_changes_overview scrivito_modal_large scrivito_adjust_dialog\" >\n <div class=\"scrivito_changes_dialog_content scrivito_auto_height\"></div>\n <div class=\"scrivito_modal_footer\">\n <a href=\"#\" class=\"scrivito_button scrivito_cancel scrivito_green\">";
|
26093
26093
|
options = {hash:{},data:data};
|
26094
|
-
buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "
|
26095
|
-
+ "
|
26094
|
+
buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "done", options) : helperMissing.call(depth0, "translate", "done", options)))
|
26095
|
+
+ "</a>\n </div>\n</div>\n";
|
26096
|
+
return buffer;
|
26097
|
+
});
|
26098
|
+
return this.ScrivitoHandlebarsTemplates["changes_dialog"];
|
26099
|
+
}).call(this);
|
26100
|
+
(function() {
|
26101
|
+
this.ScrivitoHandlebarsTemplates || (this.ScrivitoHandlebarsTemplates = {});
|
26102
|
+
this.ScrivitoHandlebarsTemplates["changes_dialog/content"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
26103
|
+
this.compilerInfo = [3,'>= 1.0.0-rc.4'];
|
26104
|
+
helpers = helpers || Handlebars.helpers; data = data || {};
|
26105
|
+
var buffer = "", stack1, stack2, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this;
|
26106
|
+
|
26107
|
+
function program1(depth0,data) {
|
26108
|
+
|
26109
|
+
var buffer = "", stack1, stack2;
|
26110
|
+
buffer += "<span>("
|
26111
|
+
+ escapeExpression(((stack1 = ((stack1 = depth0.objs),stack1 == null || stack1 === false ? stack1 : stack1.length)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
|
26112
|
+
+ " / ";
|
26113
|
+
if (stack2 = helpers.total) { stack2 = stack2.call(depth0, {hash:{},data:data}); }
|
26114
|
+
else { stack2 = depth0.total; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }
|
26115
|
+
buffer += escapeExpression(stack2)
|
26116
|
+
+ ")</span>";
|
26117
|
+
return buffer;
|
26118
|
+
}
|
26119
|
+
|
26120
|
+
function program3(depth0,data) {
|
26121
|
+
|
26122
|
+
var buffer = "", stack1, stack2;
|
26123
|
+
buffer += "\n <table class=\"scrivito_changes_table\">\n ";
|
26124
|
+
stack2 = helpers['if'].call(depth0, ((stack1 = depth0.objs),stack1 == null || stack1 === false ? stack1 : stack1.length), {hash:{},inverse:self.noop,fn:self.program(4, program4, data),data:data});
|
26125
|
+
if(stack2 || stack2 === 0) { buffer += stack2; }
|
26126
|
+
buffer += "\n\n <tbody>\n ";
|
26127
|
+
stack2 = helpers['if'].call(depth0, ((stack1 = depth0.objs),stack1 == null || stack1 === false ? stack1 : stack1.length), {hash:{},inverse:self.program(9, program9, data),fn:self.program(6, program6, data),data:data});
|
26128
|
+
if(stack2 || stack2 === 0) { buffer += stack2; }
|
26129
|
+
buffer += "\n </tbody>\n </table>\n ";
|
26130
|
+
return buffer;
|
26131
|
+
}
|
26132
|
+
function program4(depth0,data) {
|
26133
|
+
|
26134
|
+
var buffer = "", stack1, options;
|
26135
|
+
buffer += "\n <thead>\n <tr>\n <th>\n <span data-scrivito-sort-by=\"_modification\">\n ";
|
26136
|
+
options = {hash:{},data:data};
|
26137
|
+
buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "changes_dialog.modification", options) : helperMissing.call(depth0, "translate", "changes_dialog.modification", options)))
|
26138
|
+
+ "\n </span>\n </th>\n <th><span>";
|
26096
26139
|
options = {hash:{},data:data};
|
26097
|
-
buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "changes_dialog.
|
26098
|
-
+ "</span></th>\n
|
26140
|
+
buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "changes_dialog.rights", options) : helperMissing.call(depth0, "translate", "changes_dialog.rights", options)))
|
26141
|
+
+ "</span></th>\n <th><span>";
|
26099
26142
|
options = {hash:{},data:data};
|
26100
|
-
buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "changes_dialog.
|
26101
|
-
+ "</span></th>\n
|
26143
|
+
buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "changes_dialog.description_for_editor", options) : helperMissing.call(depth0, "translate", "changes_dialog.description_for_editor", options)))
|
26144
|
+
+ "</span></th>\n <th>\n <span data-scrivito-sort-by=\"_obj_class_name\">\n ";
|
26102
26145
|
options = {hash:{},data:data};
|
26103
|
-
buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "changes_dialog.
|
26104
|
-
+ "</span
|
26146
|
+
buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "changes_dialog.obj_class_name", options) : helperMissing.call(depth0, "translate", "changes_dialog.obj_class_name", options)))
|
26147
|
+
+ "\n </span>\n </th>\n <th>\n <span data-scrivito-sort-by=\"_last_changed\">\n ";
|
26105
26148
|
options = {hash:{},data:data};
|
26106
|
-
buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "changes_dialog.
|
26107
|
-
+ "</span
|
26149
|
+
buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "changes_dialog.last_changed", options) : helperMissing.call(depth0, "translate", "changes_dialog.last_changed", options)))
|
26150
|
+
+ "\n </span>\n </th>\n </tr>\n </thead>\n ";
|
26151
|
+
return buffer;
|
26152
|
+
}
|
26153
|
+
|
26154
|
+
function program6(depth0,data) {
|
26155
|
+
|
26156
|
+
var buffer = "", stack1;
|
26157
|
+
buffer += "\n ";
|
26158
|
+
stack1 = helpers.each.call(depth0, depth0.objs, {hash:{},inverse:self.noop,fn:self.program(7, program7, data),data:data});
|
26159
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
26160
|
+
buffer += "\n ";
|
26161
|
+
return buffer;
|
26162
|
+
}
|
26163
|
+
function program7(depth0,data) {
|
26164
|
+
|
26165
|
+
var stack1, options;
|
26108
26166
|
options = {hash:{},data:data};
|
26109
|
-
|
26110
|
-
|
26167
|
+
return escapeExpression(((stack1 = helpers.render),stack1 ? stack1.call(depth0, "changes_dialog/row", depth0, options) : helperMissing.call(depth0, "render", "changes_dialog/row", depth0, options)));
|
26168
|
+
}
|
26169
|
+
|
26170
|
+
function program9(depth0,data) {
|
26171
|
+
|
26172
|
+
var buffer = "", stack1, options;
|
26173
|
+
buffer += "\n <tr>\n <td class=\"scrivito_empty_result\" colspan=\"5\">";
|
26111
26174
|
options = {hash:{},data:data};
|
26112
|
-
buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "changes_dialog.
|
26113
|
-
+ "
|
26175
|
+
buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "changes_dialog.empty", options) : helperMissing.call(depth0, "translate", "changes_dialog.empty", options)))
|
26176
|
+
+ "</td>\n </tr>\n ";
|
26177
|
+
return buffer;
|
26178
|
+
}
|
26179
|
+
|
26180
|
+
function program11(depth0,data) {
|
26181
|
+
|
26182
|
+
|
26183
|
+
return "\n <tr><td colspan=\"5\"><i class=\"scrivito_icon scrivito_spinning\"></i></td></tr>\n ";
|
26184
|
+
}
|
26185
|
+
|
26186
|
+
function program13(depth0,data) {
|
26187
|
+
|
26188
|
+
var buffer = "", stack1, options;
|
26189
|
+
buffer += "<span class=\"scrivito_load_more\">";
|
26114
26190
|
options = {hash:{},data:data};
|
26115
26191
|
buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "changes_dialog.more", options) : helperMissing.call(depth0, "translate", "changes_dialog.more", options)))
|
26116
|
-
+ "</span
|
26117
|
-
|
26118
|
-
|
26119
|
-
|
26192
|
+
+ "</span>";
|
26193
|
+
return buffer;
|
26194
|
+
}
|
26195
|
+
|
26196
|
+
buffer += "<div class=\"scrivito_modal_header\">\n <h3>\n <i class=\"scrivito_icon\"></i> ";
|
26197
|
+
if (stack1 = helpers.title) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
|
26198
|
+
else { stack1 = depth0.title; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
|
26199
|
+
buffer += escapeExpression(stack1)
|
26200
|
+
+ "\n ";
|
26201
|
+
stack2 = helpers['if'].call(depth0, ((stack1 = depth0.objs),stack1 == null || stack1 === false ? stack1 : stack1.length), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
|
26202
|
+
if(stack2 || stack2 === 0) { buffer += stack2; }
|
26203
|
+
buffer += "\n </h3>\n</div>\n\n<div class=\"scrivito_modal_body scrivito_auto_height\">\n ";
|
26204
|
+
stack2 = helpers['if'].call(depth0, depth0.is_loaded, {hash:{},inverse:self.program(11, program11, data),fn:self.program(3, program3, data),data:data});
|
26205
|
+
if(stack2 || stack2 === 0) { buffer += stack2; }
|
26206
|
+
buffer += "\n\n ";
|
26207
|
+
stack2 = helpers['if'].call(depth0, depth0.has_more, {hash:{},inverse:self.noop,fn:self.program(13, program13, data),data:data});
|
26208
|
+
if(stack2 || stack2 === 0) { buffer += stack2; }
|
26209
|
+
buffer += "\n</div>\n";
|
26120
26210
|
return buffer;
|
26121
26211
|
});
|
26122
|
-
return this.ScrivitoHandlebarsTemplates["changes_dialog"];
|
26212
|
+
return this.ScrivitoHandlebarsTemplates["changes_dialog/content"];
|
26123
26213
|
}).call(this);
|
26124
26214
|
(function() {
|
26125
26215
|
this.ScrivitoHandlebarsTemplates || (this.ScrivitoHandlebarsTemplates = {});
|
@@ -26137,7 +26227,7 @@ function program1(depth0,data) {
|
|
26137
26227
|
function program3(depth0,data) {
|
26138
26228
|
|
26139
26229
|
var buffer = "", stack1, stack2, options;
|
26140
|
-
buffer += "\n
|
26230
|
+
buffer += "\n <span class=\"scrivito_restriction\" title=\"";
|
26141
26231
|
options = {hash:{},data:data};
|
26142
26232
|
stack2 = ((stack1 = helpers.array_to_title),stack1 ? stack1.call(depth0, depth0.restriction_messages, options) : helperMissing.call(depth0, "array_to_title", depth0.restriction_messages, options));
|
26143
26233
|
if(stack2 || stack2 === 0) { buffer += stack2; }
|
@@ -26148,53 +26238,45 @@ function program3(depth0,data) {
|
|
26148
26238
|
function program5(depth0,data) {
|
26149
26239
|
|
26150
26240
|
|
26151
|
-
return "\n
|
26241
|
+
return "\n <span></span>\n ";
|
26152
26242
|
}
|
26153
26243
|
|
26154
26244
|
function program7(depth0,data) {
|
26155
26245
|
|
26156
26246
|
var buffer = "", stack1, options;
|
26157
|
-
buffer += "\n <span
|
26247
|
+
buffer += "\n <span>\n <time datetime=\"";
|
26158
26248
|
if (stack1 = helpers.last_changed) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
|
26159
26249
|
else { stack1 = depth0.last_changed; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
|
26160
26250
|
buffer += escapeExpression(stack1)
|
26161
26251
|
+ "\" title=\"";
|
26162
26252
|
options = {hash:{},data:data};
|
26163
26253
|
buffer += escapeExpression(((stack1 = helpers.localize_date),stack1 ? stack1.call(depth0, depth0.last_changed, options) : helperMissing.call(depth0, "localize_date", depth0.last_changed, options)))
|
26164
|
-
+ "\">\n
|
26254
|
+
+ "\">\n ";
|
26165
26255
|
options = {hash:{},data:data};
|
26166
26256
|
buffer += escapeExpression(((stack1 = helpers.localize_date_relative),stack1 ? stack1.call(depth0, depth0.last_changed, options) : helperMissing.call(depth0, "localize_date_relative", depth0.last_changed, options)))
|
26167
|
-
+ "\n </
|
26257
|
+
+ "\n </time>\n </span>\n ";
|
26168
26258
|
return buffer;
|
26169
26259
|
}
|
26170
26260
|
|
26171
|
-
buffer += "<tr
|
26261
|
+
buffer += "<tr title=\"";
|
26172
26262
|
if (stack1 = helpers.tooltip) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
|
26173
26263
|
else { stack1 = depth0.tooltip; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
|
26174
26264
|
buffer += escapeExpression(stack1)
|
26175
|
-
+ "\"
|
26265
|
+
+ "\" data-scrivito-obj-id=\"";
|
26176
26266
|
if (stack1 = helpers.id) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
|
26177
26267
|
else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
|
26178
26268
|
buffer += escapeExpression(stack1)
|
26179
|
-
+ "\"
|
26180
|
-
if (stack1 = helpers.modification) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
|
26181
|
-
else { stack1 = depth0.modification; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
|
26182
|
-
buffer += escapeExpression(stack1)
|
26183
|
-
+ "\"\n data-scrivito-private-changes-list-obj-is-binary=\"";
|
26184
|
-
if (stack1 = helpers.is_binary) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
|
26185
|
-
else { stack1 = depth0.is_binary; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
|
26186
|
-
buffer += escapeExpression(stack1)
|
26187
|
-
+ "\">\n <td><span class=\"scrivito_changes_state ";
|
26269
|
+
+ "\">\n <td>\n <span class=\"scrivito_changes_state ";
|
26188
26270
|
if (stack1 = helpers.modification) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
|
26189
26271
|
else { stack1 = depth0.modification; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
|
26190
26272
|
buffer += escapeExpression(stack1)
|
26191
26273
|
+ " ";
|
26192
26274
|
stack1 = helpers['if'].call(depth0, depth0.has_conflict, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
|
26193
26275
|
if(stack1 || stack1 === 0) { buffer += stack1; }
|
26194
|
-
buffer += "\"
|
26276
|
+
buffer += "\">\n </span>\n </td>\n\n <td>\n ";
|
26195
26277
|
stack1 = helpers['if'].call(depth0, depth0.has_restriction, {hash:{},inverse:self.program(5, program5, data),fn:self.program(3, program3, data),data:data});
|
26196
26278
|
if(stack1 || stack1 === 0) { buffer += stack1; }
|
26197
|
-
buffer += "\n </td>\n <td><span class=\"scrivito_title\">";
|
26279
|
+
buffer += "\n </td>\n\n <td><span class=\"scrivito_title\">";
|
26198
26280
|
if (stack1 = helpers.description_for_editor) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
|
26199
26281
|
else { stack1 = depth0.description_for_editor; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
|
26200
26282
|
buffer += escapeExpression(stack1)
|
@@ -26202,7 +26284,7 @@ function program7(depth0,data) {
|
|
26202
26284
|
if (stack1 = helpers.obj_class_name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
|
26203
26285
|
else { stack1 = depth0.obj_class_name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
|
26204
26286
|
buffer += escapeExpression(stack1)
|
26205
|
-
+ "</span></td>\n <td>\n ";
|
26287
|
+
+ "</span></td>\n\n <td>\n ";
|
26206
26288
|
stack1 = helpers.unless.call(depth0, depth0.is_deleted, {hash:{},inverse:self.noop,fn:self.program(7, program7, data),data:data});
|
26207
26289
|
if(stack1 || stack1 === 0) { buffer += stack1; }
|
26208
26290
|
buffer += "\n </td>\n</tr>\n";
|
@@ -26238,41 +26320,78 @@ helpers = helpers || Handlebars.helpers; data = data || {};
|
|
26238
26320
|
}).call(this);
|
26239
26321
|
(function() {
|
26240
26322
|
this.ScrivitoHandlebarsTemplates || (this.ScrivitoHandlebarsTemplates = {});
|
26241
|
-
this.ScrivitoHandlebarsTemplates["
|
26323
|
+
this.ScrivitoHandlebarsTemplates["choose_obj_class_dialog/item"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
26242
26324
|
this.compilerInfo = [3,'>= 1.0.0-rc.4'];
|
26243
26325
|
helpers = helpers || Handlebars.helpers; data = data || {};
|
26244
|
-
var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression
|
26326
|
+
var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression;
|
26327
|
+
|
26328
|
+
|
26329
|
+
buffer += "<div class=\"scrivito_obj_class_thumbnail scrivito_editing_widget_preview\"\n data-scrivito-private-obj-class-name=\"";
|
26330
|
+
if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
|
26331
|
+
else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
|
26332
|
+
buffer += escapeExpression(stack1)
|
26333
|
+
+ "\">\n ";
|
26334
|
+
if (stack1 = helpers.markup) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
|
26335
|
+
else { stack1 = depth0.markup; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
|
26336
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
26337
|
+
buffer += "\n</div>\n";
|
26338
|
+
return buffer;
|
26339
|
+
});
|
26340
|
+
return this.ScrivitoHandlebarsTemplates["choose_obj_class_dialog/item"];
|
26341
|
+
}).call(this);
|
26342
|
+
(function() {
|
26343
|
+
this.ScrivitoHandlebarsTemplates || (this.ScrivitoHandlebarsTemplates = {});
|
26344
|
+
this.ScrivitoHandlebarsTemplates["choose_obj_class_dialog/list"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
26345
|
+
this.compilerInfo = [3,'>= 1.0.0-rc.4'];
|
26346
|
+
helpers = helpers || Handlebars.helpers; data = data || {};
|
26347
|
+
var buffer = "", stack1, stack2, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, self=this;
|
26245
26348
|
|
26246
26349
|
function program1(depth0,data) {
|
26247
26350
|
|
26248
|
-
var buffer = "", stack1;
|
26249
|
-
buffer += "\n ";
|
26250
|
-
|
26251
|
-
|
26351
|
+
var buffer = "", stack1, stack2, options;
|
26352
|
+
buffer += "\n <div class=\"scrivito_editing_widget_preview_divider\">\n <span>";
|
26353
|
+
options = {hash:{},data:data};
|
26354
|
+
buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "choose_obj_class_dialog.last_used", options) : helperMissing.call(depth0, "translate", "choose_obj_class_dialog.last_used", options)))
|
26355
|
+
+ "</span>\n </div>\n\n ";
|
26356
|
+
stack2 = helpers.each.call(depth0, ((stack1 = depth0.obj_class_selection),stack1 == null || stack1 === false ? stack1 : stack1.recent), {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data});
|
26357
|
+
if(stack2 || stack2 === 0) { buffer += stack2; }
|
26252
26358
|
buffer += "\n";
|
26253
26359
|
return buffer;
|
26254
26360
|
}
|
26255
26361
|
function program2(depth0,data) {
|
26256
26362
|
|
26257
|
-
var buffer = "", stack1;
|
26258
|
-
buffer += "\n
|
26259
|
-
|
26260
|
-
|
26261
|
-
buffer +=
|
26262
|
-
|
26263
|
-
if (stack1 = helpers.markup) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
|
26264
|
-
else { stack1 = depth0.markup; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
|
26265
|
-
if(stack1 || stack1 === 0) { buffer += stack1; }
|
26266
|
-
buffer += "\n </div>\n ";
|
26363
|
+
var buffer = "", stack1, stack2, options;
|
26364
|
+
buffer += "\n ";
|
26365
|
+
options = {hash:{},data:data};
|
26366
|
+
stack2 = ((stack1 = helpers.render),stack1 ? stack1.call(depth0, "choose_obj_class_dialog/item", depth0, options) : helperMissing.call(depth0, "render", "choose_obj_class_dialog/item", depth0, options));
|
26367
|
+
if(stack2 || stack2 === 0) { buffer += stack2; }
|
26368
|
+
buffer += "\n ";
|
26267
26369
|
return buffer;
|
26268
26370
|
}
|
26269
26371
|
|
26270
|
-
|
26271
|
-
|
26372
|
+
function program4(depth0,data) {
|
26373
|
+
|
26374
|
+
var buffer = "", stack1, stack2, options;
|
26375
|
+
buffer += "\n ";
|
26376
|
+
options = {hash:{},data:data};
|
26377
|
+
stack2 = ((stack1 = helpers.render),stack1 ? stack1.call(depth0, "choose_obj_class_dialog/item", depth0, options) : helperMissing.call(depth0, "render", "choose_obj_class_dialog/item", depth0, options));
|
26378
|
+
if(stack2 || stack2 === 0) { buffer += stack2; }
|
26379
|
+
buffer += "\n";
|
26380
|
+
return buffer;
|
26381
|
+
}
|
26382
|
+
|
26383
|
+
stack2 = helpers['if'].call(depth0, ((stack1 = depth0.obj_class_selection),stack1 == null || stack1 === false ? stack1 : stack1.recent), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
|
26384
|
+
if(stack2 || stack2 === 0) { buffer += stack2; }
|
26385
|
+
buffer += "\n\n<div class=\"scrivito_editing_widget_preview_divider\">\n <span>";
|
26386
|
+
options = {hash:{},data:data};
|
26387
|
+
buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "choose_obj_class_dialog.all", options) : helperMissing.call(depth0, "translate", "choose_obj_class_dialog.all", options)))
|
26388
|
+
+ "</span>\n</div>\n\n";
|
26389
|
+
stack2 = helpers.each.call(depth0, ((stack1 = depth0.obj_class_selection),stack1 == null || stack1 === false ? stack1 : stack1.all), {hash:{},inverse:self.noop,fn:self.program(4, program4, data),data:data});
|
26390
|
+
if(stack2 || stack2 === 0) { buffer += stack2; }
|
26272
26391
|
buffer += "\n";
|
26273
26392
|
return buffer;
|
26274
26393
|
});
|
26275
|
-
return this.ScrivitoHandlebarsTemplates["
|
26394
|
+
return this.ScrivitoHandlebarsTemplates["choose_obj_class_dialog/list"];
|
26276
26395
|
}).call(this);
|
26277
26396
|
(function() {
|
26278
26397
|
this.ScrivitoHandlebarsTemplates || (this.ScrivitoHandlebarsTemplates = {});
|
@@ -26672,6 +26791,94 @@ helpers = helpers || Handlebars.helpers; data = data || {};
|
|
26672
26791
|
});
|
26673
26792
|
return this.ScrivitoHandlebarsTemplates["element_overlay"];
|
26674
26793
|
}).call(this);
|
26794
|
+
(function() {
|
26795
|
+
this.ScrivitoHandlebarsTemplates || (this.ScrivitoHandlebarsTemplates = {});
|
26796
|
+
this.ScrivitoHandlebarsTemplates["iframe_dialog"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
26797
|
+
this.compilerInfo = [3,'>= 1.0.0-rc.4'];
|
26798
|
+
helpers = helpers || Handlebars.helpers; data = data || {};
|
26799
|
+
var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
|
26800
|
+
|
26801
|
+
function program1(depth0,data) {
|
26802
|
+
|
26803
|
+
var buffer = "", stack1;
|
26804
|
+
buffer += "scrivito_";
|
26805
|
+
if (stack1 = helpers.color) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
|
26806
|
+
else { stack1 = depth0.color; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
|
26807
|
+
buffer += escapeExpression(stack1);
|
26808
|
+
return buffer;
|
26809
|
+
}
|
26810
|
+
|
26811
|
+
function program3(depth0,data) {
|
26812
|
+
|
26813
|
+
var buffer = "", stack1;
|
26814
|
+
buffer += "\n ";
|
26815
|
+
stack1 = helpers['with'].call(depth0, depth0.cancel, {hash:{},inverse:self.noop,fn:self.program(4, program4, data),data:data});
|
26816
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
26817
|
+
buffer += "\n ";
|
26818
|
+
return buffer;
|
26819
|
+
}
|
26820
|
+
function program4(depth0,data) {
|
26821
|
+
|
26822
|
+
var buffer = "", stack1;
|
26823
|
+
buffer += "\n <a href=\"#\" class=\"scrivito_button scrivito_cancel ";
|
26824
|
+
stack1 = helpers['if'].call(depth0, depth0.color, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
|
26825
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
26826
|
+
buffer += "\">\n ";
|
26827
|
+
stack1 = helpers['if'].call(depth0, depth0.title, {hash:{},inverse:self.program(7, program7, data),fn:self.program(5, program5, data),data:data});
|
26828
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
26829
|
+
buffer += "\n </a>\n ";
|
26830
|
+
return buffer;
|
26831
|
+
}
|
26832
|
+
function program5(depth0,data) {
|
26833
|
+
|
26834
|
+
var stack1;
|
26835
|
+
if (stack1 = helpers.title) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
|
26836
|
+
else { stack1 = depth0.title; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
|
26837
|
+
return escapeExpression(stack1);
|
26838
|
+
}
|
26839
|
+
|
26840
|
+
function program7(depth0,data) {
|
26841
|
+
|
26842
|
+
|
26843
|
+
return escapeExpression((typeof depth0 === functionType ? depth0.apply(depth0) : depth0));
|
26844
|
+
}
|
26845
|
+
|
26846
|
+
function program9(depth0,data) {
|
26847
|
+
|
26848
|
+
var buffer = "", stack1;
|
26849
|
+
buffer += "\n ";
|
26850
|
+
stack1 = helpers['with'].call(depth0, depth0.confirm, {hash:{},inverse:self.noop,fn:self.program(10, program10, data),data:data});
|
26851
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
26852
|
+
buffer += "\n ";
|
26853
|
+
return buffer;
|
26854
|
+
}
|
26855
|
+
function program10(depth0,data) {
|
26856
|
+
|
26857
|
+
var buffer = "", stack1;
|
26858
|
+
buffer += "\n <a href=\"#\" class=\"scrivito_button scrivito_confirm ";
|
26859
|
+
stack1 = helpers['if'].call(depth0, depth0.color, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
|
26860
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
26861
|
+
buffer += "\">\n ";
|
26862
|
+
stack1 = helpers['if'].call(depth0, depth0.title, {hash:{},inverse:self.program(7, program7, data),fn:self.program(5, program5, data),data:data});
|
26863
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
26864
|
+
buffer += "\n </a>\n ";
|
26865
|
+
return buffer;
|
26866
|
+
}
|
26867
|
+
|
26868
|
+
buffer += "<div id=\"scrivito_iframe_dialog\"\n class=\"scrivito_modal_large scrivito_adjust_dialog ";
|
26869
|
+
stack1 = helpers['if'].call(depth0, depth0.color, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
|
26870
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
26871
|
+
buffer += "\">\n <div class=\"scrivito_modal_body scrivito_auto_height\"></div>\n <div class=\"scrivito_modal_footer\">\n ";
|
26872
|
+
stack1 = helpers.unless.call(depth0, depth0.disable_cancel, {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data});
|
26873
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
26874
|
+
buffer += "\n ";
|
26875
|
+
stack1 = helpers.unless.call(depth0, depth0.disable_confirm, {hash:{},inverse:self.noop,fn:self.program(9, program9, data),data:data});
|
26876
|
+
if(stack1 || stack1 === 0) { buffer += stack1; }
|
26877
|
+
buffer += "\n </div>\n</div>\n";
|
26878
|
+
return buffer;
|
26879
|
+
});
|
26880
|
+
return this.ScrivitoHandlebarsTemplates["iframe_dialog"];
|
26881
|
+
}).call(this);
|
26675
26882
|
(function() {
|
26676
26883
|
this.ScrivitoHandlebarsTemplates || (this.ScrivitoHandlebarsTemplates = {});
|
26677
26884
|
this.ScrivitoHandlebarsTemplates["inplace_marker"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
@@ -26749,7 +26956,7 @@ function program5(depth0,data) {
|
|
26749
26956
|
buffer += "\">\n ";
|
26750
26957
|
stack1 = helpers.each.call(depth0, depth0.menu_items, {hash:{},inverse:self.noop,fn:self.program(5, program5, data),data:data});
|
26751
26958
|
if(stack1 || stack1 === 0) { buffer += stack1; }
|
26752
|
-
buffer += "\n </ul>\n</div>\n";
|
26959
|
+
buffer += "\n <li class=\"scrivito_menu_box_overlay\"></li>\n </ul>\n</div>\n";
|
26753
26960
|
return buffer;
|
26754
26961
|
});
|
26755
26962
|
return this.ScrivitoHandlebarsTemplates["menu"];
|
@@ -27147,6 +27354,23 @@ function program1(depth0,data) {
|
|
27147
27354
|
});
|
27148
27355
|
return this.ScrivitoHandlebarsTemplates["obj_sorting_dialog"];
|
27149
27356
|
}).call(this);
|
27357
|
+
(function() {
|
27358
|
+
this.ScrivitoHandlebarsTemplates || (this.ScrivitoHandlebarsTemplates = {});
|
27359
|
+
this.ScrivitoHandlebarsTemplates["option_marker"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
27360
|
+
this.compilerInfo = [3,'>= 1.0.0-rc.4'];
|
27361
|
+
helpers = helpers || Handlebars.helpers; data = data || {};
|
27362
|
+
var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression;
|
27363
|
+
|
27364
|
+
|
27365
|
+
buffer += "<span class=\"scrivito_option_marker scrivito_";
|
27366
|
+
if (stack1 = helpers.position) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
|
27367
|
+
else { stack1 = depth0.position; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
|
27368
|
+
buffer += escapeExpression(stack1)
|
27369
|
+
+ "\">\n <i class=\"scrivito_icon scrivito_icon_marker_plus\"></i>\n</span>\n";
|
27370
|
+
return buffer;
|
27371
|
+
});
|
27372
|
+
return this.ScrivitoHandlebarsTemplates["option_marker"];
|
27373
|
+
}).call(this);
|
27150
27374
|
(function() {
|
27151
27375
|
this.ScrivitoHandlebarsTemplates || (this.ScrivitoHandlebarsTemplates = {});
|
27152
27376
|
this.ScrivitoHandlebarsTemplates["overlay"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
|
@@ -27315,56 +27539,56 @@ function program2(depth0,data) {
|
|
27315
27539
|
function program4(depth0,data) {
|
27316
27540
|
|
27317
27541
|
var buffer = "", stack1, stack2, options;
|
27318
|
-
buffer += "\n
|
27542
|
+
buffer += "\n <li class=\"scrivito_menu_separator\">\n <span>";
|
27319
27543
|
options = {hash:{},data:data};
|
27320
27544
|
buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "workspace_select.this_workspace", options) : helperMissing.call(depth0, "translate", "workspace_select.this_workspace", options)))
|
27321
|
-
+ "</span>\n
|
27545
|
+
+ "</span>\n </li>\n ";
|
27322
27546
|
stack2 = helpers.each.call(depth0, ((stack1 = depth0.commands),stack1 == null || stack1 === false ? stack1 : stack1.for_editable), {hash:{},inverse:self.noop,fn:self.program(5, program5, data),data:data});
|
27323
27547
|
if(stack2 || stack2 === 0) { buffer += stack2; }
|
27324
|
-
buffer += "\n
|
27548
|
+
buffer += "\n <li class=\"scrivito_menu_separator\"></li>\n ";
|
27325
27549
|
return buffer;
|
27326
27550
|
}
|
27327
27551
|
function program5(depth0,data) {
|
27328
27552
|
|
27329
27553
|
var buffer = "", stack1, stack2, options;
|
27330
|
-
buffer += "\n
|
27554
|
+
buffer += "\n ";
|
27331
27555
|
options = {hash:{},data:data};
|
27332
27556
|
stack2 = ((stack1 = helpers.render),stack1 ? stack1.call(depth0, "workspace_select/menu_item", depth0, options) : helperMissing.call(depth0, "render", "workspace_select/menu_item", depth0, options));
|
27333
27557
|
if(stack2 || stack2 === 0) { buffer += stack2; }
|
27334
|
-
buffer += "\n
|
27558
|
+
buffer += "\n ";
|
27335
27559
|
return buffer;
|
27336
27560
|
}
|
27337
27561
|
|
27338
27562
|
function program7(depth0,data) {
|
27339
27563
|
|
27340
27564
|
var buffer = "", stack1, stack2, options;
|
27341
|
-
buffer += "\n
|
27565
|
+
buffer += "\n <li class=\"scrivito_menu_separator\"></li>\n ";
|
27342
27566
|
options = {hash:{},data:data};
|
27343
27567
|
stack2 = ((stack1 = helpers.render),stack1 ? stack1.call(depth0, "workspace_select/menu_item", ((stack1 = depth0.commands),stack1 == null || stack1 === false ? stack1 : stack1.select_published), options) : helperMissing.call(depth0, "render", "workspace_select/menu_item", ((stack1 = depth0.commands),stack1 == null || stack1 === false ? stack1 : stack1.select_published), options));
|
27344
27568
|
if(stack2 || stack2 === 0) { buffer += stack2; }
|
27345
|
-
buffer += "\n
|
27569
|
+
buffer += "\n ";
|
27346
27570
|
return buffer;
|
27347
27571
|
}
|
27348
27572
|
|
27349
27573
|
stack1 = helpers['with'].call(depth0, depth0.selected_workspace, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
|
27350
27574
|
if(stack1 || stack1 === 0) { buffer += stack1; }
|
27351
|
-
buffer += "\n\n<
|
27575
|
+
buffer += "\n\n<ul class=\"scrivito_menu_box scrivito_hidden\">\n ";
|
27352
27576
|
stack2 = helpers['if'].call(depth0, ((stack1 = depth0.selected_workspace),stack1 == null || stack1 === false ? stack1 : stack1.is_editable), {hash:{},inverse:self.noop,fn:self.program(4, program4, data),data:data});
|
27353
27577
|
if(stack2 || stack2 === 0) { buffer += stack2; }
|
27354
|
-
buffer += "\n\n
|
27578
|
+
buffer += "\n\n <li class=\"scrivito_menu_separator\">\n <span>";
|
27355
27579
|
options = {hash:{},data:data};
|
27356
27580
|
buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "workspace_select.other_workspaces", options) : helperMissing.call(depth0, "translate", "workspace_select.other_workspaces", options)))
|
27357
|
-
+ "</span>\n
|
27581
|
+
+ "</span>\n </li>\n\n ";
|
27358
27582
|
options = {hash:{},data:data};
|
27359
27583
|
stack2 = ((stack1 = helpers.render),stack1 ? stack1.call(depth0, "workspace_select/menu_item", ((stack1 = depth0.commands),stack1 == null || stack1 === false ? stack1 : stack1.create_workspace), options) : helperMissing.call(depth0, "render", "workspace_select/menu_item", ((stack1 = depth0.commands),stack1 == null || stack1 === false ? stack1 : stack1.create_workspace), options));
|
27360
27584
|
if(stack2 || stack2 === 0) { buffer += stack2; }
|
27361
|
-
buffer += "\n\n
|
27585
|
+
buffer += "\n\n ";
|
27362
27586
|
stack2 = helpers.unless.call(depth0, ((stack1 = depth0.selected_workspace),stack1 == null || stack1 === false ? stack1 : stack1.is_published), {hash:{},inverse:self.noop,fn:self.program(7, program7, data),data:data});
|
27363
27587
|
if(stack2 || stack2 === 0) { buffer += stack2; }
|
27364
|
-
buffer += "\n\n
|
27588
|
+
buffer += "\n\n <li class=\"scrivito_menu_item scrivito_workspace_list\">\n <span>\n <i class=\"scrivito_icon scrivito_spinning\"></i>\n ";
|
27365
27589
|
options = {hash:{},data:data};
|
27366
27590
|
buffer += escapeExpression(((stack1 = helpers.translate),stack1 ? stack1.call(depth0, "menu_bar.loading_workspaces", options) : helperMissing.call(depth0, "translate", "menu_bar.loading_workspaces", options)))
|
27367
|
-
+ "\n
|
27591
|
+
+ "\n </span>\n </li>\n\n <li class=\"scrivito_menu_box_overlay\"></li>\n</ul>\n";
|
27368
27592
|
return buffer;
|
27369
27593
|
});
|
27370
27594
|
return this.ScrivitoHandlebarsTemplates["workspace_select"];
|
@@ -27545,6 +27769,8 @@ $.i18n().load({
|
|
27545
27769
|
|
27546
27770
|
'choose_obj_class_dialog.add_child_page.title': 'Seitenvorlage auswählen',
|
27547
27771
|
'choose_obj_class_dialog.create_widget.title': 'Widget auswählen',
|
27772
|
+
'choose_obj_class_dialog.last_used': 'Zuletzt verwendet',
|
27773
|
+
'choose_obj_class_dialog.all': 'Alle (a - z)',
|
27548
27774
|
|
27549
27775
|
'editable_ws_dialog.title.select_or_create': 'Arbeitskopie wählen',
|
27550
27776
|
'editable_ws_dialog.title.select': 'Arbeitskopie auswählen',
|
@@ -27614,13 +27840,13 @@ $.i18n().load({
|
|
27614
27840
|
'child_list_menu.description': 'Elemente von $1',
|
27615
27841
|
|
27616
27842
|
'changes_dialog.title': 'Änderungen von "$1"',
|
27617
|
-
'changes_dialog.
|
27843
|
+
'changes_dialog.empty': 'In dieser Arbeitskopie wurde nichts geändert.',
|
27618
27844
|
'changes_dialog.more': 'Mehr...',
|
27619
|
-
'changes_dialog.
|
27620
|
-
'changes_dialog.
|
27621
|
-
'changes_dialog.
|
27622
|
-
'changes_dialog.
|
27623
|
-
'changes_dialog.
|
27845
|
+
'changes_dialog.modification': 'Änderung',
|
27846
|
+
'changes_dialog.rights': 'Veröffentlichen erlaubt',
|
27847
|
+
'changes_dialog.description_for_editor': 'Titel',
|
27848
|
+
'changes_dialog.obj_class_name': 'Typ',
|
27849
|
+
'changes_dialog.last_changed': 'Letzte Änderung',
|
27624
27850
|
|
27625
27851
|
'current_page_link_dialog.title': 'Diese Seite teilen',
|
27626
27852
|
'current_page_link_dialog.description': 'Mit dieser URL können Sie die aktuelle Seite als Teil dieser Arbeitskopie teilen. Die Empfänger müssen angemeldet sein und Zugriff auf die Arbeitskopie haben.',
|
@@ -27804,6 +28030,8 @@ $.i18n().load({
|
|
27804
28030
|
|
27805
28031
|
'choose_obj_class_dialog.add_child_page.title': 'Select Page Type',
|
27806
28032
|
'choose_obj_class_dialog.create_widget.title': 'Select Widget',
|
28033
|
+
'choose_obj_class_dialog.last_used': 'Last used',
|
28034
|
+
'choose_obj_class_dialog.all': 'All (a - z)',
|
27807
28035
|
|
27808
28036
|
'editable_ws_dialog.title.select_or_create': 'Choose a working copy',
|
27809
28037
|
'editable_ws_dialog.title.select': 'Select a working copy',
|
@@ -27873,13 +28101,13 @@ $.i18n().load({
|
|
27873
28101
|
'child_list_menu.description': 'Items of $1',
|
27874
28102
|
|
27875
28103
|
'changes_dialog.title': 'Changes to "$1"',
|
27876
|
-
'changes_dialog.
|
28104
|
+
'changes_dialog.empty': 'Nothing was changed in this working copy.',
|
27877
28105
|
'changes_dialog.more': 'More...',
|
27878
|
-
'changes_dialog.
|
27879
|
-
'changes_dialog.
|
27880
|
-
'changes_dialog.
|
27881
|
-
'changes_dialog.
|
27882
|
-
'changes_dialog.
|
28106
|
+
'changes_dialog.modification': 'Change',
|
28107
|
+
'changes_dialog.rights': 'Publishing permitted',
|
28108
|
+
'changes_dialog.description_for_editor': 'Title',
|
28109
|
+
'changes_dialog.obj_class_name': 'Type',
|
28110
|
+
'changes_dialog.last_changed': 'Last change',
|
27883
28111
|
|
27884
28112
|
'current_page_link_dialog.title': 'Share this page',
|
27885
28113
|
'current_page_link_dialog.description': 'Using the URL below, you can share the current page as part of this working copy. The recipients need to be logged in and have access to the working copy.',
|
@@ -28041,6 +28269,8 @@ var scrivito = {};
|
|
28041
28269
|
(function() {
|
28042
28270
|
var inited = false;
|
28043
28271
|
|
28272
|
+
var ui_config_attr_name = 'data-scrivito-private-ui-config';
|
28273
|
+
|
28044
28274
|
var wait_until_write_ends = function() {
|
28045
28275
|
var deferred = $.Deferred();
|
28046
28276
|
if (scrivito.write_monitor.is_writing()) {
|
@@ -28060,6 +28290,18 @@ var scrivito = {};
|
|
28060
28290
|
return {message: error.message};
|
28061
28291
|
};
|
28062
28292
|
|
28293
|
+
var restore_prior_attr = function(promise, dom_element, attr_name) {
|
28294
|
+
var prior_attr = dom_element.attr(attr_name);
|
28295
|
+
promise.always(function() {
|
28296
|
+
if (prior_attr) {
|
28297
|
+
dom_element.attr(attr_name, prior_attr);
|
28298
|
+
} else {
|
28299
|
+
// jQuery#removeAttr violates CSP by assigning an empty value.
|
28300
|
+
dom_element.get(0).removeAttribute(attr_name);
|
28301
|
+
}
|
28302
|
+
});
|
28303
|
+
};
|
28304
|
+
|
28063
28305
|
_.extend(scrivito, {
|
28064
28306
|
suppress_alerts: false,
|
28065
28307
|
|
@@ -28095,6 +28337,36 @@ var scrivito = {};
|
|
28095
28337
|
return scrivito.redirect_to(scrivito.editing_context.location(params).href());
|
28096
28338
|
},
|
28097
28339
|
|
28340
|
+
open_obj: function(obj) {
|
28341
|
+
if (obj.is_binary() && (
|
28342
|
+
obj.is_edited() ||
|
28343
|
+
obj.is_new() && !scrivito.editing_context.is_deleted_mode() ||
|
28344
|
+
obj.is_deleted() && scrivito.editing_context.is_deleted_mode())) {
|
28345
|
+
scrivito.resource_dialog.open(obj);
|
28346
|
+
} else {
|
28347
|
+
var url = scrivito.root_path();
|
28348
|
+
var params = {};
|
28349
|
+
|
28350
|
+
if (obj.is_binary()) {
|
28351
|
+
url = '/__scrivito/resource_details/';
|
28352
|
+
params.return_to = document.URL;
|
28353
|
+
}
|
28354
|
+
|
28355
|
+
if (obj.is_new() && scrivito.editing_context.is_deleted_mode()) {
|
28356
|
+
params._scrivito_display_mode = 'added';
|
28357
|
+
}
|
28358
|
+
|
28359
|
+
if (obj.is_deleted() && !scrivito.editing_context.is_deleted_mode()) {
|
28360
|
+
params._scrivito_display_mode = 'deleted';
|
28361
|
+
}
|
28362
|
+
|
28363
|
+
url += obj.id();
|
28364
|
+
if (!_.isEmpty(params)) { url += '?'+$.param(params); }
|
28365
|
+
|
28366
|
+
scrivito.with_saving_overlay(scrivito.redirect_to(url));
|
28367
|
+
}
|
28368
|
+
},
|
28369
|
+
|
28098
28370
|
// For testing purpose only.
|
28099
28371
|
location: function() {
|
28100
28372
|
return window.location;
|
@@ -28202,7 +28474,6 @@ var scrivito = {};
|
|
28202
28474
|
scrivito.warn(message);
|
28203
28475
|
},
|
28204
28476
|
|
28205
|
-
// @api public
|
28206
28477
|
on: function(event, callback) {
|
28207
28478
|
if (event === 'load') {
|
28208
28479
|
scrivito.gui.on('open', function() {
|
@@ -28229,14 +28500,12 @@ var scrivito = {};
|
|
28229
28500
|
}
|
28230
28501
|
},
|
28231
28502
|
|
28232
|
-
// @api public
|
28233
28503
|
create_obj: function(attributes) {
|
28234
28504
|
return scrivito.obj.create(attributes).then(function(obj) {
|
28235
28505
|
return {id: obj.id()};
|
28236
28506
|
}, convert_internal_error);
|
28237
28507
|
},
|
28238
28508
|
|
28239
|
-
// @api public
|
28240
28509
|
delete_obj: function(id) {
|
28241
28510
|
if (id) {
|
28242
28511
|
return scrivito.obj.create_instance({id: id}).destroy()
|
@@ -28246,9 +28515,8 @@ var scrivito = {};
|
|
28246
28515
|
}
|
28247
28516
|
},
|
28248
28517
|
|
28249
|
-
// @api public
|
28250
28518
|
is_current_page_restricted: function() {
|
28251
|
-
var current_page = scrivito.
|
28519
|
+
var current_page = scrivito.application_document().page();
|
28252
28520
|
if (current_page) {
|
28253
28521
|
return current_page.has_restriction();
|
28254
28522
|
}
|
@@ -28258,7 +28526,6 @@ var scrivito = {};
|
|
28258
28526
|
return $.Deferred();
|
28259
28527
|
},
|
28260
28528
|
|
28261
|
-
// @api public
|
28262
28529
|
trigger: function(event_name, dom_element) {
|
28263
28530
|
if (event_name === 'content') {
|
28264
28531
|
_.each($(dom_element), function(e) {
|
@@ -28273,7 +28540,6 @@ var scrivito = {};
|
|
28273
28540
|
}
|
28274
28541
|
},
|
28275
28542
|
|
28276
|
-
// @api public
|
28277
28543
|
in_editable_view: function() {
|
28278
28544
|
return scrivito.editing_context.display_mode === 'editing' &&
|
28279
28545
|
scrivito.editing_context.visible_workspace.is_editable();
|
@@ -28329,17 +28595,14 @@ var scrivito = {};
|
|
28329
28595
|
scrivito.info_dialog(scrivito.t('workspace_limit_exceeded.message'));
|
28330
28596
|
},
|
28331
28597
|
|
28332
|
-
// @api public
|
28333
28598
|
register_default_obj_class_for_content_type: function(mapping) {
|
28334
28599
|
scrivito.obj_class_defaults.register(mapping);
|
28335
28600
|
},
|
28336
28601
|
|
28337
|
-
// @api public
|
28338
28602
|
default_obj_class_for_content_type: function(content_type) {
|
28339
28603
|
return scrivito.obj_class_defaults.lookup(content_type);
|
28340
28604
|
},
|
28341
28605
|
|
28342
|
-
// @api public
|
28343
28606
|
configure_menu_order: function(order) {
|
28344
28607
|
scrivito.menu_order = order;
|
28345
28608
|
},
|
@@ -28373,20 +28636,46 @@ var scrivito = {};
|
|
28373
28636
|
}
|
28374
28637
|
},
|
28375
28638
|
|
28376
|
-
// @api beta
|
28377
28639
|
register_select_content: function(select_content) {
|
28378
28640
|
scrivito.select_content = select_content;
|
28379
28641
|
},
|
28380
28642
|
|
28381
|
-
// @api public
|
28382
28643
|
page_menu: function(cms_document) {
|
28383
28644
|
return scrivito.menu_builder.create_instance(cms_document);
|
28384
28645
|
},
|
28385
28646
|
|
28647
|
+
custom_dialog: function(iframe, doc, content, options) {
|
28648
|
+
var dialog = scrivito.iframe_dialog.open(iframe, options);
|
28649
|
+
dialog.when_open.done(function(dialog_body) {
|
28650
|
+
var panel = scrivito.full_screen_panel(doc, dialog.when_closed);
|
28651
|
+
panel.css('background-color', dialog_body.css('background-color'));
|
28652
|
+
panel.append(content);
|
28653
|
+
});
|
28654
|
+
return {when_closed: dialog.when_closed};
|
28655
|
+
},
|
28656
|
+
|
28386
28657
|
register_browse_content: function (browse_content) {
|
28387
28658
|
scrivito.browse_content = browse_content;
|
28388
28659
|
},
|
28389
28660
|
|
28661
|
+
ui_config: function() {
|
28662
|
+
return scrivito.dom_config.read($('body'), ui_config_attr_name);
|
28663
|
+
},
|
28664
|
+
|
28665
|
+
// For test purpose only.
|
28666
|
+
mock_ui_config: function(config) {
|
28667
|
+
if (config) {
|
28668
|
+
scrivito.dom_config.write($('body'), ui_config_attr_name, config);
|
28669
|
+
} else {
|
28670
|
+
$('body').removeAttr(ui_config_attr_name);
|
28671
|
+
}
|
28672
|
+
},
|
28673
|
+
|
28674
|
+
restore_styles_afterwards: function(promise, dom_element) {
|
28675
|
+
restore_prior_attr(promise, dom_element, 'class');
|
28676
|
+
restore_prior_attr(promise, dom_element, 'style');
|
28677
|
+
},
|
28678
|
+
|
28390
28679
|
// FIXME content-widget
|
28391
28680
|
enable_content_upload: false,
|
28392
28681
|
|
@@ -28404,6 +28693,7 @@ var scrivito = {};
|
|
28404
28693
|
scrivito.is_development_mode = config.is_development_mode;
|
28405
28694
|
|
28406
28695
|
scrivito.inplace_marker.init();
|
28696
|
+
scrivito.option_marker.init();
|
28407
28697
|
scrivito.menu_bar_saving_indicator.init();
|
28408
28698
|
scrivito.menu_bar_device_toggle.init();
|
28409
28699
|
scrivito.menu_bar_warning.init();
|
@@ -28430,6 +28720,8 @@ var scrivito = {};
|
|
28430
28720
|
scrivito.widget_reloading.init();
|
28431
28721
|
scrivito.widget_sorting.init();
|
28432
28722
|
|
28723
|
+
scrivito.no_turbolinks.init();
|
28724
|
+
|
28433
28725
|
// FIXME content-widget
|
28434
28726
|
if (scrivito.enable_content_upload) {
|
28435
28727
|
scrivito.content_upload.init();
|
@@ -28440,6 +28732,7 @@ var scrivito = {};
|
|
28440
28732
|
window.onbeforeunload = scrivito.warn_before_unloading;
|
28441
28733
|
|
28442
28734
|
scrivito.url_update(scrivito.application_window, scrivito.cms_window.from(window));
|
28735
|
+
scrivito.application_window.use_fragment_of(scrivito.cms_window.from(window));
|
28443
28736
|
|
28444
28737
|
inited = true;
|
28445
28738
|
}
|
@@ -28570,19 +28863,17 @@ var scrivito = {};
|
|
28570
28863
|
|
28571
28864
|
}());
|
28572
28865
|
(function() {
|
28573
|
-
var attr_name = 'data-scrivito-private-config';
|
28574
|
-
var selector = '[' + attr_name + ']';
|
28575
|
-
|
28576
28866
|
_.extend(scrivito, {
|
28577
28867
|
dom_config: {
|
28578
|
-
read: function(dom_element) {
|
28868
|
+
read: function(dom_element, attr_name) {
|
28869
|
+
var selector = '[' + attr_name + ']';
|
28579
28870
|
var config = dom_element.find(selector).addBack(selector).attr(attr_name);
|
28580
28871
|
if (config) {
|
28581
28872
|
return JSON.parse(config);
|
28582
28873
|
}
|
28583
28874
|
},
|
28584
28875
|
|
28585
|
-
write: function(dom_element, config) {
|
28876
|
+
write: function(dom_element, attr_name, config) {
|
28586
28877
|
dom_element.attr(attr_name, JSON.stringify(config));
|
28587
28878
|
}
|
28588
28879
|
}
|
@@ -28638,16 +28929,6 @@ var scrivito = {};
|
|
28638
28929
|
}
|
28639
28930
|
};
|
28640
28931
|
|
28641
|
-
var assert_no_turbolinks = function() {
|
28642
|
-
if (scrivito.application_window.browser_window().Turbolinks) {
|
28643
|
-
scrivito.alert_dialog(
|
28644
|
-
'You have Turbolinks enabled. ' +
|
28645
|
-
'Scrivito does not yet support Turbolink. ' +
|
28646
|
-
'Please remove it from your assets.'
|
28647
|
-
);
|
28648
|
-
}
|
28649
|
-
};
|
28650
|
-
|
28651
28932
|
_.extend(scrivito, {
|
28652
28933
|
gui: {
|
28653
28934
|
start: function() {
|
@@ -28660,7 +28941,6 @@ var scrivito = {};
|
|
28660
28941
|
$('body').append('<div id="scrivito_editing"></div>');
|
28661
28942
|
run_open_callbacks();
|
28662
28943
|
scrivito.gui.run_content_callbacks(window.document);
|
28663
|
-
assert_no_turbolinks();
|
28664
28944
|
|
28665
28945
|
is_started = true;
|
28666
28946
|
},
|
@@ -29329,9 +29609,8 @@ var scrivito = {};
|
|
29329
29609
|
.attr('class', 'scrivito_icon scrivito_icon_'+device);
|
29330
29610
|
};
|
29331
29611
|
|
29332
|
-
$('#scrivito_ui').addClass('scrivito_iframe_resize_bg');
|
29333
|
-
|
29334
29612
|
scrivito.menu_bar.register_item_renderer(function(menu_bar) {
|
29613
|
+
$('#scrivito_ui').addClass('scrivito_iframe_resize_bg');
|
29335
29614
|
device_toggle = $(scrivito.template.render('menu_bar_device_toggle',
|
29336
29615
|
{device: current_device()}
|
29337
29616
|
)).appendTo(menu_bar.find('#scrivito_menu_bar_device_toggle'));
|
@@ -29349,8 +29628,11 @@ var scrivito = {};
|
|
29349
29628
|
}
|
29350
29629
|
},
|
29351
29630
|
execute: function() {
|
29352
|
-
|
29353
|
-
|
29631
|
+
var iframe = $('iframe[name=scrivito_application]');
|
29632
|
+
scrivito.transition(iframe, function() {
|
29633
|
+
toggle_device(device);
|
29634
|
+
iframe.addClass('scrivito_iframe_animate_resize');
|
29635
|
+
}).done(function() { iframe.removeClass('scrivito_iframe_animate_resize'); });
|
29354
29636
|
}
|
29355
29637
|
});
|
29356
29638
|
});
|
@@ -29592,14 +29874,14 @@ var scrivito = {};
|
|
29592
29874
|
_.extend(scrivito, {
|
29593
29875
|
current_page_restriction: {
|
29594
29876
|
init: function() {
|
29595
|
-
|
29596
|
-
|
29597
|
-
|
29877
|
+
scrivito.menu_bar.register_item_renderer(function(menu_bar) {
|
29878
|
+
var current_page = scrivito.application_document().page();
|
29879
|
+
if (current_page && current_page.has_restriction()) {
|
29598
29880
|
$(scrivito.template.render('current_page_restriction', {
|
29599
29881
|
restriction_messages: current_page.restriction_messages
|
29600
29882
|
})).appendTo(menu_bar.find('#scrivito_current_page_restriction'));
|
29601
|
-
}
|
29602
|
-
}
|
29883
|
+
}
|
29884
|
+
});
|
29603
29885
|
}
|
29604
29886
|
}
|
29605
29887
|
});
|
@@ -29661,240 +29943,88 @@ var scrivito = {};
|
|
29661
29943
|
has_separator: selected_workspace.is_published() && commands.length,
|
29662
29944
|
commands: commands
|
29663
29945
|
}
|
29664
|
-
));
|
29665
|
-
|
29666
|
-
_.each(commands, function(command) { bind_command(command); });
|
29667
|
-
}).always(function() {
|
29668
|
-
spinner.removeAttr('data-scrivito-private-loading');
|
29669
|
-
});
|
29670
|
-
}
|
29671
|
-
|
29672
|
-
return false;
|
29673
|
-
});
|
29674
|
-
});
|
29675
|
-
}
|
29676
|
-
}
|
29677
|
-
});
|
29678
|
-
}());
|
29679
|
-
(function() {
|
29680
|
-
_.extend(scrivito, {
|
29681
|
-
changes_dialog: {
|
29682
|
-
open: function() {
|
29683
|
-
loaded_objs = [];
|
29684
|
-
total_obj_count = 0;
|
29685
|
-
batch = basic_batch();
|
29686
|
-
|
29687
|
-
view = $(scrivito.template.render('changes_dialog', {
|
29688
|
-
selected_workspace_title: scrivito.editing_context.selected_workspace.title()
|
29689
|
-
}));
|
29690
|
-
|
29691
|
-
$('#scrivito_editing').append(view);
|
29692
|
-
var next_loader = view.find('.scrivito_load_more');
|
29693
|
-
|
29694
|
-
target = view.find('#scrivito_changes_table_loaded');
|
29695
|
-
var spinner = view.find('#scrivito_changes_table_loading');
|
29696
|
-
var empty_result = view.find('#scrivito_changes_table_empty_result');
|
29697
|
-
|
29698
|
-
var obj_count = view.find('#scrivito_obj_count');
|
29699
|
-
|
29700
|
-
loaded_obj_count_ref = view.find('#scrivito_loaded_obj_count');
|
29701
|
-
total_obj_count_ref = view.find('#scrivito_total_obj_count');
|
29702
|
-
|
29703
|
-
load_markup = function() {
|
29704
|
-
loading_in_progress = true;
|
29705
|
-
spinner.show();
|
29706
|
-
|
29707
|
-
batch.load_batch().then(function(data, next) {
|
29708
|
-
loading_in_progress = false;
|
29709
|
-
|
29710
|
-
batch = next;
|
29711
|
-
if (!batch) {
|
29712
|
-
next_loader.hide();
|
29713
|
-
} else {
|
29714
|
-
next_loader.show();
|
29715
|
-
}
|
29716
|
-
|
29717
|
-
if (data.total > 0) {
|
29718
|
-
loaded_objs = loaded_objs.concat(data.hits);
|
29719
|
-
total_obj_count = data.total;
|
29720
|
-
|
29721
|
-
render_objs(loaded_objs);
|
29722
|
-
} else {
|
29723
|
-
empty_result.show();
|
29724
|
-
}
|
29725
|
-
|
29726
|
-
spinner.hide();
|
29727
|
-
|
29728
|
-
loaded_obj_count_ref.text(loaded_objs.length);
|
29729
|
-
total_obj_count_ref.text(total_obj_count);
|
29730
|
-
obj_count.show();
|
29731
|
-
|
29732
|
-
view.on('click.scrivito_link_to_obj', '.scrivito_link_to_obj', function(e) {
|
29733
|
-
var element = $(e.currentTarget);
|
29734
|
-
var obj_id = element.attr('data-scrivito-private-changes-list-obj-id');
|
29735
|
-
var obj_modification = element.attr(
|
29736
|
-
'data-scrivito-private-changes-list-obj-modification');
|
29737
|
-
var obj_is_binary = element.attr('data-scrivito-private-changes-list-obj-is-binary');
|
29738
|
-
|
29739
|
-
if (can_use_resource_dialog_directly(obj_modification, obj_is_binary)) {
|
29740
|
-
var loaded_obj = _.find(loaded_objs, function(obj) {
|
29741
|
-
return obj.id === obj_id;
|
29742
|
-
});
|
29743
|
-
scrivito.resource_dialog.open(scrivito.obj.create_instance(loaded_obj));
|
29744
|
-
} else {
|
29745
|
-
scrivito.changes_dialog.redirect_to_obj(obj_id, obj_modification, obj_is_binary);
|
29746
|
-
}
|
29747
|
-
|
29748
|
-
return false;
|
29749
|
-
});
|
29750
|
-
});
|
29751
|
-
};
|
29752
|
-
|
29753
|
-
next_loader.on('click', load_markup);
|
29754
|
-
load_markup();
|
29755
|
-
activate_sorting();
|
29756
|
-
|
29757
|
-
var deferred = $.Deferred();
|
29758
|
-
|
29759
|
-
cancel = function() {
|
29760
|
-
scrivito.dialog.close(view);
|
29761
|
-
deferred.resolve();
|
29762
|
-
return false;
|
29763
|
-
};
|
29764
|
-
|
29765
|
-
view.find('.scrivito_cancel').on('click', cancel);
|
29766
|
-
|
29767
|
-
scrivito.dialog.open_and_adjust(view);
|
29768
|
-
return scrivito.with_dialog_behaviour(view, deferred, {escape: cancel});
|
29769
|
-
},
|
29946
|
+
));
|
29770
29947
|
|
29771
|
-
|
29772
|
-
|
29773
|
-
|
29948
|
+
_.each(commands, function(command) { bind_command(command); });
|
29949
|
+
}).always(function() {
|
29950
|
+
spinner.removeAttr('data-scrivito-private-loading');
|
29951
|
+
});
|
29952
|
+
}
|
29774
29953
|
|
29775
|
-
|
29776
|
-
|
29777
|
-
|
29778
|
-
|
29954
|
+
return false;
|
29955
|
+
});
|
29956
|
+
});
|
29957
|
+
}
|
29958
|
+
}
|
29959
|
+
});
|
29960
|
+
}());
|
29961
|
+
(function() {
|
29962
|
+
var dialog;
|
29779
29963
|
|
29780
|
-
|
29781
|
-
|
29782
|
-
|
29964
|
+
_.extend(scrivito, {
|
29965
|
+
changes_dialog: {
|
29966
|
+
open: function() {
|
29967
|
+
var promise = $.Deferred();
|
29968
|
+
dialog = $(scrivito.template.render('changes_dialog')).appendTo($('#scrivito_editing'));
|
29969
|
+
open_batch(scrivito.obj_changes());
|
29783
29970
|
|
29784
|
-
|
29785
|
-
|
29786
|
-
|
29971
|
+
var close = function() {
|
29972
|
+
scrivito.dialog.close_without_transition(dialog);
|
29973
|
+
promise.resolve();
|
29974
|
+
return false;
|
29975
|
+
};
|
29787
29976
|
|
29788
|
-
|
29789
|
-
|
29790
|
-
|
29791
|
-
redirect_url += '?' + $.param(query_params);
|
29792
|
-
}
|
29793
|
-
scrivito.with_saving_overlay(scrivito.redirect_to(redirect_url));
|
29977
|
+
dialog.find('.scrivito_cancel').on('click', close);
|
29978
|
+
scrivito.dialog.open_and_adjust_without_transition(dialog);
|
29979
|
+
return scrivito.with_dialog_behaviour(dialog, promise, {escape: close});
|
29794
29980
|
}
|
29795
29981
|
}
|
29796
29982
|
});
|
29797
29983
|
|
29798
|
-
var
|
29799
|
-
|
29800
|
-
|
29801
|
-
|
29802
|
-
|
29803
|
-
|
29804
|
-
|
29805
|
-
|
29806
|
-
var loading_in_progress;
|
29807
|
-
var cancel;
|
29808
|
-
|
29809
|
-
var can_use_resource_dialog_directly = function(modification, is_binary) {
|
29810
|
-
return is_binary && (
|
29811
|
-
modification === 'edited' ||
|
29812
|
-
modification === 'deleted' && scrivito.editing_context.is_deleted_mode() ||
|
29813
|
-
modification === 'new' && !scrivito.editing_context.is_deleted_mode());
|
29814
|
-
};
|
29815
|
-
|
29816
|
-
var basic_batch = function() {
|
29817
|
-
return scrivito.
|
29818
|
-
obj_where('_modification', 'equals', ['new', 'edited', 'deleted']).
|
29819
|
-
batch_size(100).
|
29820
|
-
order('_last_changed').
|
29821
|
-
reverse_order().
|
29822
|
-
format('_default').
|
29823
|
-
include_deleted();
|
29984
|
+
var open_batch = function(chainable_search, objs) {
|
29985
|
+
render(chainable_search);
|
29986
|
+
chainable_search.load_batch().then(function(result, next) {
|
29987
|
+
objs = (objs || []).concat(_.map(result.hits, function(hit) {
|
29988
|
+
return scrivito.obj.create_instance(hit);
|
29989
|
+
}));
|
29990
|
+
render(chainable_search, result, objs, next);
|
29991
|
+
});
|
29824
29992
|
};
|
29825
29993
|
|
29826
|
-
var
|
29827
|
-
|
29828
|
-
|
29994
|
+
var render = function(chainable_search, result, objs, next) {
|
29995
|
+
var view = dialog.find('.scrivito_changes_dialog_content');
|
29996
|
+
view.html(scrivito.template.render('changes_dialog/content', {
|
29997
|
+
title: scrivito.t('changes_dialog.title', scrivito.editing_context.selected_workspace.title()),
|
29998
|
+
is_loaded: !!result,
|
29999
|
+
total: result && result.total,
|
30000
|
+
objs: objs,
|
30001
|
+
has_more: !!next
|
29829
30002
|
}));
|
29830
|
-
|
30003
|
+
scrivito.update_auto_height_for(view);
|
29831
30004
|
|
29832
|
-
|
29833
|
-
|
29834
|
-
|
29835
|
-
view.on('click.scrivito_sortable', '.scrivito_sortable', function() {
|
29836
|
-
if (loading_in_progress) {
|
29837
|
-
return;
|
29838
|
-
}
|
30005
|
+
view.find('[data-scrivito-sort-by="'+chainable_search.query().order+'"]')
|
30006
|
+
.addClass('scrivito_'+(chainable_search.query().reverse_order ? 'sort_down' : 'sort_up'));
|
29839
30007
|
|
30008
|
+
view.find('[data-scrivito-sort-by]').on('click', function() {
|
29840
30009
|
var sortable = $(this);
|
29841
|
-
var
|
29842
|
-
|
29843
|
-
|
29844
|
-
|
29845
|
-
|
29846
|
-
|
29847
|
-
} else {
|
29848
|
-
sorting_by.order = 'asc';
|
29849
|
-
}
|
29850
|
-
sortables.removeClass('sort_up').removeClass('sort_down');
|
29851
|
-
|
29852
|
-
var local_sort = function() {
|
29853
|
-
var sort_function_or_attribute = sorting_by.attribute;
|
29854
|
-
|
29855
|
-
if (sort_function_or_attribute === 'rights') {
|
29856
|
-
sort_function_or_attribute = function(obj) {
|
29857
|
-
return -obj.restriction_messages.length;
|
29858
|
-
};
|
29859
|
-
}
|
29860
|
-
|
29861
|
-
var objs = _.sortBy(loaded_objs, sort_function_or_attribute);
|
29862
|
-
|
29863
|
-
if (sorting_by.order === 'desc') {
|
29864
|
-
objs = objs.reverse();
|
29865
|
-
}
|
29866
|
-
|
29867
|
-
render_objs(objs);
|
29868
|
-
};
|
29869
|
-
|
29870
|
-
var backend_sort = function() {
|
29871
|
-
batch = basic_batch();
|
29872
|
-
batch.order('_' + sorting_by.attribute);
|
29873
|
-
|
29874
|
-
if (sorting_by.order === 'asc') {
|
29875
|
-
batch.reverse_order();
|
29876
|
-
}
|
29877
|
-
|
29878
|
-
loaded_objs = [];
|
29879
|
-
render_objs(loaded_objs);
|
29880
|
-
load_markup();
|
29881
|
-
};
|
29882
|
-
|
29883
|
-
if (loaded_objs.length === total_obj_count || sorting_by.attribute === 'rights') {
|
29884
|
-
local_sort();
|
29885
|
-
} else {
|
29886
|
-
backend_sort();
|
29887
|
-
}
|
30010
|
+
var chainable_search = scrivito.obj_changes();
|
30011
|
+
chainable_search.order(sortable.attr('data-scrivito-sort-by'));
|
30012
|
+
if (sortable.hasClass('scrivito_sort_down')) { chainable_search.reverse_order(); }
|
30013
|
+
open_batch(chainable_search);
|
30014
|
+
return false;
|
30015
|
+
});
|
29888
30016
|
|
29889
|
-
|
29890
|
-
|
29891
|
-
|
29892
|
-
|
29893
|
-
}
|
30017
|
+
view.find('[data-scrivito-obj-id]').on('click', function() {
|
30018
|
+
var obj_id = $(this).attr('data-scrivito-obj-id');
|
30019
|
+
scrivito.open_obj(_.find(objs, function(obj) { return obj.id() === obj_id; }));
|
30020
|
+
return false;
|
29894
30021
|
});
|
29895
30022
|
|
30023
|
+
view.find('.scrivito_load_more').on('click', function() {
|
30024
|
+
open_batch(next, objs);
|
30025
|
+
return false;
|
30026
|
+
});
|
29896
30027
|
};
|
29897
|
-
|
29898
30028
|
}());
|
29899
30029
|
(function() {
|
29900
30030
|
_.extend(scrivito, {
|
@@ -29910,13 +30040,13 @@ var scrivito = {};
|
|
29910
30040
|
view.find('input').focus().select();
|
29911
30041
|
|
29912
30042
|
var done = function() {
|
29913
|
-
scrivito.dialog.
|
30043
|
+
scrivito.dialog.close_with_transition(view);
|
29914
30044
|
deferred.resolve();
|
29915
30045
|
return false;
|
29916
30046
|
};
|
29917
30047
|
view.find('.scrivito_done').on('click', done);
|
29918
30048
|
|
29919
|
-
scrivito.dialog.
|
30049
|
+
scrivito.dialog.open_and_adjust_with_transition(view);
|
29920
30050
|
scrivito.with_dialog_behaviour(view, deferred, {enter: done, escape: done});
|
29921
30051
|
}
|
29922
30052
|
});
|
@@ -29945,6 +30075,31 @@ var scrivito = {};
|
|
29945
30075
|
|
29946
30076
|
scrivito.obj_class_defaults.reset();
|
29947
30077
|
}());
|
30078
|
+
(function() {
|
30079
|
+
_.extend(scrivito, {
|
30080
|
+
obj_class_selection: {
|
30081
|
+
store: function(obj_class) {
|
30082
|
+
var new_storage = get_storage();
|
30083
|
+
new_storage.unshift(obj_class);
|
30084
|
+
new_storage = _.uniq(new_storage);
|
30085
|
+
new_storage = _.take(new_storage, 200);
|
30086
|
+
scrivito.storage.set(scrivito.obj_class_selection.storage_key, new_storage);
|
30087
|
+
},
|
30088
|
+
|
30089
|
+
recent: function(valid_obj_classes) {
|
30090
|
+
var recent_valid_obj_classes = _.intersection(get_storage(), valid_obj_classes);
|
30091
|
+
return _.take(recent_valid_obj_classes, 5);
|
30092
|
+
},
|
30093
|
+
|
30094
|
+
// for testing only
|
30095
|
+
storage_key: 'obj_class_selection.used_classes'
|
30096
|
+
}
|
30097
|
+
});
|
30098
|
+
|
30099
|
+
var get_storage = function() {
|
30100
|
+
return scrivito.storage.get(scrivito.obj_class_selection.storage_key) || [];
|
30101
|
+
};
|
30102
|
+
}());
|
29948
30103
|
(function() {
|
29949
30104
|
var expando = "scrivito_cms_element";
|
29950
30105
|
|
@@ -29971,6 +30126,18 @@ var scrivito = {};
|
|
29971
30126
|
|
29972
30127
|
set_menu: function(menu) {
|
29973
30128
|
dom_element.data('scrivito-menu', menu);
|
30129
|
+
},
|
30130
|
+
|
30131
|
+
enrich_obj_classes_with_recent: function(obj_classes_markup) {
|
30132
|
+
var sorted_all = _.map(obj_classes_markup, function(obj_class_markup) {
|
30133
|
+
return obj_class_markup.name;
|
30134
|
+
}).sort();
|
30135
|
+
var recent = scrivito.obj_class_selection.recent(sorted_all);
|
30136
|
+
|
30137
|
+
return {
|
30138
|
+
all: format_obj_classes(sorted_all, obj_classes_markup),
|
30139
|
+
recent: format_obj_classes(recent, obj_classes_markup)
|
30140
|
+
};
|
29974
30141
|
}
|
29975
30142
|
};
|
29976
30143
|
|
@@ -30016,22 +30183,48 @@ var scrivito = {};
|
|
30016
30183
|
}
|
30017
30184
|
}
|
30018
30185
|
});
|
30186
|
+
|
30187
|
+
var format_obj_classes = function(obj_classes, obj_classes_markup) {
|
30188
|
+
return _.map(obj_classes, function(obj_class) {
|
30189
|
+
return {
|
30190
|
+
name: obj_class,
|
30191
|
+
markup: _.find(obj_classes_markup, function(obj_class_markup) {
|
30192
|
+
return obj_class_markup.name === obj_class;
|
30193
|
+
}).markup
|
30194
|
+
};
|
30195
|
+
});
|
30196
|
+
};
|
30019
30197
|
}());
|
30020
30198
|
(function() {
|
30021
30199
|
_.extend(scrivito, {
|
30022
30200
|
blob: {
|
30023
|
-
create: function(
|
30201
|
+
create: function(obj_id, binary) {
|
30202
|
+
var uploaded_binary = binary.is_uploaded_binary ? binary : scrivito.blob.upload_binary(binary);
|
30024
30203
|
return get_upload_permission().then(function(permission) {
|
30025
30204
|
scrivito.write_monitor.start_write();
|
30026
|
-
return upload_to_s3(
|
30027
|
-
|
30028
|
-
|
30205
|
+
return upload_to_s3(uploaded_binary, permission).then(function(blob) {
|
30206
|
+
return activate_upload(obj_id, blob, binary.filename, binary.content_type)
|
30207
|
+
.then(function() { return blob; });
|
30208
|
+
}).always(function() { scrivito.write_monitor.end_write(); });
|
30029
30209
|
});
|
30030
30210
|
},
|
30031
30211
|
|
30032
30212
|
// For testing purpose only.
|
30033
30213
|
get_form_data: function() {
|
30034
30214
|
return new FormData();
|
30215
|
+
},
|
30216
|
+
|
30217
|
+
upload_binary: function(params) {
|
30218
|
+
var blob = params.blob || params.file;
|
30219
|
+
if (!blob) { $.error('need blob or file'); }
|
30220
|
+
if (!params.content_type) { params.content_type = blob.type; }
|
30221
|
+
if (!params.filename) {
|
30222
|
+
if (params.blob) { $.error('blob needs a filename'); }
|
30223
|
+
params.filename = blob.name;
|
30224
|
+
}
|
30225
|
+
params.filename = params.filename.replace(/[^\w\-_\.$]/g, '-');
|
30226
|
+
|
30227
|
+
return $.extend(params, {is_uploaded_binary: true});
|
30035
30228
|
}
|
30036
30229
|
}
|
30037
30230
|
});
|
@@ -30040,15 +30233,17 @@ var scrivito = {};
|
|
30040
30233
|
return scrivito.ajax('GET', 'blobs/upload_permission');
|
30041
30234
|
};
|
30042
30235
|
|
30043
|
-
var upload_to_s3 = function(
|
30236
|
+
var upload_to_s3 = function(binary, permission) {
|
30044
30237
|
var form_data = scrivito.blob.get_form_data();
|
30045
30238
|
_.each(permission.fields, function(value, name) {
|
30046
30239
|
form_data.append(name, value);
|
30047
30240
|
});
|
30048
|
-
form_data.append('file', file); // File must be appended last, otherwise S3 will complain.
|
30049
30241
|
|
30050
|
-
|
30051
|
-
|
30242
|
+
// File must be appended last, otherwise S3 will complain.
|
30243
|
+
form_data.append('file', binary.blob || binary.file);
|
30244
|
+
|
30245
|
+
permission.blob.filename = binary.filename;
|
30246
|
+
permission.blob.content_type = binary.content_type;
|
30052
30247
|
|
30053
30248
|
return $.ajax({type: 'POST', url: permission.url, data: form_data,
|
30054
30249
|
// These are needed in order for jQuery to work properly with a FormData.
|
@@ -30057,6 +30252,14 @@ var scrivito = {};
|
|
30057
30252
|
}).then(function() { return permission.blob; });
|
30058
30253
|
};
|
30059
30254
|
|
30255
|
+
var activate_upload = function(obj_id, blob, filename, content_type) {
|
30256
|
+
return scrivito.ajax('PUT', 'blobs/activate_upload', {data: {
|
30257
|
+
obj_id: obj_id,
|
30258
|
+
upload: blob,
|
30259
|
+
filename: filename,
|
30260
|
+
content_type: content_type
|
30261
|
+
}});
|
30262
|
+
};
|
30060
30263
|
}());
|
30061
30264
|
(function() {
|
30062
30265
|
_.extend(scrivito, {
|
@@ -30079,8 +30282,10 @@ var scrivito = {};
|
|
30079
30282
|
},
|
30080
30283
|
|
30081
30284
|
fetch_page_class_selection: function() {
|
30082
|
-
|
30083
|
-
|
30285
|
+
var request_path = 'objs/page_class_selection?' + $.param({parent_path: that.path()});
|
30286
|
+
return scrivito.ajax('GET', request_path).then(function(obj_classes_markup) {
|
30287
|
+
return that.enrich_obj_classes_with_recent(obj_classes_markup);
|
30288
|
+
});
|
30084
30289
|
},
|
30085
30290
|
|
30086
30291
|
allowed_classes: function() {
|
@@ -30090,6 +30295,7 @@ var scrivito = {};
|
|
30090
30295
|
|
30091
30296
|
create_child: function(obj_class) {
|
30092
30297
|
var id = scrivito.random_id();
|
30298
|
+
scrivito.obj_class_selection.store(obj_class);
|
30093
30299
|
return scrivito.obj.create({
|
30094
30300
|
_id: id,
|
30095
30301
|
_path: that.path() + '/' + id,
|
@@ -30200,6 +30406,7 @@ var scrivito = {};
|
|
30200
30406
|
});
|
30201
30407
|
|
30202
30408
|
var additional_public_api = {};
|
30409
|
+
var page_config_attr_name = 'data-scrivito-private-page-config';
|
30203
30410
|
|
30204
30411
|
var create_instance = function(cms_element) {
|
30205
30412
|
var that = cms_element;
|
@@ -30209,6 +30416,7 @@ var scrivito = {};
|
|
30209
30416
|
install_public_api: function() {
|
30210
30417
|
local_$().fn.scrivito = scrivito.jquery_plugin;
|
30211
30418
|
|
30419
|
+
// @api public
|
30212
30420
|
browser_window.scrivito = _.extend({}, additional_public_api, {
|
30213
30421
|
on: local_on_function,
|
30214
30422
|
trigger: scrivito.trigger,
|
@@ -30219,12 +30427,25 @@ var scrivito = {};
|
|
30219
30427
|
in_editable_view: scrivito.in_editable_view,
|
30220
30428
|
register_default_obj_class_for_content_type: scrivito.register_default_obj_class_for_content_type,
|
30221
30429
|
default_obj_class_for_content_type: scrivito.default_obj_class_for_content_type,
|
30222
|
-
register_select_content: scrivito.register_select_content,
|
30430
|
+
register_select_content: scrivito.register_select_content, // @api beta
|
30223
30431
|
configure_menu_order: scrivito.configure_menu_order,
|
30224
|
-
|
30432
|
+
upload_binary: scrivito.blob.upload_binary,
|
30433
|
+
page_menu: function() { return scrivito.page_menu(that); },
|
30434
|
+
// @api beta
|
30435
|
+
dialog: function(content, options) {
|
30436
|
+
var iframe = that.window().iframe();
|
30437
|
+
return scrivito.custom_dialog(iframe, browser_document, content, options);
|
30438
|
+
}
|
30225
30439
|
});
|
30226
30440
|
},
|
30227
30441
|
|
30442
|
+
assert_user_logged_in: function() {
|
30443
|
+
if (that.user_id() !== scrivito.user.current.id()) {
|
30444
|
+
// editing is either no longer allowed, or user changed => closing UI
|
30445
|
+
scrivito.change_location(window.location, window.parent);
|
30446
|
+
}
|
30447
|
+
},
|
30448
|
+
|
30228
30449
|
connect: function() {
|
30229
30450
|
if (connected) { $.error("document connected twice!"); }
|
30230
30451
|
|
@@ -30248,11 +30469,9 @@ var scrivito = {};
|
|
30248
30469
|
});
|
30249
30470
|
},
|
30250
30471
|
|
30251
|
-
|
30252
|
-
var
|
30253
|
-
|
30254
|
-
return scrivito.obj.create_instance(config.current_page);
|
30255
|
-
}
|
30472
|
+
add_app_extensions: function() {
|
30473
|
+
var app_extension_tags = scrivito.ui_config().app_extension_tags;
|
30474
|
+
browser_window.document.write(app_extension_tags);
|
30256
30475
|
},
|
30257
30476
|
|
30258
30477
|
window: function() {
|
@@ -30282,14 +30501,36 @@ var scrivito = {};
|
|
30282
30501
|
}
|
30283
30502
|
},
|
30284
30503
|
|
30504
|
+
page: function() {
|
30505
|
+
var config = that.page_config();
|
30506
|
+
if (config && !_.isEmpty(config.current_page)) {
|
30507
|
+
return scrivito.obj.create_instance(config.current_page);
|
30508
|
+
}
|
30509
|
+
},
|
30510
|
+
|
30511
|
+
user_id: function() {
|
30512
|
+
var config = that.page_config();
|
30513
|
+
if (config) {
|
30514
|
+
return config.user_id;
|
30515
|
+
}
|
30516
|
+
},
|
30517
|
+
|
30518
|
+
page_config: function() {
|
30519
|
+
return scrivito.dom_config.read(that.dom_element().find('body'), page_config_attr_name);
|
30520
|
+
},
|
30521
|
+
|
30285
30522
|
// For test purpose only.
|
30286
|
-
|
30287
|
-
|
30523
|
+
mock_page_config: function(config) {
|
30524
|
+
if (config) {
|
30525
|
+
scrivito.dom_config.write(that.dom_element().find('body'), page_config_attr_name, config);
|
30526
|
+
} else {
|
30527
|
+
that.dom_element().find('body').removeAttr(page_config_attr_name);
|
30528
|
+
}
|
30288
30529
|
},
|
30289
30530
|
|
30290
30531
|
// For test purpose only.
|
30291
30532
|
mock_current_page: function(attrs) {
|
30292
|
-
that.
|
30533
|
+
that.mock_page_config({current_page: attrs});
|
30293
30534
|
}
|
30294
30535
|
});
|
30295
30536
|
|
@@ -30299,7 +30540,15 @@ var scrivito = {};
|
|
30299
30540
|
var browser_window = browser_document.defaultView;
|
30300
30541
|
|
30301
30542
|
var local_$ = function() {
|
30302
|
-
|
30543
|
+
if (browser_window.jQuery) {
|
30544
|
+
return browser_window.jQuery;
|
30545
|
+
} else {
|
30546
|
+
var jquery_missing = 'jQuery is missing! ' +
|
30547
|
+
'In order for Scrivito to work, jQuery is needed. ' +
|
30548
|
+
'Please add jQuery to your assets.';
|
30549
|
+
scrivito.alert_dialog(jquery_missing);
|
30550
|
+
$.error(jquery_missing);
|
30551
|
+
}
|
30303
30552
|
};
|
30304
30553
|
|
30305
30554
|
var connected = false;
|
@@ -30404,10 +30653,7 @@ var scrivito = {};
|
|
30404
30653
|
}
|
30405
30654
|
|
30406
30655
|
return request_promise.then(function(model_data) {
|
30407
|
-
|
30408
|
-
if (field_data) {
|
30409
|
-
return field_data[0];
|
30410
|
-
}
|
30656
|
+
return model_data[that.field_name()];
|
30411
30657
|
});
|
30412
30658
|
},
|
30413
30659
|
|
@@ -30568,6 +30814,17 @@ var scrivito = {};
|
|
30568
30814
|
return with_saving_overlay(scrivito.redirect_to(location, browser_window));
|
30569
30815
|
},
|
30570
30816
|
|
30817
|
+
use_fragment_of: function(other_cms_window) {
|
30818
|
+
if (that === other_cms_window) { return; }
|
30819
|
+
|
30820
|
+
var ui_hash = other_cms_window.browser_window().location.hash;
|
30821
|
+
if (ui_hash) {
|
30822
|
+
var src_uri = new URI(that.iframe().src);
|
30823
|
+
src_uri.fragment(ui_hash);
|
30824
|
+
that.iframe().src = src_uri.href();
|
30825
|
+
}
|
30826
|
+
},
|
30827
|
+
|
30571
30828
|
is_frame: function() {
|
30572
30829
|
return browser_window.parent !== browser_window;
|
30573
30830
|
},
|
@@ -30693,22 +30950,26 @@ var scrivito = {};
|
|
30693
30950
|
|
30694
30951
|
var serialize_date = function(date) {
|
30695
30952
|
return date.getUTCFullYear().toString() +
|
30696
|
-
format_date_number(date.getUTCMonth() + 1) + // Month numbers are starting at 0.
|
30697
|
-
format_date_number(date.getUTCDate()) +
|
30698
|
-
format_date_number(date.getUTCHours()) +
|
30699
|
-
format_date_number(date.getUTCMinutes()) +
|
30700
|
-
format_date_number(date.getUTCSeconds())
|
30953
|
+
'-' + format_date_number(date.getUTCMonth() + 1) + // Month numbers are starting at 0.
|
30954
|
+
'-' + format_date_number(date.getUTCDate()) +
|
30955
|
+
'T' + format_date_number(date.getUTCHours()) +
|
30956
|
+
':' + format_date_number(date.getUTCMinutes()) +
|
30957
|
+
':' + format_date_number(date.getUTCSeconds()) +
|
30958
|
+
'Z';
|
30701
30959
|
};
|
30702
30960
|
|
30703
|
-
var convert_attrs = function(attrs) {
|
30961
|
+
var convert_attrs = function(obj_id, attrs) {
|
30704
30962
|
var collected_promises = _.map(attrs, function(value, field_name) {
|
30705
30963
|
if (is_file(value)) {
|
30706
|
-
return scrivito.blob.create(value).then(function(
|
30707
|
-
return [field_name,
|
30964
|
+
return scrivito.blob.create(obj_id, {file: value}).then(function(blob) {
|
30965
|
+
return [field_name, blob];
|
30966
|
+
});
|
30967
|
+
} else if (value && value.is_uploaded_binary) {
|
30968
|
+
return scrivito.blob.create(obj_id, value).then(function(blob) {
|
30969
|
+
return [field_name, blob];
|
30708
30970
|
});
|
30709
|
-
} else {
|
30710
|
-
return $.Deferred().resolve([field_name, scrivito.obj.serialize_value(value)]);
|
30711
30971
|
}
|
30972
|
+
return $.Deferred().resolve([field_name, scrivito.obj.serialize_value(value)]);
|
30712
30973
|
});
|
30713
30974
|
|
30714
30975
|
return $.when.apply(this, collected_promises).then(function() {
|
@@ -30716,10 +30977,10 @@ var scrivito = {};
|
|
30716
30977
|
});
|
30717
30978
|
};
|
30718
30979
|
|
30719
|
-
var convert_widget_pool = function(widget_pool) {
|
30980
|
+
var convert_widget_pool = function(obj_id, widget_pool) {
|
30720
30981
|
if (widget_pool) {
|
30721
30982
|
var conversion_promises = _.map(widget_pool, function(attrs, widget_id) {
|
30722
|
-
return convert_attrs(attrs).then(function(converted_attrs) {
|
30983
|
+
return convert_attrs(obj_id, attrs).then(function(converted_attrs) {
|
30723
30984
|
return [widget_id, converted_attrs];
|
30724
30985
|
});
|
30725
30986
|
});
|
@@ -30732,9 +30993,9 @@ var scrivito = {};
|
|
30732
30993
|
}
|
30733
30994
|
};
|
30734
30995
|
|
30735
|
-
var prepare_attrs = function(attrs) {
|
30736
|
-
return convert_widget_pool(attrs._widget_pool).then(function(widget_pool) {
|
30737
|
-
return convert_attrs(attrs).then(function(converted_attrs) {
|
30996
|
+
var prepare_attrs = function(obj_id, attrs) {
|
30997
|
+
return convert_widget_pool(obj_id, attrs._widget_pool).then(function(widget_pool) {
|
30998
|
+
return convert_attrs(obj_id, attrs).then(function(converted_attrs) {
|
30738
30999
|
converted_attrs._widget_pool = widget_pool;
|
30739
31000
|
return converted_attrs;
|
30740
31001
|
});
|
@@ -30816,7 +31077,7 @@ var scrivito = {};
|
|
30816
31077
|
},
|
30817
31078
|
|
30818
31079
|
save: function(attrs) {
|
30819
|
-
return prepare_attrs(attrs).then(function(prepared_attrs) {
|
31080
|
+
return prepare_attrs(that.id(), attrs).then(function(prepared_attrs) {
|
30820
31081
|
return scrivito.ajax('PUT', 'objs/'+that.id(), {data: {obj: prepared_attrs}});
|
30821
31082
|
});
|
30822
31083
|
},
|
@@ -30912,7 +31173,7 @@ var scrivito = {};
|
|
30912
31173
|
},
|
30913
31174
|
|
30914
31175
|
create: function(attrs) {
|
30915
|
-
return prepare_attrs(attrs).then(function(prepared_attrs) {
|
31176
|
+
return prepare_attrs(scrivito.random_id(), attrs).then(function(prepared_attrs) {
|
30916
31177
|
return scrivito.ajax('POST', 'objs', {data: {obj: prepared_attrs}}).then(function(data) {
|
30917
31178
|
return scrivito.obj.create_instance(data);
|
30918
31179
|
});
|
@@ -30921,6 +31182,18 @@ var scrivito = {};
|
|
30921
31182
|
}
|
30922
31183
|
});
|
30923
31184
|
}());
|
31185
|
+
(function() {
|
31186
|
+
_.extend(scrivito, {
|
31187
|
+
obj_changes: function() {
|
31188
|
+
return scrivito.obj_where('_modification', 'equals', ['new', 'edited', 'deleted']).
|
31189
|
+
batch_size(100).
|
31190
|
+
order('_last_changed').
|
31191
|
+
reverse_order().
|
31192
|
+
format('_default').
|
31193
|
+
include_deleted();
|
31194
|
+
}
|
31195
|
+
});
|
31196
|
+
}());
|
30924
31197
|
(function() {
|
30925
31198
|
_.extend(scrivito, {
|
30926
31199
|
obj_element: {
|
@@ -31242,7 +31515,7 @@ var scrivito = {};
|
|
31242
31515
|
save: function(widget_attributes) {
|
31243
31516
|
var obj_attributes = build_obj_attributes(widget_attributes);
|
31244
31517
|
return that.obj().save(obj_attributes).then(function(obj_data) {
|
31245
|
-
return obj_data._widget_pool[
|
31518
|
+
return obj_data._widget_pool[that.id()];
|
31246
31519
|
});
|
31247
31520
|
},
|
31248
31521
|
|
@@ -31389,37 +31662,46 @@ var scrivito = {};
|
|
31389
31662
|
return that.widget_elements().length === 0;
|
31390
31663
|
},
|
31391
31664
|
|
31392
|
-
add_widget: function(widget_spec, widget_element) {
|
31393
|
-
var
|
31665
|
+
add_widget: function(widget_spec, widget_element, position) {
|
31666
|
+
var index;
|
31394
31667
|
if (widget_element) {
|
31395
|
-
|
31396
|
-
|
31668
|
+
index = widget_element.dom_element()
|
31669
|
+
.prevAll('[data-scrivito-private-widget-id]').length;
|
31670
|
+
if (position === 'bottom') { index += 1; }
|
31397
31671
|
} else {
|
31398
|
-
|
31672
|
+
index = that.widget_elements().length;
|
31399
31673
|
}
|
31400
31674
|
|
31401
31675
|
var content = that.content();
|
31402
|
-
content.splice(
|
31676
|
+
content.splice(index, 0, widget_spec);
|
31403
31677
|
|
31404
31678
|
return that.save(content).then(function(field_data) {
|
31405
|
-
var new_widget_id;
|
31406
|
-
if (field_data.list) {
|
31407
|
-
new_widget_id = field_data.list[position].widget;
|
31408
|
-
} else {
|
31409
|
-
new_widget_id = field_data[position];
|
31410
|
-
}
|
31679
|
+
var new_widget_id = field_data[index];
|
31411
31680
|
var widget = scrivito.widget.create_instance(that.obj(), new_widget_id);
|
31412
|
-
return
|
31681
|
+
return insert_widget(widget, widget_element, position);
|
31413
31682
|
});
|
31414
31683
|
},
|
31415
31684
|
|
31685
|
+
add_widget_via_create: function(widget_params, widget_element, position) {
|
31686
|
+
scrivito.obj_class_selection.store(widget_params._obj_class);
|
31687
|
+
return that.add_widget({create: widget_params}, widget_element, position);
|
31688
|
+
},
|
31689
|
+
|
31690
|
+
add_widget_via_copy: function(widget_params, widget_element, position) {
|
31691
|
+
return that.add_widget({copy: widget_params}, widget_element, position);
|
31692
|
+
},
|
31693
|
+
|
31416
31694
|
fetch_widget_class_selection: function() {
|
31417
31695
|
var params = {field_name: that.field_name()};
|
31418
31696
|
if (that.widget()) {
|
31419
31697
|
params.widget_id = that.widget().id();
|
31420
31698
|
}
|
31421
|
-
|
31422
|
-
$.param(params)
|
31699
|
+
var request_path = 'objs/' + that.obj().id() + '/widget_class_selection?' +
|
31700
|
+
$.param(params);
|
31701
|
+
|
31702
|
+
return scrivito.ajax('GET', request_path).then(function(obj_classes_markup) {
|
31703
|
+
return that.enrich_obj_classes_with_recent(obj_classes_markup);
|
31704
|
+
});
|
31423
31705
|
},
|
31424
31706
|
|
31425
31707
|
allowed_classes: function() {
|
@@ -31482,12 +31764,16 @@ var scrivito = {};
|
|
31482
31764
|
.attr('data-scrivito-private-field-widget-allowed-classes'));
|
31483
31765
|
};
|
31484
31766
|
|
31485
|
-
var
|
31767
|
+
var insert_widget = function(widget, widget_element, position) {
|
31486
31768
|
return widget.fetch_markup(that.template_name(), that.inner_tag()).then(
|
31487
31769
|
function(widget_markup) {
|
31488
31770
|
var dom_element = $($.trim(widget_markup));
|
31489
31771
|
if (widget_element) {
|
31490
|
-
|
31772
|
+
if (position === 'bottom') {
|
31773
|
+
widget_element.dom_element().after(dom_element);
|
31774
|
+
} else {
|
31775
|
+
widget_element.dom_element().before(dom_element);
|
31776
|
+
}
|
31491
31777
|
} else {
|
31492
31778
|
that.dom_element().prepend(dom_element);
|
31493
31779
|
}
|
@@ -31586,12 +31872,6 @@ var scrivito = {};
|
|
31586
31872
|
return scrivito.ajax('DELETE', 'workspaces/' + that.id());
|
31587
31873
|
},
|
31588
31874
|
|
31589
|
-
fetch_memberships: function() {
|
31590
|
-
return scrivito.ajax('GET', 'workspaces/' + that.id()).then(function(details) {
|
31591
|
-
return details.memberships;
|
31592
|
-
});
|
31593
|
-
},
|
31594
|
-
|
31595
31875
|
has_conflicts: function() {
|
31596
31876
|
return scrivito.obj_where('_conflicts', 'equals', true).size().then(function(size) {
|
31597
31877
|
var promise = $.Deferred();
|
@@ -31917,17 +32197,23 @@ var scrivito = {};
|
|
31917
32197
|
_.extend(scrivito, {
|
31918
32198
|
template: {
|
31919
32199
|
load_templates_from_server: false,
|
32200
|
+
template_cache: {},
|
31920
32201
|
|
31921
32202
|
render: function(template_path, data) {
|
31922
32203
|
var template;
|
31923
32204
|
if(typeof ScrivitoHandlebarsTemplates !== 'undefined') {
|
31924
32205
|
template = ScrivitoHandlebarsTemplates[template_path];
|
31925
32206
|
}
|
31926
|
-
if(template
|
32207
|
+
if(!template) {
|
31927
32208
|
if(scrivito.template.load_templates_from_server) {
|
31928
|
-
|
31929
|
-
|
31930
|
-
|
32209
|
+
template = scrivito.template.template_cache[template_path];
|
32210
|
+
if(!template) {
|
32211
|
+
var url = "/app/assets/javascripts/templates/" + template_path + ".hbs?" +
|
32212
|
+
Math.random();
|
32213
|
+
var source = jQuery.ajax(url, { async: false }).responseText;
|
32214
|
+
template = Handlebars.compile(source);
|
32215
|
+
scrivito.template.template_cache[template_path] = template;
|
32216
|
+
}
|
31931
32217
|
} else {
|
31932
32218
|
throw('could not load template' + template_path);
|
31933
32219
|
}
|
@@ -32111,14 +32397,14 @@ var scrivito = {};
|
|
32111
32397
|
var promise = $.Deferred();
|
32112
32398
|
|
32113
32399
|
var close = function() {
|
32114
|
-
scrivito.dialog.
|
32400
|
+
scrivito.dialog.close_with_transition(view);
|
32115
32401
|
promise.resolve();
|
32116
32402
|
return false;
|
32117
32403
|
};
|
32118
32404
|
|
32119
32405
|
view.find('.scrivito_close').on('click', close);
|
32120
32406
|
|
32121
|
-
scrivito.dialog.
|
32407
|
+
scrivito.dialog.open_and_center_with_transition(view);
|
32122
32408
|
|
32123
32409
|
return scrivito.with_dialog_behaviour(view, promise, {enter: close, escape: close});
|
32124
32410
|
},
|
@@ -32156,13 +32442,13 @@ var scrivito = {};
|
|
32156
32442
|
var deferred = $.Deferred();
|
32157
32443
|
|
32158
32444
|
var accept = function() {
|
32159
|
-
scrivito.dialog.
|
32445
|
+
scrivito.dialog.close_with_transition(view);
|
32160
32446
|
deferred.resolve();
|
32161
32447
|
return false;
|
32162
32448
|
};
|
32163
32449
|
|
32164
32450
|
var cancel = function() {
|
32165
|
-
scrivito.dialog.
|
32451
|
+
scrivito.dialog.close_with_transition(view);
|
32166
32452
|
deferred.reject();
|
32167
32453
|
return false;
|
32168
32454
|
};
|
@@ -32170,7 +32456,7 @@ var scrivito = {};
|
|
32170
32456
|
view.find('.scrivito_confirm').on('click', accept);
|
32171
32457
|
view.find('.scrivito_cancel').on('click', cancel);
|
32172
32458
|
|
32173
|
-
scrivito.dialog.
|
32459
|
+
scrivito.dialog.open_and_center_with_transition(view);
|
32174
32460
|
return scrivito.with_dialog_behaviour(view, deferred, {enter: accept, escape: cancel});
|
32175
32461
|
},
|
32176
32462
|
|
@@ -32202,14 +32488,14 @@ var scrivito = {};
|
|
32202
32488
|
var accept = function() {
|
32203
32489
|
var val = view.find('input').val();
|
32204
32490
|
if (val) {
|
32205
|
-
scrivito.dialog.
|
32491
|
+
scrivito.dialog.close_with_transition(view);
|
32206
32492
|
deferred.resolve(val);
|
32207
32493
|
}
|
32208
32494
|
return false;
|
32209
32495
|
};
|
32210
32496
|
|
32211
32497
|
var cancel = function() {
|
32212
|
-
scrivito.dialog.
|
32498
|
+
scrivito.dialog.close_with_transition(view);
|
32213
32499
|
deferred.reject();
|
32214
32500
|
return false;
|
32215
32501
|
};
|
@@ -32217,7 +32503,7 @@ var scrivito = {};
|
|
32217
32503
|
view.find('.scrivito_accept').on('click', accept);
|
32218
32504
|
view.find('.scrivito_cancel').on('click', cancel);
|
32219
32505
|
|
32220
|
-
scrivito.dialog.
|
32506
|
+
scrivito.dialog.open_and_center_with_transition(view).then(function() {
|
32221
32507
|
view.find('input').focus();
|
32222
32508
|
});
|
32223
32509
|
|
@@ -32228,25 +32514,34 @@ var scrivito = {};
|
|
32228
32514
|
(function() {
|
32229
32515
|
_.extend(scrivito, {
|
32230
32516
|
dialog: {
|
32231
|
-
|
32517
|
+
open_without_transition: function(view) {
|
32518
|
+
view.addClass('scrivito_show');
|
32519
|
+
},
|
32520
|
+
|
32521
|
+
open_and_adjust_without_transition: function(view) {
|
32522
|
+
scrivito.dialog.open_without_transition(view);
|
32523
|
+
scrivito.dialog.adjust(view);
|
32524
|
+
},
|
32525
|
+
|
32526
|
+
open_with_transition: function(view) {
|
32232
32527
|
return scrivito.transition(view, function() {
|
32233
|
-
|
32528
|
+
scrivito.dialog.open_without_transition(view);
|
32234
32529
|
});
|
32235
32530
|
},
|
32236
32531
|
|
32237
|
-
|
32238
|
-
return scrivito.dialog.
|
32532
|
+
open_and_adjust_with_transition: function(view) {
|
32533
|
+
return scrivito.dialog.open_with_transition(view).then(function() {
|
32239
32534
|
scrivito.dialog.adjust(view);
|
32240
32535
|
});
|
32241
32536
|
},
|
32242
32537
|
|
32243
|
-
|
32244
|
-
return scrivito.dialog.
|
32538
|
+
open_and_center_with_transition: function(view) {
|
32539
|
+
return scrivito.dialog.open_with_transition(view).then(function() {
|
32245
32540
|
scrivito.center(view);
|
32246
32541
|
});
|
32247
32542
|
},
|
32248
32543
|
|
32249
|
-
|
32544
|
+
close_with_transition: function(view) {
|
32250
32545
|
scrivito.transition(view, function() {
|
32251
32546
|
view.removeClass('scrivito_show');
|
32252
32547
|
}).then(function() {
|
@@ -32255,6 +32550,12 @@ var scrivito = {};
|
|
32255
32550
|
});
|
32256
32551
|
},
|
32257
32552
|
|
32553
|
+
close_without_transition: function(view) {
|
32554
|
+
view.removeClass('scrivito_show');
|
32555
|
+
view.remove();
|
32556
|
+
view = null;
|
32557
|
+
},
|
32558
|
+
|
32258
32559
|
adjust: function(view) {
|
32259
32560
|
scrivito.invalidate_auto_height_for(view);
|
32260
32561
|
scrivito.update_auto_height_for(view);
|
@@ -32308,8 +32609,8 @@ var scrivito = {};
|
|
32308
32609
|
}));
|
32309
32610
|
|
32310
32611
|
obj_classes_deferred.done(function(obj_class_selection) {
|
32311
|
-
var selection_view = scrivito.template.render('
|
32312
|
-
{
|
32612
|
+
var selection_view = scrivito.template.render('choose_obj_class_dialog/list',
|
32613
|
+
{obj_class_selection: obj_class_selection});
|
32313
32614
|
|
32314
32615
|
selection_view = $($.trim(selection_view));
|
32315
32616
|
|
@@ -32317,7 +32618,7 @@ var scrivito = {};
|
|
32317
32618
|
|
32318
32619
|
view.on('click', '.scrivito_obj_class_thumbnail', function(e) {
|
32319
32620
|
e.preventDefault();
|
32320
|
-
scrivito.dialog.
|
32621
|
+
scrivito.dialog.close_without_transition(view);
|
32321
32622
|
deferred.resolve($(this).attr('data-scrivito-private-obj-class-name'));
|
32322
32623
|
});
|
32323
32624
|
});
|
@@ -32325,14 +32626,14 @@ var scrivito = {};
|
|
32325
32626
|
$('#scrivito_editing').append(view);
|
32326
32627
|
|
32327
32628
|
var cancel = function() {
|
32328
|
-
scrivito.dialog.
|
32629
|
+
scrivito.dialog.close_without_transition(view);
|
32329
32630
|
deferred.reject();
|
32330
32631
|
return false;
|
32331
32632
|
};
|
32332
32633
|
|
32333
32634
|
view.find('.scrivito_cancel').on('click', cancel);
|
32334
32635
|
|
32335
|
-
scrivito.dialog.
|
32636
|
+
scrivito.dialog.open_and_adjust_without_transition(view);
|
32336
32637
|
return scrivito.with_dialog_behaviour(view, deferred, {escape: cancel});
|
32337
32638
|
}
|
32338
32639
|
});
|
@@ -32368,25 +32669,20 @@ var scrivito = {};
|
|
32368
32669
|
var modal_size = iframe.contents().find('['+size_attr+']').attr(size_attr);
|
32369
32670
|
if (_.contains(['small', 'medium', 'large'], modal_size)) {
|
32370
32671
|
view.removeClass('scrivito_modal_medium');
|
32371
|
-
|
32372
|
-
view.addClass('scrivito_modal_' + modal_size);
|
32373
|
-
}).then(function() {
|
32374
|
-
scrivito.dialog.adjust(view);
|
32375
|
-
});
|
32376
|
-
} else {
|
32377
|
-
scrivito.dialog.adjust(view);
|
32672
|
+
view.addClass('scrivito_modal_' + modal_size);
|
32378
32673
|
}
|
32674
|
+
scrivito.dialog.adjust(view);
|
32379
32675
|
});
|
32380
32676
|
|
32381
32677
|
var cancel = function() {
|
32382
32678
|
indicator.destroy();
|
32383
|
-
scrivito.dialog.
|
32679
|
+
scrivito.dialog.close_without_transition(view);
|
32384
32680
|
deferred.resolve();
|
32385
32681
|
return false;
|
32386
32682
|
};
|
32387
32683
|
|
32388
32684
|
view.find('.scrivito_cancel').on('click', cancel);
|
32389
|
-
scrivito.dialog.
|
32685
|
+
scrivito.dialog.open_and_adjust_without_transition(view);
|
32390
32686
|
return scrivito.with_dialog_behaviour(view, deferred, {escape: cancel});
|
32391
32687
|
}
|
32392
32688
|
}
|
@@ -32396,14 +32692,17 @@ var scrivito = {};
|
|
32396
32692
|
_.extend(scrivito, {
|
32397
32693
|
menus: {
|
32398
32694
|
open: function(dom_element, commands, options) {
|
32399
|
-
scrivito.close_all_menus();
|
32400
|
-
|
32401
32695
|
var menu = $(scrivito.template.render('menu', _.extend(options || {}, {
|
32402
32696
|
menu_items: _.map(scrivito.pattern_sort(commands, scrivito.menu_order), function(command) {
|
32403
32697
|
return scrivito.menu_item.create_instance(command);
|
32404
32698
|
})
|
32405
32699
|
})));
|
32406
32700
|
|
32701
|
+
menu.find('.scrivito_menu_box_overlay').on('click', function() {
|
32702
|
+
menu.data('scrivito-menu-close')();
|
32703
|
+
return false;
|
32704
|
+
});
|
32705
|
+
|
32407
32706
|
dom_element.data('scrivito-menu-dom', menu);
|
32408
32707
|
|
32409
32708
|
menu.data('scrivito-menu-close', function() {
|
@@ -32506,15 +32805,6 @@ var scrivito = {};
|
|
32506
32805
|
}
|
32507
32806
|
});
|
32508
32807
|
}());
|
32509
|
-
(function() {
|
32510
|
-
_.extend(scrivito, {
|
32511
|
-
close_all_menus: function() {
|
32512
|
-
_.each($('.scrivito_editing_marker_menu'), function(menu) {
|
32513
|
-
$(menu).data('scrivito-menu-close')();
|
32514
|
-
});
|
32515
|
-
}
|
32516
|
-
});
|
32517
|
-
}());
|
32518
32808
|
(function() {
|
32519
32809
|
var callbacks = [];
|
32520
32810
|
|
@@ -32626,6 +32916,38 @@ var scrivito = {};
|
|
32626
32916
|
}
|
32627
32917
|
};
|
32628
32918
|
}());
|
32919
|
+
(function() {
|
32920
|
+
_.extend(scrivito, {
|
32921
|
+
option_marker: {
|
32922
|
+
init: function() {
|
32923
|
+
scrivito.on('content', function(content) {
|
32924
|
+
if (scrivito.editing_context.is_editing_mode()) {
|
32925
|
+
_.each(scrivito.widget_element.all($(content)), function(widget_element) {
|
32926
|
+
if (!widget_element.has_widgetlist()) {
|
32927
|
+
scrivito.option_marker.create(widget_element, 'top');
|
32928
|
+
scrivito.option_marker.create(widget_element, 'bottom');
|
32929
|
+
}
|
32930
|
+
});
|
32931
|
+
}
|
32932
|
+
});
|
32933
|
+
},
|
32934
|
+
|
32935
|
+
create: function(widget_element, position) {
|
32936
|
+
var marker = $(scrivito.template.render('option_marker', {position: position}));
|
32937
|
+
marker.appendTo(widget_element.dom_element());
|
32938
|
+
marker.on('click', function() {
|
32939
|
+
var widgetlist_field_element = widget_element.widget_field();
|
32940
|
+
if (widgetlist_field_element.can_choose_widget_class()) {
|
32941
|
+
scrivito.choose_and_create_widget_command(widget_element, position).execute();
|
32942
|
+
} else {
|
32943
|
+
scrivito.create_widget_command(widget_element, position).execute();
|
32944
|
+
}
|
32945
|
+
return false;
|
32946
|
+
});
|
32947
|
+
}
|
32948
|
+
}
|
32949
|
+
});
|
32950
|
+
}());
|
32629
32951
|
(function() {
|
32630
32952
|
_.extend(scrivito, {
|
32631
32953
|
resource_dialog: {
|
@@ -32633,20 +32955,21 @@ var scrivito = {};
|
|
32633
32955
|
if (config.obj) {
|
32634
32956
|
var obj = scrivito.obj.create_instance(config.obj);
|
32635
32957
|
scrivito.gui.on('open', function() {
|
32636
|
-
scrivito.resource_dialog.open(obj).then(function() {
|
32958
|
+
scrivito.resource_dialog.open(obj, config.return_to).then(function() {
|
32637
32959
|
return scrivito.with_saving_overlay(scrivito.redirect_to(config.return_to));
|
32638
32960
|
});
|
32639
32961
|
});
|
32640
32962
|
}
|
32641
32963
|
},
|
32642
32964
|
|
32643
|
-
open: function(obj) {
|
32965
|
+
open: function(obj, return_to) {
|
32644
32966
|
var title = scrivito.t('resource_dialog.title', obj.obj_class_name());
|
32645
32967
|
return scrivito.details_dialog.open(obj.details_src(), title, obj, [
|
32646
32968
|
scrivito.revert_obj_command(obj, 'resource_dialog.commands.revert_obj'),
|
32647
32969
|
scrivito.restore_obj_command(obj, 'resource_dialog.commands.restore_obj'),
|
32648
32970
|
scrivito.mark_resolved_obj_command(obj, 'resource_dialog.commands.mark_resolved_obj'),
|
32649
|
-
scrivito.delete_obj_command(obj, 'resource_dialog.commands.delete_obj'
|
32971
|
+
scrivito.delete_obj_command(obj, 'resource_dialog.commands.delete_obj',
|
32972
|
+
return_to || '/'+scrivito.application_document().page().id())
|
32650
32973
|
]);
|
32651
32974
|
}
|
32652
32975
|
}
|
@@ -32711,6 +33034,99 @@ var scrivito = {};
|
|
32711
33034
|
return target;
|
32712
33035
|
};
|
32713
33036
|
}());
|
33037
|
+
(function() {
|
33038
|
+
_.extend(scrivito, {
|
33039
|
+
iframe_dialog: {
|
33040
|
+
open: function(iframe, options) {
|
33041
|
+
iframe = $(iframe);
|
33042
|
+
options = options || {};
|
33043
|
+
|
33044
|
+
var iframe_container;
|
33045
|
+
if (!iframe.parent().is('body')) {
|
33046
|
+
iframe_container = iframe.closest('#scrivito_editing > div');
|
33047
|
+
}
|
33048
|
+
|
33049
|
+
var view = $(scrivito.template.render('iframe_dialog', {
|
33050
|
+
color: options.color,
|
33051
|
+
confirm: options.confirm || scrivito.t('confirm'),
|
33052
|
+
cancel: options.cancel || scrivito.t('cancel'),
|
33053
|
+
disable_confirm: options.confirm === false,
|
33054
|
+
disable_cancel: options.cancel === false
|
33055
|
+
}));
|
33056
|
+
|
33057
|
+
$('#scrivito_editing').append(view);
|
33058
|
+
|
33059
|
+
var dialog_body = view.find('.scrivito_modal_body');
|
33060
|
+
var when_closed = $.Deferred();
|
33061
|
+
|
33062
|
+
var confirm = function() {
|
33063
|
+
scrivito.dialog.close_without_transition(view);
|
33064
|
+
when_closed.resolve();
|
33065
|
+
return false;
|
33066
|
+
};
|
33067
|
+
|
33068
|
+
var cancel = function() {
|
33069
|
+
scrivito.dialog.close_without_transition(view);
|
33070
|
+
when_closed.reject();
|
33071
|
+
return false;
|
33072
|
+
};
|
33073
|
+
|
33074
|
+
view.find('.scrivito_confirm').on('click', confirm);
|
33075
|
+
view.find('.scrivito_cancel').on('click', cancel);
|
33076
|
+
|
33077
|
+
scrivito.with_dialog_behaviour(view, when_closed, {enter: confirm, escape: cancel});
|
33078
|
+
scrivito.dialog.open_and_adjust_without_transition(view);
|
33079
|
+
|
33080
|
+
scrivito.restore_styles_afterwards(when_closed, iframe);
|
33081
|
+
iframe.css('z-index', scrivito.iframe_dialog.z_index(view) + 1);
|
33082
|
+
|
33083
|
+
if (iframe_container) {
|
33084
|
+
scrivito.restore_styles_afterwards(when_closed, iframe_container);
|
33085
|
+
iframe_container.addClass('scrivito_dialog_mode');
|
33086
|
+
} else {
|
33087
|
+
iframe.attr('class', ''); // Remove device toggle classes.
|
33088
|
+
}
|
33089
|
+
|
33090
|
+
var adjust = function() {
|
33091
|
+
// Make sure to never manipulate the iFrame after the dialog has been closed.
|
33092
|
+
if (when_closed.state() !== 'pending') { return; }
|
33093
|
+
iframe.width(dialog_body.width());
|
33094
|
+
iframe.height(dialog_body.height());
|
33095
|
+
iframe.offset(dialog_body.offset());
|
33096
|
+
};
|
33097
|
+
|
33098
|
+
$(window).on('resize', adjust);
|
33099
|
+
adjust();
|
33100
|
+
|
33101
|
+
return {
|
33102
|
+
when_open: $.Deferred().resolve(dialog_body),
|
33103
|
+
when_closed: when_closed.promise()
|
33104
|
+
};
|
33105
|
+
},
|
33106
|
+
|
33107
|
+
// For test purpose only.
|
33108
|
+
z_index: function(view) {
|
33109
|
+
return parseInt(view.css('z-index'), 10);
|
33110
|
+
}
|
33111
|
+
}
|
33112
|
+
});
|
33113
|
+
}());
|
33114
|
+
(function() {
|
33115
|
+
_.extend(scrivito, {
|
33116
|
+
full_screen_panel: function(doc, promise) {
|
33117
|
+
var body = $(doc).find('body');
|
33118
|
+
var panel = $('<div class="scrivito_full_screen_panel"></div>');
|
33119
|
+
|
33120
|
+
body.append(panel);
|
33121
|
+
promise.always(function() { panel.detach(); });
|
33122
|
+
|
33123
|
+
scrivito.restore_styles_afterwards(promise, body);
|
33124
|
+
body.css('overflow', 'hidden');
|
33125
|
+
|
33126
|
+
return panel;
|
33127
|
+
}
|
33128
|
+
});
|
33129
|
+
}());
|
32714
33130
|
(function() {
|
32715
33131
|
_.extend(scrivito, {
|
32716
33132
|
add_content_command: function(cms_element) {
|
@@ -32747,14 +33163,12 @@ var scrivito = {};
|
|
32747
33163
|
var content = contents[0];
|
32748
33164
|
if (content) {
|
32749
33165
|
var widget_params = {
|
32750
|
-
|
32751
|
-
|
32752
|
-
content: content
|
32753
|
-
}
|
33166
|
+
_obj_class: 'Scrivito::ContentWidget',
|
33167
|
+
content: content
|
32754
33168
|
};
|
32755
33169
|
|
32756
33170
|
scrivito.with_saving_overlay(
|
32757
|
-
widgetlist_field_element.
|
33171
|
+
widgetlist_field_element.add_widget_via_create(widget_params, widget_element)
|
32758
33172
|
);
|
32759
33173
|
}
|
32760
33174
|
});
|
@@ -32789,7 +33203,7 @@ var scrivito = {};
|
|
32789
33203
|
}());
|
32790
33204
|
(function() {
|
32791
33205
|
_.extend(scrivito, {
|
32792
|
-
choose_and_create_widget_command: function(cms_element) {
|
33206
|
+
choose_and_create_widget_command: function(cms_element, position) {
|
32793
33207
|
var widgetlist_field_element, widget_element;
|
32794
33208
|
if (cms_element.widget_field) {
|
32795
33209
|
widget_element = cms_element;
|
@@ -32820,9 +33234,9 @@ var scrivito = {};
|
|
32820
33234
|
var choose_obj_class = scrivito.choose_obj_class_dialog(
|
32821
33235
|
widgetlist_field_element.fetch_widget_class_selection(), 'create_widget');
|
32822
33236
|
return choose_obj_class.then(function(obj_class) {
|
33237
|
+
var widget_params = {_obj_class: obj_class};
|
32823
33238
|
return scrivito.with_saving_overlay(
|
32824
|
-
widgetlist_field_element.
|
32825
|
-
);
|
33239
|
+
widgetlist_field_element.add_widget_via_create(widget_params, widget_element, position));
|
32826
33240
|
});
|
32827
33241
|
}
|
32828
33242
|
});
|
@@ -32901,15 +33315,13 @@ var scrivito = {};
|
|
32901
33315
|
}
|
32902
33316
|
var widget = scrivito.widget_clipboard.widget();
|
32903
33317
|
var workspace_id = scrivito.widget_clipboard.workspace_id();
|
32904
|
-
var
|
32905
|
-
|
32906
|
-
|
32907
|
-
|
32908
|
-
widget_id: widget.id()
|
32909
|
-
}
|
33318
|
+
var widget_params = {
|
33319
|
+
workspace_id: workspace_id,
|
33320
|
+
obj_id: widget.obj().id(),
|
33321
|
+
widget_id: widget.id()
|
32910
33322
|
};
|
32911
33323
|
return scrivito.with_saving_overlay(
|
32912
|
-
widgetlist_field_element.
|
33324
|
+
widgetlist_field_element.add_widget_via_copy(widget_params, widget_element)
|
32913
33325
|
);
|
32914
33326
|
}
|
32915
33327
|
});
|
@@ -32918,7 +33330,7 @@ var scrivito = {};
|
|
32918
33330
|
}());
|
32919
33331
|
(function() {
|
32920
33332
|
_.extend(scrivito, {
|
32921
|
-
create_widget_command: function(cms_element) {
|
33333
|
+
create_widget_command: function(cms_element, position) {
|
32922
33334
|
var widgetlist_field_element, widget_element, description, obj_class;
|
32923
33335
|
if (cms_element.widget_field) {
|
32924
33336
|
widget_element = cms_element;
|
@@ -32943,10 +33355,9 @@ var scrivito = {};
|
|
32943
33355
|
},
|
32944
33356
|
|
32945
33357
|
execute: function() {
|
32946
|
-
var
|
33358
|
+
var params = {_obj_class: obj_class};
|
32947
33359
|
return scrivito.with_saving_overlay(
|
32948
|
-
widgetlist_field_element.
|
32949
|
-
);
|
33360
|
+
widgetlist_field_element.add_widget_via_create(params, widget_element, position));
|
32950
33361
|
}
|
32951
33362
|
});
|
32952
33363
|
}
|
@@ -33003,7 +33414,7 @@ var scrivito = {};
|
|
33003
33414
|
}());
|
33004
33415
|
(function() {
|
33005
33416
|
_.extend(scrivito, {
|
33006
|
-
delete_obj_command: function(obj, translations_namespace) {
|
33417
|
+
delete_obj_command: function(obj, translations_namespace, redirect_target) {
|
33007
33418
|
if (!translations_namespace) {
|
33008
33419
|
translations_namespace = 'commands.delete_obj';
|
33009
33420
|
}
|
@@ -33040,7 +33451,11 @@ var scrivito = {};
|
|
33040
33451
|
scrivito.obj_clipboard.obj().id() === obj.id()) {
|
33041
33452
|
scrivito.obj_clipboard.clear();
|
33042
33453
|
}
|
33043
|
-
|
33454
|
+
var redirect_url = URI({
|
33455
|
+
path: scrivito.root_path() + (redirect_target || redirect_to)
|
33456
|
+
});
|
33457
|
+
redirect_url.normalizePath();
|
33458
|
+
return scrivito.redirect_to(redirect_url.path());
|
33044
33459
|
}));
|
33045
33460
|
});
|
33046
33461
|
}
|
@@ -33723,16 +34138,16 @@ var scrivito = {};
|
|
33723
34138
|
icon: '',
|
33724
34139
|
|
33725
34140
|
execute: function() {
|
33726
|
-
|
33727
|
-
|
33728
|
-
|
34141
|
+
var title = scrivito.t('commands.workspace_settings.dialog.title', workspace.title());
|
34142
|
+
scrivito.workspace_settings_dialog.open(title, workspace.memberships()).then(
|
34143
|
+
function(memberships) {
|
33729
34144
|
scrivito.with_saving_overlay(
|
33730
34145
|
workspace.update({memberships: memberships}).then(function() {
|
33731
34146
|
return scrivito.reload();
|
33732
34147
|
})
|
33733
34148
|
);
|
33734
|
-
}
|
33735
|
-
|
34149
|
+
}
|
34150
|
+
);
|
33736
34151
|
}
|
33737
34152
|
});
|
33738
34153
|
}
|
@@ -33800,7 +34215,6 @@ var scrivito = {};
|
|
33800
34215
|
if (!scrivito.editing_context.is_view_mode()) {
|
33801
34216
|
scrivito.on('content', function(content) {
|
33802
34217
|
_.each(scrivito.widget_element.all($(content)), function(widget_element) {
|
33803
|
-
var widgetlist_field_element = widget_element.widget_field();
|
33804
34218
|
widget_element.set_menu([
|
33805
34219
|
scrivito.create_widget_command(widget_element),
|
33806
34220
|
scrivito.choose_and_create_widget_command(widget_element),
|
@@ -34054,8 +34468,6 @@ var scrivito = {};
|
|
34054
34468
|
var cms_document = scrivito.cms_document.from(ui.item);
|
34055
34469
|
cms_document.dom_element().find('body').addClass('scrivito_widget_dragging_active');
|
34056
34470
|
|
34057
|
-
scrivito.close_all_menus();
|
34058
|
-
|
34059
34471
|
var widget_element = scrivito.cms_element.from_dom_element(ui.item);
|
34060
34472
|
var widget_class_name = widget_element.widget().widget_class_name();
|
34061
34473
|
_.each(widgetlist_field_elements, function(widgetlist_field_element) {
|
@@ -34193,6 +34605,23 @@ var scrivito = {};
|
|
34193
34605
|
add_field_changes(changes._widget_pool[widget_id], widgetlist_field_element);
|
34194
34606
|
};
|
34195
34607
|
}());
|
34608
|
+
(function() {
|
34609
|
+
_.extend(scrivito, {
|
34610
|
+
no_turbolinks: {
|
34611
|
+
init: function() {
|
34612
|
+
scrivito.gui.on('document', function(cms_document) {
|
34613
|
+
if (cms_document.browser_window().Turbolinks) {
|
34614
|
+
scrivito.alert_dialog(
|
34615
|
+
'You have Turbolinks enabled. ' +
|
34616
|
+
'Scrivito does not yet support Turbolinks. ' +
|
34617
|
+
'Please remove it from your assets.'
|
34618
|
+
);
|
34619
|
+
}
|
34620
|
+
});
|
34621
|
+
}
|
34622
|
+
}
|
34623
|
+
});
|
34624
|
+
}());
|
34196
34625
|
(function() {
|
34197
34626
|
_.extend(scrivito, {
|
34198
34627
|
content_upload: {
|
@@ -34328,7 +34757,7 @@ var scrivito = {};
|
|
34328
34757
|
|
34329
34758
|
var create_workspace = function() {
|
34330
34759
|
var title = $('#scrivito_new_ws_name').val();
|
34331
|
-
scrivito.dialog.
|
34760
|
+
scrivito.dialog.close_with_transition(view);
|
34332
34761
|
scrivito.with_saving_overlay(scrivito.workspace.create(title)).then(function(workspace) {
|
34333
34762
|
deferred.resolve(workspace.id());
|
34334
34763
|
}, function() { deferred.reject(); });
|
@@ -34336,12 +34765,12 @@ var scrivito = {};
|
|
34336
34765
|
|
34337
34766
|
var select_workspace = function() {
|
34338
34767
|
var ws_id = $('select#scrivito_list_of_ws').val();
|
34339
|
-
scrivito.dialog.
|
34768
|
+
scrivito.dialog.close_with_transition(view);
|
34340
34769
|
deferred.resolve(ws_id);
|
34341
34770
|
};
|
34342
34771
|
|
34343
34772
|
var cancel_action = function() {
|
34344
|
-
scrivito.dialog.
|
34773
|
+
scrivito.dialog.close_with_transition(view);
|
34345
34774
|
deferred.reject();
|
34346
34775
|
return false;
|
34347
34776
|
};
|
@@ -34349,7 +34778,7 @@ var scrivito = {};
|
|
34349
34778
|
view.find('.scrivito_confirm').on('click', confirm_action);
|
34350
34779
|
view.find('.scrivito_cancel').on('click', cancel_action);
|
34351
34780
|
|
34352
|
-
scrivito.dialog.
|
34781
|
+
scrivito.dialog.open_and_center_with_transition(view);
|
34353
34782
|
|
34354
34783
|
if (can_select) {
|
34355
34784
|
view.find('.scrivito_input_list_of_ws').click();
|
@@ -34393,14 +34822,14 @@ var scrivito = {};
|
|
34393
34822
|
});
|
34394
34823
|
deferred.resolve(sorted_children);
|
34395
34824
|
|
34396
|
-
scrivito.dialog.
|
34825
|
+
scrivito.dialog.close_without_transition(view);
|
34397
34826
|
|
34398
34827
|
return false;
|
34399
34828
|
};
|
34400
34829
|
|
34401
34830
|
var cancel_action = function(e) {
|
34402
34831
|
deferred.reject();
|
34403
|
-
scrivito.dialog.
|
34832
|
+
scrivito.dialog.close_without_transition(view);
|
34404
34833
|
|
34405
34834
|
return false;
|
34406
34835
|
};
|
@@ -34408,7 +34837,7 @@ var scrivito = {};
|
|
34408
34837
|
view.find('.scrivito_confirm').on('click', confirm_action);
|
34409
34838
|
view.find('.scrivito_cancel').on('click', cancel_action);
|
34410
34839
|
|
34411
|
-
scrivito.dialog.
|
34840
|
+
scrivito.dialog.open_and_adjust_without_transition(view);
|
34412
34841
|
|
34413
34842
|
return scrivito.with_dialog_behaviour(view, deferred, {
|
34414
34843
|
enter: confirm_action,
|
@@ -34438,13 +34867,13 @@ var scrivito = {};
|
|
34438
34867
|
new_memberships[user_id] = {role: 'owner'};
|
34439
34868
|
});
|
34440
34869
|
promise.resolve(new_memberships);
|
34441
|
-
scrivito.dialog.
|
34870
|
+
scrivito.dialog.close_without_transition(view);
|
34442
34871
|
return false;
|
34443
34872
|
};
|
34444
34873
|
|
34445
34874
|
var cancel = function() {
|
34446
34875
|
promise.reject();
|
34447
|
-
scrivito.dialog.
|
34876
|
+
scrivito.dialog.close_without_transition(view);
|
34448
34877
|
return false;
|
34449
34878
|
};
|
34450
34879
|
|
@@ -34478,7 +34907,7 @@ var scrivito = {};
|
|
34478
34907
|
view.find('.scrivito_confirm').on('click', confirm);
|
34479
34908
|
view.find('.scrivito_cancel').on('click', cancel);
|
34480
34909
|
|
34481
|
-
scrivito.dialog.
|
34910
|
+
scrivito.dialog.open_and_adjust_without_transition(view);
|
34482
34911
|
|
34483
34912
|
view.on('keyup', function(e) {
|
34484
34913
|
if ((e.keyCode === 13 || e.keyCode === 27) &&
|
@@ -34650,6 +35079,9 @@ var scrivito = {};
|
|
34650
35079
|
|
34651
35080
|
|
34652
35081
|
|
35082
|
+
|
35083
|
+
|
35084
|
+
|
34653
35085
|
|
34654
35086
|
|
34655
35087
|
|
@@ -34677,6 +35109,7 @@ var scrivito = {};
|
|
34677
35109
|
|
34678
35110
|
|
34679
35111
|
|
35112
|
+
|
34680
35113
|
//
|
34681
35114
|
|
34682
35115
|
|
@@ -34688,28 +35121,25 @@ var scrivito = {};
|
|
34688
35121
|
// Fallback behavior in case that application window renders a page with no SDK, e.g. an error
|
34689
35122
|
// or a static page.
|
34690
35123
|
iframe.on('load', function() {
|
34691
|
-
var
|
34692
|
-
|
34693
|
-
|
35124
|
+
var application_document = scrivito.application_document();
|
35125
|
+
var browser_window = scrivito.application_window.browser_window();
|
35126
|
+
|
35127
|
+
var has_config = !!application_document.page_config();
|
35128
|
+
var has_sdk = !!browser_window.scrivito;
|
34694
35129
|
|
34695
35130
|
// The application window is completely missing the SDK and the config.
|
34696
35131
|
if (!has_config && !has_sdk) {
|
34697
35132
|
// Install jQuery in order to allow correct application document bootstrapping.
|
34698
|
-
var browser_window = scrivito.application_window.browser_window();
|
34699
35133
|
if (!browser_window.jQuery) { browser_window.jQuery = jQuery; }
|
34700
35134
|
if (!browser_window.$) { browser_window.$ = $; }
|
34701
35135
|
|
34702
35136
|
// Bootstrap the application document.
|
34703
|
-
var application_document = scrivito.application_document();
|
34704
35137
|
application_document.install_public_api();
|
34705
|
-
if (!scrivito.is_inited()) {
|
34706
|
-
// Start the UI if it is the first open, which responds with an error.
|
34707
|
-
// Use the fallback config with no page context.
|
34708
|
-
scrivito.init(scrivito.dom_config.read($('body')));
|
34709
|
-
scrivito.gui.start();
|
34710
|
-
}
|
34711
35138
|
application_document.connect();
|
34712
35139
|
}
|
34713
35140
|
});
|
35141
|
+
|
35142
|
+
scrivito.init(scrivito.ui_config());
|
35143
|
+
scrivito.gui.start();
|
34714
35144
|
});
|
34715
35145
|
}());
|