Created
December 27, 2011 16:17
-
-
Save itsbth/1524221 to your computer and use it in GitHub Desktop.
Uploaded by UploadToGist for Sublime Text 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Place all the behaviors and hooks related to the matching controller here. | |
| # All this logic will automatically be available in application.js. | |
| # You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ | |
| #= require Markdown.Converter.js | |
| #= require Markdown.Sanitizer.js | |
| $ -> | |
| converter = Markdown.getSanitizingConverter() | |
| $('#dupe_description').keyup (evt) -> | |
| $('#md_preview').html converter.makeHtml $(this).val() | |
| $('.screenshot a').click (evt) -> | |
| evt.preventDefault() | |
| $this = $(this) | |
| $root = $this.parents('.screenshot') | |
| $root.find('input').prop disabled: true | |
| $root.find('input[type=hidden]').val(true) | |
| fun = arguments.callee | |
| $this.parent().text("Deleted... ").append $('<a href="#"></a>').text('undo.').click (evt) -> | |
| evt.preventDefault() | |
| $root.find('input').prop disabled: false | |
| $root.find('input[type=hidden]').val(false) | |
| $(this).parent().text("").append($('<a href="#"></a>').text('Delete').click(fun)).append(" this screenshot.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment