Ticket #1485304: ie_html_signature_no_call_init.patch

File ie_html_signature_no_call_init.patch, 2.6 kB (added by tensor1982, 4 months ago)

tested without call_init() on IE 7, Opera 9.52 and FF 3.0.1

  • program/js/editor.js

     
    3434    content_css : skin_path + "/editor_content.css", 
    3535    external_image_list_url : "program/js/editor_images.js", 
    3636    spellchecker_languages : (rcmail.env.spellcheck_langs ? rcmail.env.spellcheck_langs : "Dansk=da,Deutsch=de,+English=en,Espanol=es,Francais=fr,Italiano=it,Nederlands=nl,Polski=pl,Portugues=pt,Suomi=fi,Svenska=sv"), 
    37     rc_client: rcube_webmail_client 
     37    rc_client: rcube_webmail_client, 
     38    init_instance_callback : "rcmail_editor_callback" 
    3839  }); 
    3940} 
    4041 
     42// react to real individual tinyMCE editor init 
     43function rcmail_editor_callback(editor) 
     44{ 
     45   if (editor.editorId == 'compose-body'){ 
     46        var input_from = rcube_find_object('_from'); 
     47       if (input_from && input_from.type=='select-one') 
     48           rcmail.change_identity(input_from); 
     49   } 
     50} 
     51 
    4152// Toggle between the HTML and Plain Text editors 
    4253 
    4354function rcmail_toggle_editor(toggler) 
  • program/js/app.js

     
    443443      this.init_address_input_events(input_bcc); 
    444444 
    445445    // add signature according to selected identity 
    446     if (input_from && input_from.type=='select-one') 
     446    // if we have HTML editor, signature is added in callback 
     447    if (input_from && input_from.type=='select-one' 
     448          && rcube_find_object('_is_html').value != '1') 
    447449      this.change_identity(input_from); 
    448450 
    449451    if (input_to && input_to.value=='') 
     
    41774179  this.reset(); 
    41784180 
    41794181  }  // end class rcube_http_request 
    4180  
    4181  
    4182 // helper function to call the init method with a delay 
    4183 function call_init(o) 
    4184   { 
    4185     window.setTimeout('if (window[\''+o+'\'] && window[\''+o+'\'].init) { '+o+'.init(); }', 
    4186                       bw.win ? 500 : 200); 
    4187   } 
    4188  
  • program/include/rcube_template.php

     
    6565        $javascript = 'var '.JS_OBJECT_NAME.' = new rcube_webmail();'; 
    6666 
    6767        // don't wait for page onload. Call init at the bottom of the page (delayed) 
    68         $javascript_foot = "if (window.call_init)\n call_init('".JS_OBJECT_NAME."');"; 
     68        $javascript_foot = JS_OBJECT_NAME . ".init();"; 
    6969 
    7070        $this->add_script($javascript, 'head_top'); 
    7171        $this->add_script($javascript_foot, 'foot');