| | |
| | | /** |
| | | * Roundcube functions for default skin interface |
| | | * |
| | | * Copyright (c) 2011, The Roundcube Dev Team |
| | | * Copyright (c) 2013, The Roundcube Dev Team |
| | | * |
| | | * The contents are subject to the Creative Commons Attribution-ShareAlike |
| | | * License. It is allowed to copy, distribute, transmit and to adapt the work |
| | |
| | | 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') { |
| | |
| | | }).css('cursor', 'pointer'); |
| | | |
| | | // toggle compose options if opened in new window and they were visible before |
| | | if (window.opener && opener.rcmail && opener.rcmail.env.action == 'compose' && $('#composeoptionstoggle', opener.document).hasClass('remove')) |
| | | 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', |
| | |
| | | |
| | | $('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); |
| | | |
| | |
| | | $('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); |
| | | } |
| | | |
| | | |
| | |
| | | this.delay = 500; |
| | | |
| | | this.top |
| | | .mouseenter(function() { ref.ts = window.setTimeout(function() { ref.scroll('down'); }, ref.delay); }) |
| | | .mouseenter(function() { if (rcmail.drag_active) ref.ts = window.setTimeout(function() { ref.scroll('down'); }, ref.delay); }) |
| | | .mouseout(function() { if (ref.ts) window.clearTimeout(ref.ts); }); |
| | | |
| | | this.bottom |
| | | .mouseenter(function() { ref.ts = window.setTimeout(function() { ref.scroll('up'); }, ref.delay); }) |
| | | .mouseenter(function() { if (rcmail.drag_active) ref.ts = window.setTimeout(function() { ref.scroll('up'); }, ref.delay); }) |
| | | .mouseout(function() { if (ref.ts) window.clearTimeout(ref.ts); }); |
| | | |
| | | this.scroll = function(dir) |