Aleksander Machniak
2013-07-01 a45f9b7bf58475ccc812e819f159638403c00419
skins/larry/ui.js
@@ -19,7 +19,7 @@
    searchmenu:         { editable:1, callback:searchmenu },
    attachmentmenu:     { },
    listoptions:        { editable:1 },
    dragmessagemenu:    { sticky:1 },
    dragmenu:           { sticky:1 },
    groupmenu:          { above:1 },
    mailboxmenu:        { above:1 },
    spellmenu:          { callback: spellmenu },
@@ -90,8 +90,8 @@
      var dragmenu = $('#dragmessagemenu');
      if (dragmenu.length) {
        rcmail.gui_object('message_dragmenu', 'dragmessagemenu');
        popups.dragmessagemenu = dragmenu;
        rcmail.gui_object('dragmenu', 'dragmessagemenu');
        popups.dragmenu = dragmenu;
      }
      if (rcmail.env.action == 'show' || rcmail.env.action == 'preview') {
@@ -152,6 +152,11 @@
        rcmail.addEventListener('setquota', update_quota);
        rcmail.addEventListener('enable-command', enable_command);
        rcmail.addEventListener('afterimport-messages', show_uploadform);
      }
      else if (rcmail.env.action == 'get') {
        new rcube_splitter({ id:'mailpartsplitterv', p1:'#messagepartheader', p2:'#messagepartcontainer',
          orientation:'v', relative:true, start:226, min:150, size:12}).init();
      }
      if ($('#mailview-left').length) {
@@ -190,6 +195,8 @@
    /***  addressbook task  ***/
    else if (rcmail.env.task == 'addressbook') {
      rcmail.addEventListener('afterupload-photo', show_uploadform);
      rcmail.addEventListener('beforepushgroup', push_contactgroup);
      rcmail.addEventListener('beforepopgroup', pop_contactgroup);
      if (rcmail.env.action == '') {
        new rcube_splitter({ id:'addressviewsplitterd', p1:'#addressview-left', p2:'#addressview-right',
@@ -199,12 +206,12 @@
        new rcube_scroller('#directorylist-content', '#directorylist-header', '#directorylist-footer');
      }
    }
    // set min-width to show all toolbar buttons
    var screen = $('.minwidth');
    if (screen.length) {
      screen.css('min-width', $('.toolbar').width() + $('#quicksearchbar').parent().width() + 20);
      var dragmenu = $('#dragcontactmenu');
      if (dragmenu.length) {
        rcmail.gui_object('dragmenu', 'dragcontactmenu');
        popups.dragmenu = dragmenu;
      }
    }
    // turn a group of fieldsets into tabs
@@ -218,6 +225,7 @@
      }
      var select = $(this),
        parent = select.parent(),
        height = Math.max(select.height(), 26) - 2,
        width = select.width() - 22,
        title = $('option', this).first().text();
@@ -232,19 +240,22 @@
      overlay.children().width(width).height(height).css('line-height', (height - 1) + 'px');
      select.change(function() {
          var val = $('option:selected', this).text();
          $(this).next().children().html(val);
        });
      var parent = select.parent();
      if (parent.css('position') != 'absolute')
        parent.css('position', 'relative');
      // re-set original select width to fix click action and options width in some browsers
      if (!bw.mz)
        select.width(overlay.width());
      select.width(overlay.width())
        .change(function() {
          var val = $('option:selected', this).text();
          $(this).next().children().text(val);
        });
    });
    // set min-width to show all toolbar buttons
    var screen = $('body > div.minwidth');
    if (screen.length) {
      screen.css('min-width', $('.toolbar').width() + $('#quicksearchbar').width() + $('#searchfilter').width() + 30);
    }
    $(document.body)
      .bind('mouseup', body_mouseup)
@@ -740,8 +751,6 @@
    $('input[name="sort_col"][value="'+rcmail.env.sort_col+'"]').prop('checked', true);
    $('input[name="sort_ord"][value="DESC"]').prop('checked', rcmail.env.sort_order == 'DESC');
    $('input[name="sort_ord"][value="ASC"]').prop('checked', rcmail.env.sort_order != 'DESC');
    $('input[name="view"][value="thread"]').prop('checked', rcmail.env.threading ? true : false);
    $('input[name="view"][value="list"]').prop('checked', rcmail.env.threading ? false : true);
    // set checkboxes
    $('input[name="list_col[]"]').each(function() {
@@ -756,7 +765,8 @@
      close: function() {
        $dialog.dialog('destroy').hide();
      },
      width: 650
      minWidth: 500,
      width: $dialog.width()+25
    }).show();
  }
@@ -770,11 +780,10 @@
    var sort = $('input[name="sort_col"]:checked').val(),
      ord = $('input[name="sort_ord"]:checked').val(),
      thread = $('input[name="view"]:checked').val(),
      cols = $('input[name="list_col[]"]:checked')
        .map(function(){ return this.value; }).get();
    rcmail.set_list_options(cols, sort, ord, thread == 'thread' ? 1 : 0);
    rcmail.set_list_options(cols, sort, ord, rcmail.env.threading);
  }
@@ -826,6 +835,35 @@
    });
  }
  function push_contactgroup(p)
  {
    // lets the contacts list swipe to the left, nice!
    var table = $('#contacts-table'),
      scroller = table.parent().css('overflow', 'hidden');
    table.clone()
      .css({ position:'absolute', top:'0', left:'0', width:table.width()+'px', 'z-index':10 })
      .appendTo(scroller)
      .animate({ left: -(table.width()+5) + 'px' }, 300, 'swing', function(){
        $(this).remove();
        scroller.css('overflow', 'auto')
      });
  }
  function pop_contactgroup(p)
  {
    // lets the contacts list swipe to the left, nice!
    var table = $('#contacts-table'),
      scroller = table.parent().css('overflow', 'hidden'),
      clone = table.clone().appendTo(scroller);
      table.css({ position:'absolute', top:'0', left:-(table.width()+5) + 'px', width:table.width()+'px', height:table.height()+'px', 'z-index':10 })
        .animate({ left:'0' }, 300, 'linear', function(){
        clone.remove();
        $(this).css({ position:'relative', left:'0', width:'100%', height:'auto', 'z-index':1 });
        scroller.css('overflow', 'auto')
      });
  }
  function show_uploadform()
  {
@@ -836,7 +874,7 @@
      $dialog.dialog('close');
      return;
    }
    // add icons to clone file input field
    if (rcmail.env.action == 'compose' && !$dialog.data('extended')) {
      $('<a>')