Files
2016-07-05 20:38:34 +00:00

51 lines
1.7 KiB
JavaScript

CKEDITOR.plugins.add( 'tokens_skonto',
{
requires : ['richcombo'], //, 'styles' ],
init : function( editor )
{
var config = editor.config,
lang = editor.lang.format;
// Gets the list of tags from the settings.
var tags_b = []; //new Array();
//this.add('value', 'drop_text', 'drop_label');
tags_b[0]=["[Skonto_Gültig]", "Skonto_Gültig", "Skonto_Gültig"];
tags_b[1]=["[Skonto_Betrag]", "Skonto_Betrag", "Skonto_Betrag"];
tags_b[2]=["[Skonto_Prozent]", "Skonto_Prozent", "Skonto_Prozent"];
// Create style objects for all defined styles.
editor.ui.addRichCombo( 'tokens_skonto',
{
label : "Textbausteine",
title : "Textbausteine einfügen",
voiceLabel : "Textbausteine einfügen",
className : 'cke_format',
multiSelect : false,
panel :
{
css : [ config.contentsCss, CKEDITOR.getUrl( editor.skinPath + 'editor.css' ) ],
voiceLabel : lang.panelvoiceLabel
},
init : function()
{
this.startGroup( "Bearbeiter" );
//this.add('value', 'drop_text', 'drop_label');
for (var this_tags_b in tags_b){
this.add(tags_b[this_tags_b][0], tags_b[this_tags_b][1], tags_b[this_tags_b][2]);
}
},
onClick : function( value )
{
editor.focus();
editor.fire( 'saveSnapshot' );
editor.insertHtml(value);
editor.fire( 'saveSnapshot' );
}
});
}
});