diff --git a/priv/css/muc.css b/priv/css/muc.css index 48b7a19fa..b81ad5b52 100644 --- a/priv/css/muc.css +++ b/priv/css/muc.css @@ -16,12 +16,14 @@ a.roomjid {color: #336699; font-size: 24px; font-weight: bold; font-family: sans div.logdate {color: #663399; font-size: 20px; font-weight: bold; font-family: sans-serif; letter-spacing: 2px; border-bottom: #224466 solid 1pt; margin-left:80pt; margin-top:20px;} div.roomsubject {color: #336699; font-size: 18px; font-family: sans-serif; margin-left: 80pt; margin-bottom: 10px;} div.rc {color: #336699; font-size: 12px; font-family: sans-serif; margin-left: 50%; text-align: right; background: #f3f6f9; border-bottom: 1px solid #336699; border-right: 4px solid #336699;} -div.rct {font-weight: bold; background: #e3e6e9; padding-right: 10px;} +div.rct {font-weight: bold; background: #e3e6e9; padding-right: 10px; cursor: pointer;} +div.rct:hover {text-decoration: underline;} div.rcos {padding-right: 10px;} div.rcoe {color: green;} div.rcod {color: red;} div.rcoe:after {content: ": v";} div.rcod:after {content: ": x";} div.rcot:after {} +div.jl {display: none;} .legend {width: 100%; margin-top: 30px; border-top: #224466 solid 1pt; padding: 10px 0px 10px 0px; text-align: left; font-family: monospace; letter-spacing: 2px;} .w3c {position: absolute; right: 10px; width: 60%; text-align: right; font-family: monospace; letter-spacing: 1px;} diff --git a/priv/js/muc.js b/priv/js/muc.js index 9acd0dcfa..7f7de5c39 100644 --- a/priv/js/muc.js +++ b/priv/js/muc.js @@ -6,3 +6,14 @@ function sh(e) { document.getElementById(e).style.display='none'; } } +// Show/Hide join/leave elements +function jlf() { + var es = document.getElementsByClassName('jl'); + for (var i = 0; i < es.length; i++) { + if (es[i].style.display === 'block') { + es[i].style.display = 'none'; + } else { + es[i].style.display = 'block'; + } + } +} diff --git a/src/mod_muc_log.erl b/src/mod_muc_log.erl index fa2c47c22..b678961b5 100644 --- a/src/mod_muc_log.erl +++ b/src/mod_muc_log.erl @@ -443,11 +443,13 @@ add_message_to_log(Nick1, Message, RoomJID, Opts, {_, _, Microsecs} = Now, STimeUnique = io_lib:format("~ts.~w", [STime, Microsecs]), + maybe_print_jl(open, F, Message, FileFormat), fw(F, io_lib:format("[~ts] ", [STimeUnique, STimeUnique, STimeUnique, STime]) ++ Text, FileFormat), + maybe_print_jl(close, F, Message, FileFormat), file:close(F), ok. @@ -598,6 +600,7 @@ put_header(F, Room, Date, CSSFile, Lang, Hour_offset, RoomOccupants = roomoccupants_to_string(Occupants, FileFormat), put_room_occupants(F, RoomOccupants, Lang, FileFormat), + put_occupants_join_leave(F, Lang), Time_offset_str = case Hour_offset < 0 of true -> io_lib:format("~p", [Hour_offset]); false -> io_lib:format("+~p", [Hour_offset]) @@ -663,6 +666,35 @@ put_room_occupants(F, RoomOccupants, Lang, [Now2, RoomOccupants]), fw(F, <<"">>). +put_occupants_join_leave(F, Lang) -> + fw(F, <<"
">>), + fw(F, + <<"
~ts
">>, + [tr(Lang, ?T("Show Occupants Join/Leave"))]), + fw(F, <<"
">>). + +maybe_print_jl(_Direction, _F, _Message, plaintext) -> + ok; +maybe_print_jl(Direction, F, Message, html) -> + PrintJl = case Message of + join -> true; + leave -> true; + {leave, _} -> true; + _ -> false + end, + case PrintJl of + true -> print_jl(Direction, F); + false -> ok + end. + +print_jl(Direction, F) -> + String = case Direction of + open -> "
"; + close -> "
" + end, + fw(F, io_lib:format(String, [])). + htmlize(S1) -> htmlize(S1, html). htmlize(S1, plaintext) ->