Rename Dimp.baseWindow to DimpCore.base
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 7 Sep 2010 23:28:10 +0000 (17:28 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 7 Sep 2010 23:38:00 +0000 (17:38 -0600)
imp/js/compose-dimp.js
imp/js/dimpcore.js
imp/js/fullmessage-dimp.js

index a3d70b9..daebfec 100644 (file)
@@ -20,9 +20,9 @@ var DimpCompose = {
     {
         if (window.confirm(DIMP.text_compose.cancel)) {
             if ((this.is_popup || DIMP.conf_compose.popup) &&
-                DIMP.baseWindow.DimpBase &&
+                DimpCore.base &&
                 !DIMP.conf_compose.qreply) {
-                DIMP.baseWindow.focus();
+                DimpCore.base.focus();
             }
             DimpCore.doAction(DIMP.conf_compose.auto_save_interval_val ? 'deleteDraft' : 'cancelCompose', { imp_compose: $F('composeCache') }, { ajaxopts: { asynchronous: DIMP.conf_compose.qreply } });
             this.updateDraftsMailbox();
@@ -33,9 +33,9 @@ var DimpCompose = {
     updateDraftsMailbox: function()
     {
         if (this.is_popup &&
-            DIMP.baseWindow.DimpBase &&
-            DIMP.baseWindow.DimpBase.folder == DIMP.conf_compose.drafts_mbox) {
-            DIMP.baseWindow.DimpBase.poll();
+            DimpCore.base &&
+            DimpCore.base.DimpBase.folder == DIMP.conf_compose.drafts_mbox) {
+            DimpCore.base.DimpBase.poll();
         }
     },
 
@@ -242,9 +242,9 @@ var DimpCompose = {
 
                 if (d.action == 'saveDraft') {
                     if (this.is_popup &&
-                        DIMP.baseWindow.DimpBase &&
+                        DimpCore.base &&
                         !DIMP.conf_compose.qreply) {
-                        DIMP.baseWindow.DimpCore.showNotifications(r.msgs);
+                        DimpCore.base.DimpCore.showNotifications(r.msgs);
                         r.msgs = [];
                     }
                     if (DIMP.conf_compose.close_draft) {
@@ -254,38 +254,38 @@ var DimpCompose = {
                 break;
 
             case 'sendMessage':
-                if (this.is_popup && DIMP.baseWindow.DimpBase) {
+                if (this.is_popup && DimpCore.base) {
                     if (d.reply_type) {
-                        DIMP.baseWindow.DimpBase.flag(d.reply_type == 'forward' ? '$forwarded' : '\\answered', true, { uid: d.uid, mailbox: d.reply_folder, noserver: true });
+                        DimpCore.base.DimpBase.flag(d.reply_type == 'forward' ? '$forwarded' : '\\answered', true, { uid: d.uid, mailbox: d.reply_folder, noserver: true });
                     }
 
                     if (d.mailbox) {
-                        DIMP.baseWindow.DimpBase.mailboxCallback(r);
+                        DimpCore.base.DimpBase.mailboxCallback(r);
                     }
 
                     if (d.draft_delete) {
-                        DIMP.baseWindow.DimpBase.poll();
+                        DimpCore.base.DimpBase.poll();
                     }
 
                     if (d.log) {
-                        DIMP.baseWindow.DimpBase.updateMsgLog(d.log, { uid: d.uid, mailbox: d.reply_folder });
+                        DimpCore.base.DimpBase.updateMsgLog(d.log, { uid: d.uid, mailbox: d.reply_folder });
                     }
 
                     if (!DIMP.conf_compose.qreply) {
-                        DIMP.baseWindow.DimpCore.showNotifications(r.msgs);
+                        DimpCore.base.DimpCore.showNotifications(r.msgs);
                         r.msgs = [];
                     }
                 }
                 return this.closeCompose();
 
             case 'redirectMessage':
-                if (this.is_popup && DIMP.baseWindow.DimpBase) {
+                if (this.is_popup && DimpCore.base) {
                     if (d.log) {
-                        DIMP.baseWindow.DimpBase.updateMsgLog(d.log, { uid: d.uid, mailbox: d.mbox });
+                        DimpCore.base.DimpBase.updateMsgLog(d.log, { uid: d.uid, mailbox: d.mbox });
                     }
 
                     if (!DIMP.conf_compose.qreply) {
-                        DIMP.baseWindow.DimpCore.showNotifications(r.msgs);
+                        DimpCore.base.DimpCore.showNotifications(r.msgs);
                         r.msgs = [];
                     }
                 }
@@ -967,7 +967,7 @@ var DimpCompose = {
         DimpCore.growler_log = false;
         DimpCore.init();
 
-        this.is_popup = DIMP.baseWindow.DimpBase;
+        this.is_popup = DimpCore.base;
 
         /* Initialize redirect elements (always needed). */
         $('redirect').observe('submit', Event.stop);
index b449dd2..67c7056 100644 (file)
@@ -13,6 +13,7 @@ var DimpCore = {
     //   DMenu, Growler, inAjaxCallback, is_init, is_logout
     //   onDoActionComplete
     alarms: {},
+    base: null,
     growler_log: true,
     server_error: 0,
 
@@ -594,12 +595,11 @@ var DimpCore = {
         /* Determine base window. Need a try/catch block here since, if the
          * page was loaded by an opener out of this current domain, this will
          * throw an exception. */
-        DIMP.baseWindow = {};
         try {
             if (parent.opener &&
                 parent.opener.location.host == window.location.host &&
                 parent.opener.DimpCore) {
-                DIMP.baseWindow = parent.opener.DIMP.baseWindow || parent.opener;
+                this.base = parent.opener.DimpCore.base || parent.opener;
             }
         } catch (e) {}
     }
index bcbf3a1..0779a3e 100644 (file)
@@ -106,12 +106,12 @@ var DimpFullmessage = {
             case 'button_deleted':
             case 'button_ham':
             case 'button_spam':
-                if (DIMP.baseWindow.DimpBase) {
-                    DIMP.baseWindow.focus();
+                if (DimpCore.base) {
+                    DimpCore.base.focus();
                     if (id == 'button_deleted') {
-                        DIMP.baseWindow.DimpBase.deleteMsg({ uid: this.uid, mailbox: this.mailbox });
+                        DimpCore.base.DimpBase.deleteMsg({ uid: this.uid, mailbox: this.mailbox });
                     } else {
-                        DIMP.baseWindow.DimpBase.reportSpam(id == 'button_spam', { uid: this.uid, mailbox: this.mailbox });
+                        DimpCore.base.DimpBase.reportSpam(id == 'button_spam', { uid: this.uid, mailbox: this.mailbox });
                     }
                     window.close();
                 }
@@ -230,8 +230,8 @@ var DimpFullmessage = {
             DimpCore.updateMsgLog(this.log);
         }
 
-        if (this.strip && DIMP.baseWindow.DimpBase) {
-            DIMP.baseWindow.DimpBase.poll();
+        if (this.strip && DimpCore.base) {
+            DimpCore.base.DimpBase.poll();
         }
 
         $('dimpLoading').hide();