65 lines
2.5 KiB
JavaScript
65 lines
2.5 KiB
JavaScript
CKEDITOR.plugins.add( 'tokens_stamm',
|
|
{
|
|
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();
|
|
var tags_f = [];
|
|
//this.add('value', 'drop_text', 'drop_label');
|
|
tags_b[0]=["[Bearbeiter_Nachname]", "Bearbeiter_Nachname", "Bearbeiter_Nachname"];
|
|
tags_b[1]=["[Bearbeiter_Vorname]", "Bearbeiter_Vorname", "Bearbeiter_Vorname"];
|
|
tags_b[2]=["[Bearbeiter_Telefon]", "Bearbeiter_Telefon", "Bearbeiter_Telefon"];
|
|
tags_b[3]=["[Bearbeiter_Mobil]", "Bearbeiter_Mobil", "Bearbeiter_Mobil"];
|
|
tags_b[4]=["[Bearbeiter_EMail]", "Bearbeiter_EMail", "Bearbeiter_EMail"];
|
|
|
|
tags_f[0]=["[Firma_Name]", "Firma_Name", "Firma_Name"];
|
|
tags_f[1]=["[Firma_Vertreter]", "Firma_Vertreter", "Firma_Vertreter"];
|
|
tags_f[2]=["[Firma_Telefon]", "Firma_Telefon", "Firma_Telefon"];
|
|
tags_f[3]=["[Firma_Mobil]", "Firma_Mobil", "Firma_Mobil"];
|
|
tags_f[4]=["[Firma_EMail]", "Firma_EMail", "Firma_EMail"];
|
|
|
|
// Create style objects for all defined styles.
|
|
|
|
editor.ui.addRichCombo( 'tokens_stamm',
|
|
{
|
|
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]);
|
|
}
|
|
this.startGroup( "Firma" );
|
|
//this.add('value', 'drop_text', 'drop_label');
|
|
for (var this_tags_f in tags_f){
|
|
this.add(tags_f[this_tags_f][0], tags_f[this_tags_f][1], tags_f[this_tags_f][2]);
|
|
}
|
|
},
|
|
|
|
onClick : function( value )
|
|
{
|
|
editor.focus();
|
|
editor.fire( 'saveSnapshot' );
|
|
editor.insertHtml(value);
|
|
editor.fire( 'saveSnapshot' );
|
|
}
|
|
});
|
|
}
|
|
});
|