Ticket #7851: 7851.patch

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

     
    10351035                        this.RegisterStartupScript(this.GetType(), this.ClientID + @"_addControl", string.Format(@"CKEditor_Controls.push('{0}');
    10361036", this.ClientID), true);
    10371037                        string script = string.Empty;
     1038                        string doPostBackScript = string.Empty;
     1039                        if (this.AutoPostBack) doPostBackScript = string.Format(@"ckeditor.on('blur', function() {{if(this.checkDirty()){{javascript:setTimeout('__doPostBack(\'{0}\',\'\')',0); }}}});", this.ClientID);
    10381040                        if (this.config.CKEditorEventHandler != null)
    10391041                                foreach (object[] item in this.config.CKEditorEventHandler)
    10401042                                {
     
    10471049                                foreach (string item in this.config.protectedSource)
    10481050                                        proSour += @"
    10491051ckeditor.config.protectedSource.push( " + item + " );";
    1050                                 script += string.Format(@"CKEditor_Init.push(function(){{if(typeof CKEDITOR.instances['{0}']!='undefined' || !document.getElementById('{0}')) return;var ckeditor = CKEDITOR.replace('{0}',{1}); {2}}});
    1051 ", this.ClientID, prepareJSON(), proSour);
     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} {3}}});
     1053", this.ClientID, prepareJSON(), proSour, doPostBackScript);
    10521054                        }
    10531055                        else
    1054                                 script += string.Format(@"CKEditor_Init.push(function(){{if(typeof CKEDITOR.instances['{0}']!='undefined' || !document.getElementById('{0}')) return;CKEDITOR.replace('{0}',{1});}});
    1055 ", this.ClientID, prepareJSON());
    1056 
     1056                                script += string.Format(@"CKEditor_Init.push(function(){{if(typeof CKEDITOR.instances['{0}']!='undefined' || !document.getElementById('{0}')) return;var ckeditor = CKEDITOR.replace('{0}',{1}); {2}}});
     1057", this.ClientID, prepareJSON(), doPostBackScript);
    10571058                        bool isInUpdatePanel = false;
    10581059                        Control con = this.Parent;
    10591060                        if (updatePanel != null)
     
    10681069                                }
    10691070                        this.RegisterOnSubmitStatement(this.GetType(), "aspintegrator_Postback" + this.ClientID, string.Format("CKEditor_TextBoxEncode('{0}', {1}); ", this.ClientID, isInUpdatePanel ? 1 : 0));
    10701071                        this.RegisterStartupScript(this.GetType(), "aspintegratorInitial_" + this.ClientID, script, true);
     1072                        this.RegisterStartupScript(this.GetType(), "aspintegratorAutoPostBack_" + this.ClientID, script, true);
    10711073                }
    10721074
    10731075                #endregion
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy