(function() { var activate, open_image_editing_dialog, open_image_editing_dialog_options, save_edited_image, setup_edit_btn, setup_image_kit, setup_image_kit_container; activate = function(element) { return setup_edit_btn($(element)); }; setup_edit_btn = function(element) { scrivito.editors._setupButtonContainer(element); if (element.scrivito('content')) { return $(" ").insertBefore(element).click(function(event) { event.preventDefault(); return open_image_editing_dialog(element); }); } }; open_image_editing_dialog = function(element) { var content, dialog; content = $("
"); dialog = scrivito.dialog(content, open_image_editing_dialog_options()); return setup_image_kit_container(element, dialog); }; open_image_editing_dialog_options = function() { var dialog_options; return dialog_options = { color: "dark", confirm: { title: "Confirm", color: "green" }, cancel: { title: "Cancel", color: "lightgrey" } }; }; setup_image_kit = function(image, container) { return new ImglyKit({ renderer: "canvas", assetsUrl: "imgly_sdk", image: image, versionCheck: false, container: container[0], ui: { enabled: true, assetPathResolver: scrivito.editors._imgly_asset_path_resolver } }); }; setup_image_kit_container = function(element, dialog) { return element.scrivito('content').noCacheUrl().then(function(no_cache_url) { var container, image; container = $(".image_kit_start"); image = new Image(); image.crossOrigin = "Anonymous"; image.src = no_cache_url; image.onerror = function() { return $("Scrivito can't edit this image in your browser. What now?
\n