comparison mod_muc_log_http/muc_log_http/mod_muc_log_http.lua @ 108:4c2b35e3d979

mod_muc_log_http: corrected the merged stuff
author Thilo Cestonaro <thilo@cestona.ro>
date Tue, 08 Dec 2009 21:29:41 +0100
parents 0e4e000e3de9
children 5e657a305c88
comparison
equal deleted inserted replaced
107:0e4e000e3de9 108:4c2b35e3d979
36 36
37 --[[ 37 --[[
38 * Default templates for the html output. 38 * Default templates for the html output.
39 ]]-- 39 ]]--
40 local html = {}; 40 local html = {};
41 <<<<<<< local
42 local theme = "default"; 41 local theme = "default";
43 =======
44 html.doc = [[<html>
45 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
46 <head>
47 <title>muc_log</title>
48 </head>
49 <script type="text/javascript"><!--
50 function showHide(name) {
51 var eles = document.getElementsByName(name);
52 for (var i = 0; i < eles.length; i++) {
53 eles[i].style.display = eles[i].style.display != "none" ? "none" : "";
54 }
55 }
56 --></script>
57 <style type="text/css">
58 <!--
59 .day { font: 12px Verdana; height: 17px; }
60 .weekday { font: 10px Verdana; height: 17px; color: #FFFFFF; background-color: #000000; }
61 .timestuff {color: #AAAAAA; text-decoration: none;}
62 .muc_join {color: #009900; font-style: italic;}
63 .muc_leave {color: #009900; font-style: italic;}
64 .muc_statusChange {color: #009900; font-style: italic;}
65 .muc_title {color: #BBBBBB; font-size: 32px;}
66 .muc_titleChange {color: #009900; font-style: italic;}
67 .muc_kick {color: #009900; font-style: italic;}
68 .muc_bann {color: #009900; font-style: italic;}
69 .muc_msg_nick {color: #0000AA;}
70 .muc_msg_me {color: #0000AA;}
71 .join_link {font-height: 9px;}
72 //-->
73 </style>
74 <body>
75 ###BODY_STUFF###
76 </body>
77 <script><!--
78 window.captureEvents(Event.RESIZE | Event.LOAD);
79 window.onresize = resize;
80 window.onload = load;
81 function load(e) {
82 resize(e);
83 }
84
85 function resize(e) {
86 var ele = document.getElementById("main");
87 ele.style.height = window.innerHeight - ele.offsetTop - 25;
88
89 var yearDivs = document.getElemetsByName("yearDiv");
90 if(yearDivs) {
91 for each (var year in yearDivs) {
92 year.style.width = window.innerWidth - year.style.padding;
93 }
94 }
95 }
96
97 --></script>
98 </html>]];
99
100 html.components = {};
101 html.components.bit = [[<a href="###COMPONENT###/">###COMPONENT###</a><br />]]
102 html.components.body = [[<h2>Available Multi-User Chats:</h2><hr /><p>
103 ###COMPONENTS_STUFF###
104 </p><hr />]];
105
106 html.rooms = {};
107 html.rooms.bit = [[<a href="###ROOM###/">###ROOM###</a><br />]]
108 html.rooms.body = [[<h2>Available rooms on ###COMPONENT###:</h2><hr /><p>
109 ###ROOMS_STUFF###
110 </p><hr />]];
111
112 html.days = {};
113 html.days.bit = [[<a href="###BARE_DAY###/">###DAY###</a><br />]];
114 html.days.body = [[<h2>Available days for ###JID###:</h2><hr /><div id="main" style="overflow: auto;">
115 ###DAYS_STUFF###
116 </div><hr />]];
117
118 html.day = {};
119 html.day.title = [[Subject: <font class="muc_title">###TITLE###</font>]];
120 html.day.time = [[<a name="###TIME###" href="####TIME###" class="timestuff">[###TIME###]</a> ]]; -- the one ####TIME### need to stay! it will evaluate to e.g. #09:10:56 which is an anker then
121 html.day.presence = {};
122 html.day.presence.join = [[<div name="joinLeave" style="display: ###SHOWHIDE###;">###TIME_STUFF###<font class="muc_join"> *** ###NICK### has joined the room</font><br /></div>]];
123 html.day.presence.leave = [[<div name="joinLeave" style="display: ###SHOWHIDE###;">###TIME_STUFF###<font class="muc_leave"> *** ###NICK### has left the room</font><br /></div>]];
124 html.day.presence.statusText = [[ and his status message is "###STATUS###"]];
125 html.day.presence.statusChange = [[<div name="status" style="display: ###SHOWHIDE###;">###TIME_STUFF###<font class="muc_statusChange"> *** ###NICK### shows as "###SHOW###"###STATUS_STUFF###</font><br /></div>]];
126 html.day.message = [[###TIME_STUFF###<font class="muc_msg_nick">&lt;###NICK###&gt;</font> ###MSG###<br />]];
127 html.day.message_me = [[###TIME_STUFF###<font class="muc_msg_me">*###NICK### ###MSG###</font><br />]];
128 html.day.titleChange = [[###TIME_STUFF###<font class="muc_titleChange"> *** ###NICK### changed the title to "###TITLE###"</font><br />]];
129 html.day.reason = [[, the reason was "###REASON###"]]
130 html.day.kick = [[###TIME_STUFF###<font class="muc_kick"> *** ###VICTIM### got kicked###REASON_STUFF###</font><br />]];
131 html.day.bann = [[###TIME_STUFF###<font class="muc_bann"> *** ###VICTIM### got banned###REASON_STUFF###</font><br />]];
132 html.day.day_link = [[<a href="../###DAY###/">###TEXT###</a>]]
133 html.day.body = [[<h2>Logs for ###JID### on 20###YEAR###/###MONTH###/###DAY###</h2>
134 <p>###TITLE_STUFF###</p>
135 <font class="join_link"><a href="http://speeqe.com/room/###JID###/" target="_blank">Join room via speeqe.com</a></font><br />
136 ###PREVIOUS_LINK### ###NEXT_LINK###<br />
137 <input type="checkbox" onclick="showHide('joinLeave')" ###JOIN_CHECKED###/>show/hide joins and leaves</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
138 <input type="checkbox" onclick="showHide('status')" ###STATUS_CHECKED###/>show/hide status changes</button>
139 <hr /><div id="main" style="overflow: auto;">
140 ###DAY_STUFF###
141 </div><hr />
142 ]];
143
144 -- Calendar stuff
145 html.year = {};
146 html.year.title = [[<center><font style="font: bold 16px Verdana;"><a name="###YEAR###">###YEAR###</a></font></center>]];
147
148 html.month = {};
149 html.month.header = [[<table rules="groups" cellpadding="5">
150 <thead><tr><td colspan="7"><center><H2><font size="2" face="Verdana">###TITLE###</font></H2></center></td></tr></thead>
151 <tbody style="border: solid black 1px;">
152 <tr>
153 ###WEEKDAYS###</tr>
154 ]];
155 html.month.weekDay = [[ <th class="weekday" valign="middle" align="center">###DAY###</th>]];
156 html.month.emptyDay = [[ <td class="day">&nbsp;</td>]];
157 html.month.day = [[ <td class="day" valign="middle" align="center">###DAY###</td>]];
158 html.month.footer = [[</tbody></table>]];
159
160 >>>>>>> other
161 42
162 local function checkDatastorePathExists(node, host, today, create) 43 local function checkDatastorePathExists(node, host, today, create)
163 create = create or false; 44 create = create or false;
164 local path = data_getpath(node, host, datastore, "dat", true); 45 local path = data_getpath(node, host, datastore, "dat", true);
165 path = path:gsub("/[^/]*$", ""); 46 path = path:gsub("/[^/]*$", "");