Ticket #7292: 7292.patch
File 7292.patch, 4.2 KB (added by , 13 years ago) |
---|
-
_dev/msajax.js
10 10 function CKEditor_TextBoxEncode(cID, inUpdatePanel) { 11 11 if (typeof CKEDITOR == 'undefined' || typeof CKEDITOR.instances[cID] == 'undefined') { 12 12 var control = document.getElementById(cID); 13 control.value = control.value.replace(/</g, '<').replace(/>/g, '>'); 13 if(control != null) 14 control.value = control.value.replace(/</g, '<').replace(/>/g, '>'); 14 15 } 15 16 else { 16 17 var e = CKEDITOR.instances[cID]; -
CKEditor.NET/CKEditorControl.cs
1000 1000 // Sys.Application.add_load does not work on browsers != IE 1001 1001 // http://msdn.microsoft.com/en-us/library/bb386417.aspx 1002 1002 // Check _dev/msajax.js for an uncompressed version (available in CKEditor.Net downloaded from SVN). 1003 scriptInit += @"var CKEditor_Controls=[],CKEditor_Init=[];function CKEditor_TextBoxEncode(d,e){if(typeof CKEDITOR=='undefined'||typeof CKEDITOR.instances[d]=='undefined'){var f=document.getElementById(d); f.value=f.value.replace(/</g,'<').replace(/>/g,'>');}else{var g=CKEDITOR.instances[d];if(e)g.destroy();else g.updateElement();}};(function(){var d=function(){var e=CKEditor_Controls,f=CKEditor_Init,g=window.pageLoad,h=function(){for(var i=e.length;i--;){var j=document.getElementById(e[i]);if(j&&j.value&&(j.value.indexOf('<')==-1||j.value.indexOf('>')==-1))j.value=j.value.replace(/</g,'<').replace(/>/g,'>').replace(/&/g,'&');}if(typeof CKEDITOR!='undefined')for(var i=0;i<f.length;i++)f[i].call(this);};window.pageLoad=function(i,j){if(j.get_isPartialLoad())setTimeout(h,0);if(g&&typeof g=='function')g.call(this,i,j);};setTimeout(h,0);};if(window.addEventListener)window.addEventListener('load',d,false);else if(window.attachEvent)window.attachEvent('onload',d);})();1003 scriptInit += @"var CKEditor_Controls=[],CKEditor_Init=[];function CKEditor_TextBoxEncode(d,e){if(typeof CKEDITOR=='undefined'||typeof CKEDITOR.instances[d]=='undefined'){var f=document.getElementById(d); if(f!=null) f.value=f.value.replace(/</g,'<').replace(/>/g,'>');}else{var g=CKEDITOR.instances[d];if(e)g.destroy();else g.updateElement();}};(function(){var d=function(){var e=CKEditor_Controls,f=CKEditor_Init,g=window.pageLoad,h=function(){for(var i=e.length;i--;){var j=document.getElementById(e[i]);if(j&&j.value&&(j.value.indexOf('<')==-1||j.value.indexOf('>')==-1))j.value=j.value.replace(/</g,'<').replace(/>/g,'>').replace(/&/g,'&');}if(typeof CKEDITOR!='undefined')for(var i=0;i<f.length;i++)f[i].call(this);};window.pageLoad=function(i,j){if(j.get_isPartialLoad())setTimeout(h,0);if(g&&typeof g=='function')g.call(this,i,j);};setTimeout(h,0);};if(window.addEventListener)window.addEventListener('load',d,false);else if(window.attachEvent)window.attachEvent('onload',d);})(); 1004 1004 "; 1005 1005 this.RegisterStartupScript(this.GetType(), "CKEditorForNet", scriptInit, true); 1006 1006 this.RegisterStartupScript(this.GetType(), this.ClientID + @"_addControl", string.Format(@"CKEditor_Controls.push('{0}'); … … 1018 1018 foreach (string item in this.config.protectedSource) 1019 1019 proSour += @" 1020 1020 ckeditor.config.protectedSource.push( " + item + " );"; 1021 script += string.Format(@"CKEditor_Init.push(function(){{if(typeof CKEDITOR.instances['{0}']!='undefined' ) return;var ckeditor = CKEDITOR.replace('{0}',{1}); {2}}});1021 script += string.Format(@"CKEditor_Init.push(function(){{if(typeof CKEDITOR.instances['{0}']!='undefined' || document.getElementById('{0}') == null) return;var ckeditor = CKEDITOR.replace('{0}',{1}); {2}}}); 1022 1022 ", this.ClientID, prepareJSON(), proSour); 1023 1023 } 1024 1024 else 1025 script += string.Format(@"CKEditor_Init.push(function(){{if(typeof CKEDITOR.instances['{0}']!='undefined' ) return;CKEDITOR.replace('{0}',{1});}});1025 script += string.Format(@"CKEditor_Init.push(function(){{if(typeof CKEDITOR.instances['{0}']!='undefined' || document.getElementById('{0}') == null) return;CKEDITOR.replace('{0}',{1});}}); 1026 1026 ", this.ClientID, prepareJSON()); 1027 1027 1028 1028 bool isInUpdatePanel = false;