ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject incubator-ponymail git commit: Add option to change page when popup closes
Date Thu, 03 Nov 2016 13:57:16 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/master 69385fe99 -> 5acb78c50


Add option to change page when popup closes

Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/5acb78c5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/5acb78c5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/5acb78c5

Branch: refs/heads/master
Commit: 5acb78c50f08800ef9ce01cccd2c74ec90c49d52
Parents: 69385fe
Author: Sebb <sebb@apache.org>
Authored: Thu Nov 3 13:57:05 2016 +0000
Committer: Sebb <sebb@apache.org>
Committed: Thu Nov 3 13:57:05 2016 +0000

----------------------------------------------------------------------
 site/js/dev/ponymail_dom_helpers.js | 14 +++++++++++---
 site/js/ponymail.js                 | 14 +++++++++++---
 2 files changed, 22 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/5acb78c5/site/js/dev/ponymail_dom_helpers.js
----------------------------------------------------------------------
diff --git a/site/js/dev/ponymail_dom_helpers.js b/site/js/dev/ponymail_dom_helpers.js
index 4f1868f..f08fb3e 100644
--- a/site/js/dev/ponymail_dom_helpers.js
+++ b/site/js/dev/ponymail_dom_helpers.js
@@ -225,7 +225,7 @@ function setPopup(pid, close) {
 
 
 // Pop-up message display thingy. Used for saying "email sent...I think!"
-function popup(title, body, timeout, pid) {
+function popup(title, body, timeout, pid, wloc) {
     var obj = document.getElementById('popupper')
     if (pid) {
         if (typeof(window.localStorage) !== "undefined") {
@@ -238,17 +238,25 @@ function popup(title, body, timeout, pid) {
     if (obj) {
         obj.innerHTML = ""
         obj.style.display = 'block'
-        obj.innerHTML = "<h3>" + title + "</h3><p>" + body + "</p><p><a
class='btn btn-success' href='javascript:void(0);' onclick='toggleView(\"popupper\")'>Got
it!</a></p>"
+        obj.innerHTML = "<h3>" + title + "</h3><p>" + body + "</p><p><a
class='btn btn-success' href='javascript:void(0);' onclick='popup_close(\""+wloc?wloc:''+"\")'>Got
it!</a></p>"
         if (pid) {
             obj.innerHTML += "<br/><input type='checkbox' onclick='setPopup(\""+pid+"\",
this.checked);' id='popre'><label for='popre'>Don't show this again</label>"
         }
         // hide popupper after N seconds, giving people enough time to read it.
         window.setTimeout(function() {
-            document.getElementById('popupper').style.display = 'none'
+            popup_close(wloc)
             }, (timeout ? timeout : 5) * 1000)
     }
 }
 
+// close the popup and open new page if required
+function popup_close(wloc){
+    document.getElementById('popupper').style.display = 'none'
+    if (wloc) {
+        location.href = wloc
+    }
+}
+
 // function for determining if an email is open or not
 function openEmail() {
     kiddos = []

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/5acb78c5/site/js/ponymail.js
----------------------------------------------------------------------
diff --git a/site/js/ponymail.js b/site/js/ponymail.js
index 541a928..27a4776 100644
--- a/site/js/ponymail.js
+++ b/site/js/ponymail.js
@@ -1321,7 +1321,7 @@ function setPopup(pid, close) {
 
 
 // Pop-up message display thingy. Used for saying "email sent...I think!"
-function popup(title, body, timeout, pid) {
+function popup(title, body, timeout, pid, wloc) {
     var obj = document.getElementById('popupper')
     if (pid) {
         if (typeof(window.localStorage) !== "undefined") {
@@ -1334,17 +1334,25 @@ function popup(title, body, timeout, pid) {
     if (obj) {
         obj.innerHTML = ""
         obj.style.display = 'block'
-        obj.innerHTML = "<h3>" + title + "</h3><p>" + body + "</p><p><a
class='btn btn-success' href='javascript:void(0);' onclick='toggleView(\"popupper\")'>Got
it!</a></p>"
+        obj.innerHTML = "<h3>" + title + "</h3><p>" + body + "</p><p><a
class='btn btn-success' href='javascript:void(0);' onclick='popup_close(\""+wloc?wloc:''+"\")'>Got
it!</a></p>"
         if (pid) {
             obj.innerHTML += "<br/><input type='checkbox' onclick='setPopup(\""+pid+"\",
this.checked);' id='popre'><label for='popre'>Don't show this again</label>"
         }
         // hide popupper after N seconds, giving people enough time to read it.
         window.setTimeout(function() {
-            document.getElementById('popupper').style.display = 'none'
+            popup_close(wloc)
             }, (timeout ? timeout : 5) * 1000)
     }
 }
 
+// close the popup and open new page if required
+function popup_close(wloc){
+    document.getElementById('popupper').style.display = 'none'
+    if (wloc) {
+        location.href = wloc
+    }
+}
+
 // function for determining if an email is open or not
 function openEmail() {
     kiddos = []


Mime
View raw message