#37 FitWindow : Stretch editor to fullsize and back

closed
None
5
2006-09-26
2006-02-14
saul11
No

This plugin stretches the editor's frame to fit into
the current window or toggles back to its original
size. In fullsize mode, the editor will adapt to the
new window size on resize of it.
Technically, the plugins does this by positioning the
editor at the top left of the current page and then
scrolling to that position. The body's its scrollbars
are removed and is stripped from its CSS to be able to
set the editor fullscreen. When the user switched back
to standard size, the scrollbars and CSS are restored.
The editor is positioned back at its original position
and is resized back to its original size. The window
scrolls to its position. Either so that the editor
appears at the top of the viewPane or centered. This
can be configured.
The resize functionality also let the editor resize
when e.g. the searchbar of firefox switches off or just
when any browser modification is made that affects the
window size....

Tested in Firfox 1.5 and IE 6.0 on Windows and in
Firefox 1.0.7 on Linux

Written By Paul Moers, 2006
mail@saulmade.nl

With help from Christian Fecteau
webmaster@christianfecteau.com

Discussion

  • saul11

    saul11 - 2006-02-14
    • summary: FitWindow : Stretch window to fullsize and back --> FitWindow : Stretch editor to fullsize and back
     
  • saul11

    saul11 - 2006-02-14

    Logged In: YES
    user_id=1371356

    Installation instructions :
    -----------------------------

    1. Copy the 'FitWindow' directory to the plugins directory
    of the FCKeditor 'editor/plugins/'
    2. Edit your fckconfig.js and add the next lines :

    FCKConfig.Plugins.Add( 'FitWindow' ) ;

    // --- config settings for the FitWindow plugin ---
    // when toggling back to original size, scroll so
    that the editor appears centered in the viewPane
    FCKConfig.FitWindow_center = true;
    // should the editor auto fit to the window when it
    gets resized
    FCKConfig.FitWindow_autoFitToResize = true;

    3. Modify those configuration options you just pasted to
    your likings.
    4. Still in the fckconfig.js file, edit your toolbar and add
    a button named FitWindow (e.g. ['About','-','FitWindow']).
    This will be the button to stretch the editor to fit the
    current window or toggle back to its original size.
    5. start clicking :)

     
  • cedric-OB

    cedric-OB - 2006-02-15

    Logged In: YES
    user_id=1301772

    tested in firefox 1.5.0.1 on Linux

     
  • saul11

    saul11 - 2006-02-20

    Logged In: YES
    user_id=1371356

    installation instruction correction :

    The first line of the text that needs to be added to your
    config file (installation step 2) needs to define the
    language you want the plugin to have. Available are 'en'
    for English and 'nl' for Dutch.

    FCKConfig.Plugins.Add( 'FitWindow','en' ) ;

     
  • AZ

    AZ - 2006-03-08

    Logged In: YES
    user_id=879516

    Hi!

    Really a great work! Two ideas for improvements:

    1.
    I do have problems to use the default language of my
    fck-installation. Do you see any possibility to use the
    default for Fitwindow, too? Now I have to use a hardcoded
    language 'en'...

    2.
    It would be nicer to have two different fitwindow-icons -
    one for the normal window and one for fullscreen window. So
    everybody can see the right icon for getting the normal
    smaller window again!

    Thanks

    Alex

     
  • Aichi

    Aichi - 2006-03-14

    Logged In: YES
    user_id=1247922

    Great job.

     
  • Ashish Kulkarni

    Ashish Kulkarni - 2006-04-06

    Logged In: YES
    user_id=735961

    There's a small bug, when you load this from a custom path
    the icon doesn't show properly. The fix is to change line
    282 from:

    oFitWindowItem.IconPath = FCKConfig.PluginsPath .... ;

    to

    oFitWindowItem.IconPath = FCKPlugins.Items['FitWindow'].Path

    Fantastic plugin :-)

     
  • saul11

    saul11 - 2006-04-15

    Logged In: YES
    user_id=1371356

    Alexander (alex-z),

    1. sorry, I don't know how to make the plugin use the
    default language. I tried simply "FCKConfig.Plugins.Add(
    'FitWindow', FCKConfig.DefaultLanguage )" but it didn't work...

    2. I deliberately used an icon not indicating the state of
    the editor, because I'm not sure how to modify the icon at
    runtime (i.e. on size change)

     
  • saul11

    saul11 - 2006-04-15

    Logged In: YES
    user_id=1371356

    Sadly another bug was reported:
    When in fullscreen mode the tools like Style, Size, Text
    Color etc. don't work anymore (no popup menu is displayed).
    - This bug only appears in firefox, in IE the popups show up
    correctly.
    - The popups seem to be overlapped when the plugin places
    the editor on z-index 9999999 in fullscreen mode. Decreasing
    the z-index (line 102 in the plugin's 'fckplugin.js' file)
    to lower than 10001 brings up the popup menus again, but
    they are all on the left side of the window. Seemingly the
    plugin breaks the relative positioning of the popups in
    gecko browsers...

     
  • saul11

    saul11 - 2006-05-07

    FitWindow : Stretch window to fullsize and back

     
  • saul11

    saul11 - 2006-05-07

    Logged In: YES
    user_id=1371356

    FitWindow 2006-05-07 Update:

    - Added Finnish language file.
    - Decreased the Z-index the FCKeditor is placed on when in
    fullsize mode to 9999 as a 'bugfix' to the bug described
    below. With this z-index the popups will show, but they will
    all appear on the left of your screen. To fix this you'll
    have to delete your doctype declaration! Any doctype I've
    tested causes the popups to misalign (HTML 4.01 Strict,
    Transitional, Frameset; XHTML 1.0 Strict, Transitional,
    Frameset; and XHTML 1.1 DTD) so you'll have to delete it.

     
  • Frederico Caldeira Knabben

    • assigned_to: nobody --> fredck
     
  • Frederico Caldeira Knabben

    Logged In: YES
    user_id=572424

    I'm implementing this feature in the core of FCKeditor,
    with many changes and cleanups... resolved also the panel
    positioning problem.

    I'm sure all you will enjoy it. Thanks Paul.

     
  • Chris Seufert

    Chris Seufert - 2006-06-14

    Logged In: YES
    user_id=620138

    There is a problem with the feature when the editor is
    placed in an position:absolute div box.
    ...
    <style>
    html,body,form {height:100%; width:100%}
    </style>
    ...
    <div style="position:absolute; left:20%; width:80%;>
    <!--Text Editor Here -->
    </div>

    The text editors top left corner will stay in the div, and
    it will expand from there,to the correct width and height,
    it happens in both IE6 and Firefox 1.5.0.4.

    I was thinking on moving the IFRAME object in the DOM
    temporarily from where it is, to a direct decendant of a
    body node.

     
  • saul11

    saul11 - 2006-06-20

    Logged In: YES
    user_id=1371356

    I you're having problems with this plugin, please upgrade to
    FCKeditor 2.3 which has the 'FitWindow' feature implemented
    into it!

     
  • Frederico Caldeira Knabben

    • status: open --> closed
     
  • Frederico Caldeira Knabben

    Logged In: YES
    user_id=572424

    AS this is a core feature now, I'm closing this plugin to
    avoid confusion.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks