| | |
| | | var n; |
| | | this.task = this.env.task; |
| | | |
| | | // check browser |
| | | if (this.env.server_error != 409 && (!bw.dom || !bw.xmlhttp_test() || (bw.mz && bw.vendver < 1.9) || (bw.ie && bw.vendver < 7))) { |
| | | // check browser capabilities (never use version checks here) |
| | | if (this.env.server_error != 409 && (!bw.dom || !bw.xmlhttp_test())) { |
| | | this.goto_url('error', '_code=0x199'); |
| | | return; |
| | | } |
| | |
| | | break; |
| | | |
| | | case 'login': |
| | | var input_user = $('#rcmloginuser'); |
| | | input_user.bind('keyup', function(e){ return ref.login_user_keyup(e); }); |
| | | var tz, tz_name, jstz = window.jstz, |
| | | input_user = $('#rcmloginuser'), |
| | | input_tz = $('#rcmlogintz'); |
| | | |
| | | input_user.bind('keyup', function(e) { return ref.login_user_keyup(e); }); |
| | | |
| | | if (input_user.val() == '') |
| | | input_user.focus(); |
| | |
| | | $('#rcmloginpwd').focus(); |
| | | |
| | | // detect client timezone |
| | | if (window.jstz) { |
| | | var timezone = jstz.determine(); |
| | | if (timezone.name()) |
| | | $('#rcmlogintz').val(timezone.name()); |
| | | } |
| | | else { |
| | | $('#rcmlogintz').val(new Date().getStdTimezoneOffset() / -60); |
| | | } |
| | | if (jstz && (tz = jstz.determine())) |
| | | tz_name = tz.name(); |
| | | |
| | | input_tz.val(tz_name ? tz_name : (new Date().getStdTimezoneOffset() / -60)); |
| | | |
| | | // display 'loading' message on form submit, lock submit button |
| | | $('form').submit(function () { |
| | |
| | | |
| | | this.set_list_sorting = function(sort_col, sort_order) |
| | | { |
| | | var sort_old = this.env.sort_col == 'arrival' ? 'date' : this.env.sort_col, |
| | | sort_new = sort_col == 'arrival' ? 'date' : sort_col; |
| | | |
| | | // set table header class |
| | | $('#rcm'+this.env.sort_col).removeClass('sorted'+(this.env.sort_order.toUpperCase())); |
| | | if (sort_col) |
| | | $('#rcm'+sort_col).addClass('sorted'+sort_order); |
| | | $('#rcm' + sort_old).removeClass('sorted' + this.env.sort_order.toUpperCase()); |
| | | if (sort_new) |
| | | $('#rcm' + sort_new).addClass('sorted' + sort_order); |
| | | |
| | | // if sorting by 'arrival' is selected, click on date column should not switch to 'date' |
| | | $('#rcmdate > a').prop('rel', sort_col == 'arrival' ? 'arrival' : 'date'); |
| | | |
| | | this.env.sort_col = sort_col; |
| | | this.env.sort_order = sort_order; |
| | |
| | | var oldval = input.val(), rx = new RegExp(RegExp.escape(delim) + '\\s*$'); |
| | | if (oldval && !rx.test(oldval)) |
| | | oldval += delim + ' '; |
| | | input.val(oldval + recipients.join(delim + ' ') + delim + ' '); |
| | | input.val(oldval + recipients.join(delim + ' ') + delim + ' ').change(); |
| | | this.triggerEvent('add-recipient', { field:field, recipients:recipients }); |
| | | } |
| | | |
| | |
| | | if (show) { |
| | | // truncate stack down to the one containing the ref link |
| | | for (var i = this.menu_stack.length - 1; stack && i >= 0; i--) { |
| | | if (!$(ref).parents('#'+this.menu_stack[i]).length) |
| | | if (!$(ref).parents('#'+this.menu_stack[i]).length && $(event.target).parent().attr('role') != 'menuitem') |
| | | this.hide_menu(this.menu_stack[i], event); |
| | | } |
| | | if (stack && this.menu_stack.length) { |
| | |
| | | var submit_data = function() { |
| | | var multiple = files.length > 1, |
| | | ts = new Date().getTime(), |
| | | content = '<span>' + (multiple ? ref.get_label('uploadingmany') : files[0].name) + '</span>'; |
| | | // jQuery way to escape filename (#1490530) |
| | | content = $('<span>').text(multiple ? ref.get_label('uploadingmany') : files[0].name).html(); |
| | | |
| | | // add to attachments list |
| | | if (!ref.add2attachment_list(ts, { name:'', html:content, classname:'uploading', complete:false })) |