JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.6.1
[ckeditor.git] / _source / plugins / wsc / dialogs / wsc.js
index fbc2f77..047d23a 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -23,7 +23,7 @@ CKEDITOR.dialog.add( 'checkspell', function( editor )
                        ' style="display:none;color:red;font-size:16px;font-weight:bold;padding-top:160px;text-align:center;z-index:11;">' +\r
                '</div><iframe' +\r
                        ' src=""' +\r
-                       ' style="width:485px;background-color:#f1f1e3;height:380px"' +\r
+                       ' style="width:100%;background-color:#f1f1e3;"' +\r
                        ' frameborder="0"' +\r
                        ' name="' + iframeId + '"' +\r
                        ' id="' + iframeId + '"' +\r
@@ -31,7 +31,7 @@ CKEDITOR.dialog.add( 'checkspell', function( editor )
                '</iframe>';\r
 \r
        var wscCoreUrl = editor.config.wsc_customLoaderScript || ( protocol +\r
-                       '//loader.spellchecker.net/sproxy_fck/sproxy.php'\r
+                       '//loader.webspellchecker.net/sproxy_fck/sproxy.php'\r
                        + '?plugin=fck2'\r
                        + '&customerid=' + editor.config.wsc_customerId\r
                        + '&cmd=script&doc=wsc&schema=22'\r
@@ -84,7 +84,9 @@ CKEDITOR.dialog.add( 'checkspell', function( editor )
 \r
                window.doSpell({\r
                        ctrl : textareaId,\r
-                       lang : LangComparer.getSPLangCode( editor.langCode ),\r
+\r
+                       lang : editor.config.wsc_lang || LangComparer.getSPLangCode(editor.langCode ),\r
+                       intLang: editor.config.wsc_uiLang || LangComparer.getSPLangCode(editor.langCode ),\r
                        winType : iframeId,             // If not defined app will run on winpopup.\r
 \r
                        // Callback binding section.\r
@@ -105,7 +107,12 @@ CKEDITOR.dialog.add( 'checkspell', function( editor )
                        iframePath : pluginPath + 'ciframe.html',\r
 \r
                        // Styles defining.\r
-                       schemaURI : pluginPath + 'wsc.css'\r
+                       schemaURI : pluginPath + 'wsc.css',\r
+\r
+                       userDictionaryName: editor.config.wsc_userDictionaryName,\r
+                       customDictionaryName: editor.config.wsc_customDictionaryIds && editor.config.wsc_customDictionaryIds.split(","),\r
+                       domainName: editor.config.wsc_domainName\r
+\r
                });\r
 \r
                // Hide user message console (if application was loaded more then after timeout).\r
@@ -114,7 +121,7 @@ CKEDITOR.dialog.add( 'checkspell', function( editor )
        }\r
 \r
        return {\r
-               title : editor.lang.spellCheck.title,\r
+               title : editor.config.wsc_dialogTitle || editor.lang.spellCheck.title,\r
                minWidth : 485,\r
                minHeight : 380,\r
                buttons : [ CKEDITOR.dialog.cancelButton ],\r
@@ -122,6 +129,7 @@ CKEDITOR.dialog.add( 'checkspell', function( editor )
                {\r
                        var contentArea = this.getContentElement( 'general', 'content' ).getElement();\r
                        contentArea.setHtml( pasteArea );\r
+                       contentArea.getChild( 2 ).setStyle( 'height', this._.contentSize.height + 'px' );\r
 \r
                        if ( typeof( window.doSpell ) != 'function' )\r
                        {\r
@@ -153,17 +161,32 @@ CKEDITOR.dialog.add( 'checkspell', function( editor )
                contents : [\r
                        {\r
                                id : 'general',\r
-                               label : editor.lang.spellCheck.title,\r
+                               label : editor.config.wsc_dialogTitle || editor.lang.spellCheck.title,\r
                                padding : 0,\r
                                elements : [\r
                                        {\r
                                                type : 'html',\r
                                                id : 'content',\r
-                                               style : 'width:485;height:380px',\r
-                                               html : '<div></div>'\r
+                                               html : ''\r
                                        }\r
                                ]\r
                        }\r
                ]\r
        };\r
 });\r
+\r
+// Expand the spell-check frame when dialog resized. (#6829)\r
+CKEDITOR.dialog.on( 'resize', function( evt )\r
+{\r
+       var data = evt.data,\r
+               dialog = data.dialog;\r
+\r
+       if ( dialog._.name == 'checkspell' )\r
+       {\r
+               var content = dialog.getContentElement( 'general', 'content' ).getElement(),\r
+                       iframe = content && content.getChild( 2 );\r
+\r
+               iframe && iframe.setSize( 'height', data.height );\r
+               iframe && iframe.setSize( 'width', data.width );\r
+       }\r
+});\r