Basic link and image insertion from editbar.

This commit is contained in:
Tom Preston-Werner
2010-07-14 14:30:11 -07:00
parent 9f4af3173c
commit c1ac944508
@@ -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')
})
})