| | |
| | | this.update_quota = update_quota; |
| | | this.get_pref = get_pref; |
| | | this.save_pref = save_pref; |
| | | this.folder_search_init = folder_search_init; |
| | | |
| | | |
| | | // set minimal mode on small screens (don't wait for document.ready) |
| | |
| | | function get_pref(key) |
| | | { |
| | | if (!prefs) { |
| | | prefs = window.localStorage ? rcmail.local_storage_get_item('prefs.larry', {}) : {}; |
| | | prefs = rcmail.local_storage_get_item('prefs.larry', {}); |
| | | } |
| | | |
| | | // fall-back to cookies |
| | |
| | | if (cookie != null) { |
| | | prefs[key] = cookie; |
| | | |
| | | // copy value to local storage and remove cookie |
| | | if (window.localStorage) { |
| | | rcmail.local_storage_set_item('prefs.larry', prefs); |
| | | // copy value to local storage and remove cookie (if localStorage is supported) |
| | | if (rcmail.local_storage_set_item('prefs.larry', prefs)) { |
| | | rcmail.set_cookie(key, cookie, new Date()); // expire cookie |
| | | } |
| | | } |
| | |
| | | { |
| | | prefs[key] = val; |
| | | |
| | | // write prefs to local storage |
| | | if (window.localStorage) { |
| | | rcmail.local_storage_set_item('prefs.larry', prefs); |
| | | } |
| | | else { |
| | | // write prefs to local storage (if supported) |
| | | if (!rcmail.local_storage_set_item('prefs.larry', prefs)) { |
| | | // store value in cookie |
| | | var exp = new Date(); |
| | | exp.setYear(exp.getFullYear() + 1); |
| | |
| | | orientation:'v', relative:true, start:266, min:180, size:12 }).init(); |
| | | |
| | | rcmail.addEventListener('setquota', update_quota); |
| | | |
| | | folder_search_init($('#folderslist')); |
| | | } |
| | | else if (rcmail.env.action == 'identities') { |
| | | new rcube_splitter({ id:'identviewsplitter', p1:'#identitieslist', p2:'#identity-details', |
| | |
| | | if (me.message_timer) { |
| | | window.clearTimeout(me.message_timer); |
| | | } |
| | | |
| | | if (!me.messagedialog) { |
| | | me.messagedialog = $('<div>').addClass('popupdialog').hide(); |
| | | } |
| | |
| | | me.messagedialog.is(':visible') && me.messagedialog.dialog('destroy').hide(); |
| | | }; |
| | | |
| | | if (me.messagedialog.is(':visible')) |
| | | if (me.messagedialog.is(':visible') && me.messagedialog.text() != msg) |
| | | msg = me.messagedialog.html() + '<p>' + p.message + '</p>'; |
| | | |
| | | me.messagedialog.html(msg) |
| | |
| | | |
| | | $('#composebodycontainer > div').width(w+8); |
| | | $('#composebody_ifr').height(h + 4 - $('div.mce-toolbar').height()); |
| | | $('#googie_edit_layer').height(h - 8); |
| | | $('#googie_edit_layer').width(w).height(h); |
| | | // $('#composebodycontainer')[(btns ? 'addClass' : 'removeClass')]('buttons'); |
| | | // $('#composeformbuttons')[(btns ? 'show' : 'hide')](); |
| | | |
| | | var abooks = $('#directorylist'); |
| | | $('#compose-contacts .scroller').css('top', abooks.position().top + abooks.outerHeight()); |
| | | if (abooks.length) |
| | | $('#compose-contacts .scroller').css('top', abooks.position().top + abooks.outerHeight()); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | function folder_search_init(container) |
| | | { |
| | | // animation to unfold list search box |
| | | $('.boxtitle a.search', container).click(function(e) { |
| | | var title = $('.boxtitle', container), |
| | | box = $('.listsearchbox', container), |
| | | dir = box.is(':visible') ? -1 : 1, |
| | | height = 34 + ($('select', box).length ? 22 : 0); |
| | | |
| | | box.slideToggle({ |
| | | duration: 160, |
| | | progress: function(animation, progress) { |
| | | if (dir < 0) progress = 1 - progress; |
| | | $('.scroller', container).css('top', (title.outerHeight() + height * progress) + 'px'); |
| | | }, |
| | | complete: function() { |
| | | box.toggleClass('expanded'); |
| | | if (box.is(':visible')) { |
| | | box.find('input[type=text]').focus(); |
| | | height = 34 + ($('select', box).length ? $('select', box).outerHeight() + 4 : 0); |
| | | $('.scroller', container).css('top', (title.outerHeight() + height) + 'px'); |
| | | } |
| | | else { |
| | | $('a.reset', box).click(); |
| | | } |
| | | // TODO: save state in localStorage |
| | | } |
| | | }); |
| | | |
| | | return false; |
| | | }); |
| | | } |
| | | |
| | | function enable_command(p) |
| | | { |
| | |
| | | */ |
| | | function show_about(elem) |
| | | { |
| | | var frame = $('<iframe>').attr('id', 'aboutframe') |
| | | .attr('src', rcmail.url('settings/about')) |
| | | .attr('frameborder', '0') |
| | | .appendTo(document.body); |
| | | var frame = $('<iframe>').attr({id: 'aboutframe', src: rcmail.url('settings/about'), frameborder: '0'}); |
| | | h = Math.floor($(window).height() * 0.75), |
| | | buttons = {}, |
| | | supportln = $('#supportlink'); |
| | | |
| | | var h = Math.floor($(window).height() * 0.75); |
| | | var buttons = {}; |
| | | var supportln = $('#supportlink'); |
| | | if (supportln.length && (env.supporturl = supportln.attr('href'))) |
| | | buttons[supportln.html()] = function(e){ env.supporturl.indexOf('mailto:') < 0 ? window.open(env.supporturl) : location.href = env.supporturl }; |
| | | |
| | |
| | | this.resize = function() |
| | | { |
| | | if (this.horizontal) { |
| | | this.p1.css('height', Math.floor(this.pos - this.p1pos.top - this.halfsize) + 'px'); |
| | | this.p2.css('top', Math.ceil(this.pos + this.halfsize + 2) + 'px'); |
| | | this.p1.css('height', Math.floor(this.pos - this.p1pos.top - Math.floor(this.halfsize)) + 'px'); |
| | | this.p2.css('top', Math.ceil(this.pos + Math.ceil(this.halfsize) + 2) + 'px'); |
| | | this.handle.css('top', Math.round(this.pos - this.halfsize + this.offset)+'px'); |
| | | if (bw.ie) { |
| | | var new_height = parseInt(this.parent.outerHeight(), 10) - parseInt(this.p2.css('top'), 10) - (bw.ie8 ? 2 : 0); |
| | |
| | | } |
| | | } |
| | | else { |
| | | this.p1.css('width', Math.floor(this.pos - this.p1pos.left - this.halfsize) + 'px'); |
| | | this.p2.css('left', Math.ceil(this.pos + this.halfsize) + 'px'); |
| | | this.p1.css('width', Math.floor(this.pos - this.p1pos.left - Math.floor(this.halfsize)) + 'px'); |
| | | this.p2.css('left', Math.ceil(this.pos + Math.ceil(this.halfsize)) + 'px'); |
| | | this.handle.css('left', Math.round(this.pos - this.halfsize + this.offset + 3)+'px'); |
| | | if (bw.ie) { |
| | | var new_width = parseInt(this.parent.outerWidth(), 10) - parseInt(this.p2.css('left'), 10) ; |
| | |
| | | |
| | | if (me.horizontal) { |
| | | if (((pos.y - me.halfsize) > me.p1pos.top) && ((pos.y + me.halfsize) < (me.p2pos.top + me.p2.outerHeight()))) { |
| | | me.pos = Math.max(me.min, pos.y - me.offset); |
| | | me.pos = Math.max(me.min, pos.y - Math.max(0, me.offset)); |
| | | if (me.pos > me.min) |
| | | me.pos = Math.min(me.pos, me.parent.height() - me.min); |
| | | |
| | |
| | | } |
| | | else { |
| | | if (((pos.x - me.halfsize) > me.p1pos.left) && ((pos.x + me.halfsize) < (me.p2pos.left + me.p2.outerWidth()))) { |
| | | me.pos = Math.max(me.min, pos.x - me.offset); |
| | | me.pos = Math.max(me.min, pos.x - Math.max(0, me.offset)); |
| | | if (me.pos > me.min) |
| | | me.pos = Math.min(me.pos, me.parent.width() - me.min); |
| | | |