{I" class:ETI"ProcessedAsset; FI"logical_path; TI"chaskiq/manage/iframe.js; FI" pathname; TI"c/Users/michelson/Documents/ruby/chaskiq/app/assets/javascripts/chaskiq/manage/iframe.js.coffee; FI"content_type; TI"application/javascript; TI" mtime; Tl+>ÖÊUI"length; TiÕ$I"digest; TI"%032c59ea95a3d6807db0310fb090fdd2; FI"source; TI"Õ$(function() { var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; window.Iframe = (function(superClass) { extend(Iframe, superClass); function Iframe() { return Iframe.__super__.constructor.apply(this, arguments); } Iframe.prototype.el = '#chaskiq-mail-editor'; Iframe.prototype.events = function() { return { 'drag .blocks li a': 'drag', 'drag .tpl-block-controls a': 'drag', 'dragstart .tpl-block-controls a': 'setDraggedEl', 'dragend .tpl-block-controls a': 'removeDraggedEl', "dragleave #bodyTable": "hideSections", "drop #bodyTable": "hideSections", "dragover .tpl-block": "displayItemOver", "dragover .chaskiqContainerEmptyMessage": "displayItemOver", 'drop #templateBody': "drop", 'drop #templatePreheader': "drop", 'drop #templateHeader': "drop", 'drop #templateBody': "drop", "drop #templateFooter": "drop", "click .tpl-block": "setFocus", "click .imagePlaceholder .button-small": "displayUploaderList", "click .tpl-block-delete": "deleteBloc", "click input.submit": "submitEditor" }; }; Iframe.prototype.initialize = function() { this.editor = top.editor; this.textarea = $(this.editor.el).find('#campaign_html_content'); return this.css = $(this.editor.el).find('#campaign_css'); }; Iframe.prototype.copyToTextArea = function() { var $this; $this = $("#mail-editor"); return window.setTimeout((function(_this) { return function() { return $(_this.editor.el).find('#campaign_html_content').val($this.html()); }; })(this), 0); }; Iframe.prototype.copyCssRulesToTextArea = function() { var rules; rules = _.map(this.style().cssRules, function(rule) { return rule.cssText; }); return $("#campaign_css").val(rules.join(" ")); }; Iframe.prototype.template = function() { return '
dsfsd
'; }; Iframe.prototype.render = function() { $(this.el).find('#mail-editor').html(this.textarea.val()); this.removeTplBlockControls(); return this.addTplBlockControls(); }; Iframe.prototype.removeTplBlockControls = function() { return $(".tpl-block-controls").remove(); }; Iframe.prototype.addTplBlockControls = function() { return _.each($(".chaskiqBlock.tpl-block"), (function(_this) { return function(n) { return $(n).append(_this.templateBlockControls()); }; })(this)); }; Iframe.prototype.displaySections = function(ev) { var container; container = $(ev.currentTarget).parent(".tpl-container"); container.append("