Don't use deprecated (soon) jQuery .bind() and .unbind() methods
| | |
| | | var rowid = this.id.substr(6); |
| | | |
| | | // remove all attached events |
| | | $(this).unbind(); |
| | | $(this).off(); |
| | | |
| | | // update row id |
| | | if (rowid > id) { |
| | |
| | | rcube_webmail.prototype.managesieve_fixdragend = function(elem) |
| | | { |
| | | var p = this; |
| | | $(elem).bind('mouseup' + ((bw.iphone || bw.ipad) ? ' touchend' : ''), function(e) { |
| | | $(elem).on('mouseup' + ((bw.iphone || bw.ipad) ? ' touchend' : ''), function(e) { |
| | | if (p.drag_active) |
| | | p.filters_list.drag_mouse_up(e); |
| | | }); |
| | |
| | | var n, framed = parent.rcmail, |
| | | tip = framed ? parent.rcmail.env.ms_tip_layer : rcmail.env.ms_tip_layer; |
| | | |
| | | for (var n in tips) { |
| | | for (n in tips) { |
| | | $('#'+tips[n][0]) |
| | | .data('tip', tips[n][1]) |
| | | .bind('mouseenter', function(e) { |
| | | .mouseleave(function(e) { tip.hide(); }) |
| | | .mouseenter(function(e) { |
| | | var elem = $(this), |
| | | offset = elem.offset(), |
| | | left = offset.left, |
| | |
| | | top -= tip.height(); |
| | | |
| | | tip.css({left: left, top: top, minWidth: (minwidth-2) + 'px'}).show(); |
| | | }) |
| | | .bind('mouseleave', function(e) { tip.hide(); }); |
| | | }); |
| | | } |
| | | }; |
| | | |
| | |
| | | // to use memcache as a fallback when write-master is unavailable. |
| | | $config['redundant_attachments_memcache'] = false; |
| | | |
| | | // Attachment data expires after specied TTL time in seconds (max.2592000). |
| | | // Attachment data expires after specified TTL time in seconds (max.2592000). |
| | | // Default is 12 hours. |
| | | $config['redundant_attachments_cache_ttl'] = 12 * 60 * 60; |
| | | |
| | |
| | | var tab = $('<span>').attr('id', 'settingstabpluginuserinfo').addClass('tablink'); |
| | | |
| | | var button = $('<a>').attr('href', rcmail.env.comm_path+'&_action=plugin.userinfo').html(rcmail.gettext('userinfo', 'userinfo')).appendTo(tab); |
| | | button.bind('click', function(e){ return rcmail.command('plugin.userinfo', this) }); |
| | | button.click(function(e) { return rcmail.command('plugin.userinfo', this); }); |
| | | |
| | | // add button and register command |
| | | rcmail.add_element(tab, 'tabs'); |
| | |
| | | }); |
| | | |
| | | // unload fix |
| | | $(window).bind('beforeunload', function() { ref.unload = true; }); |
| | | $(window).on('beforeunload', function() { ref.unload = true; }); |
| | | |
| | | // set environment variable(s) |
| | | this.set_env = function(p, value) |
| | |
| | | $('a.insertresponse', this.gui_objects.responseslist) |
| | | .attr('unselectable', 'on') |
| | | .mousedown(function(e){ return rcube_event.cancel(e); }) |
| | | .bind('mouseup keypress', function(e){ |
| | | .on('mouseup keypress', function(e) { |
| | | if (e.type == 'mouseup' || rcube_event.get_keycode(e) == 13) { |
| | | ref.command('insert-response', $(this).attr('rel')); |
| | | $(document.body).trigger('mouseup'); // hides the menu |
| | |
| | | input_user = $('#rcmloginuser'), |
| | | input_tz = $('#rcmlogintz'); |
| | | |
| | | input_user.bind('keyup', function(e) { return ref.login_user_keyup(e); }); |
| | | input_user.keyup(function(e) { return ref.login_user_keyup(e); }); |
| | | |
| | | if (input_user.val() == '') |
| | | input_user.focus(); |
| | |
| | | |
| | | // activate html5 file drop feature (if browser supports it and if configured) |
| | | if (this.gui_objects.filedrop && this.env.filedrop && ((window.XMLHttpRequest && XMLHttpRequest.prototype && XMLHttpRequest.prototype.sendAsBinary) || window.FormData)) { |
| | | $(document.body).bind('dragover dragleave drop', function(e){ return ref.document_drag_hover(e, e.type == 'dragover'); }); |
| | | $(document.body).on('dragover dragleave drop', function(e) { return ref.document_drag_hover(e, e.type == 'dragover'); }); |
| | | $(this.gui_objects.filedrop).addClass('droptarget') |
| | | .bind('dragover dragleave', function(e){ return ref.file_drag_hover(e, e.type == 'dragover'); }) |
| | | .on('dragover dragleave', function(e) { return ref.file_drag_hover(e, e.type == 'dragover'); }) |
| | | .get(0).addEventListener('drop', function(e){ return ref.file_dropped(e); }, false); |
| | | } |
| | | |
| | | // catch document (and iframe) mouse clicks |
| | | var body_mouseup = function(e){ return ref.doc_mouse_up(e); }; |
| | | $(document.body) |
| | | .bind('mouseup', body_mouseup) |
| | | .bind('keydown', function(e){ return ref.doc_keypress(e); }); |
| | | .mouseup(body_mouseup) |
| | | .keydown(function(e){ return ref.doc_keypress(e); }); |
| | | |
| | | $('iframe').on('load', function(e) { |
| | | try { $(this.contentDocument || this.contentWindow).on('mouseup', body_mouseup); } |
| | |
| | | $('#'+r.id+' .leaf:first') |
| | | .attr('id', 'rcmexpando' + r.id) |
| | | .attr('class', (r.obj.style.display != 'none' ? 'expanded' : 'collapsed')) |
| | | .bind('mousedown', {uid: r.uid}, |
| | | function(e) { return ref.expand_message_row(e, e.data.uid); }); |
| | | .mousedown({uid: r.uid}, function(e) { |
| | | return ref.expand_message_row(e, e.data.uid); |
| | | }); |
| | | |
| | | r.unread_children = 0; |
| | | roots.push(r); |
| | |
| | | .mousedown(function(e){ |
| | | return rcube_event.cancel(e); |
| | | }) |
| | | .bind('mouseup keypress', function(e){ |
| | | .on('mouseup keypress', function(e) { |
| | | if (e.type == 'mouseup' || rcube_event.get_keycode(e) == 13) { |
| | | ref.command('insert-response', $(this).attr('rel')); |
| | | $(document.body).trigger('mouseup'); // hides the menu |
| | |
| | | if (!this.local_save_timer && window.localStorage && this.env.save_localstorage) { |
| | | // track typing activity and only save on changes |
| | | this.compose_type_activity = this.compose_type_activity_last = 0; |
| | | $(document).bind('keypress', function(e){ ref.compose_type_activity++; }); |
| | | $(document).keypress(function(e) { ref.compose_type_activity++; }); |
| | | |
| | | this.local_save_timer = setInterval(function(){ |
| | | if (ref.compose_type_activity > ref.compose_type_activity_last) { |
| | |
| | | } |
| | | |
| | | // handle upload errors by parsing iframe content in onload |
| | | frame.bind('load', {ts:ts}, onload); |
| | | frame.on('load', {ts:ts}, onload); |
| | | |
| | | $(form).attr({ |
| | | target: frame_name, |
| | |
| | | |
| | | rcmail.gui_objects.filedrop = $('#image-selector-form'); |
| | | rcmail.gui_objects.filedrop.addClass('droptarget') |
| | | .bind('dragover dragleave', function(e) { |
| | | .on('dragover dragleave', function(e) { |
| | | e.preventDefault(); |
| | | e.stopPropagation(); |
| | | $(this)[(e.type == 'dragover' ? 'addClass' : 'removeClass')]('hover'); |
| | |
| | | this.cnt_errors_fixed = 0; |
| | | |
| | | // Set document's onclick to hide the language and error menu |
| | | $(document).bind('click', function(e) { |
| | | $(document).click(function(e) { |
| | | var target = $(e.target); |
| | | if(target.attr('googie_action_btn') != '1' && ref.isLangWindowShown()) |
| | | ref.hideLangWindow(); |
| | |
| | | catch (e) { } |
| | | |
| | | if (this.main_controller) |
| | | $(this.spell_span).unbind('click'); |
| | | $(this.spell_span).off('click'); |
| | | |
| | | this.orginal_text = area.val(); |
| | | }; |
| | |
| | | this.ignoreError = function(elm, id) |
| | | { |
| | | // @TODO: ignore all same words |
| | | $(elm).removeAttr('class').css('color', '').unbind(); |
| | | $(elm).removeAttr('class').css('color', '').off(); |
| | | this.hideErrorWindow(); |
| | | }; |
| | | |
| | |
| | | this.lang_elms.push(item); |
| | | |
| | | $(item).attr('googieId', this.langlist_codes[i]) |
| | | .bind('click', function(e) { |
| | | .click(function(e) { |
| | | ref.deHighlightCurSel(); |
| | | ref.setCurrentLanguage($(this).attr('googieId')); |
| | | |
| | |
| | | ref.highlightCurSel(); |
| | | ref.hideLangWindow(); |
| | | }) |
| | | .bind('mouseover', function(e) { |
| | | .mouseover(function(e) { |
| | | if (this.className != "googie_list_selected") |
| | | this.className = "googie_list_onhover"; |
| | | }) |
| | | .bind('mouseout', function(e) { |
| | | .mouseout(function(e) { |
| | | if (this.className != "googie_list_selected") |
| | | this.className = "googie_list_onout"; |
| | | }); |
| | |
| | | |
| | | $(switch_lan).addClass('googie_lang_3d_on') |
| | | .append(img) |
| | | .bind('click', function(e) { |
| | | .click(function(e) { |
| | | var elm = this.tagName.toLowerCase() == 'img' ? this.parentNode : this; |
| | | if($(elm).hasClass('googie_lang_3d_click')) { |
| | | elm.className = 'googie_lang_3d_on'; |
| | |
| | | var ref = this; |
| | | |
| | | $(this.switch_lan_pic).hide(); |
| | | $(this.spell_span).empty().unbind().append(rsm) |
| | | .bind('click', function() { ref.resumeEditing() }) |
| | | $(this.spell_span).empty().off().append(rsm) |
| | | .click(function() { ref.resumeEditing(); }) |
| | | .removeClass().addClass('googie_resume_editing'); |
| | | } |
| | | |
| | |
| | | ref = this; |
| | | |
| | | if (this.custom_spellcheck_starter) |
| | | $(span_chck).bind('click', function(e) { ref.custom_spellcheck_starter() }); |
| | | $(span_chck).click(function(e) { ref.custom_spellcheck_starter(); }); |
| | | else { |
| | | $(span_chck).bind('click', function(e) { ref.spellCheck() }); |
| | | $(span_chck).click(function(e) { ref.spellCheck(); }); |
| | | } |
| | | |
| | | if (this.main_controller) { |
| | |
| | | spn_btn = document.createTextNode(name); |
| | | } |
| | | |
| | | $(btn).bind('click', c_fn) |
| | | .bind('mouseover', this.item_onmouseover) |
| | | .bind('mouseout', this.item_onmouseout); |
| | | $(btn).click(c_fn) |
| | | .mouseover(this.item_onmouseover) |
| | | .mouseout(this.item_onmouseout); |
| | | |
| | | btn.appendChild(spn_btn); |
| | | btn_row.appendChild(btn); |
| | |
| | | { |
| | | var id = elem.parentNode.id.replace(/^attach/, ''); |
| | | |
| | | $('#attachmenuopen').unbind('click').attr('onclick', '').click(function(e) { |
| | | $('#attachmenuopen').off('click').attr('onclick', '').click(function(e) { |
| | | return rcmail.command('open-attachment', id, this); |
| | | }); |
| | | |
| | | $('#attachmenudownload').unbind('click').attr('onclick', '').click(function() { |
| | | $('#attachmenudownload').off('click').attr('onclick', '').click(function() { |
| | | rcmail.command('download-attachment', id, this); |
| | | }); |
| | | |
| | |
| | | else if (rcmail.env.action == 'show' || rcmail.env.action == 'preview') { |
| | | // add menu link for each attachment |
| | | $('#attachment-list > li[id^="attach"]').each(function() { |
| | | $(this).append($('<a class="drop"></a>').bind('click keypress', function(e) { |
| | | $(this).append($('<a class="drop"></a>').on('click keypress', function(e) { |
| | | if (e.type != 'keypress' || e.which == 13) { |
| | | rcmail_ui.show_attachmentmenu(this, e); |
| | | return false; |
| | |
| | | me.p2pos = me.relative ? $(me.p2).position() : $(me.p2).offset(); |
| | | |
| | | // start listening to mousemove events |
| | | $(document).bind('mousemove.'+me.id, onDrag).bind('mouseup.'+me.id, onDragStop); |
| | | $(document).on('mousemove.' + me.id, onDrag).on('mouseup.' + me.id, onDragStop); |
| | | |
| | | // enable dragging above iframes |
| | | $('iframe').each(function() { |
| | |
| | | document.body.style.webkitUserSelect = 'auto'; |
| | | |
| | | // cancel the listening for drag events |
| | | $(document).unbind('.' + me.id); |
| | | $(document).off('.' + me.id); |
| | | |
| | | // remove temp divs |
| | | $('div.iframe-splitter-fix').remove(); |
| | |
| | | // add menu link for each attachment |
| | | $('#attachment-list > li').each(function() { |
| | | $(this).append($('<a class="drop" tabindex="0" aria-haspopup="true">Show options</a>') |
| | | .bind('click keypress', function(e) { |
| | | .on('click keypress', function(e) { |
| | | if (e.type != 'keypress' || rcube_event.get_keycode(e) == 13) { |
| | | attachmentmenu(this, e); |
| | | return false; |
| | |
| | | { |
| | | var id = elem.parentNode.id.replace(/^attach/, ''); |
| | | |
| | | $('#attachmenuopen').unbind('click').attr('onclick', '').click(function(e) { |
| | | $('#attachmenuopen').off('click').attr('onclick', '').click(function(e) { |
| | | return rcmail.command('open-attachment', id, this); |
| | | }); |
| | | |
| | | $('#attachmenudownload').unbind('click').attr('onclick', '').click(function() { |
| | | $('#attachmenudownload').off('click').attr('onclick', '').click(function() { |
| | | rcmail.command('download-attachment', id, this); |
| | | }); |
| | | |
| | |
| | | li = $('<li role="menuitem">'); |
| | | link = $('<a href="#'+k+'" tabindex="0"></a>').text(rcmail.env.spell_langs[k]) |
| | | .addClass('active').data('lang', k) |
| | | .bind('click keypress', function(e) { |
| | | .on('click keypress', function(e) { |
| | | if (e.type != 'keypress' || rcube_event.get_keycode(e) == 13) { |
| | | rcmail.spellcheck_lang_set($(this).data('lang')); |
| | | rcmail.hide_menu('spellmenu', e); |
| | |
| | | .attr('role', 'presentation') |
| | | .addClass('splitter ' + (this.horizontal ? 'splitter-h' : 'splitter-v')) |
| | | .appendTo(this.parent) |
| | | .bind('mousedown', onDragStart); |
| | | .mousedown(onDragStart); |
| | | |
| | | if (this.horizontal) { |
| | | var top = this.p1pos.top + this.p1.outerHeight(); |
| | |
| | | me.drag_active = true; |
| | | |
| | | // start listening to mousemove events |
| | | $(document).bind('mousemove.'+this.id, onDrag).bind('mouseup.'+this.id, onDragStop); |
| | | $(document).on('mousemove.' + this.id, onDrag).on('mouseup.' + this.id, onDragStop); |
| | | |
| | | // enable dragging above iframes |
| | | $('iframe').each(function(i, elem) { |
| | |
| | | document.body.style.webkitUserSelect = 'auto'; |
| | | |
| | | // cancel the listening for drag events |
| | | $(document).unbind('.'+me.id); |
| | | $(document).off('.' + me.id); |
| | | me.drag_active = false; |
| | | |
| | | // remove temp divs |