From 2ff2f08f96c643e5501d2c352ef2ced7b52715f4 Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Tue, 2 Jul 2013 15:08:57 +0200 Subject: [PATCH] window opened with '_blank' name to prevent win reuse during reload, reload managed, exit managed --- web/Obj/user.phh | 7 +++++-- web/commons.js | 29 +++++++++++++++++++++++------ web/moderation.php | 41 ++++++++++++++++++++++++++++++++++++----- 3 files changed, 64 insertions(+), 13 deletions(-) diff --git a/web/Obj/user.phh b/web/Obj/user.phh index bda7cd6..35c76ad 100644 --- a/web/Obj/user.phh +++ b/web/Obj/user.phh @@ -607,14 +607,17 @@ class User { if ($cur_step == -1) { log_rd2("PRE-NEWSTAT: ".$this->stat); + if ($this->flags_vlt_get(USER_FLAG_MODER)) { + $ret .= sprintf('moderate(true);'); + } if ($this->stat == 'room') { log_rd("roomma ".$this->step); $curtime = time(); - + if ($G_with_splash && ($$CO_splashdate < $curtime - $G_splash_interval || $$CO_splashdate > $curtime)) { - $is_super = $this->flags & USER_FLAG_TY_SUPER; + $is_super = $this->flags_get(USER_FLAG_TY_SUPER); $ret .= show_notify_ex(str_replace("\n", " ", $G_splash_content[$G_lang]), ($is_super ? 0 : $G_splash_timeout), // $mlang_indrd[($is_super ? 'btn_btotabsup' : 'btn_backtotab')][$G_lang], diff --git a/web/commons.js b/web/commons.js index bc39719..5e98d05 100644 --- a/web/commons.js +++ b/web/commons.js @@ -458,17 +458,35 @@ function act_logout(exitlock) function ModerateItem(item_ar) { - var tr, td; + var tr, td, date; this.time = item_ar[0]; this.usrid = item_ar[1]; this.where = item_ar[2]; this.name = item_ar[3]; this.cont = item_ar[4]; + date = new Date(); + date.setTime(this.time * 1000); + tr = document.createElement("tr"); + td = document.createElement("td"); + // FIXME a more readable date here + // td.innerHTML = date.xxxx; + td.innerHTML = this.time % 100000; + tr.appendChild(td); + + td = document.createElement("td"); + td.innerHTML = this.where; + tr.appendChild(td); + + td = document.createElement("td"); + td.innerHTML = this.usrid; + tr.appendChild(td); + td = document.createElement("td"); td.innerHTML = this.name; tr.appendChild(td); + td = document.createElement("td"); td.innerHTML = this.cont; tr.appendChild(td); @@ -522,7 +540,7 @@ Moderate.prototype = { if (enable) { this.disable(); - this.win = window.open("moderation.php", "Moderazione", "width=800,height=600,toolbar=no,location=no,menubar=no,status=no"); + this.win = window.open("moderation.php", "_blank", "width=800,height=600,toolbar=no,location=no,menubar=no,status=no"); if (this.win == null) { this.disable(); return false; @@ -539,11 +557,9 @@ Moderate.prototype = { win_waitonload: function () { if (typeof(this.win.is_loaded) == 'undefined' || this.win.is_loaded != true) { - console.log("not ready"); this.tout = setTimeout(function (obj) { obj.win_waitonload(); }, 250, this); } else { - console.log("ready now!"); this.post_onload(); } }, @@ -580,12 +596,10 @@ Moderate.prototype = { add: function(item) { var mi; - console.log(typeof(this.item)); mi = new ModerateItem(item); this.item.push(mi); this.table.appendChild(mi.tr_get()); - } // send_mesg("moderate|"+(enable ? "false" | "true")); @@ -630,6 +644,9 @@ function act_moderate() function act_reloadroom() { + if (g_moder.is_enabled()) { + g_moder.disable(); + } window.onunload = null; window.onbeforeunload = null; document.location.assign("index.php"); diff --git a/web/moderation.php b/web/moderation.php index cddc0d8..50f320a 100644 --- a/web/moderation.php +++ b/web/moderation.php @@ -1,8 +1,25 @@ + Moderation