Ticket #1622: 1622_2.patch

File 1622_2.patch, 26.8 KB (added by Alfonso Martínez de Lizarrondo, 12 years ago)

work in progress

  • editor/_source/internals/fck.js

     
    439439                        if ( FCKBrowserInfo.IsIE )
    440440                                sHeadExtra += FCK._GetBehaviorsStyle() ;
    441441                        else if ( FCKConfig.ShowBorders )
    442                                 sHeadExtra += '<link href="' + FCKConfig.FullBasePath + 'css/fck_showtableborders_gecko.css" rel="stylesheet" type="text/css" _fcktemp="true" />' ;
     442                                sHeadExtra += FCKCSSManager.GetCSSInclude( FCKConfig.FullBasePath + 'css/fck_showtableborders_gecko.css', true) ;
    443443
    444                         sHeadExtra += '<link href="' + FCKConfig.FullBasePath + 'css/fck_internal.css" rel="stylesheet" type="text/css" _fcktemp="true" />' ;
     444                        sHeadExtra +=  FCKCSSManager.GetCSSInclude( FCKConfig.FullBasePath + 'css/fck_internal.css', true) ;
    445445
    446446                        // Attention: do not change it before testing it well (sample07)!
    447447                        // This is tricky... if the head ends with <meta ... content type>,
     
    975975        var sStyles = FCKConfig.EditorAreaStyles ;
    976976
    977977        for ( var i = 0 ; i < aCSSs.length ; i++ )
    978                 sTags += '<link href="' + aCSSs[i] + '" rel="stylesheet" type="text/css" />' ;
     978                sTags += FCKCSSManager.GetCSSInclude( aCSSs[i] ) ;
    979979
    980980        if ( sStyles && sStyles.length > 0 )
    981981                sTags += "<style>" + sStyles + "</style>" ;
  • editor/_source/internals/fckcssmanager.js

     
     1/*
     2* FCKeditor - The text editor for Internet - http://www.fckeditor.net
     3* This file copyright (C) 2007 PBwiki, Inc.
     4*
     5* == BEGIN LICENSE ==
     6*
     7* Licensed under the terms of any of the following licenses at your
     8* choice:
     9*
     10*  - GNU General Public License Version 2 or later (the "GPL")
     11*    http://www.gnu.org/licenses/gpl.html
     12*
     13*  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
     14*    http://www.gnu.org/licenses/lgpl.html
     15*
     16*  - Mozilla Public License Version 1.1 or later (the "MPL")
     17*    http://www.mozilla.org/MPL/MPL-1.1.html
     18*
     19* == END LICENSE ==
     20*
     21*/
     22
     23var FCKCSSManager =
     24{
     25        CachedCSS : {},
     26
     27        AddCachedCSS : function( path, value )
     28        {
     29                FCKCSSManager.CachedCSS[ path ] = value ;
     30        },
     31
     32        _ProcessPath : function( path )
     33        {
     34                if ( !path )
     35                        return null ;
     36
     37                if ( path.substr( 0, FCKConfig.BasePath.length ) == FCKConfig.BasePath )
     38                        path = path.substr( FCKConfig.BasePath.length ).replace( /^\//, "" ) ;
     39
     40                return path;
     41        },
     42
     43        GetCachedCSS : function( path )
     44        {
     45                if ( !path )
     46                        return null ;
     47
     48                var relativePath = FCKCSSManager._ProcessPath( path ) ;
     49
     50                if ( !FCKCSSManager.CachedCSS[ relativePath ] )
     51                        return null ;
     52
     53                var cachedCSS = FCKCSSManager.CachedCSS[ relativePath ];
     54
     55                var pathPrefix = path.replace( /\/[^\/]+\.css$/i, "/" );
     56                pathPrefix.replace( /^[^\/]*$/, "" );
     57
     58                function pathReplace ( str, prefix, path, suffix, cache_path ) {
     59                        if ( path.match( /^http|^\// ) )
     60                                return "url(" + prefix + path + suffix + ")" ;
     61                        else
     62                                return "url(" + prefix + cache_path + path + suffix + ")" ;
     63                }
     64
     65                cachedCSS = cachedCSS.replace( /url *\(([ '"]*)(.*?)([ "']*)\)/g,
     66                        ( function( a, b, c, d, e, f, g) { return pathReplace( a, b, c, d, pathPrefix ) ; } ) );
     67
     68                return cachedCSS ;
     69        },
     70
     71        GetCSSInclude : function( path, markTemp )
     72        {
     73                if ( !path )
     74                        return null ;
     75
     76                var cachedCSS = FCKCSSManager.GetCachedCSS( path ) ;
     77
     78                var temp = (markTemp) ? ' _fcktemp="true"' : '' ;
     79
     80                if ( !cachedCSS )
     81                        return( '<link href="' + path + '" type="text/css" rel="stylesheet" ' + temp + '/>' ) ;
     82
     83//  onload="alert(this)"
     84                return( '<sty' + 'le type="text/css"' + temp + '>' + cachedCSS + '</st' + 'yle>' ) ;
     85        },
     86
     87        PrintCSSInclude : function( path )
     88        {
     89                document.write( FCKCSSManager.GetCSSInclude( path ) ) ;
     90        },
     91
     92        ParseStyleSheets : function( theDoc )
     93        {
     94                if (!theDoc)
     95                        return;
     96
     97//              debugger;
     98                for ( var i = 0 ; i < theDoc.styleSheets.length ; i++ )
     99                {
     100                        // It will hold all the rules of the applied stylesheet
     101                        var sheet = theDoc.styleSheets[i] ;
     102                        var node = sheet.ownerNode || sheet.owningElement ;
     103
     104                        if ( node.nodeName.toUpperCase() == 'LINK')
     105                        {
     106                                var sCssText = ""
     107                                if ( sheet.cssText )
     108                                        sCssText = sheet.cssText ;
     109                                else
     110                                {
     111                                        var aRules = [] ;
     112                                        var sheetRules = (sheet.cssRules || sheet.rules) ;
     113                                        for (var j = 0; j < sheetRules.length ; j++ )
     114                                                aRules.push( sheetRules[j].cssText ) ;
     115
     116                                        sCssText = aRules.join("\r\n") ;
     117                                }
     118
     119                                // FCKDebug.Output("Caching " + node.href);
     120                                FCKCSSManager.AddCachedCSS( FCKCSSManager._ProcessPath( node.href ), sCssText ) ;
     121                        }
     122                }
     123        },
     124        // This is called after the document has been loaded and automatically adds the existing stylesheets to the cache
     125        // So when using those files for the panels are available, and switching from source mode also uses them
     126        ParseStyleSheets_EditorDocument : function()
     127        {
     128                FCKCSSManager.ParseStyleSheets( FCK.EditorDocument ) ;
     129        }
     130} ;
     131
     132// Listen for the moment when the editor is loaded
     133FCK.Events.AttachEvent( 'OnAfterSetHTML' , FCKCSSManager.ParseStyleSheets_EditorDocument ) ;
     134
     135// listen for this window
     136FCKTools.AddEventListener( window, "load", function() { FCKCSSManager.ParseStyleSheets( document )} );
     137
     138
     139/*
     140FCKCSSManager.AddCachedCSS("skins\/silver\/fck_editor.css","\/*\r\n * FCKeditor - The text editor for Internet - http:\/\/www.fckeditor.net\r\n * Copyright (C) 2003-2007 Frederico Caldeira Knabben\r\n *\r\n * == BEGIN LICENSE ==\r\n *\r\n * Licensed under the terms of any of the following licenses at your\r\n * choice:\r\n *\r\n *  - GNU General Public License Version 2 or later (the \"GPL\")\r\n *    http:\/\/www.gnu.org\/licenses\/gpl.html\r\n *\r\n *  - GNU Lesser General Public License Version 2.1 or later (the \"LGPL\")\r\n *    http:\/\/www.gnu.org\/licenses\/lgpl.html\r\n *\r\n *  - Mozilla Public License Version 1.1 or later (the \"MPL\")\r\n *    http:\/\/www.mozilla.org\/MPL\/MPL-1.1.html\r\n *\r\n * == END LICENSE ==\r\n *\r\n * Styles used by the editor IFRAME and Toolbar.\r\n *\/\r\n\r\n\/*\r\n\t### Basic Editor IFRAME Styles.\r\n*\/\r\n\r\nbody\r\n{\r\n\tpadding: 1px;\r\n\tmargin: 0;\r\n\tbackground-color: #ffffff;\r\n}\r\n\r\n#xEditingArea\r\n{\r\n\tborder: #696969 1px solid;\r\n}\r\n\r\n.SourceField\r\n{\r\n\tpadding: 5px;\r\n\tmargin: 0px;\r\n\tfont-family: Monospace;\r\n}\r\n\r\n\/*\r\n\tToolbar\r\n*\/\r\n\r\n.TB_ToolbarSet, .TB_Expand, .TB_Collapse\r\n{\r\n    cursor: default;\r\n\tbackground-color: #f7f7f7;\r\n}\r\n\r\n.TB_ToolbarSet\r\n{\r\n\tpadding: 1px;\r\n\tborder-top: #efefde 1px outset;\r\n\tborder-bottom: #efefde 1px outset;\r\n}\r\n\r\n.TB_ToolbarSet TD\r\n{\r\n\tfont-size: 11px;\r\n\tfont-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;\r\n}\r\n\r\n.TB_Toolbar\r\n{\r\n    display: inline-table;\r\n}\r\n\r\n.TB_Separator\r\n{\r\n    width: 1px;\r\n    height: 21px;\r\n    margin: 2px;\r\n    background-color: #C6C3BD;\r\n}\r\n\r\n.TB_Start\r\n{\r\n    background-image: url(images\/toolbar.start.gif);\r\n    margin-left: 2px;\r\n    margin-right: 2px;\r\n    width: 3px;\r\n    background-repeat: no-repeat;\r\n    height: 27px;\r\n    background-position: center center;\r\n}\r\n\r\n.TB_End\r\n{\r\n\tdisplay: none;\r\n}\r\n\r\n.TB_ExpandImg\r\n{\r\n\tbackground-image: url(images\/toolbar.expand.gif);\r\n\tbackground-repeat: no-repeat;\r\n}\r\n\r\n.TB_CollapseImg\r\n{\r\n\tbackground-image: url(images\/toolbar.collapse.gif);\r\n\tbackground-repeat: no-repeat;\r\n}\r\n\r\n.TB_SideBorder\r\n{\r\n\tbackground-color: #696969;\r\n}\r\n\r\n.TB_Expand, .TB_Collapse\r\n{\r\n\tpadding: 2px 2px 2px 2px;\r\n\tborder: #efefde 1px outset;\r\n}\r\n\r\n.TB_Collapse\r\n{\r\n\tborder: #efefde 1px outset;\r\n\twidth: 5px;\r\n}\r\n\r\n.TB_Break\r\n{\r\n\theight: 27px;\r\n}\r\n\r\n\/*\r\n\tToolbar Button\r\n*\/\r\n\r\n.TB_Button_On, .TB_Button_Off, .TB_Button_On_Over, .TB_Button_Off_Over, .TB_Button_Disabled\r\n{\r\n\tpadding: 1px ;\r\n\tmargin:1px;\r\n\theight: 21px;\r\n}\r\n\r\n.TB_Button_On, .TB_Button_Off, .TB_Button_On_Over, .TB_Button_Off_Over, .TB_Button_Disabled\r\n{\r\n\tborder: #cec6b5 1px solid;\r\n}\r\n\r\n.TB_Button_On\r\n{\r\n\tborder-color: #316ac5;\r\n\tbackground-color: #c1d2ee;\r\n}\r\n\r\n.TB_Button_On_Over, .TB_Button_Off_Over\r\n{\r\n    border: #316ac5 1px solid;\r\n    background-color: #dff1ff;\r\n}\r\n\r\n.TB_Button_Off\r\n{\r\n\tbackground: #efefef url(images\/toolbar.buttonbg.gif) repeat-x;\r\n}\r\n\r\n.TB_Button_Off, .TB_Combo_Off\r\n{\r\n\topacity: 0.70; \/* Safari, Opera and Mozilla *\/\r\n\tfilter: alpha(opacity=70); \/* IE *\/\r\n\t\/* -moz-opacity: 0.70; Mozilla (Old) *\/\r\n}\r\n\r\n.TB_Button_Disabled\r\n{\r\n    opacity: 0.30; \/* Safari, Opera and Mozilla *\/\r\n    filter: gray() alpha(opacity=30); \/* IE *\/\r\n}\r\n\r\n.TB_Button_Padding\r\n{\r\n    visibility: hidden;\r\n    width: 3px;\r\n    height: 21px;\r\n}\r\n\r\n.TB_Button_Image\r\n{\r\n    overflow: hidden;\r\n    width: 16px;\r\n    height: 16px;\r\n    margin: 3px;\r\n    margin-top: 4px;\r\n    margin-bottom: 2px;\r\n    background-repeat: no-repeat;\r\n}\r\n\r\n\/* For composed button ( icon + text, icon + arrow ), we must compensate the table *\/\r\n.TB_Button_On TABLE .TB_Button_Image,\r\n.TB_Button_Off TABLE .TB_Button_Image,\r\n.TB_Button_On_Over TABLE .TB_Button_Image,\r\n.TB_Button_Off_Over TABLE .TB_Button_Image,\r\n.TB_Button_Disabled TABLE .TB_Button_Image\r\n{\r\n    margin-top: 3px;\r\n}\r\n\r\n.TB_Button_Image img\r\n{\r\n    position: relative;\r\n}\r\n\r\n.TB_ConnectionLine\r\n{\r\n    background-color: #ffffff;\r\n    height: 1px;\r\n    margin-left: 1px;   \/* ltr *\/\r\n    margin-right: 1px;  \/* rtl *\/\r\n}\r\n\r\n\/*\r\n\tMenu\r\n*\/\r\n\r\n.MN_Menu\r\n{\r\n    border: 1px solid #8f8f73;\r\n    padding: 2px;\r\n    background-color: #f7f7f7;\r\n    cursor: default;\r\n}\r\n\r\n.MN_Menu, .MN_Menu .MN_Label\r\n{\r\n    font-size: 11px;\r\n    font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;\r\n}\r\n\r\n.MN_Item_Padding\r\n{\r\n    visibility: hidden;\r\n    width: 3px;\r\n    height: 20px;\r\n}\r\n\r\n.MN_Icon\r\n{\r\n    background-color: #dedede;\r\n    text-align: center;\r\n    height: 20px;\r\n}\r\n\r\n.MN_Label\r\n{\r\n    padding-left: 3px;\r\n    padding-right: 3px;\r\n}\r\n\r\n.MN_Separator\r\n{\r\n    height: 3px;\r\n}\r\n\r\n.MN_Separator_Line\r\n{\r\n    border-top: #b9b99d 1px solid;\r\n}\r\n\r\n.MN_Item .MN_Icon IMG\r\n{\r\n    filter: alpha(opacity=70);\r\n    opacity: 0.70;\r\n}\r\n\r\n.MN_Item_Over\r\n{\r\n    color: #ffffff;\r\n    background-color: #8a857d;\r\n}\r\n\r\n.MN_Item_Over .MN_Icon\r\n{\r\n    background-color: #6c6761;\r\n}\r\n\r\n.MN_Item_Disabled IMG\r\n{\r\n    filter: gray() alpha(opacity=30); \/* IE *\/\r\n    opacity: 0.30; \/* Safari, Opera and Mozilla *\/\r\n}\r\n\r\n.MN_Item_Disabled .MN_Label\r\n{\r\n    color: #b7b7b7;\r\n}\r\n\r\n.MN_Arrow\r\n{\r\n    padding-right: 3px;\r\n    padding-left: 3px;\r\n}\r\n\r\n.MN_ConnectionLine\r\n{\r\n    background-color: #ffffff;\r\n}\r\n\r\n.Menu .TB_Button_On, .Menu .TB_Button_On_Over\r\n{\r\n    border: #8f8f73 1px solid;\r\n    background-color: #ffffff;\r\n}\r\n\r\n\/*\r\n\t### Panel Styles\r\n*\/\r\n\r\n.FCK_Panel\r\n{\r\n    border: #8f8f73 1px solid;\r\n    padding: 2px;\r\n    background-color: #ffffff;\r\n}\r\n\r\n.FCK_Panel, .FCK_Panel TD\r\n{\r\n    font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;\r\n    font-size: 11px;\r\n}\r\n\r\n\/*\r\n\t### Special Combos\r\n*\/\r\n\r\n.SC_Panel\r\n{\r\n    overflow: auto;\r\n    white-space: nowrap;\r\n    cursor: default;\r\n    border: 1px solid #8f8f73;\r\n    padding-left: 2px;\r\n    padding-right: 2px;\r\n}\r\n\r\n.SC_Panel, .SC_Panel TD\r\n{\r\n    font-size: 11px;\r\n    font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;\r\n}\r\n\r\n.SC_Item, .SC_ItemSelected\r\n{\r\n    margin-top: 2px;\r\n    margin-bottom: 2px;\r\n    background-position: left center;\r\n    padding-left: 11px;\r\n    padding-right: 3px;\r\n    padding-top: 2px;\r\n    padding-bottom: 2px;\r\n    text-overflow: ellipsis;\r\n    overflow: hidden;\r\n    background-repeat: no-repeat;\r\n    border: #dddddd 1px solid;\r\n}\r\n\r\n.SC_Item *, .SC_ItemSelected *\r\n{\r\n    margin-top: 0px;\r\n    margin-bottom: 0px;\r\n}\r\n\r\n.SC_ItemSelected\r\n{\r\n    border: #9a9afb 1px solid;\r\n    background-image: url(images\/toolbar.arrowright.gif);\r\n}\r\n\r\n.SC_ItemOver\r\n{\r\n    border: #316ac5 1px solid;\r\n}\r\n\r\n.SC_Field\r\n{\r\n    margin-top:1px ;\r\n    border: #b7b7a6 1px solid;\r\n    cursor: default;\r\n}\r\n\r\n.SC_FieldCaption\r\n{\r\n    padding-top: 1px ;\r\n    overflow: visible;\r\n    padding-right: 5px;\r\n    padding-left: 5px;\r\n    opacity: 0.75; \/* Safari, Opera and Mozilla *\/\r\n    filter: alpha(opacity=70); \/* IE *\/ \/* -moz-opacity: 0.75; Mozilla (Old) *\/\r\n    height: 23px;\r\n    background-color: #f7f7f7;\r\n}\r\n\r\n.SC_FieldLabel\r\n{\r\n    white-space: nowrap;\r\n    padding: 2px;\r\n    width: 100%;\r\n    cursor: default;\r\n    background-color: #ffffff;\r\n    text-overflow: ellipsis;\r\n    overflow: hidden;\r\n}\r\n\r\n.SC_FieldButton\r\n{\r\n    background-position: center center;\r\n    background-image: url(images\/toolbar.buttonarrow.gif);\r\n    border-left: #b7b7a6 1px solid;\r\n    width: 14px;\r\n    background-repeat: no-repeat;\r\n}\r\n\r\n.SC_FieldDisabled .SC_FieldButton, .SC_FieldDisabled .SC_FieldCaption\r\n{\r\n    opacity: 0.30; \/* Safari, Opera and Mozilla *\/\r\n    filter: gray() alpha(opacity=30); \/* IE *\/ \/* -moz-opacity: 0.30; Mozilla (Old) *\/\r\n}\r\n\r\n.SC_FieldOver\r\n{\r\n    border: #316ac5 1px solid;\r\n}\r\n\r\n.SC_FieldOver .SC_FieldButton\r\n{\r\n    border-left: #316ac5 1px solid;\r\n}\r\n\r\n\/*\r\n\t### Color Selector Panel\r\n*\/\r\n\r\n.ColorBoxBorder\r\n{\r\n    border: #808080 1px solid;\r\n    position: static;\r\n}\r\n\r\n.ColorBox\r\n{\r\n    font-size: 1px;\r\n    width: 10px;\r\n    position: static;\r\n    height: 10px;\r\n}\r\n\r\n.ColorDeselected, .ColorSelected\r\n{\r\n    cursor: default;\r\n}\r\n\r\n.ColorDeselected\r\n{\r\n    border: #ffffff 1px solid;\r\n    padding: 2px;\r\n    float: left;\r\n}\r\n\r\n.ColorSelected\r\n{\r\n    border: #316ac5 1px solid;\r\n    padding: 2px;\r\n    float: left;\r\n    background-color: #c1d2ee;\r\n}\r\n");
     141FCKCSSManager.AddCachedCSS("css\/fck_showtableborders_gecko.css","\/*\r\n * FCKeditor - The text editor for Internet - http:\/\/www.fckeditor.net\r\n * Copyright (C) 2003-2007 Frederico Caldeira Knabben\r\n *\r\n * == BEGIN LICENSE ==\r\n *\r\n * Licensed under the terms of any of the following licenses at your\r\n * choice:\r\n *\r\n *  - GNU General Public License Version 2 or later (the \"GPL\")\r\n *    http:\/\/www.gnu.org\/licenses\/gpl.html\r\n *\r\n *  - GNU Lesser General Public License Version 2.1 or later (the \"LGPL\")\r\n *    http:\/\/www.gnu.org\/licenses\/lgpl.html\r\n *\r\n *  - Mozilla Public License Version 1.1 or later (the \"MPL\")\r\n *    http:\/\/www.mozilla.org\/MPL\/MPL-1.1.html\r\n *\r\n * == END LICENSE ==\r\n *\r\n * This CSS Style Sheet defines the rules to show table borders on Gecko.\r\n *\/\r\n\r\n\/* For tables with the \"border\" attribute set to \"0\" *\/\r\ntable[border=\"0\"],\r\ntable[border=\"0\"] > tr > td, table[border=\"0\"] > tr > th,\r\ntable[border=\"0\"] > tbody > tr > td, table[border=\"0\"] > tbody > tr > th,\r\ntable[border=\"0\"] > thead > tr > td, table[border=\"0\"] > thead > tr > th,\r\ntable[border=\"0\"] > tfoot > tr > td, table[border=\"0\"] > tfoot > tr > th\r\n{\r\n\tborder: #d3d3d3 1px dotted ;\r\n}\r\n\r\n\/* For tables with no \"border\" attribute set *\/\r\ntable:not([border]),\r\ntable:not([border]) > tr > td, table:not([border]) > tr > th,\r\ntable:not([border]) > tbody > tr > td, table:not([border]) > tbody > tr > th,\r\ntable:not([border]) > thead > tr > td, table:not([border]) > thead > tr > th,\r\ntable:not([border]) > tfoot > tr > td, table:not([border]) > tfoot > tr > th\r\n{\r\n\tborder: #d3d3d3 1px dotted ;\r\n}\r\n");
     142FCKCSSManager.AddCachedCSS("css\/fck_editorarea.css","\/*\r\n * FCKeditor - The text editor for Internet - http:\/\/www.fckeditor.net\r\n * Copyright (C) 2003-2007 Frederico Caldeira Knabben\r\n *\r\n * == BEGIN LICENSE ==\r\n *\r\n * Licensed under the terms of any of the following licenses at your\r\n * choice:\r\n *\r\n *  - GNU General Public License Version 2 or later (the \"GPL\")\r\n *    http:\/\/www.gnu.org\/licenses\/gpl.html\r\n *\r\n *  - GNU Lesser General Public License Version 2.1 or later (the \"LGPL\")\r\n *    http:\/\/www.gnu.org\/licenses\/lgpl.html\r\n *\r\n *  - Mozilla Public License Version 1.1 or later (the \"MPL\")\r\n *    http:\/\/www.mozilla.org\/MPL\/MPL-1.1.html\r\n *\r\n * == END LICENSE ==\r\n *\r\n * This is the default CSS file used by the editor area. It defines the\r\n * initial font of the editor and background color.\r\n *\r\n * A user can configure the editor to use another CSS file. Just change\r\n * the value of the FCKConfig.EditorAreaCSS key in the configuration\r\n * file.\r\n *\/\r\n\r\n\/*\r\n    The \"body\" styles should match your editor web site, mainly regarding\r\n    background color and font family and size.\r\n*\/\r\n\r\nbody\r\n{\r\n\tbackground-color: #ffffff;\r\n\tpadding: 5px 5px 5px 5px;\r\n\tmargin: 0px;\r\n}\r\n\r\nbody, td\r\n{\r\n\tfont-family: Arial, Verdana, sans-serif;\r\n\tfont-size: 12px;\r\n}\r\n\r\na[href]\r\n{\r\n\tcolor: -moz-hyperlinktext !important;\t\t\/* For Firefox... mark as important, otherwise it becomes black *\/\r\n\ttext-decoration: -moz-anchor-decoration;\t\/* For Firefox 3, otherwise no underline will be used *\/\r\n}\r\n\r\n\/*\r\n\tJust uncomment the following block if you want to avoid spaces between\r\n\tparagraphs. Remember to apply the same style in your output front end page.\r\n*\/\r\n\r\n\/*\r\np, ul, li\r\n{\r\n\tmargin-top: 0px;\r\n\tmargin-bottom: 0px;\r\n}\r\n*\/\r\n\r\n\/*\r\n    The following are some sample styles used in the \"Styles\" toolbar command.\r\n    You should instead remove them, and include the styles used by the site\r\n    you are using the editor in.\r\n*\/\r\n\r\n.Bold\r\n{\r\n\tfont-weight: bold;\r\n}\r\n\r\n.Title\r\n{\r\n\tfont-weight: bold;\r\n\tfont-size: 18px;\r\n\tcolor: #cc3300;\r\n}\r\n\r\n.Code\r\n{\r\n\tborder: #8b4513 1px solid;\r\n\tpadding-right: 5px;\r\n\tpadding-left: 5px;\r\n\tcolor: #000066;\r\n\tfont-family: 'Courier New' , Monospace;\r\n\tbackground-color: #ff9933;\r\n}\r\n");
     143FCKCSSManager.AddCachedCSS("css\/fck_internal.css","\/*\r\n * FCKeditor - The text editor for Internet - http:\/\/www.fckeditor.net\r\n * Copyright (C) 2003-2007 Frederico Caldeira Knabben\r\n *\r\n * == BEGIN LICENSE ==\r\n *\r\n * Licensed under the terms of any of the following licenses at your\r\n * choice:\r\n *\r\n *  - GNU General Public License Version 2 or later (the \"GPL\")\r\n *    http:\/\/www.gnu.org\/licenses\/gpl.html\r\n *\r\n *  - GNU Lesser General Public License Version 2.1 or later (the \"LGPL\")\r\n *    http:\/\/www.gnu.org\/licenses\/lgpl.html\r\n *\r\n *  - Mozilla Public License Version 1.1 or later (the \"MPL\")\r\n *    http:\/\/www.mozilla.org\/MPL\/MPL-1.1.html\r\n *\r\n * == END LICENSE ==\r\n *\r\n * This CSS Style Sheet defines rules used by the editor for its internal use.\r\n *\/\r\n\r\n\/* Fix to allow putting the caret at the end of the content in Firefox if\r\n   clicking below the content. *\/\r\nhtml\r\n{\r\n\tmin-height: 100%;\r\n}\r\n\r\ntable.FCK__ShowTableBorders, table.FCK__ShowTableBorders td, table.FCK__ShowTableBorders th\r\n{\r\n\tborder: #d3d3d3 1px solid;\r\n}\r\n\r\nform\r\n{\r\n\tborder: 1px dotted #FF0000;\r\n\tpadding: 2px;\r\n}\r\n\r\n.FCK__Flash\r\n{\r\n\tborder: #a9a9a9 1px solid;\r\n\tbackground-position: center center;\r\n\tbackground-image: url(images\/fck_flashlogo.gif);\r\n\tbackground-repeat: no-repeat;\r\n\twidth: 80px;\r\n\theight: 80px;\r\n}\r\n\r\n\/* Empty anchors images *\/\r\n.FCK__Anchor\r\n{\r\n\tborder: 1px dotted #00F;\r\n\tbackground-position: center center;\r\n\tbackground-image: url(images\/fck_anchor.gif);\r\n\tbackground-repeat: no-repeat;\r\n\twidth: 16px;\r\n\theight: 15px;\r\n\tvertical-align: middle;\r\n}\r\n\r\n\/* Anchors with content *\/\r\n.FCK__AnchorC\r\n{\r\n\tborder: 1px dotted #00F;\r\n\tbackground-position: 1px center;\r\n\tbackground-image: url(images\/fck_anchor.gif);\r\n\tbackground-repeat: no-repeat;\r\n\tpadding-left: 18px;\r\n}\r\n\r\n\/* Any anchor for non-IE, if we combine it with the previous rule IE ignores all. *\/\r\na[name]\r\n{\r\n\tborder: 1px dotted #00F;\r\n\tbackground-position: 0 center;\r\n\tbackground-image: url(images\/fck_anchor.gif);\r\n\tbackground-repeat: no-repeat;\r\n\tpadding-left: 18px;\r\n}\r\n\r\n.FCK__PageBreak\r\n{\r\n\tbackground-position: center center;\r\n\tbackground-image: url(images\/fck_pagebreak.gif);\r\n\tbackground-repeat: no-repeat;\r\n\tclear: both;\r\n\tdisplay: block;\r\n\tfloat: none;\r\n\twidth: 100%;\r\n\tborder-top: #999999 1px dotted;\r\n\tborder-bottom: #999999 1px dotted;\r\n\tborder-right: 0px;\r\n\tborder-left: 0px;\r\n\theight: 5px;\r\n}\r\n\r\n\/* Hidden fields *\/\r\n.FCK__InputHidden\r\n{\r\n\twidth: 19px;\r\n\theight: 18px;\r\n\tbackground-image: url(images\/fck_hiddenfield.gif);\r\n\tbackground-repeat: no-repeat;\r\n\tvertical-align: text-bottom;\r\n\tbackground-position: center center;\r\n}\r\n\r\n.FCK__ShowBlocks p,\r\n.FCK__ShowBlocks div,\r\n.FCK__ShowBlocks pre,\r\n.FCK__ShowBlocks address,\r\n.FCK__ShowBlocks blockquote,\r\n.FCK__ShowBlocks h1,\r\n.FCK__ShowBlocks h2,\r\n.FCK__ShowBlocks h3,\r\n.FCK__ShowBlocks h4,\r\n.FCK__ShowBlocks h5,\r\n.FCK__ShowBlocks h6\r\n{\r\n\tbackground-repeat: no-repeat;\r\n\tborder: 1px dotted gray;\r\n\tpadding-top: 8px;\r\n\tpadding-left: 8px;\r\n}\r\n\r\n.FCK__ShowBlocks p\r\n{\r\n\tbackground-image: url(images\/block_p.png);\r\n}\r\n\r\n.FCK__ShowBlocks div\r\n{\r\n\tbackground-image: url(images\/block_div.png);\r\n}\r\n\r\n.FCK__ShowBlocks pre\r\n{\r\n\tbackground-image: url(images\/block_pre.png);\r\n}\r\n\r\n.FCK__ShowBlocks address\r\n{\r\n\tbackground-image: url(images\/block_address.png);\r\n}\r\n\r\n.FCK__ShowBlocks blockquote \r\n{\r\n\tbackground-image: url(images\/block_blockquote.png);\r\n}\r\n\r\n.FCK__ShowBlocks h1\r\n{\r\n\tbackground-image: url(images\/block_h1.png);\r\n}\r\n\r\n.FCK__ShowBlocks h2\r\n{\r\n\tbackground-image: url(images\/block_h2.png);\r\n}\r\n\r\n.FCK__ShowBlocks h3\r\n{\r\n\tbackground-image: url(images\/block_h3.png);\r\n}\r\n\r\n.FCK__ShowBlocks h4\r\n{\r\n\tbackground-image: url(images\/block_h4.png);\r\n}\r\n\r\n.FCK__ShowBlocks h5\r\n{\r\n\tbackground-image: url(images\/block_h5.png);\r\n}\r\n\r\n.FCK__ShowBlocks h6\r\n{\r\n\tbackground-image: url(images\/block_h6.png);\r\n}\r\n");
     144*/
     145 No newline at end of file
  • editor/_source/internals/fcktools_gecko.js

     
    4040// Appends a CSS file to a document.
    4141FCKTools._AppendStyleSheet = function( documentElement, cssFileUrl )
    4242{
    43         var e = documentElement.createElement( 'LINK' ) ;
    44         e.rel   = 'stylesheet' ;
    45         e.type  = 'text/css' ;
    46         e.href  = cssFileUrl ;
    47         documentElement.getElementsByTagName("HEAD")[0].appendChild( e ) ;
    48         return e ;
     43        var cssText = FCKCSSManager.GetCachedCSS( cssFileUrl ) ;
     44
     45        if ( cssText == null )
     46        {
     47                var e = documentElement.createElement( 'LINK' ) ;
     48                e.rel   = 'stylesheet' ;
     49                e.type  = 'text/css' ;
     50                e.href  = cssFileUrl ;
     51                documentElement.getElementsByTagName( "HEAD" )[0].appendChild( e ) ;
     52                return e ;
     53        }
     54        else
     55        {
     56                return FCKTools._AppendStyleString( documentElement, cssText ) ;
     57        }
    4958}
    5059
    5160// Appends a CSS style string to a document.
  • editor/_source/internals/fcktools_ie.js

     
    2929// Appends one or more CSS files to a document.
    3030FCKTools._AppendStyleSheet = function( documentElement, cssFileUrl )
    3131{
    32         return documentElement.createStyleSheet( cssFileUrl ).owningElement ;
     32        var cssText = FCKCSSManager.GetCachedCSS( cssFileUrl );
     33
     34        if ( cssText )
     35        {
     36                return FCKTools._AppendStyleString( documentElement, cssText ) ;
     37        }
     38        else
     39        {
     40                return documentElement.createStyleSheet( cssFileUrl ).owningElement ;
     41        }
    3342}
    3443
    3544// Appends a CSS style string to a document.
  • editor/fckdialog.html

     
    7777var FCKDialog           = E.FCKDialog ;
    7878var FCKBrowserInfo      = E.FCKBrowserInfo ;
    7979var FCKConfig           = E.FCKConfig ;
     80var FCKCSSManager               = E.FCKCSSManager ;
    8081
    8182// Steal the focus so that the caret would no longer stay in the editor iframe.
    8283window.focus() ;
    8384
    8485// Sets the Skin CSS
    85 document.write( '<link href="' + FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ;
     86document.write( FCKCSSManager.GetCSSInclude( FCKConfig.SkinPath + 'fck_dialog.css' ) );
    8687
    8788// Sets the language direction.
    8889var langDir = window.document.dir = E.FCKLang.Dir ;
     
    557558                Throbber.Show( 1000 ) ;
    558559
    559560                Sizer.RefreshContainerSize() ;
     561
     562                // Cache the CSS
     563                FCKCSSManager.ParseStyleSheets( document ) ;
     564
    560565                LoadInnerDialog() ;
    561566
    562567                FCKTools.DisableSelection( document.body ) ;
     
    643648                innerDoc.dir = langDir ;
    644649
    645650                // Sets the Skin CSS.
    646                 innerDoc.write( '<link href="' + FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ;
     651                innerDoc.write( FCKCSSManager.GetCSSInclude( FCKConfig.SkinPath + 'fck_dialog.css' ) ) ;
    647652
    648653                setOnKeyDown( innerDoc ) ;
    649654                disableContextMenu( innerDoc ) ;
  • editor/fckeditor.html

     
    8383
    8484function LoadCss( url )
    8585{
    86         document.write( '<link href="' + url + '" type="text/css" rel="stylesheet" />' ) ;
     86        FCKCSSManager.PrintCSSInclude( url ) ;
    8787}
    8888
    8989// Main editor scripts.
     
    186186LoadScript( '_source/classes/fckmenublockpanel.js' ) ;
    187187LoadScript( '_source/classes/fckcontextmenu.js' ) ;
    188188LoadScript( '_source/internals/fck_contextmenu.js' ) ;
     189LoadScript( '_source/internals/fckcssmanager.js' ) ;
    189190LoadScript( '_source/classes/fckplugin.js' ) ;
    190191LoadScript( '_source/internals/fckplugins.js' ) ;
    191192
     
    342343                if ( eInnerElement )
    343344                {
    344345                        eInnerElement.style.height = 0 ;
    345                         eInnerElement.style.height = oCell.scrollHeight - 2 ;
     346                        var iCellBorderAndMargin = oCell.offsetHeight - oCell.clientHeight ;
     347                        eInnerElement.style.height = oCell.scrollHeight - iCellBorderAndMargin ;
    346348                }
    347349        }
    348350}
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy