Ticket #7851: 7851_v2.patch

File 7851_v2.patch, 2.4 KB (added by kaga, 12 years ago)
  • CKEditorControl.cs

     
    10281028                        this.RegisterStartupScript(this.GetType(), "CKEDITOR_BASEPATH", string.Format("window.CKEDITOR_BASEPATH = '{0}/';\n", (this.CKEditorJSFile.StartsWith("~") ? this.ResolveUrl(this.BasePath) : this.BasePath)), true);
    10291029                        this.RegisterStartupScript(this.GetType(), "ckeditor", "<script src=\"" + (this.CKEditorJSFile.StartsWith("~") ? this.ResolveUrl(this.CKEditorJSFile) : this.CKEditorJSFile) + timestamp + "\" type=\"text/javascript\"></script>", false);
    10301030                        string scriptInit = string.Empty;
    1031 
     1031                        string doPostBackScript = string.Empty;
     1032                        if (this.AutoPostBack) doPostBackScript = string.Format(@"CKEDITOR.instances['{0}'].on('blur', function() {{if(this.checkDirty()){{javascript:setTimeout('__doPostBack(\'{0}\',\'\')',0); }}}});", this.ClientID);
     1033                       
    10321034                        // Sys.Application.add_load does not work on browsers != IE
    10331035                        // http://msdn.microsoft.com/en-us/library/bb386417.aspx
    10341036                        // Check _dev/msajax.js for an uncompressed version (available in CKEditor.Net downloaded from SVN).
     
    10491051                                foreach (string item in this.config.protectedSource)
    10501052                                        proSour += @"
    10511053ckeditor.config.protectedSource.push( " + item + " );";
    1052                                 script += string.Format(@"CKEditor_Init.push(function(){{if(typeof CKEDITOR.instances['{0}']!='undefined' || !document.getElementById('{0}')) return;var ckeditor = CKEDITOR.replace('{0}',{1}); {2}}});
    1053 ", this.ClientID, prepareJSON(), proSour);
     1054                                script += string.Format(@"CKEditor_Init.push(function(){{if(typeof CKEDITOR.instances['{0}']!='undefined' || !document.getElementById('{0}')) return;var ckeditor = CKEDITOR.replace('{0}',{1}); {2} {3}}});
     1055", this.ClientID, prepareJSON(), proSour, doPostBackScript);
    10541056                        }
    10551057                        else
    1056                                 script += string.Format(@"CKEditor_Init.push(function(){{if(typeof CKEDITOR.instances['{0}']!='undefined' || !document.getElementById('{0}')) return;CKEDITOR.replace('{0}',{1});}});
    1057 ", this.ClientID, prepareJSON());
     1058                                script += string.Format(@"CKEditor_Init.push(function(){{if(typeof CKEDITOR.instances['{0}']!='undefined' || !document.getElementById('{0}')) return;CKEDITOR.replace('{0}',{1}); {2}}});
     1059", this.ClientID, prepareJSON(), doPostBackScript);
    10581060
    10591061                        bool isInUpdatePanel = false;
    10601062                        Control con = this.Parent;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy