Ticket #2931: 2931_2.patch

File 2931_2.patch, 14.4 KB (added by Artur Formella, 15 years ago)
  • _source/core/config.js

     
    147147         * config.plugins = 'basicstyles,button,htmldataprocessor,toolbar,wysiwygarea';
    148148         */
    149149
    150         plugins : 'basicstyles,blockquote,button,clipboard,elementspath,find,flash,format,forms,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,newpage,pagebreak,pastefromword,pastetext,preview,print,removeformat,smiley,showblocks,sourcearea,table,specialchar,tab,templates,toolbar,undo,wysiwygarea',
     150        plugins : 'basicstyles,blockquote,button,clipboard,elementspath,find,flash,format,forms,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,newpage,pagebreak,pastefromword,pastetext,preview,print,removeformat,smiley,showblocks,sourcearea,table,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc',
    151151
    152152        /**
    153153         * The theme to be used to build the UI.
  • _source/lang/en.js

     
    376376                validateVSpace : 'VSpace must be a number.'
    377377        },
    378378
     379        // Speller Pages Dialog
     380        spellCheck :
     381        {
     382                toolbar                 : 'Check Spelling',
     383                title                   : 'Spell Check',
     384                notAvailable    : 'Sorry, but service is unavailable now.',
     385                errorLoading    : 'Error loading application service host: %s.',
     386                notInDic                : 'Not in dictionary',
     387                changeTo                : 'Change to',
     388                btnIgnore               : 'Ignore',
     389                btnIgnoreAll    : 'Ignore All',
     390                btnReplace              : 'Replace',
     391                btnReplaceAll   : 'Replace All',
     392                btnUndo                 : 'Undo',
     393                noSuggestions   : '- No suggestions -',
     394                progress                : 'Spell check in progress...',
     395                noMispell               : 'Spell check complete: No misspellings found',
     396                noChanges               : 'Spell check complete: No words changed',
     397                oneChange               : 'Spell check complete: One word changed',
     398                manyChanges             : 'Spell check complete: %1 words changed',
     399                ieSpellDownload : 'Spell checker not installed. Do you want to download it now?'
     400        },
     401
    379402        smiley :
    380403        {
    381404                toolbar : 'Smiley',
  • _source/plugins/toolbar/plugin.js

     
    207207[
    208208        [
    209209                'Source', '-',
    210                 'NewPage', 'Preview', 'Templates', 'Print', '-',
     210                'NewPage', 'Preview', 'Templates', 'Print', 'SpellChecker','-',
    211211                'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-',
    212212                'Undo', 'Redo', '-',
    213213                'Find', 'Replace', '-',
  • _source/plugins/wsc/dialogs/ciframe.html

     
     1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
     2<!--
     3Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
     4For licensing, see LICENSE.html or http://ckeditor.com/license
     5-->
     6<html>
     7<head>
     8        <title></title>
     9        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     10        <script type="text/javascript">
     11
     12function gup( name )
     13{
     14        name = name.replace( /[\[]/, '\\\[' ).replace( /[\]]/, '\\\]' ) ;
     15        var regexS = '[\\?&]' + name + '=([^&#]*)' ;
     16        var regex = new RegExp( regexS ) ;
     17        var results = regex.exec( window.location.href ) ;
     18
     19        if( results == null )
     20                return '' ;
     21        else
     22                return results[ 1 ] ;
     23}
     24
     25function sendData2Master()
     26{
     27        var destination = parent.parent ;
     28        try
     29        {
     30                if ( destination.XDTMaster )
     31                {
     32                        var t = destination.XDTMaster.read( [ gup( 'cmd' ), gup( 'data' ) ] ) ;
     33                        window.clearInterval( interval ) ;
     34                }
     35        }
     36        catch (e) {}
     37}
     38
     39function onLoad()
     40{
     41        interval = window.setInterval( sendData2Master, 100 );
     42}
     43
     44</script>
     45</head>
     46<body onload="onLoad()"><p></p></body>
     47</html>
  • _source/plugins/wsc/dialogs/tmpFrameset.html

     
     1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
     2<!--
     3Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
     4For licensing, see LICENSE.html or http://ckeditor.com/license
     5-->
     6<html>
     7<head>
     8        <title></title>
     9        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     10        <script type="text/javascript">
     11
     12function doLoadScript( url )
     13{
     14        if ( !url )
     15                return false ;
     16
     17        var s = document.createElement( "script" ) ;
     18        s.type = "text/javascript" ;
     19        s.src = url ;
     20        document.getElementsByTagName( "head" )[ 0 ].appendChild( s ) ;
     21
     22        return true ;
     23}
     24
     25function tryLoad ()
     26{
     27    if ( typeof( opener ) == 'undefined' || !opener )
     28        opener = parent ;
     29
     30    // get access to global parameters
     31    oParams = opener.oldFramesetPageParams ;
     32
     33    // make frameset rows string prepare
     34    sFramesetRows = ( parseInt( oParams.firstframeh, 10 ) || '30') + ",*," + ( parseInt( oParams.thirdframeh, 10 ) || '150' ) + ',0' ;
     35    document.getElementById( 'itFrameset' ).rows = sFramesetRows ;
     36
     37    // dynamic including init frames and crossdomain transport code
     38    // from config sproxy_js_frameset url
     39    var addScriptUrl = oParams.sproxy_js_frameset ;
     40    doLoadScript( addScriptUrl ) ;
     41}
     42
     43        </script>
     44</head>
     45
     46<frameset id="itFrameset" onload="tryLoad();" border="0" rows="30,*,*,0">
     47    <frame scrolling="no" framespacing="0" frameborder="0" noresize="noresize" marginheight="0" marginwidth="2" src="" name="navbar"></frame>
     48    <frame scrolling="auto" framespacing="0" frameborder="0" noresize="noresize" marginheight="0" marginwidth="0" src="" name="mid"></frame>
     49    <frame scrolling="no" framespacing="0" frameborder="0" noresize="noresize" marginheight="1" marginwidth="1" src="" name="bot"></frame>
     50    <frame scrolling="no" framespacing="0" frameborder="0" noresize="noresize" marginheight="1" marginwidth="1" src="" name="spellsuggestall"></frame>
     51</frameset>
     52</html>
  • _source/plugins/wsc/dialogs/wsc.css

     
     1/*
     2Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
     3For licensing, see LICENSE.html or http://ckeditor.com/license
     4*/
     5
     6html, body
     7{
     8        background-color: transparent;
     9        margin: 0px;
     10        padding: 0px;
     11}
     12
     13body
     14{
     15        padding: 10px;
     16}
     17
     18body, td, input, select, textarea
     19{
     20        font-size: 11px;
     21        font-family: 'Microsoft Sans Serif' , Arial, Helvetica, Verdana;
     22}
     23
     24.midtext
     25{
     26        padding:0px;
     27        margin:10px;
     28}
     29
     30.midtext p
     31{
     32        padding:0px;
     33        margin:10px;
     34}
     35
     36.Button
     37{
     38        border: #737357 1px solid;
     39        color: #3b3b1f;
     40        background-color: #c7c78f;
     41}
     42
     43.PopupTabArea
     44{
     45        color: #737357;
     46        background-color: #e3e3c7;
     47}
     48
     49.PopupTitleBorder
     50{
     51        border-bottom: #d5d59d 1px solid;
     52}
     53.PopupTabEmptyArea
     54{
     55        padding-left: 10px;
     56        border-bottom: #d5d59d 1px solid;
     57}
     58
     59.PopupTab, .PopupTabSelected
     60{
     61        border-right: #d5d59d 1px solid;
     62        border-top: #d5d59d 1px solid;
     63        border-left: #d5d59d 1px solid;
     64        padding: 3px 5px 3px 5px;
     65        color: #737357;
     66}
     67
     68.PopupTab
     69{
     70        margin-top: 1px;
     71        border-bottom: #d5d59d 1px solid;
     72        cursor: pointer;
     73        cursor: hand;
     74}
     75
     76.PopupTabSelected
     77{
     78        font-weight: bold;
     79        cursor: default;
     80        padding-top: 4px;
     81        border-bottom: #f1f1e3 1px solid;
     82        background-color: #f1f1e3;
     83}
  • _source/plugins/wsc/dialogs/wsc.js

     
     1/*
     2Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
     3For licensing, see LICENSE.html or http://ckeditor.com/license
     4*/
     5
     6CKEDITOR.dialog.add( 'checkspell', function( editor )
     7{
     8        var number = CKEDITOR.tools.getNextNumber(),
     9                iframeId = 'cke_frame_' + number,
     10                textareaId = 'cke_data_' + number,
     11                errorBoxId = 'cke_error_' + number,
     12                interval,
     13                protocol = document.location.protocol || 'http:',
     14                errorMsg = editor.lang.spellCheck.notAvailable;
     15
     16        var pasteArea = '<textarea'+
     17                        ' style="display: none"' +
     18                        ' id="' + textareaId + '"' +
     19                        ' rows="10"' +
     20                        ' cols="40">' +
     21                ' </textarea><div' +
     22                        ' id="' + errorBoxId + '"' +
     23                        ' style="display:none;color:red;font-size:16px;font-weight:bold;padding-top:160px;text-align:center;z-index:11;">' +
     24                '</div><iframe' +
     25                        ' src=""' +
     26                        ' style="width:485px;background-color:#f1f1e3;height:380px"' +
     27                        ' frameborder="0"' +
     28                        ' name="' + iframeId + '"' +
     29                        ' id="' + iframeId + '"' +
     30                        ' allowtransparency="1">' +
     31                '</iframe>';
     32
     33        var wscCoreUrl = editor.config.wsc_customLoaderScript || ( protocol +
     34                        '//loader.spellchecker.net/sproxy_fck/sproxy.php'
     35                        + '?plugin=fck2'
     36                        + '&customerid=' + editor.config.wsc_customerId
     37                        + '&cmd=script&doc=wsc&schema=22'
     38                );
     39
     40        if ( editor.config.wsc_customLoaderScript )
     41                errorMsg += '<p style="color:#000;font-size:11px;font-weight: normal;text-align:center;padding-top:10px">' +
     42                        editor.lang.spellCheck.errorLoading.replace( /%s/g, editor.config.wsc_customLoaderScript ) + '</p>';
     43
     44        function burnSpelling( dialog, errorMsg )
     45        {
     46                var i = 0;
     47                return function ()
     48                {
     49                        if ( typeof( doSpell ) == 'function' )
     50                                initAndSpell( dialog );
     51                        else if ( i++ == 180 )                                                          // Timeout: 180 * 250ms = 45s.
     52                                _cancelOnError( errorMsg );
     53                }
     54        };
     55
     56        function _cancelOnError( m )
     57        {
     58                if ( typeof( WSC_Error ) == 'undefined' )
     59                {
     60                        CKEDITOR.document.getById( iframeId ).setStyle( 'display', 'none' );
     61                        var errorBox = CKEDITOR.document.getById( errorBoxId );
     62                        errorBox.setStyle( 'display', 'block' );
     63                        errorBox.setHtml( m || editor.lang.spellCheck.notAvailable );
     64                }
     65        }
     66
     67        function initAndSpell( dialog )
     68        {
     69                //Call from window.setInteval expected at once.
     70                if ( typeof( interval ) == 'undefined' )
     71                        return null;
     72                window.clearInterval( interval );
     73
     74                // Global var is used in FCK specific core.
     75                gFCKPluginName = 'wsc';
     76
     77                var sData = editor.getData(),                                                                                   // Get the data to be checked.
     78                        LangComparer = new _SP_FCK_LangCompare(),                                                       // Language abbr standarts comparer.
     79                        pluginPath = CKEDITOR.getUrl( editor.plugins.wsc.path + 'dialogs/' ),                   // Service paths corecting/preparing.
     80                        framesetPath = pluginPath + 'tmpFrameset.html';
     81
     82                LangComparer.setDefaulLangCode( editor.config.defaultLanguage );
     83
     84                // Prepare content.
     85                CKEDITOR.document.getById( textareaId ).setValue( sData );
     86
     87                // Hide user message console (if application was loaded more then after timeout).
     88                CKEDITOR.document.getById( errorBoxId ).setStyle( 'display', 'none' );
     89                CKEDITOR.document.getById( iframeId ).setStyle( 'display', 'block' );
     90
     91                doSpell({
     92                        ctrl : textareaId,
     93                        lang : LangComparer.getSPLangCode( editor.langCode ),
     94                        winType : iframeId,             // If not defined app will run on winpopup.
     95
     96                        // Callback binding section.
     97                        onCancel : function()
     98                        {
     99                                dialog.hide();
     100                        },
     101                        onFinish : function( dT )
     102                        {
     103                                dialog.getParentEditor().setData( dT.value );
     104                                dialog.hide();
     105                        },
     106
     107                        // Some manipulations with client static pages.
     108                        staticFrame : framesetPath,
     109                        framesetPath : framesetPath,
     110                        iframePath : pluginPath + 'ciframe.html',
     111
     112                        // Styles defining.
     113                        schemaURI : pluginPath + 'wsc.css'
     114                });
     115        };
     116
     117        return {
     118                title : editor.lang.spellCheck.title,
     119                minWidth : 540,
     120                minHeight : 480,
     121                buttons : [ CKEDITOR.dialog.cancelButton ],
     122                onShow : function()
     123                {
     124                        contentArea = this.getContentElement( 'general', 'content' ).getElement();
     125                        contentArea.setHtml( pasteArea );
     126
     127                        if ( typeof( doSpell ) != 'function' )
     128                        {
     129                                // Load script.
     130                                CKEDITOR.document.getHead().append(
     131                                        CKEDITOR.document.createElement( 'script',
     132                                                {
     133                                                        attributes :
     134                                                                {
     135                                                                        type : 'text/javascript',
     136                                                                        src : wscCoreUrl
     137                                                                }
     138                                                })
     139                                );
     140                        }
     141                        interval = window.setInterval( burnSpelling( this, errorMsg ), 250 );
     142                },
     143                contents : [
     144                        {
     145                                id : 'general',
     146                                label : editor.lang.spellCheck.title,
     147                                elements : [
     148                                        {
     149                                                type : 'html',
     150                                                id : 'content',
     151                                                style : 'width:500px;height:400px',
     152                                                html : '<div></div>'
     153                                        }
     154                                ]
     155                        }
     156                ]
     157        };
     158});
     159 No newline at end of file
  • _source/plugins/wsc/plugin.js

     
     1/*
     2Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
     3For licensing, see LICENSE.html or http://ckeditor.com/license
     4*/
     5
     6/**
     7 * @file Spell checker
     8 */
     9 
     10// Register a plugin named "wsc".
     11CKEDITOR.plugins.add( 'wsc',
     12{
     13        init : function( editor, pluginPath )
     14        {
     15                var commandName = 'checkspell';
     16
     17                var command = editor.addCommand( commandName, new CKEDITOR.dialogCommand( commandName ) );
     18
     19                // SpellChecker doesn't work in Opera.
     20                if ( CKEDITOR.env.opera )
     21                        command.state = CKEDITOR.TRISTATE_DISABLED;
     22
     23                editor.ui.addButton( 'SpellChecker',
     24                        {
     25                                label : editor.lang.spellCheck.title,
     26                                command : commandName
     27                        });
     28                CKEDITOR.dialog.add( commandName, this.path + 'dialogs/wsc.js' );
     29        }
     30});
     31
     32 
     33CKEDITOR.config.wsc_customerId                          = '1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk' ;
     34CKEDITOR.config.wsc_customLoaderScript          = false;
  • _source/skins/default/toolbar.css

     
    281281        background-position: 0 -176px;
    282282}
    283283
     284.cke_skin_default a.cke_button_checkspell .cke_icon
     285{
     286        background-position: 0 -192px;
     287}
     288
    284289.cke_skin_default a.cke_button_pagebreak .cke_icon
    285290{
    286291        background-position: 0 -672px;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy