scratch
/bower_components/trumbowyg/dist/plugins/template/trumbowyg.template.js |
@@ -0,0 +1,52 @@ |
(function($) { |
'use strict'; |
|
// Adds the language variables |
$.extend(true, $.trumbowyg, { |
langs: { |
en: { |
template: 'Template' |
}, |
nl: { |
template: 'Sjabloon' |
} |
} |
}); |
|
// Adds the extra button definition |
$.extend(true, $.trumbowyg, { |
plugins: { |
template: { |
shouldInit: function(trumbowyg) { |
return trumbowyg.o.plugins.hasOwnProperty('templates'); |
}, |
init: function(trumbowyg) { |
trumbowyg.addBtnDef('template', { |
dropdown: templateSelector(trumbowyg), |
hasIcon: false, |
text: trumbowyg.lang.template |
}); |
} |
} |
} |
}); |
|
// Creates the template-selector dropdown. |
function templateSelector(trumbowyg) { |
var available = trumbowyg.o.plugins.templates; |
var templates = []; |
|
$.each(available, function(index, template) { |
trumbowyg.addBtnDef('template_' + index, { |
fn: function(){ |
trumbowyg.html(template.html); |
}, |
hasIcon: false, |
title: template.name |
}); |
templates.push('template_' + index); |
}); |
|
return templates; |
} |
})(jQuery); |
/bower_components/trumbowyg/dist/plugins/template/trumbowyg.template.min.js |
@@ -0,0 +1 @@ |
!function(t){"use strict";function e(e){var n=e.o.plugins.templates,a=[];return t.each(n,function(t,n){e.addBtnDef("template_"+t,{fn:function(){e.html(n.html)},hasIcon:!1,title:n.name}),a.push("template_"+t)}),a}t.extend(!0,t.trumbowyg,{langs:{en:{template:"Template"},nl:{template:"Sjabloon"}}}),t.extend(!0,t.trumbowyg,{plugins:{template:{shouldInit:function(t){return t.o.plugins.hasOwnProperty("templates")},init:function(t){t.addBtnDef("template",{dropdown:e(t),hasIcon:!1,text:t.lang.template})}}}})}(jQuery); |