Ticket #7851: 7851_v2.patch
File 7851_v2.patch, 2.4 KB (added by , 12 years ago) |
---|
-
CKEditorControl.cs
1028 1028 this.RegisterStartupScript(this.GetType(), "CKEDITOR_BASEPATH", string.Format("window.CKEDITOR_BASEPATH = '{0}/';\n", (this.CKEditorJSFile.StartsWith("~") ? this.ResolveUrl(this.BasePath) : this.BasePath)), true); 1029 1029 this.RegisterStartupScript(this.GetType(), "ckeditor", "<script src=\"" + (this.CKEditorJSFile.StartsWith("~") ? this.ResolveUrl(this.CKEditorJSFile) : this.CKEditorJSFile) + timestamp + "\" type=\"text/javascript\"></script>", false); 1030 1030 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 1032 1034 // Sys.Application.add_load does not work on browsers != IE 1033 1035 // http://msdn.microsoft.com/en-us/library/bb386417.aspx 1034 1036 // Check _dev/msajax.js for an uncompressed version (available in CKEditor.Net downloaded from SVN). … … 1049 1051 foreach (string item in this.config.protectedSource) 1050 1052 proSour += @" 1051 1053 ckeditor.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); 1054 1056 } 1055 1057 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); 1058 1060 1059 1061 bool isInUpdatePanel = false; 1060 1062 Control con = this.Parent;