{I" class:ETI"ProcessedAsset;FI"logical_path;TI"rubber_ring/link_editor.js;FI" pathname;TI"a/Users/zigomir/development/rubber_ring/app/assets/javascripts/rubber_ring/link_editor.coffee;FI"content_type;TI"application/javascript;TI" mtime;Tl+až‚QI" length;TiI" digest;TI"%42155da9e2392c9600ec9c03da46f9c7;FI" source;TI"(function() { this.LinkEditor = (function() { var getSelectionStartNode; function LinkEditor(editable_content) { this.editable_content = editable_content; } LinkEditor.prototype.init = function() { var $edit_link, _this = this; $edit_link = $("#rubber-ring-application #edit-link"); this.editable_content.bind("click", "a", function(e) { var $node; $node = $(getSelectionStartNode()); if ($node !== null && $node.is("a")) { e.stopPropagation(); $edit_link.css({ top: $node.offset().top - $edit_link.height() - 5, left: $node.offset().left }).show(); $edit_link.data("node", $node); $("#link-title").val($node.text()); $("#link-href").val($node.attr("href")); return $("#link-preview").attr("href", $node.attr("href")); } else { return $edit_link.hide(); } }); $(document).bind("click", function(e) { e.stopPropagation(); if ($("#edit-link").is(":visible") && $(e.target).parents("#edit-link").length === 0) { return $edit_link.hide(); } }); $("#link-title").bind("change", function(e) { var $node; $node = $edit_link.data("node"); $node.text($(e.currentTarget).val()); return $node.parents("[contenteditable]").trigger("change"); }); return $("#link-href").bind("change", function(e) { var $node; $node = $edit_link.data("node"); $node.add("#link-preview").attr("href", $(e.currentTarget).val()); return $node.parents("[contenteditable]").trigger("change"); }); }; getSelectionStartNode = function() { var node; if (window.getSelection) { node = window.getSelection().anchorNode; if (node !== null && node.nodeName === "#text") { return node.parentNode; } else { return node; } } }; return LinkEditor; })(); }).call(this); ;TI"dependency_digest;TI"%412496df610da7d1dce3bfe977830bae;FI"required_paths;T[I"a/Users/zigomir/development/rubber_ring/app/assets/javascripts/rubber_ring/link_editor.coffee;FI"dependency_paths;T[{I" path;TI"a/Users/zigomir/development/rubber_ring/app/assets/javascripts/rubber_ring/link_editor.coffee;FI" mtime;TI"2013-05-02T19:12:01+02:00;TI" digest;TI"%65ed57995dc5f28e15c71d8b2e67e3ba;FI" _version;TI"%a3b89b66a8471f3e75abb239e3b35c7d;F