| | |
| | | dragmessagemenu: { sticky:1 }, |
| | | groupmenu: { above:1 }, |
| | | mailboxmenu: { above:1 }, |
| | | composeoptionsmenu: { editable:1, overlap:1 }, |
| | | spellmenu: { callback: spellmenu }, |
| | | // toggle: #1486823, #1486930 |
| | | 'attachment-form': { editable:1, above:1, toggle:!bw.ie&&!bw.linux }, |
| | |
| | | this.hide_header_row = hide_header_row; |
| | | |
| | | |
| | | // set minimal mode on small screens (don't wait for document.ready) |
| | | if (window.$ && document.body) { |
| | | var minmode = rcmail.get_cookie('minimalmode'); |
| | | if (parseInt(minmode) || (minmode === null && $(window).height() < 850)) { |
| | | $(document.body).addClass('minimal'); |
| | | } |
| | | |
| | | if (bw.tablet) { |
| | | $('#viewport').attr('content', "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * |
| | | */ |
| | |
| | | function init() |
| | | { |
| | | rcmail.addEventListener('message', message_displayed); |
| | | |
| | | /*** prepare minmode functions ***/ |
| | | $('#taskbar a').each(function(i,elem){ |
| | | $(elem).append('<span class="tooltip">' + $('.button-inner', this).html() + '</span>') |
| | | }); |
| | | |
| | | $('#taskbar .minmodetoggle').click(function(e){ |
| | | var ismin = $(document.body).toggleClass('minimal').hasClass('minimal'); |
| | | rcmail.set_cookie('minimalmode', ismin?1:0); |
| | | $(window).resize(); |
| | | }); |
| | | |
| | | /*** mail task ***/ |
| | | if (rcmail.env.task == 'mail') { |
| | |
| | | show_header_row(fields[f], true); |
| | | } |
| | | |
| | | $('#composeoptionstoggle').parent().click(function(){ |
| | | $('#composeoptionstoggle').toggleClass('enabled'); |
| | | $('#composeoptionstoggle').click(function(){ |
| | | $('#composeoptionstoggle').toggleClass('remove'); |
| | | $('#composeoptions').toggle(); |
| | | layout_composeview(); |
| | | return false; |
| | | }).css('cursor', 'pointer'); |
| | | |
| | | // toggle compose options if opened in new window and they were visible before |
| | | var opener_rc = rcmail.opener(); |
| | | if (opener_rc && opener_rc.env.action == 'compose' && $('#composeoptionstoggle', opener.document).hasClass('remove')) |
| | | $('#composeoptionstoggle').click(); |
| | | |
| | | new rcube_splitter({ id:'composesplitterv', p1:'#composeview-left', p2:'#composeview-right', |
| | | orientation:'v', relative:true, start:248, min:170, size:12, render:layout_composeview }).init(); |
| | |
| | | /*** 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', |
| | |
| | | |
| | | $('iframe').load(function(e){ |
| | | // this = iframe |
| | | var doc = this.contentDocument ? this.contentDocument : this.contentWindow ? this.contentWindow.document : null; |
| | | $(doc).mouseup(body_mouseup); |
| | | try { |
| | | var doc = this.contentDocument ? this.contentDocument : this.contentWindow ? this.contentWindow.document : null; |
| | | $(doc).mouseup(body_mouseup); |
| | | } |
| | | catch (e) { |
| | | // catch possible "Permission denied" error in IE |
| | | }; |
| | | }) |
| | | .contents().mouseup(body_mouseup); |
| | | |
| | |
| | | { |
| | | // show a popup dialog on errors |
| | | if (p.type == 'error' && rcmail.env.task != 'login') { |
| | | if (me.message_timer) { |
| | | window.clearTimeout(me.message_timer); |
| | | } |
| | | if (!me.messagedialog) { |
| | | me.messagedialog = $('<div>').addClass('popupdialog'); |
| | | me.messagedialog = $('<div>').addClass('popupdialog').hide(); |
| | | } |
| | | |
| | | var pos = $(p.object).offset(); |
| | | var msg = p.message, |
| | | pos = $(p.object).offset(); |
| | | pos.top -= (rcmail.env.task == 'login' ? 20 : 160); |
| | | me.messagedialog.dialog('close'); |
| | | me.messagedialog.html(p.message) |
| | | |
| | | if (me.messagedialog.is(':visible')) |
| | | msg = me.messagedialog.html() + '<p>' + p.message + '</p>'; |
| | | |
| | | me.messagedialog.html(msg) |
| | | .dialog({ |
| | | resizable: false, |
| | | closeOnEscape: true, |
| | |
| | | minHeight: 90 |
| | | }).show(); |
| | | |
| | | window.setTimeout(function(){ me.messagedialog.dialog('close'); }, Math.max(2000, p.timeout / 2)); |
| | | me.message_timer = window.setTimeout(function(){ me.messagedialog.dialog('close'); }, Math.max(2000, p.timeout / 2)); |
| | | } |
| | | } |
| | | |
| | |
| | | var body = $('#composebody'), |
| | | form = $('#compose-content'), |
| | | bottom = $('#composeview-bottom'), |
| | | w, h; |
| | | w, h, bh, ovflw, btns = 0, |
| | | minheight = 300, |
| | | |
| | | bottom.css('height', (form.height() - bottom.position().top) + 'px'); |
| | | bh = (form.height() - bottom.position().top); |
| | | ovflw = minheight - bh; |
| | | btns = ovflw > -100 ? 0 : 40; |
| | | bottom.css('height', Math.max(minheight, bh) + 'px'); |
| | | form.css('overflow', ovflw > 0 ? 'auto' : 'hidden'); |
| | | |
| | | w = body.parent().width() - 5; |
| | | h = body.parent().height() - 16; |
| | |
| | | $('#composebody_tbl').width((w+8)+'px').height('').css('margin-top', '1px'); |
| | | $('#composebody_ifr').width((w+8)+'px').height((h-40)+'px'); |
| | | $('#googie_edit_layer').height(h+'px'); |
| | | // $('#composebodycontainer')[(btns ? 'addClass' : 'removeClass')]('buttons'); |
| | | // $('#composeformbuttons')[(btns ? 'show' : 'hide')](); |
| | | |
| | | var abooks = $('#directorylist'); |
| | | $('#compose-contacts .scroller').css('top', abooks.position().top + abooks.outerHeight()); |
| | |
| | | $('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() { |
| | |
| | | |
| | | 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); |
| | | } |
| | | |
| | | |
| | |
| | | }); |
| | | } |
| | | |
| | | 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() |
| | | { |
| | |
| | | $dialog.dialog('close'); |
| | | return; |
| | | } |
| | | |
| | | |
| | | // add icons to clone file input field |
| | | if (rcmail.env.action == 'compose' && !$dialog.data('extended')) { |
| | | $('<a>') |