svncommit
2006-09-13 a0109c4933e0bfb5ed9dbcf94f932991ca689542
program/js/app.js
@@ -2019,7 +2019,7 @@
      }
    // check for empty body
    if (input_message.value=='')
    if ((input_message.value=='')&&(tinyMCE.getContent()==''))
      {
      if (!confirm(this.get_label('nobodywarning')))
        {
@@ -2079,15 +2079,18 @@
    var id = obj.options[obj.selectedIndex].value;
    var input_message = rcube_find_object('_message');
    var message = input_message ? input_message.value : '';
    var is_html = (rcube_find_object('_is_html').value == '1');
    var sig, p;
    if (!this.env.identity)
      this.env.identity = id
    if (!is_html)
      {
    // remove the 'old' signature
    if (this.env.identity && this.env.signatures && this.env.signatures[this.env.identity])
      {
      sig = this.env.signatures[this.env.identity];
        sig = this.env.signatures[this.env.identity]['text'];
      if (sig.indexOf('--')!=0)
        sig = '--\n'+sig;
@@ -2099,10 +2102,39 @@
    // add the new signature string
    if (this.env.signatures && this.env.signatures[id])
      {
      sig = this.env.signatures[id];
        sig = this.env.signatures[id]['text'];
      if (sig.indexOf('--')!=0)
        sig = '--\n'+sig;
      message += '\n'+sig;
        }
      }
    else
      {
        var eid = tinyMCE.getEditorId('_message');
        // editor is a TinyMCE_Control object
        var editor = tinyMCE.getInstanceById(eid);
        var msgDoc = editor.getDoc();
        var msgBody = msgDoc.body;
        if (this.env.signatures && this.env.signatures[id])
          {
          // Append the signature as a span within the body
          var sigElem = msgDoc.getElementById("_rc_sig");
          if (!sigElem)
            {
            sigElem = msgDoc.createElement("span");
            sigElem.setAttribute("id", "_rc_sig");
            msgBody.appendChild(sigElem);
            }
          if (this.env.signatures[id]['is_html'])
            {
            sigElem.innerHTML = this.env.signatures[id]['text'];
            }
          else
            {
            sigElem.innerHTML = '<pre>' + this.env.signatures[id]['text'] + '</pre>';
            }
          }
      }
    if (input_message)
@@ -3431,6 +3463,18 @@
    };
  this.toggle_editor = function(checkbox, textElementName)
    {
    var ischecked = checkbox.checked;
    if (ischecked)
      {
        tinyMCE.execCommand('mceAddControl', true, textElementName);
      }
    else
      {
        tinyMCE.execCommand('mceRemoveControl', true, textElementName);
      }
    }
  /********************************************************/
  /*********          drag & drop methods         *********/
@@ -3820,7 +3864,7 @@
      }
    }
  // sedn GET request
  // send GET request
  this.GET = function(url)
    {
    this.build();
@@ -3841,9 +3885,28 @@
    };
  this.POST = function(url, a_param)
  this.POST = function(url, body, contentType)
    {
    // not implemented yet
    // default value for contentType if not provided
    contentType = typeof(contentType) != 'undefined' ?
       contentType : 'application/x-www-form-urlencoded';
    this.build();
    if (!this.xmlhttp)
    {
       this.onerror(this);
       return false;
    }
    var ref=this;
    this.url = url;
    this.busy = true;
    this.xmlhttp.onreadystatechange = function() { ref.xmlhttp_onreadystatechange(); };
    this.xmlhttp.open('POST', url, true);
    this.xmlhttp.setRequestHeader('Content-Type', contentType);
    this.xmlhttp.send(body);
    };