thomascube
2012-01-02 7c2a9310c4104f51fcf56379dcc3511fa5bfae2d
skins/larry/ui.js
@@ -61,7 +61,6 @@
    if (rcmail.env.task == 'mail') {
      rcmail.addEventListener('menu-open', show_listoptions);
      rcmail.addEventListener('menu-save', save_listoptions);
      rcmail.addEventListener('aftertoggle-editor', function(){ window.setTimeout(function(){ layout_composeview() }, 100); });
      var dragmenu = $('#dragmessagemenu');
      if (dragmenu.length) {
@@ -76,8 +75,10 @@
      if (rcmail.env.action == 'show' || rcmail.env.action == 'preview') {
        layout_messageview();
        $("#all-headers").resizable({ handles: 's', minHeight: 50 });
      }
      else if (rcmail.env.action == 'compose') {
        rcmail.addEventListener('aftertoggle-editor', function(){ window.setTimeout(function(){ layout_composeview() }, 100); });
        rcmail.addEventListener('aftersend-attachment', show_uploadform);
        layout_composeview();
@@ -89,7 +90,7 @@
        }).css('cursor', 'pointer');
        new rcube_splitter({ id:'composesplitterv', p1:'#composeview-left', p2:'#composeview-right',
          orientation:'v', relative:true, start:248, min:150, size:12 }).init();
          orientation:'v', relative:true, start:248, min:170, size:12 }).init();
      }
      else if (rcmail.env.action == 'list' || !rcmail.env.action) {
          mailviewsplit = new rcube_splitter({ id:'mailviewsplitter', p1:'#mailview-top', p2:'#mailview-bottom',
@@ -119,7 +120,7 @@
        new rcube_splitter({ id:'folderviewsplitter', p1:'#folderslist', p2:'#folder-details',
          orientation:'v', relative:true, start:305, min:150, size:12 }).init();
      }
      else if (rcmail.env.action.indexOf('identit') >= 0) {
      else if (rcmail.env.action == 'identities') {
        new rcube_splitter({ id:'identviewsplitter', p1:'#identitieslist', p2:'#identity-details',
          orientation:'v', relative:true, start:305, min:150, size:12 }).init();
      }
@@ -133,7 +134,23 @@
        new rcube_splitter({ id:'addressviewsplitter', p1:'#addresslist', p2:'#contacts-box',
          orientation:'v', relative:true, start:296, min:220, size:12 }).init();
      }
    }
    else if (rcmail.env.task == 'login') {
      if (bw.ie && bw.vendver < 9) {
        var popup = $('<div>')
          .addClass('readtext')
          .html("Roundcube will not work well with the crappy browser ya' using. Get yourself a new internet browsing software and don't come back without!<p>Sincerly,<br/>the Roundcube Dev Team</p>")
          .appendTo(document.body)
          .dialog({
            dialogClass: 'alert',
            closeOnEscape: true,
            title: "No way, are you serious?",
            close: function() {
              popup.dialog('destroy').remove();
            },
            width: 450
          });
      }
    }
    // turn a group of fieldsets into tabs
@@ -532,6 +549,17 @@
      $dialog.dialog('close');
      return;
    }
    // add icons to clone file input field
    if (rcmail.env.action == 'compose' && !$dialog.data('extended')) {
      $('<a>')
        .addClass('iconlink add')
        .attr('href', '#add')
        .html('Add')
        .appendTo($('input[type="file"]', $dialog).parent())
        .click(add_uploadfile);
      $dialog.data('extended', true);
    }
    $dialog.dialog({
      modal: true,
@@ -543,13 +571,26 @@
        catch(e){ }  // ignore errors
        $dialog.dialog('destroy').hide();
        $('div.addline', $dialog).remove();
      },
      width: 480
    }).show();
    if (!document.all)
      $('input[type=file]', $dialog).click();
      $('input[type=file]', $dialog).first().click();
  }
  function add_uploadfile(e)
  {
    var div = $(this).parent();
    var clone = div.clone().addClass('addline').insertAfter(div);
    clone.children('.iconlink').click(add_uploadfile);
    clone.children('input').val('');
    if (!document.all)
      $('input[type=file]', clone).click();
  }
  /**
   *
@@ -746,7 +787,7 @@
      this.handle.css('top', Math.round(this.pos - this.halfsize + this.offset)+'px');
      if (bw.ie) {
        var new_height = parseInt(this.p2.parent().outerHeight(), 10) - parseInt(this.p2.css('top'), 10) - (bw.ie8 ? 2 : 0);
        this.p2.css('height') = (new_height > 0 ? new_height : 0) + 'px';
        this.p2.css('height', (new_height > 0 ? new_height : 0) + 'px');
      }
    }
    else {
@@ -761,6 +802,14 @@
    this.p2.resize();
    this.p1.resize();
    // also resize iframe covers
    if (this.drag_active) {
      $('iframe').each(function(i, elem) {
        var pos = $(this).offset();
        $('#iframe-splitter-fix-'+i).css({ top: pos.top+'px', left: pos.left+'px', width:elem.offsetWidth+'px', height: elem.offsetHeight+'px' });
      });
    }
    if (typeof this.render == 'function')
      this.render(this);
@@ -783,10 +832,12 @@
    $(document).bind('mousemove.'+this.id, onDrag).bind('mouseup.'+this.id, onDragStop);
    // enable dragging above iframes
    $('iframe').each(function() {
      $('<div class="iframe-splitter-fix"></div>')
    $('iframe').each(function(i, elem) {
      $('<div>')
        .attr('id', 'iframe-splitter-fix-'+i)
        .addClass('iframe-splitter-fix')
        .css({ background: '#fff',
          width: this.offsetWidth+'px', height: this.offsetHeight+'px',
          width: elem.offsetWidth+'px', height: elem.offsetHeight+'px',
          position: 'absolute', opacity: '0.001', zIndex: 1000
        })
        .css($(this).offset())
@@ -842,7 +893,7 @@
    me.drag_active = false;
    // remove temp divs
    $('div.iframe-splitter-fix').each(function(){ this.parentNode.removeChild(this); });
    $('div.iframe-splitter-fix').remove();
    me.set_cookie();