diff --git a/lib/gollum/frontend/public/javascript/gollum.js b/lib/gollum/frontend/public/javascript/gollum.js index 585270c6..7703e843 100644 --- a/lib/gollum/frontend/public/javascript/gollum.js +++ b/lib/gollum/frontend/public/javascript/gollum.js @@ -29,6 +29,10 @@ Gollum.Formats = { bold: Gollum.encloseStrategy('**', 'bold text', '**'), italic: Gollum.encloseStrategy('//', 'italic text', '//') }, + gollum: { + link: Gollum.encloseStrategy('[[', 'Page Name', ']]'), + image: Gollum.encloseStrategy('[[', '/path/to/image.png', ']]'), + }, markdown: { bold: Gollum.encloseStrategy('**', 'bold text', '**'), italic: Gollum.encloseStrategy('*', 'italic text', '*') @@ -79,4 +83,16 @@ $(function(){ var format = $('#guides .write select[name=format] option:selected').attr('value') Gollum.enclose(el, format, 'italic') }) + + $('#editbar .link').click(function() { + var el = $('#guides .write textarea') + var format = $('#guides .write select[name=format] option:selected').attr('value') + Gollum.enclose(el, 'gollum', 'link') + }) + + $('#editbar .image').click(function() { + var el = $('#guides .write textarea') + var format = $('#guides .write select[name=format] option:selected').attr('value') + Gollum.enclose(el, 'gollum', 'image') + }) })