Ticket #7292: 7292.patch

File 7292.patch, 4.2 KB (added by kaga, 11 years ago)
  • _dev/msajax.js

     
    1010function CKEditor_TextBoxEncode(cID, inUpdatePanel) {
    1111        if (typeof CKEDITOR == 'undefined' || typeof CKEDITOR.instances[cID] == 'undefined') {
    1212                var control = document.getElementById(cID);
    13                 control.value = control.value.replace(/</g, '&lt;').replace(/>/g, '&gt;');
     13                if(control != null)
     14                        control.value = control.value.replace(/</g, '&lt;').replace(/>/g, '&gt;');
    1415        }
    1516        else {
    1617                var e = CKEDITOR.instances[cID];
  • CKEditor.NET/CKEditorControl.cs

     
    10001000                        // Sys.Application.add_load does not work on browsers != IE
    10011001                        // http://msdn.microsoft.com/en-us/library/bb386417.aspx
    10021002                        // 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,'&lt;').replace(/>/g,'&gt;');}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(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&amp;/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,'&lt;').replace(/>/g,'&gt;');}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(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&amp;/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);})();
    10041004";
    10051005                        this.RegisterStartupScript(this.GetType(), "CKEditorForNet", scriptInit, true);
    10061006                        this.RegisterStartupScript(this.GetType(), this.ClientID + @"_addControl", string.Format(@"CKEditor_Controls.push('{0}');
     
    10181018                                foreach (string item in this.config.protectedSource)
    10191019                                        proSour += @"
    10201020ckeditor.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}}});
    10221022", this.ClientID, prepareJSON(), proSour);
    10231023                        }
    10241024                        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});}});
    10261026", this.ClientID, prepareJSON());
    10271027
    10281028                        bool isInUpdatePanel = false;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy