Basic link and image insertion from editbar.
This commit is contained in:
@@ -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')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user