+ if (this.win) {
+ this.win.close();
+ this.win = null;
+ }
+ },
+
+ activate: function (enable) {
+ if (this.enabled == enable) {
+ return true;
+ }
+ if (enable) {
+ this.disable();
+
+ this.win = window.open("moderation.php", "Moderazione", "width=800,height=600,toolbar=no,location=no,menubar=no,status=no");
+ if (this.win == null) {
+ this.disable();
+ return false;
+ }
+ // to finish initialization we wait for popup page onload event ...
+ this.win_waitonload();
+ }
+ else {
+ this.disable();
+ this.enabled = false;
+ }
+
+ },
+
+ 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();
+ }
+ },
+
+ post_onload: function() {
+ $(this.win, 'mainbody').innerHTML = "GHE SEMU";
+ this.enabled = true;
+ },
+
+ is_enabled: function() {
+ return (this.enabled);
+ }// ,
+
+ //add: function(item) {
+ // this.item.append(new ModerateItem(item));
+ //}
+ // send_mesg("moderate|"+(enable ? "true" | "false"));
+