{:uriI"file:///Users/messutied/Projects/portfolio/app/assets/javascripts/portfolio/admin/markdown_preview.js?type=application/javascript&pipeline=self&id=23e00b19c5c7835d34b139cd3d1ce4beac890b7466dbb4760c16e8252b22a620:ET:load_pathI"?/Users/messutied/Projects/portfolio/app/assets/javascripts;F: filenameI"c/Users/messutied/Projects/portfolio/app/assets/javascripts/portfolio/admin/markdown_preview.js;T: nameI"%portfolio/admin/markdown_preview;T:logical_pathI"-portfolio/admin/markdown_preview.self.js;T:content_typeI"application/javascript;T: sourceI"function setupMarkdownPreview() { $('.js_markdown_preview').click(function (evt) { var el = $(this); var parent = el.parent() var textEl = parent.find('textarea'); var previewEl = parent.find('.markdown_preview'); evt.preventDefault(); if (textEl.is(':visible')) { $.post(adminPath()+'/markdown_preview', {text: textEl.val()}, function(data) { textEl.hide(); previewEl.html(data.html).show(); el.html('Hide preview'); }); } else { previewEl.hide().html(''); textEl.show(); el.html('Show preview'); } }); } function adminPath() { var pieces = window.location.pathname.split('/'); var adminPathArr = []; for (var i in pieces) { var piece = pieces[i]; adminPathArr.push(piece); if (piece == 'admin') { return adminPathArr.join('/'); } } } $(document).ready(setupMarkdownPreview); $(document).off('page:load').on('page:load', setupMarkdownPreview); ;T: metadata{ :dependencieso:Set: @hash{ I"environment-version;TTI"environment-paths;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"qfile-digest:///Users/messutied/Projects/portfolio/app/assets/javascripts/portfolio/admin/markdown_preview.js;TT: requiredo;;{: stubbedo;;{: linkso;;{: charsetI" utf-8;F: digest"%!jI[E{PL: lengthi:dependencies_digest"%[LrXnwJ}N>eT:idI"E23e00b19c5c7835d34b139cd3d1ce4beac890b7466dbb4760c16e8252b22a620;F: mtimel+T*VV