commit | author | age
|
5f660c
|
1 |
/** |
e019f2
|
2 |
* Roundcube functions for default skin interface |
5f660c
|
3 |
*/ |
A |
4 |
|
|
5 |
/** |
|
6 |
* Settings |
|
7 |
*/ |
|
8 |
|
|
9 |
function rcube_init_settings_tabs() |
|
10 |
{ |
cc97ea
|
11 |
var tab = '#settingstabdefault'; |
5f660c
|
12 |
if (window.rcmail && rcmail.env.action) |
cc97ea
|
13 |
tab = '#settingstab' + (rcmail.env.action=='preferences' ? 'default' : (rcmail.env.action.indexOf('identity')>0 ? 'identities' : rcmail.env.action.replace(/\./g, ''))); |
T |
14 |
|
|
15 |
$(tab).addClass('tablink-selected'); |
a4865a
|
16 |
$(tab + '> a').removeAttr('onclick').unbind('click').bind('click', function(){return false;}); |
5f660c
|
17 |
} |
A |
18 |
|
|
19 |
function rcube_show_advanced(visible) |
|
20 |
{ |
cc97ea
|
21 |
$('tr.advanced').css('display', (visible ? (bw.ie ? 'block' : 'table-row') : 'none')); |
5f660c
|
22 |
} |
A |
23 |
|
6769ba
|
24 |
// Fieldsets-to-tabs converter |
A |
25 |
// Warning: don't place "caller" <script> inside page element (id) |
|
26 |
function rcube_init_tabs(id, current) |
|
27 |
{ |
|
28 |
var content = document.getElementById(id), |
7403ab
|
29 |
// get fieldsets of the higher-level (skip nested fieldsets) |
A |
30 |
fs = $('fieldset', content).not('fieldset > fieldset'); |
|
31 |
|
|
32 |
if (!fs.length) |
|
33 |
return; |
6769ba
|
34 |
|
A |
35 |
current = current ? current : 0; |
|
36 |
|
|
37 |
// first hide not selected tabs |
|
38 |
fs.each(function(idx) { if (idx != current) $(this).hide(); }); |
|
39 |
|
|
40 |
// create tabs container |
|
41 |
var tabs = $('<div>').addClass('tabsbar').appendTo($(content)); |
|
42 |
|
|
43 |
// convert fildsets into tabs |
|
44 |
fs.each(function(idx) { |
7403ab
|
45 |
var tab, a, elm = $(this), |
A |
46 |
// get first legend element |
|
47 |
legend = $(elm).children('legend'); |
6769ba
|
48 |
|
A |
49 |
// create a tab |
|
50 |
a = $('<a>').text(legend.text()).attr('href', '#'); |
|
51 |
tab = $('<span>').attr({'id': 'tab'+idx, 'class': 'tablink'}) |
|
52 |
.click(function() { return rcube_show_tab(id, idx); }) |
|
53 |
|
|
54 |
// remove legend |
|
55 |
legend.remove(); |
|
56 |
// style fieldset |
|
57 |
elm.addClass('tabbed'); |
|
58 |
// style selected tab |
|
59 |
if (idx == current) |
|
60 |
tab.addClass('tablink-selected'); |
|
61 |
|
|
62 |
// add the tab to container |
|
63 |
tab.append(a).appendTo(tabs); |
|
64 |
}); |
|
65 |
} |
|
66 |
|
|
67 |
function rcube_show_tab(id, index) |
|
68 |
{ |
|
69 |
var content = document.getElementById(id), |
|
70 |
fs = $('fieldset', content); |
|
71 |
|
|
72 |
fs.each(function(idx) { |
|
73 |
// Show/hide fieldset (tab content) |
|
74 |
$(this)[index==idx ? 'show' : 'hide'](); |
|
75 |
// Select/unselect tab |
|
76 |
$('#tab'+idx).toggleClass('tablink-selected', idx==index); |
|
77 |
}); |
|
78 |
} |
|
79 |
|
5f660c
|
80 |
/** |
3940ba
|
81 |
* Mail UI |
5f660c
|
82 |
*/ |
A |
83 |
|
|
84 |
function rcube_mail_ui() |
|
85 |
{ |
9e5550
|
86 |
this.popups = { |
A |
87 |
markmenu: {id:'markmessagemenu'}, |
e25a35
|
88 |
replyallmenu: {id:'replyallmenu'}, |
9e5550
|
89 |
searchmenu: {id:'searchmenu', editable:1}, |
A |
90 |
messagemenu: {id:'messagemenu'}, |
|
91 |
listmenu: {id:'listmenu', editable:1}, |
|
92 |
dragmessagemenu:{id:'dragmessagemenu', sticky:1}, |
|
93 |
groupmenu: {id:'groupoptionsmenu', above:1}, |
|
94 |
mailboxmenu: {id:'mailboxoptionsmenu', above:1}, |
|
95 |
composemenu: {id:'composeoptionsmenu', editable:1}, |
71f60c
|
96 |
// toggle: #1486823, #1486930 |
A |
97 |
uploadmenu: {id:'attachment-form', editable:1, above:1, toggle:!bw.ie&&!bw.linux } |
a61bbb
|
98 |
}; |
3940ba
|
99 |
|
a61bbb
|
100 |
var obj; |
9e5550
|
101 |
for (var k in this.popups) { |
A |
102 |
obj = $('#'+this.popups[k].id) |
a61bbb
|
103 |
if (obj.length) |
9e5550
|
104 |
this.popups[k].obj = obj; |
A |
105 |
else { |
|
106 |
delete this.popups[k]; |
|
107 |
} |
a61bbb
|
108 |
} |
5f660c
|
109 |
} |
A |
110 |
|
|
111 |
rcube_mail_ui.prototype = { |
|
112 |
|
9e5550
|
113 |
show_popup: function(popup, show) |
5f660c
|
114 |
{ |
9e5550
|
115 |
if (typeof this[popup] == 'function') |
A |
116 |
return this[popup](show); |
|
117 |
else |
|
118 |
return this.show_popupmenu(popup, show); |
|
119 |
}, |
|
120 |
|
|
121 |
show_popupmenu: function(popup, show) |
|
122 |
{ |
|
123 |
var obj = this.popups[popup].obj, |
|
124 |
above = this.popups[popup].above, |
|
125 |
ref = rcube_find_object(popup+'link'); |
|
126 |
|
5f660c
|
127 |
if (typeof show == 'undefined') |
a61bbb
|
128 |
show = obj.is(':visible') ? false : true; |
0e2ccb
|
129 |
else if (this.popups[popup].toggle && show && this.popups[popup].obj.is(':visible') ) |
T |
130 |
show = false; |
6c9d49
|
131 |
|
a61bbb
|
132 |
if (show && ref) { |
8431a7
|
133 |
var parent = $(ref).parent(), |
A |
134 |
pos = parent.hasClass('dropbutton') ? parent.offset() : $(ref).offset(); |
|
135 |
|
b218aa
|
136 |
if (!above && pos.top + ref.offsetHeight + obj.height() > window.innerHeight) |
T |
137 |
above = true; |
8431a7
|
138 |
|
a61bbb
|
139 |
obj.css({ left:pos.left, top:(pos.top + (above ? -obj.height() : ref.offsetHeight)) }); |
T |
140 |
} |
3940ba
|
141 |
|
a61bbb
|
142 |
obj[show?'show':'hide'](); |
T |
143 |
}, |
|
144 |
|
9e5550
|
145 |
dragmessagemenu: function(show) |
a61bbb
|
146 |
{ |
9e5550
|
147 |
this.popups.dragmessagemenu.obj[show?'show':'hide'](); |
511420
|
148 |
}, |
A |
149 |
|
9e5550
|
150 |
uploadmenu: function(show) |
087c7d
|
151 |
{ |
A |
152 |
if (typeof show == 'object') // called as event handler |
|
153 |
show = false; |
64fa95
|
154 |
|
T |
155 |
// clear upload form |
|
156 |
if (!show) { |
|
157 |
try { $('#attachment-form form')[0].reset(); } |
|
158 |
catch(e){} // ignore errors |
|
159 |
} |
b218aa
|
160 |
|
9e5550
|
161 |
this.show_popupmenu('uploadmenu', show); |
b218aa
|
162 |
|
9a4fd7
|
163 |
if (!document.all && this.popups.uploadmenu.obj.is(':visible')) |
b218aa
|
164 |
$('#attachment-form input[type=file]').click(); |
5f660c
|
165 |
}, |
A |
166 |
|
9e5550
|
167 |
searchmenu: function(show) |
30b152
|
168 |
{ |
9e5550
|
169 |
var obj = this.popups.searchmenu.obj, |
A |
170 |
ref = rcube_find_object('searchmenulink'); |
30b152
|
171 |
|
9e5550
|
172 |
if (typeof show == 'undefined') |
A |
173 |
show = obj.is(':visible') ? false : true; |
|
174 |
|
30b152
|
175 |
if (show && ref) { |
A |
176 |
var pos = $(ref).offset(); |
9e5550
|
177 |
obj.css({ left:pos.left, top:(pos.top + ref.offsetHeight + 2)}) |
A |
178 |
.find(':checked').attr('checked', false); |
30b152
|
179 |
|
A |
180 |
if (rcmail.env.search_mods) { |
7910c0
|
181 |
var search_mods = rcmail.env.search_mods[rcmail.env.mailbox] ? rcmail.env.search_mods[rcmail.env.mailbox] : rcmail.env.search_mods['*']; |
T |
182 |
for (var n in search_mods) |
|
183 |
$('#s_mod_' + n).attr('checked', true); |
30b152
|
184 |
} |
A |
185 |
} |
9e5550
|
186 |
obj[show?'show':'hide'](); |
30b152
|
187 |
}, |
3940ba
|
188 |
|
30b152
|
189 |
set_searchmod: function(elem) |
A |
190 |
{ |
|
191 |
if (!rcmail.env.search_mods) |
a4865a
|
192 |
rcmail.env.search_mods = {}; |
3940ba
|
193 |
|
7910c0
|
194 |
if (!rcmail.env.search_mods[rcmail.env.mailbox]) |
T |
195 |
rcmail.env.search_mods[rcmail.env.mailbox] = rcube_clone_object(rcmail.env.search_mods['*']); |
3940ba
|
196 |
|
30b152
|
197 |
if (!elem.checked) |
7910c0
|
198 |
delete(rcmail.env.search_mods[rcmail.env.mailbox][elem.value]); |
30b152
|
199 |
else |
7910c0
|
200 |
rcmail.env.search_mods[rcmail.env.mailbox][elem.value] = elem.value; |
30b152
|
201 |
}, |
A |
202 |
|
9e5550
|
203 |
listmenu: function(show) |
f52c93
|
204 |
{ |
9e5550
|
205 |
var obj = this.popups.listmenu.obj, |
A |
206 |
ref = rcube_find_object('listmenulink'); |
f52c93
|
207 |
|
9e5550
|
208 |
if (typeof show == 'undefined') |
A |
209 |
show = obj.is(':visible') ? false : true; |
|
210 |
|
f52c93
|
211 |
if (show && ref) { |
6c9d49
|
212 |
var pos = $(ref).offset(), |
9e5550
|
213 |
menuwidth = obj.width(), |
6c9d49
|
214 |
pagewidth = $(document).width(); |
A |
215 |
|
|
216 |
if (pagewidth - pos.left < menuwidth && pos.left > menuwidth) |
|
217 |
pos.left = pos.left - menuwidth; |
|
218 |
|
9e5550
|
219 |
obj.css({ left:pos.left, top:(pos.top + ref.offsetHeight + 2)}); |
f52c93
|
220 |
// set form values |
T |
221 |
$('input[name="sort_col"][value="'+rcmail.env.sort_col+'"]').attr('checked', 1); |
|
222 |
$('input[name="sort_ord"][value="DESC"]').attr('checked', rcmail.env.sort_order=='DESC' ? 1 : 0); |
|
223 |
$('input[name="sort_ord"][value="ASC"]').attr('checked', rcmail.env.sort_order=='DESC' ? 0 : 1); |
|
224 |
$('input[name="view"][value="thread"]').attr('checked', rcmail.env.threading ? 1 : 0); |
|
225 |
$('input[name="view"][value="list"]').attr('checked', rcmail.env.threading ? 0 : 1); |
|
226 |
// list columns |
|
227 |
var cols = $('input[name="list_col[]"]'); |
|
228 |
for (var i=0; i<cols.length; i++) { |
|
229 |
var found = 0; |
|
230 |
if (cols[i].value != 'from') |
|
231 |
found = jQuery.inArray(cols[i].value, rcmail.env.coltypes) != -1; |
|
232 |
else |
|
233 |
found = (jQuery.inArray('from', rcmail.env.coltypes) != -1 |
|
234 |
|| jQuery.inArray('to', rcmail.env.coltypes) != -1); |
|
235 |
$(cols[i]).attr('checked',found ? 1 : 0); |
|
236 |
} |
|
237 |
} |
|
238 |
|
9e5550
|
239 |
obj[show?'show':'hide'](); |
f52c93
|
240 |
|
T |
241 |
if (show) { |
|
242 |
var maxheight=0; |
|
243 |
$('#listmenu fieldset').each(function() { |
|
244 |
var height = $(this).height(); |
|
245 |
if (height > maxheight) { |
|
246 |
maxheight = height; |
|
247 |
} |
|
248 |
}); |
|
249 |
$('#listmenu fieldset').css("min-height", maxheight+"px") |
|
250 |
// IE6 complains if you set this attribute using either method: |
|
251 |
//$('#listmenu fieldset').css({'height':'auto !important'}); |
|
252 |
//$('#listmenu fieldset').css("height","auto !important"); |
|
253 |
.height(maxheight); |
|
254 |
}; |
|
255 |
}, |
|
256 |
|
|
257 |
open_listmenu: function(e) |
|
258 |
{ |
9e5550
|
259 |
this.listmenu(); |
f52c93
|
260 |
}, |
T |
261 |
|
|
262 |
save_listmenu: function() |
|
263 |
{ |
9e5550
|
264 |
this.listmenu(); |
f52c93
|
265 |
|
a80405
|
266 |
var sort = $('input[name="sort_col"]:checked').val(), |
A |
267 |
ord = $('input[name="sort_ord"]:checked').val(), |
|
268 |
thread = $('input[name="view"]:checked').val(), |
|
269 |
cols = $('input[name="list_col[]"]:checked') |
|
270 |
.map(function(){ return this.value; }).get(); |
f52c93
|
271 |
|
T |
272 |
rcmail.set_list_options(cols, sort, ord, thread == 'thread' ? 1 : 0); |
|
273 |
}, |
|
274 |
|
ec581c
|
275 |
body_mouseup: function(evt, p) |
5f660c
|
276 |
{ |
9e5550
|
277 |
var i, target = rcube_event.get_target(evt); |
f52c93
|
278 |
|
9e5550
|
279 |
for (i in this.popups) { |
A |
280 |
if (this.popups[i].obj.is(':visible') && target != rcube_find_object(i+'link') |
0e2ccb
|
281 |
&& !this.popups[i].toggle |
9e5550
|
282 |
&& (!this.popups[i].editable || !this.target_overlaps(target, this.popups[i].id)) |
A |
283 |
&& (!this.popups[i].sticky || !rcube_mouse_is_over(evt, rcube_find_object(this.popups[i].id))) |
|
284 |
) { |
c7f7ce
|
285 |
window.setTimeout('$("#'+this.popups[i].id+'").hide()', 50); |
9e5550
|
286 |
} |
30b152
|
287 |
} |
087c7d
|
288 |
}, |
A |
289 |
|
|
290 |
target_overlaps: function (target, elementid) |
|
291 |
{ |
|
292 |
var element = rcube_find_object(elementid); |
|
293 |
while (target.parentNode) { |
|
294 |
if (target.parentNode == element) |
|
295 |
return true; |
|
296 |
target = target.parentNode; |
|
297 |
} |
|
298 |
return false; |
5f660c
|
299 |
}, |
A |
300 |
|
0a36c3
|
301 |
body_keydown: function(evt, p) |
5f660c
|
302 |
{ |
30b152
|
303 |
if (rcube_event.get_keycode(evt) == 27) { |
9e5550
|
304 |
for (var k in this.popups) { |
A |
305 |
if (this.popups[k].obj.is(':visible')) |
|
306 |
this.show_popup(k, false); |
a61bbb
|
307 |
} |
30b152
|
308 |
} |
ce06d3
|
309 |
}, |
A |
310 |
|
|
311 |
switch_preview_pane: function(elem) |
|
312 |
{ |
|
313 |
var uid, prev_frm = $('#mailpreviewframe'); |
|
314 |
|
|
315 |
if (elem.checked) { |
|
316 |
rcmail.env.contentframe = 'messagecontframe'; |
|
317 |
if (mailviewsplit.layer) { |
|
318 |
mailviewsplit.resize(); |
|
319 |
mailviewsplit.layer.elm.style.display = ''; |
129997
|
320 |
} |
A |
321 |
else |
ce06d3
|
322 |
mailviewsplit.init(); |
129997
|
323 |
|
A |
324 |
if (bw.opera) { |
|
325 |
$('#messagelistcontainer').css({height: ''}); |
|
326 |
} |
ce06d3
|
327 |
prev_frm.show(); |
129997
|
328 |
|
ce06d3
|
329 |
if (uid = rcmail.message_list.get_single_selection()) |
A |
330 |
rcmail.show_message(uid, false, true); |
129997
|
331 |
} |
A |
332 |
else { |
ce06d3
|
333 |
prev_frm.hide(); |
A |
334 |
if (bw.ie6 || bw.ie7) { |
|
335 |
var fr = document.getElementById('mailcontframe'); |
|
336 |
fr.style.bottom = 0; |
129997
|
337 |
fr.style.height = parseInt(fr.parentNode.offsetHeight)+'px'; |
ce06d3
|
338 |
} |
129997
|
339 |
else { |
ce06d3
|
340 |
$('#mailcontframe').css({height: 'auto', bottom: 0}); |
129997
|
341 |
if (bw.opera) |
A |
342 |
$('#messagelistcontainer').css({height: 'auto'}); |
|
343 |
} |
ce06d3
|
344 |
if (mailviewsplit.layer) |
A |
345 |
mailviewsplit.layer.elm.style.display = 'none'; |
129997
|
346 |
|
ce06d3
|
347 |
rcmail.env.contentframe = null; |
A |
348 |
rcmail.show_contentframe(false); |
|
349 |
} |
249db1
|
350 |
rcmail.http_post('save-pref', '_name=preview_pane&_value='+(elem.checked?1:0)); |
3940ba
|
351 |
}, |
A |
352 |
|
|
353 |
/* Message composing */ |
|
354 |
init_compose_form: function() |
|
355 |
{ |
db1a87
|
356 |
var f, field, fields = ['cc', 'bcc', 'replyto', 'followupto'], |
3940ba
|
357 |
div = document.getElementById('compose-div'), |
A |
358 |
headers_div = document.getElementById('compose-headers-div'); |
|
359 |
|
e25a35
|
360 |
// Show input elements with non-empty value |
A |
361 |
for (f=0; f<fields.length; f++) { |
|
362 |
if ((field = $('#_'+fields[f])) && field.length && field.val() != '') |
|
363 |
rcmail_ui.show_header_form(fields[f]); |
|
364 |
} |
3940ba
|
365 |
|
A |
366 |
// prevent from form data loss when pressing ESC key in IE |
|
367 |
if (bw.ie) { |
|
368 |
var form = rcube_find_object('form'); |
|
369 |
form.onkeydown = function (e) { |
|
370 |
if (rcube_event.get_keycode(e) == 27) |
|
371 |
rcube_event.cancel(e); |
|
372 |
}; |
|
373 |
} |
|
374 |
|
|
375 |
$(window).resize(function() { |
|
376 |
rcmail_ui.resize_compose_body(); |
|
377 |
}); |
|
378 |
|
|
379 |
$('#compose-container').resize(function() { |
|
380 |
rcmail_ui.resize_compose_body(); |
|
381 |
}); |
|
382 |
|
b218aa
|
383 |
div.style.top = (parseInt(headers_div.offsetHeight, 10) + 3) + 'px'; |
3940ba
|
384 |
$(window).resize(); |
A |
385 |
}, |
|
386 |
|
|
387 |
resize_compose_body: function() |
|
388 |
{ |
b218aa
|
389 |
var div = $('#compose-div .boxlistcontent'), w = div.width(), h = div.height(); |
T |
390 |
w -= 8; // 2 x 3px padding + 2 x 1px border |
|
391 |
h -= 4; |
3940ba
|
392 |
|
b218aa
|
393 |
$('#compose-body').width(w+'px').height(h+'px'); |
3940ba
|
394 |
|
A |
395 |
if (window.tinyMCE && tinyMCE.get('compose-body')) { |
b218aa
|
396 |
$('#compose-body_tbl').width((w+6)+'px').height(''); |
T |
397 |
$('#compose-body_ifr').width((w+6)+'px').height((h-54)+'px'); |
3940ba
|
398 |
} |
b8d4fe
|
399 |
else { |
9bfcb3
|
400 |
$('#googie_edit_layer').height(h+'px'); |
b8d4fe
|
401 |
} |
7534f6
|
402 |
}, |
A |
403 |
|
|
404 |
resize_compose_body_ev: function() |
|
405 |
{ |
|
406 |
window.setTimeout(function(){rcmail_ui.resize_compose_body();}, 100); |
3940ba
|
407 |
}, |
A |
408 |
|
|
409 |
show_header_form: function(id) |
|
410 |
{ |
|
411 |
var row, s, |
|
412 |
link = document.getElementById(id + '-link'); |
|
413 |
|
|
414 |
if ((s = this.next_sibling(link))) |
|
415 |
s.style.display = 'none'; |
|
416 |
else if ((s = this.prev_sibling(link))) |
|
417 |
s.style.display = 'none'; |
|
418 |
|
|
419 |
link.style.display = 'none'; |
|
420 |
|
|
421 |
if ((row = document.getElementById('compose-' + id))) { |
|
422 |
var div = document.getElementById('compose-div'), |
|
423 |
headers_div = document.getElementById('compose-headers-div'); |
|
424 |
row.style.display = (document.all && !window.opera) ? 'block' : 'table-row'; |
b218aa
|
425 |
div.style.top = (parseInt(headers_div.offsetHeight, 10) + 3) + 'px'; |
3940ba
|
426 |
this.resize_compose_body(); |
A |
427 |
} |
|
428 |
|
|
429 |
return false; |
|
430 |
}, |
|
431 |
|
|
432 |
hide_header_form: function(id) |
|
433 |
{ |
|
434 |
var row, ns, |
|
435 |
link = document.getElementById(id + '-link'), |
|
436 |
parent = link.parentNode, |
|
437 |
links = parent.getElementsByTagName('a'); |
|
438 |
|
|
439 |
link.style.display = ''; |
|
440 |
|
|
441 |
for (var i=0; i<links.length; i++) |
|
442 |
if (links[i].style.display != 'none') |
|
443 |
for (var j=i+1; j<links.length; j++) |
|
444 |
if (links[j].style.display != 'none') |
|
445 |
if ((ns = this.next_sibling(links[i]))) { |
|
446 |
ns.style.display = ''; |
|
447 |
break; |
|
448 |
} |
|
449 |
|
|
450 |
document.getElementById('_' + id).value = ''; |
|
451 |
|
|
452 |
if ((row = document.getElementById('compose-' + id))) { |
|
453 |
var div = document.getElementById('compose-div'), |
|
454 |
headers_div = document.getElementById('compose-headers-div'); |
|
455 |
row.style.display = 'none'; |
|
456 |
div.style.top = (parseInt(headers_div.offsetHeight, 10) + 1) + 'px'; |
|
457 |
this.resize_compose_body(); |
|
458 |
} |
|
459 |
|
|
460 |
return false; |
|
461 |
}, |
|
462 |
|
|
463 |
next_sibling: function(elm) |
|
464 |
{ |
|
465 |
var ns = elm.nextSibling; |
|
466 |
while (ns && ns.nodeType == 3) |
|
467 |
ns = ns.nextSibling; |
|
468 |
return ns; |
|
469 |
}, |
|
470 |
|
|
471 |
prev_sibling: function(elm) |
|
472 |
{ |
|
473 |
var ps = elm.previousSibling; |
|
474 |
while (ps && ps.nodeType == 3) |
|
475 |
ps = ps.previousSibling; |
|
476 |
return ps; |
5f660c
|
477 |
} |
A |
478 |
|
|
479 |
}; |
3940ba
|
480 |
|
5f660c
|
481 |
|
59ed6f
|
482 |
var rcmail_ui; |
5f660c
|
483 |
|
A |
484 |
function rcube_init_mail_ui() |
|
485 |
{ |
|
486 |
rcmail_ui = new rcube_mail_ui(); |
ec581c
|
487 |
rcube_event.add_listener({ object:rcmail_ui, method:'body_mouseup', event:'mouseup' }); |
0a36c3
|
488 |
rcube_event.add_listener({ object:rcmail_ui, method:'body_keydown', event:'keydown' }); |
e2b0a0
|
489 |
|
A |
490 |
$('iframe').load(iframe_events) |
ec581c
|
491 |
.contents().mouseup(function(e){rcmail_ui.body_mouseup(e)}); |
e2b0a0
|
492 |
|
a61bbb
|
493 |
if (rcmail.env.task == 'mail') { |
T |
494 |
rcmail.addEventListener('menu-open', 'open_listmenu', rcmail_ui); |
|
495 |
rcmail.addEventListener('menu-save', 'save_listmenu', rcmail_ui); |
9e5550
|
496 |
rcmail.addEventListener('aftersend-attachment', 'uploadmenu', rcmail_ui); |
7534f6
|
497 |
rcmail.addEventListener('aftertoggle-editor', 'resize_compose_body_ev', rcmail_ui); |
a61bbb
|
498 |
rcmail.gui_object('message_dragmenu', 'dragmessagemenu'); |
3940ba
|
499 |
|
A |
500 |
if (rcmail.env.action == 'compose') |
|
501 |
rcmail_ui.init_compose_form(); |
a61bbb
|
502 |
} |
5f660c
|
503 |
} |
e2b0a0
|
504 |
|
A |
505 |
// Events handling in iframes (eg. preview pane) |
|
506 |
function iframe_events() |
|
507 |
{ |
|
508 |
// this==iframe |
|
509 |
var doc = this.contentDocument ? this.contentDocument : this.contentWindow ? this.contentWindow.document : null; |
ec581c
|
510 |
rcube_event.add_listener({ element: doc, object:rcmail_ui, method:'body_mouseup', event:'mouseup' }); |
e2b0a0
|
511 |
} |
A |
512 |
|