| | |
| | | } |
| | | /*** login page ***/ |
| | | else if (rcmail.env.task == 'login') { |
| | | if (bw.ie && bw.vendver < 9) { |
| | | if (bw.ie && bw.vendver < 8) { |
| | | 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>") |
| | |
| | | // turn a group of fieldsets into tabs |
| | | $('.tabbed').each(function(idx, elem){ init_tabs(elem); }) |
| | | |
| | | $(document.body).bind('mouseup', function(e){ |
| | | var config, obj, target = e.target; |
| | | for (var id in popups) { |
| | | obj = popups[id]; |
| | | config = popupconfig[id]; |
| | | if (obj.is(':visible') |
| | | && target.id != id+'link' |
| | | && !config.toggle |
| | | && (!config.editable || !target_overlaps(target, obj.get(0))) |
| | | && (!config.sticky || !rcube_mouse_is_over(e, obj.get(0))) |
| | | ) { |
| | | var myid = id+''; |
| | | window.setTimeout(function(){ show_popupmenu(myid, false) }, 10); |
| | | // decorate select elements |
| | | if (!bw.opera) { |
| | | $('select.decorated').each(function(){ |
| | | var title = $('option', this).first().text(); |
| | | if ($('option:selected', this).val() != '') |
| | | title = $('option:selected', this).text(); |
| | | var select = $(this) |
| | | .change(function(){ |
| | | var val = $('option:selected', this).text(); |
| | | $(this).next().children().html(val); |
| | | }); |
| | | |
| | | $('<a class="menuselector dropdownselector"><span class="handle">' + title + '</span></a>') |
| | | .css('position', 'absolute') |
| | | .offset(select.position()) |
| | | .insertAfter(select) |
| | | .children().width(select.outerWidth() - 40); |
| | | |
| | | select.parent().css('position', 'relative'); |
| | | }); |
| | | } |
| | | |
| | | $(document.body) |
| | | .bind('mouseup', body_mouseup) |
| | | .bind('keyup', function(e){ |
| | | if (e.keyCode == 27) { |
| | | for (var id in popups) { |
| | | if (popups[id].is(':visible')) |
| | | show_popup(id, false); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | |
| | | $('iframe').load(function(e){ |
| | | // this = iframe |
| | | var doc = this.contentDocument ? this.contentDocument : this.contentWindow ? this.contentWindow.document : null; |
| | | $(doc).mouseup(body_mouseup); |
| | | }) |
| | | .bind('keyup', function(e){ |
| | | if (e.keyCode == 27) { |
| | | for (var id in popups) { |
| | | if (popups[id].is(':visible')) |
| | | show_popup(id, false); |
| | | } |
| | | } |
| | | }); |
| | | .contents().mouseup(body_mouseup); |
| | | |
| | | $(window).resize(function(e) { |
| | | // check target due to bugs in jquery |
| | |
| | | // http://bugs.jquery.com/ticket/9841 |
| | | if (e.target == window) resize(); |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * Handler for mouse-up events on the document body. |
| | | * This will close all open popup menus |
| | | */ |
| | | function body_mouseup(e) |
| | | { |
| | | var config, obj, target = e.target; |
| | | for (var id in popups) { |
| | | obj = popups[id]; |
| | | config = popupconfig[id]; |
| | | if (obj.is(':visible') |
| | | && target.id != id+'link' |
| | | && !config.toggle |
| | | && (!config.editable || !target_overlaps(target, obj.get(0))) |
| | | && (!config.sticky || !rcube_mouse_is_over(e, obj.get(0))) |
| | | ) { |
| | | var myid = id+''; |
| | | window.setTimeout(function(){ show_popupmenu(myid, false) }, 10); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | resizable: false, |
| | | closeOnEscape: true, |
| | | dialogClass: 'popupmessage ' + p.type, |
| | | title: null, |
| | | title: env.errortitle, |
| | | close: function() { |
| | | me.messagedialog.dialog('destroy').hide(); |
| | | }, |
| | |
| | | function toggle_preview_headers(button) |
| | | { |
| | | $('#preview-shortheaders').toggle(); |
| | | var full = $('#preview-allheaders').toggle(); |
| | | |
| | | var full = $('#preview-allheaders').toggle(), |
| | | button = $('a#previewheaderstoggle'); |
| | | |
| | | // add toggle button to full headers table |
| | | if (!full.data('mod')) { |
| | | $('<a>').attr('href', '#hide') |
| | | .addClass('iconlink remove') |
| | | .html('Hide') |
| | | .appendTo($('<td>').appendTo($('tr:first', full))) |
| | | .click(function(){ toggle_preview_headers(this);return false }); |
| | | full.data('mod', true); |
| | | } |
| | | if (full.is(':visible')) |
| | | button.attr('href', '#hide').removeClass('add').addClass('remove') |
| | | else |
| | | button.attr('href', '#details').removeClass('remove').addClass('add') |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | function init_tabs(elem, current) |
| | | { |
| | | var id = elem.id, |
| | | content = $(elem), |
| | | var content = $(elem), |
| | | id = content.get(0).id, |
| | | fs = content.children('fieldset'); |
| | | |
| | | if (!fs.length) |
| | |
| | | |
| | | if (!id) { |
| | | id = 'rcmtabcontainer'; |
| | | elem.attr('id', id); |
| | | content.attr('id', id); |
| | | } |
| | | |
| | | // first hide not selected tabs |
| | |
| | | { |
| | | var frame = $('<iframe>').attr('id', 'aboutframe') |
| | | .attr('src', rcmail.url('settings/about')) |
| | | .attr('frameborder', '0') |
| | | .appendTo(document.body); |
| | | |
| | | var h = Math.floor($(window).height() * 0.75); |
| | |
| | | |
| | | |
| | | /** |
| | | * Roundcube splitter GUI class |
| | | * Roundcube UI splitter class |
| | | * |
| | | * @constructor |
| | | */ |
| | |
| | | this.callback = p.callback; |
| | | |
| | | var me = this; |
| | | rcube_splitter._instances[this.id] = me; |
| | | |
| | | this.init = function() |
| | | { |
| | | this.p1 = $(this.p.p1); |
| | | this.p2 = $(this.p.p2); |
| | | |
| | | // check if referenced elements exist, otherwise abort |
| | | if (!this.p1.length || !this.p2.length) |
| | | return; |
| | | |
| | | // create and position the handle for this splitter |
| | | this.p1pos = this.relative ? this.p1.position() : this.p1.offset(); |
| | |
| | | this.handle.css({ left:left+'px', top:'0px' }); |
| | | } |
| | | |
| | | this.elm = this.handle.get(0); |
| | | |
| | | // listen to window resize on IE |
| | | if (bw.ie) |
| | | $(window).resize(function(e){ onResize(e) }); |
| | | $(window).resize(onResize); |
| | | |
| | | // read saved position from cookie |
| | | var cookie = bw.get_cookie(this.id); |
| | |
| | | } // end class rcube_splitter |
| | | |
| | | |
| | | // static getter for splitter instances |
| | | rcube_splitter._instances = {}; |
| | | |
| | | rcube_splitter.get_instance = function(id) |
| | | { |
| | | return rcube_splitter._instances[id]; |
| | | }; |
| | | |