Ticket #1886: 1886_2.patch

File 1886_2.patch, 17.1 KB (added by fredck, 2 years ago)
  • _dev/fckreleaser.xml

     
    2828        <IgnoreDir path="_testcases" /> 
    2929 
    3030        <!-- 
    31                 The following directory should not existing in the development version, 
     31                The following files should not existing in the development version, 
    3232                but we leave it here just in case the packager has been run by mistake. 
    3333        --> 
    34         <IgnoreDir path="editor/js" /> 
     34        <IgnoreFile path="editor/js/fckeditorcode_ie.js" /> 
     35        <IgnoreFile path="editor/js/fckeditorcode_gecko.js" /> 
    3536 
    3637        <!-- 
    37         <IgnoreFile path="anyfile.xxx" /> 
     38        <IgnoreDir path="dir/path" /> 
    3839        --> 
    3940 
    4041</Release> 
  • _samples/adobeair/application.xml

     
     1<?xml version="1.0" encoding="utf-8" ?> 
     2<application xmlns="http://ns.adobe.com/air/application/1.0.M6"> 
     3        <!-- AIR Application Descriptor File. See http://www.adobe.com/go/air_1.0_application_descriptor. --> 
     4        <id>net.fckeditor.air.samples.sample01</id> 
     5        <name>FCKeditor Sample Application 1.0</name> 
     6        <version>1.0</version> 
     7        <filename>FCKeditor AIR Sample</filename> 
     8        <description>This is a sample AIR application including FCKeditor.</description> 
     9        <copyright>Copyright (C) 2003-2008 Frederico Caldeira Knabben</copyright> 
     10        <initialWindow> 
     11                <content>_samples/adobeair/sample01.html</content> 
     12                <title>FCKeditor AIR Sample</title> 
     13                <systemChrome>standard</systemChrome> 
     14                <transparent>false</transparent> 
     15                <visible>true</visible> 
     16                <minimizable>true</minimizable> 
     17                <maximizable>true</maximizable> 
     18                <resizable>true</resizable> 
     19                <x>100</x> 
     20                <y>80</y> 
     21                <width>820</width> 
     22                <height>600</height> 
     23                <minSize>600 400</minSize> 
     24        </initialWindow> 
     25        <installFolder>FCKeditor/AIR Samples/Sample01</installFolder> 
     26        <programMenuFolder>FCKeditor/AIR Samples</programMenuFolder> 
     27        <icon> 
     28                <image16x16>_samples/adobeair/icons/16.png</image16x16> 
     29                <image32x32>_samples/adobeair/icons/32.png</image32x32> 
     30                <image48x48>_samples/adobeair/icons/48.png</image48x48> 
     31                <image128x128>_samples/adobeair/icons/128.png</image128x128> 
     32        </icon> 
     33        <customUpdateUI>false</customUpdateUI> 
     34        <allowBrowserInvocation>false</allowBrowserInvocation> 
     35</application> 
  • _samples/adobeair/package.bat

     
     1@ECHO OFF 
     2 
     3:: 
     4:: FCKeditor - The text editor for Internet - http://www.fckeditor.net 
     5:: Copyright (C) 2003-2008 Frederico Caldeira Knabben 
     6:: 
     7:: == BEGIN LICENSE == 
     8:: 
     9:: Licensed under the terms of any of the following licenses at your 
     10:: choice: 
     11:: 
     12::  - GNU General Public License Version 2 or later (the "GPL") 
     13::    http://www.gnu.org/licenses/gpl.html 
     14:: 
     15::  - GNU Lesser General Public License Version 2.1 or later (the "LGPL") 
     16::    http://www.gnu.org/licenses/lgpl.html 
     17:: 
     18::  - Mozilla Public License Version 1.1 or later (the "MPL") 
     19::    http://www.mozilla.org/MPL/MPL-1.1.html 
     20:: 
     21:: == END LICENSE == 
     22:: 
     23 
     24:: adt -package SIGNING_OPTIONS air_file app_xml [file_or_dir | -C dir file_or_dir | -e file dir ...] ... 
     25 
     26"C:\Adobe AIR SDK\bin\adt" -package -storetype pkcs12 -keystore sample01_cert.pfx -storepass 123abc FCKeditor.air application.xml -C ../../ . 
     27 
  • _samples/adobeair/run.bat

     
     1@ECHO OFF 
     2 
     3:: 
     4:: FCKeditor - The text editor for Internet - http://www.fckeditor.net 
     5:: Copyright (C) 2003-2008 Frederico Caldeira Knabben 
     6:: 
     7:: == BEGIN LICENSE == 
     8:: 
     9:: Licensed under the terms of any of the following licenses at your 
     10:: choice: 
     11:: 
     12::  - GNU General Public License Version 2 or later (the "GPL") 
     13::    http://www.gnu.org/licenses/gpl.html 
     14:: 
     15::  - GNU Lesser General Public License Version 2.1 or later (the "LGPL") 
     16::    http://www.gnu.org/licenses/lgpl.html 
     17:: 
     18::  - Mozilla Public License Version 1.1 or later (the "MPL") 
     19::    http://www.mozilla.org/MPL/MPL-1.1.html 
     20:: 
     21:: == END LICENSE == 
     22:: 
     23 
     24:: adl [-runtime runtime-directory] [-pubId publisher-id] [-nodebug] application.xml [rootdirectory] [-- arguments] 
     25 
     26"C:\Adobe AIR SDK\bin\adl" application.xml ../../ 
  • _samples/adobeair/sample01.html

     
     1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     2<!-- 
     3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net 
     4 * Copyright (C) 2003-2008 Frederico Caldeira Knabben 
     5 * 
     6 * == BEGIN LICENSE == 
     7 * 
     8 * Licensed under the terms of any of the following licenses at your 
     9 * choice: 
     10 * 
     11 *  - GNU General Public License Version 2 or later (the "GPL") 
     12 *    http://www.gnu.org/licenses/gpl.html 
     13 * 
     14 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL") 
     15 *    http://www.gnu.org/licenses/lgpl.html 
     16 * 
     17 *  - Mozilla Public License Version 1.1 or later (the "MPL") 
     18 *    http://www.mozilla.org/MPL/MPL-1.1.html 
     19 * 
     20 * == END LICENSE == 
     21 * 
     22 * Sample Adobe AIR application. 
     23--> 
     24<html xmlns="http://www.w3.org/1999/xhtml"> 
     25<head> 
     26        <title>FCKeditor - Adobe AIR Sample</title> 
     27        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
     28        <meta name="robots" content="noindex, nofollow" /> 
     29        <link href="../sample.css" rel="stylesheet" type="text/css" /> 
     30        <script type="text/javascript" src="../../fckeditor.js"></script> 
     31        <style type="text/css"> 
     32                body { margin: 10px ; } 
     33        </style> 
     34</head> 
     35<body> 
     36        <h1> 
     37                FCKeditor - Adobe AIR Sample 
     38        </h1> 
     39        <div> 
     40                This sample loads FCKeditor with full features enabled. 
     41        </div> 
     42        <hr /> 
     43        <script type="text/javascript"> 
     44 
     45// Automatically calculates the editor base path based on the _samples directory. 
     46// This is usefull only for these samples. A real application should use something like this: 
     47// oFCKeditor.BasePath = '/fckeditor/' ;        // '/fckeditor/' is the default value. 
     48var sBasePath = document.location.href.substring(0,document.location.href.lastIndexOf('_samples')) ; 
     49 
     50var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ; 
     51oFCKeditor.BasePath     = sBasePath ; 
     52oFCKeditor.Height       = 400 ; 
     53oFCKeditor.Value        = '<p>FCKeditor is in the <strong>AIR</strong>!<\/p>' ; 
     54oFCKeditor.Create() ; 
     55 
     56        </script> 
     57</body> 
     58</html> 
  • _whatsnew.html

     
    3737        <p> 
    3838                New Features and Improvements:</p> 
    3939        <ul> 
     40                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1886">#1886</a>] <strong> 
     41                        Adobe AIR</strong> compatibility.</li> 
    4042                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/123">#123</a>] Full support 
    4143                        for <strong>document.domain</strong> with automatic domain detection.</li> 
    4244                <li>New language file for <strong>Canadian French</strong>.</li> 
  • editor/_source/classes/fckeditingarea.js

     
    133133                        oDoc.close() ; 
    134134                } 
    135135 
     136                if ( FCKBrowserInfo.IsAIR ) 
     137                        FCKAdobeAIR.EditingArea_Start( oDoc, html ) ; 
     138 
    136139                // Firefox 1.0.x is buggy... ohh yes... so let's do it two times and it 
    137140                // will magically work. 
    138141                if ( FCKBrowserInfo.IsGecko10 && !secondCall ) 
  • editor/_source/classes/fckpanel.js

     
    8080                oDocument.write( '<html><head>' + sBase + '<\/head><body style="margin:0px;padding:0px;"><\/body><\/html>' ) ; 
    8181                oDocument.close() ; 
    8282 
     83                if( FCKBrowserInfo.IsAIR ) 
     84                        FCKAdobeAIR.Panel_Contructor( oDocument, window.document.location ) ; 
     85 
    8386                FCKTools.AddEventListenerEx( oIFrameWindow, 'focus', FCKPanel_Window_OnFocus, this ) ; 
    8487                FCKTools.AddEventListenerEx( oIFrameWindow, 'blur', FCKPanel_Window_OnBlur, this ) ; 
    8588        } 
  • editor/_source/fckeditorapi.js

     
    3939                // code (like JSON) can extend the Object prototype and we get then extra oEditor 
    4040                // objects that aren't really FCKeditor instances. 
    4141                var sScript = 
    42                         'var FCKeditorAPI = {' + 
     42                        'window.FCKeditorAPI = {' + 
    4343                                'Version : "[Development]",' + 
    4444                                'VersionBuild : "[DEV]",' + 
    4545                                '__Instances : new Object(),' + 
     
    111111                                // following seams to work well. 
    112112                                eval.call( oParentWindow, sScript ) ; 
    113113                        } 
     114                        else if( FCKBrowserInfo.IsAIR ) 
     115                        { 
     116                                FCKAdobeAIR.FCKeditorAPI_Evaluate( oParentWindow, sScript ) ; 
     117                        } 
    114118                        else if ( FCKBrowserInfo.IsSafari || FCKBrowserInfo.IsGecko19 ) 
    115119                        { 
    116120                                // oParentWindow.eval in Safari and Gran Paradiso executes in the calling window 
  • editor/_source/internals/fckbrowserinfo.js

     
    3131        IsGecko         : s.Contains('gecko/'), 
    3232        IsSafari        : s.Contains(' applewebkit/'),          // Read "IsWebKit" 
    3333        IsOpera         : !!window.opera, 
     34        IsAIR           : s.Contains(' adobeair/'), 
    3435        IsMac           : s.Contains('macintosh') 
    3536} ; 
    3637 
  • editor/_source/internals/fcktoolbarset.js

     
    5050                        var oOutMatch = sLocation.match( /^Out:(.+)\((\w+)\)$/ ) ; 
    5151                        if ( oOutMatch ) 
    5252                        { 
    53                                 eToolbarTarget = eval( 'parent.' + oOutMatch[1] ).document.getElementById( oOutMatch[2] ) ; 
     53                                if ( FCKBrowserInfo.IsAIR ) 
     54                                        FCKAdobeAIR.ToolbarSet_GetOutElement( window, oOutMatch ) ; 
     55                                else 
     56                                        eToolbarTarget = eval( 'parent.' + oOutMatch[1] ).document.getElementById( oOutMatch[2] ) ; 
    5457                        } 
    5558                        else 
    5659                        { 
     
    111114                                        + '</script></head><body style="overflow: hidden">' + document.getElementById( 'xToolbarSpace' ).innerHTML + '</body></html>' ) ; 
    112115                        eTargetDocument.close() ; 
    113116 
     117                        if( FCKBrowserInfo.IsAIR ) 
     118                                FCKAdobeAIR.ToolbarSet_InitOutFrame( eTargetDocument ) ; 
     119 
    114120                        FCKTools.AddEventListener( eTargetDocument, 'contextmenu', FCKTools.CancelEvent ) ; 
    115121 
    116122                        // Load external resources (must be done here, otherwise Firefox will not 
  • editor/fckeditor.html

     
    198198        </script> 
    199199        <script type="text/javascript"> 
    200200 
     201// Adobe AIR compatibility file. 
     202if ( FCKBrowserInfo.IsAIR ) 
     203        LoadScript( 'js/fckadobeair.js' ) ; 
     204 
    201205if ( FCKBrowserInfo.IsIE ) 
    202206{ 
    203207        // Remove IE mouse flickering. 
  • editor/js/fckadobeair.js

     
     1/* 
     2 * FCKeditor - The text editor for Internet - http://www.fckeditor.net 
     3 * Copyright (C) 2003-2008 Frederico Caldeira Knabben 
     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 * Compatibility code for Adobe AIR. 
     22 */ 
     23 
     24if ( FCKBrowserInfo.IsAIR ) 
     25{ 
     26        var FCKAdobeAIR = (function() 
     27        { 
     28                /* 
     29                 * ### Private functions. 
     30                 */ 
     31 
     32                function _GetDocumentHead( doc ) 
     33                { 
     34                        var head ; 
     35                        var heads = doc.getElementsByTagName( 'head' ) ; 
     36 
     37                        if( heads && heads[0] ) 
     38                                head = heads[0] ; 
     39                        else 
     40                        { 
     41                                head = doc.createElement( 'head' ) ; 
     42                                doc.documentElement.insertBefore( head, doc.documentElement.firstChild ) ; 
     43                        } 
     44 
     45                        return head ; 
     46                } ; 
     47 
     48                /* 
     49                 * ### Public interface. 
     50                 */ 
     51                return { 
     52                        FCKeditorAPI_Evaluate : function( parentWindow, script ) 
     53                        { 
     54                                // TODO : This one doesn't work always. The parent window will 
     55                                // point to an anonymous function in this window. If this 
     56                                // window is destroyied the parent window will be pointing to 
     57                                // an invalid reference. 
     58 
     59                                // Evaluate the script in this window. 
     60                                eval( script ) ; 
     61 
     62                                // Point the FCKeditorAPI property of the parent window to the 
     63                                // local reference. 
     64                                parentWindow.FCKeditorAPI = window.FCKeditorAPI ; 
     65                        }, 
     66 
     67                        EditingArea_Start : function( doc, html ) 
     68                        { 
     69                                // Get the HTML for the <head>. 
     70                                var headInnerHtml = html.match( /<head>([\s\S]*)<\/head>/i )[1] ; 
     71 
     72                                if ( headInnerHtml && headInnerHtml.length > 0 ) 
     73                                { 
     74                                        // Inject the <head> HTML inside a <div>. 
     75                                        // Do that before _GetDocumentHead because WebKit moves 
     76                                        // <link css> elements to the <head> at this point. 
     77                                        var div = doc.createElement( 'div' ) ; 
     78                                        div.innerHTML = headInnerHtml ; 
     79 
     80                                        // Move the <div> nodes to <head>. 
     81                                        FCKDomTools.MoveChildren( div, _GetDocumentHead( doc ) ) ; 
     82                                } 
     83 
     84                                doc.body.innerHTML = html.match( /<body>([\s\S]*)<\/body>/i )[1] ; 
     85 
     86                                //prevent clicking on hyperlinks and navigating away 
     87                                doc.addEventListener('click', function( ev ) 
     88                                        { 
     89                                                ev.preventDefault() ; 
     90                                                ev.stopPropagation() ; 
     91                                        }, true ) ; 
     92                        }, 
     93 
     94                        Panel_Contructor : function( doc, baseLocation ) 
     95                        { 
     96                                var head = _GetDocumentHead( doc ) ; 
     97 
     98                                // Set the <base> href. 
     99                                head.appendChild( doc.createElement('base') ).href = baseLocation ; 
     100 
     101                                doc.body.style.margin   = '0px' ; 
     102                                doc.body.style.padding  = '0px' ; 
     103                        }, 
     104 
     105                        ToolbarSet_GetOutElement : function( win, outMatch ) 
     106                        { 
     107                                var toolbarTarget = win.parent ; 
     108 
     109                                var targetWindowParts = outMatch[1].split( '.' ) ; 
     110                                while ( targetWindowParts.length > 0 ) 
     111                                { 
     112                                        var part = targetWindowParts.shift() ; 
     113                                        if ( part.length > 0 ) 
     114                                                toolbarTarget = toolbarTarget[ part ] ; 
     115                                } 
     116 
     117                                toolbarTarget = toolbarTarget.document.getElementById( outMatch[2] ) ; 
     118                        }, 
     119 
     120                        ToolbarSet_InitOutFrame : function( doc ) 
     121                        { 
     122                                var head = _GetDocumentHead( doc ) ; 
     123 
     124                                head.appendChild( doc.createElement('base') ).href = window.document.location ; 
     125 
     126                                var targetWindow = doc.defaultView; 
     127 
     128                                targetWindow.adjust = function() 
     129                                { 
     130                                        targetWindow.frameElement.height = doc.body.scrollHeight; 
     131                                } ; 
     132 
     133                                targetWindow.onresize = targetWindow.adjust ; 
     134                                targetWindow.setTimeout( targetWindow.adjust, 0 ) ; 
     135 
     136                                doc.body.style.overflow = 'hidden'; 
     137                                doc.body.innerHTML = document.getElementById( 'xToolbarSpace' ).innerHTML ; 
     138                        } 
     139                } ; 
     140        })(); 
     141 
     142        /* 
     143         * ### Overrides 
     144         */ 
     145        ( function() 
     146        { 
     147                // Save references for override reuse. 
     148                var _Original_FCKPanel_Window_OnFocus   = FCKPanel_Window_OnFocus ; 
     149                var _Original_FCKPanel_Window_OnBlur    = FCKPanel_Window_OnBlur ; 
     150 
     151                FCKPanel_Window_OnFocus = function( e, panel ) 
     152                { 
     153                        // Call the original implementation. 
     154                        _Original_FCKPanel_Window_OnFocus.call( this, e, panel ) ; 
     155 
     156                        if ( panel._focusTimer ) 
     157                                clearTimeout( panel._focusTimer ) ; 
     158                } 
     159 
     160                FCKPanel_Window_OnBlur = function( e, panel ) 
     161                { 
     162                        // Delay the execution of the original function. 
     163                        panel._focusTimer = FCKTools.SetTimeout( _Original_FCKPanel_Window_OnBlur, 100, this, [ e, panel ] ) ; 
     164                } 
     165        })(); 
     166} 
  • fckeditor.js

     
    287287 
    288288        // Opera 9.50+ 
    289289        if ( window.opera && window.opera.version && parseFloat( window.opera.version() ) >= 9.5 ) 
    290                         return true ; 
     290                return true ; 
    291291 
     292        // Adobe AIR 
     293        // Checked before Safari because AIR have the WebKit rich text editor 
     294        // features from Safari 3.0.4, but the version reported is 420. 
     295        if ( sAgent.indexOf( ' adobeair/' ) != -1 ) 
     296                return ( sAgent.match( / adobeair\/(\d+)/ )[1] >= 1 ) ; // Build must be at least v1 
     297 
    292298        // Safari 3+ 
    293299        if ( sAgent.indexOf( ' applewebkit/' ) != -1 ) 
    294300                return ( sAgent.match( / applewebkit\/(\d+)/ )[1] >= 522 ) ;    // Build must be at least 522 (v3)