diff --git a/src/main/twirl/repo/editor.scala.html b/src/main/twirl/repo/editor.scala.html index 712e51c..4112c6d 100644 --- a/src/main/twirl/repo/editor.scala.html +++ b/src/main/twirl/repo/editor.scala.html @@ -23,18 +23,25 @@
-
+ @if(renderableSuffixes.find(suffix => fileName.map(_.toLowerCase.endsWith(suffix)).getOrElse(false))) { +
+ + +
+ }
+ @@ -103,5 +110,26 @@ $('#commit').click(function(){ $('#content').val(editor.getValue()); }); + + $('#btn-code').click(function(){ + $('#editor').show(); + $('#preview').hide(); + }); + + $('#btn-preview').click(function(){ + $('#editor').hide(); + $('#preview').show() + + // update preview + $('#preview').html(' Previewing...'); + $.post('@url(repository)/_preview', { + content : editor.getValue(), + enableWikiLink : false, + enableRefsLink : false + }, function(data){ + $('#preview').html(data); + prettyPrint(); + }); + }); });