• Join/Login
  • Business Software
  • Open Source Software
  • For Vendors
  • Blog
  • About
  • More
    • Articles
    • Create
    • SourceForge Podcast
    • Site Documentation
    • Subscribe to our Newsletter
    • Support Request
SourceForge logo
For Vendors Help Create Join Login
SourceForge logo
Business Software
Open Source Software
SourceForge Podcast
Resources
  • Articles
  • Case Studies
  • Blog
Menu
  • Help
  • Create
  • Join
  • Login
  • Home
  • Browse
  • FCKeditor
  • Plugins
FCKeditor

Zoom plugin.

FCKeditor (retired)

Brought to you by: fredck, gok9ok, wwalc
This project can now be found here.
  • Summary
  • Files
  • Reviews
  • Support
  • Mailing Lists
  • Tickets ▾
    • Skins
    • Plugins
    • Patches
  • News
  • Browse SVN
  • CVS
Menu ▾ ▴
  • Create Ticket
  • View Stats

Group

Searches

  • Changes
  • Closed Tickets
  • Open Tickets

Help

  • Formatting Help

#95 Zoom plugin.

open
nobody
None
5
2008-09-10
2008-09-10
Francesco Iaccarino
No

Zoom plugin.
Plugin that allows to enter a magnification between min_value and max_value percent to enlarge or reduce the display of the active document.
It has been developed starting by combo plugin submitted by Marcus.

=============================================
Changes to your custom fckconfig.js
=============================================

1. Add the following line
FCKConfig.Plugins.Add( 'mycombo' ) ; // you can replace mycombo with zoom

2. Add the 'mycombo' item to your toolbarset.
Eg:
FCKConfig.ToolbarSets["Basic"] = [
['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-'
,'About'],
['mycombo']
] ;

=============================================
Create the plugin
=============================================

1. Copy 'mycombo' dir under plugins dir
your_path_to/FCKeditor/editor/plugins/mycombo

2. In the fckplugin.js i implement zoom function:
//**************************START*********************
/*
1st, define the 'command' to execute when an item from the list is selected
*/
var FCKMyCombo_command = function(name) {
this.Name = name ;
}
//This execute the zoom of editor area
FCKMyCombo_command.prototype.Execute = function(itemText, itemLabel) {
if (itemText != "") {
FCK.EditorDocument.body.style.zoom=itemText;
}
}
//was getting GetState is not a function (or similar) errors, so added this.
FCKMyCombo_command.prototype.GetState = function() {
return;
}
FCKCommands.RegisterCommand( 'mycombocommand' , new FCKMyCombo_command('any_name') ) ;

/*
2nd, create the Combo object with the percentage values
*/
var FCKToolbarMyCombo=function(tooltip,style){
this.Command=FCKCommands.GetCommand('mycombocommand');//the command to execute when an item is selected
this.CommandName = 'mycombocommand';
this.Label=this.GetLabel();
this.Tooltip=tooltip?tooltip:this.Label; //Doesn't seem to work
this.Style=style; //FCK_TOOLBARITEM_ICONTEXT OR FCK_TOOLBARITEM_ONLYTEXT
};
FCKToolbarMyCombo.prototype=new FCKToolbarSpecialCombo;
//Label to appear in the FCK toolbar
FCKToolbarMyCombo.prototype.GetLabel=function(){
return "Zoom";
};
//Add the items to the combo list
FCKToolbarMyCombo.prototype.CreateItems=function(A){
//this._Combo.AddItem(itemText, itemLabel); //see FCKMyCombo_command.prototype.Execute = function(itemText, itemLabel) above
this._Combo.AddItem('50%', '<span style="color:#000000;font-weight: normal; font-size: 10pt;">50%</span>');
this._Combo.AddItem('100%', '<span style="color:#000000;font-weight: normal; font-size: 10pt;">100%</span>');
this._Combo.AddItem('150%', '<span style="color:#000000;font-weight: normal; font-size: 10pt;">150%</span>');
}

//Register the combo with the FCKEditor
FCKToolbarItems.RegisterItem( 'mycombo' , new FCKToolbarMyCombo( 'My Combo', FCK_TOOLBARITEM_ICONTEXT ) ) ; //or FCK_TOOLBARITEM_ONLYTEXT

//********END********

Discussion

  • Francesco Iaccarino

    Francesco Iaccarino - 2008-09-10
     
    zoom.zip
    If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

Log in to post a comment.

SourceForge
  • Create a Project
  • Open Source Software
  • Business Software
  • Top Downloaded Projects
Company
  • About
  • Team
  • SourceForge Headquarters
    1320 Columbia Street Suite 310
    San Diego, CA 92101
    +1 (858) 422-6466
Resources
  • Support
  • Site Documentation
  • Site Status
  • SourceForge Reviews
SourceForge logo
© 2026 Slashdot Media. All Rights Reserved.
Terms Privacy Opt Out Advertise
×