]> git.uio.no Git - usit-rt.git/blame - share/static/js/history-folding.js
Putting 4.2.0 on top of 4.0.17
[usit-rt.git] / share / static / js / history-folding.js
CommitLineData
af59614d
MKG
1function fold_message_stanza(e,showmsg, hidemsg) {
2 var box = jQuery(e).next("br").next('.message-stanza');
3 if ( box.hasClass('closed') ) {
4 jQuery([e, box[0]]).removeClass('closed').addClass('open');
5 jQuery(e).text( hidemsg);
6 } else {
7 jQuery([e, box[0]]).addClass('closed').removeClass('open');
8 jQuery(e).text( showmsg);
9 }
10}
11
12function toggle_all_folds(e, showmsg, hidemsg) {
13 var link = jQuery(e);
14 var history = link.closest(".history");
15 var dir = link.attr('data-direction');
16
17 if (dir == 'open') {
18 history.find(".message-stanza-folder.closed").click();
19 link.attr('data-direction', 'closed').text(hidemsg);
20 }
21 else if (dir == 'closed') {
22 history.find(".message-stanza-folder.open").click();
23 link.attr('data-direction', 'open').text(showmsg);
24 }
25 return false;
26}