[Php-it] [OT] Fckeditor, aggiungere un bottone.

Giovanni Battista Lenoci gianiaz at gianiaz.net
Fri Apr 6 13:59:19 CEST 2007


Giovanni Battista Lenoci ha scritto:
>
> Ciao, il compito che devo svolgere è semplice, devo creare un bottone 
> per la toolbar che una volta premuto aggiunga del testo statico alla 
> textarea.
>
> Qualcuno di voi ha già fatto e può darmi una dritta?
>
> grazie.
>
> ciao
>
non so se è la via giusta, ma se vi interessa io ho risolto cosi:

nella cartella plugin creo la cartella "citta", dentro ci metto il file 
fckplugin.js fatto cosi:

var CittaCommand=function(){
        //create our own command, we dont want to use the 
FCKDialogCommand because it uses the default fck layout and not our own
};

CittaCommand.prototype.Execute=function(){
}

CittaCommand.GetState=function() {
        return FCK_TRISTATE_OFF; //we dont want the button to be toggled
}

CittaCommand.Execute=function() {
   FCK.InsertHtml('{citta}');
}

FCKCommands.RegisterCommand('Citta', CittaCommand ); //otherwise our 
command will not be found

var oCittas = new FCKToolbarButton('Citta', 'Inserimento Citta');
oCittas.IconPath = FCKConfig.PluginsPath + '../images/Citta_button.gif'; 
//specifies the image used in the toolbar

FCKToolbarItems.RegisterItem( 'Citta', oCittas );


Poi nel file di configurazione :

FCKConfig.Plugins.Add('Fax');

e nella toolbar aggiungo la voce "Fax".


Ciao



-- 
gianiaz.net
di Giovanni Battista Lenoci 
P.le Bertacchi 66 
23100 Sondrio
cell. +39.392.7096936
cell. +39.347.7196482



More information about the Php-it mailing list