mirror of
https://github.com/YunoHost/doc.git
synced 2024-09-03 20:06:26 +02:00
7b447ac5ae
Creating the pages hierarchy for transitioning to Grav
22 lines
1,003 B
JavaScript
22 lines
1,003 B
JavaScript
(function($){
|
|
$(function(){
|
|
$('body').on('grav-editor-ready', function() {
|
|
var Instance = Grav.default.Forms.Fields.EditorField.Instance;
|
|
Instance.addButton({
|
|
'shortcodes-presentation': {
|
|
identifier: 'shortcodes-presentation',
|
|
title: 'Presentation',
|
|
label: '<i class="fa fa-file-powerpoint-o"></i>',
|
|
modes: ['gfm', 'markdown'],
|
|
action: function(_ref) {
|
|
var codemirror = _ref.codemirror, button = _ref.button;
|
|
button.on('click.editor.shortcodes-presentation', function() {
|
|
Instance.buttonStrategies.replaceSelections({ token: '$1', template: '[presentation="presentations/"]$1', codemirror: codemirror});
|
|
codemirror.setCursor(codemirror.getCursor().line,codemirror.getCursor().ch-2);
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
})(jQuery);
|