From: Jacob Hilker Date: Sun, 9 Mar 2014 23:30:28 +0000 (-0400) Subject: add ability to view original file X-Git-Tag: release-20150131~148^2~1^2~4 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b03ee802565df3947bdd171faf064d8f7e7d1a9b;p=oweals%2Fkarmaworld.git add ability to view original file --- diff --git a/karmaworld/assets/js/note-detail.js b/karmaworld/assets/js/note-detail.js index d450531..772419b 100644 --- a/karmaworld/assets/js/note-detail.js +++ b/karmaworld/assets/js/note-detail.js @@ -133,28 +133,33 @@ $(function() { // Embed the converted markdown if it is on the page, else default to the iframe if ($('#note-markdown').length > 0) { $('#note-markdown').html(marked($('#note-markdown').data('markdown'))); - } else { - $.ajax(note_contents_url, { - type: 'GET', - xhrFields: { - onprogress: function (progress) { - var percentage = Math.floor((progress.loaded / progress.total) * 100); - writeNoteFrame("

" + percentage + "%

"); - } - }, - success: function(data, textStatus, jqXHR) { - writeNoteFrame(data); - autoResize('noteframe'); - if (pdfControls == true) { - setupPdfViewer(); - } - }, - error: function(data, textStatus, jqXHR) { - writeNoteFrame("

Sorry, your note could not be retrieved.

"); - } - }); } + $('#note-iframe-toggle').click(function(){ + $('#noteframe').slideToggle(); + autoResize('noteframe'); + }); + + $.ajax(note_contents_url, { + type: 'GET', + xhrFields: { + onprogress: function (progress) { + var percentage = Math.floor((progress.loaded / progress.total) * 100); + writeNoteFrame("

" + percentage + "%

"); + } + }, + success: function(data, textStatus, jqXHR) { + writeNoteFrame(data); + autoResize('noteframe'); + if (pdfControls == true) { + setupPdfViewer(); + } + }, + error: function(data, textStatus, jqXHR) { + writeNoteFrame("

Sorry, your note could not be retrieved.

"); + } + }); + $('#edit_note_tags').click(function(event) { $('#note_tags_form').slideToggle(); }); diff --git a/karmaworld/templates/notes/note_detail.html b/karmaworld/templates/notes/note_detail.html index 38db821..415576e 100644 --- a/karmaworld/templates/notes/note_detail.html +++ b/karmaworld/templates/notes/note_detail.html @@ -193,10 +193,11 @@
{% if note.has_markdown %} - {% else %} - + Show original document {% endif %} +