deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject deltaspike git commit: DELTASPIKE-1148 add client side method for generating new windowIds
Date Thu, 19 May 2016 20:52:04 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 351b56369 -> f21e0266d


DELTASPIKE-1148 add client side method for generating new windowIds

Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/f21e0266
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/f21e0266
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/f21e0266

Branch: refs/heads/master
Commit: f21e0266d240305f6b9327e2f7111298c95a7335
Parents: 351b563
Author: Thomas Andraschko <tandraschko@apache.org>
Authored: Thu May 19 22:50:57 2016 +0200
Committer: Thomas Andraschko <tandraschko@apache.org>
Committed: Thu May 19 22:51:29 2016 +0200

----------------------------------------------------------------------
 .../resources/META-INF/resources/deltaspike/windowhandler.js | 8 ++++++--
 .../jsf/impl/src/main/resources/static/windowhandler.html    | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/f21e0266/deltaspike/modules/jsf/impl/src/main/resources/META-INF/resources/deltaspike/windowhandler.js
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/resources/META-INF/resources/deltaspike/windowhandler.js
b/deltaspike/modules/jsf/impl/src/main/resources/META-INF/resources/deltaspike/windowhandler.js
index 1dcbe97..12dbd0c 100644
--- a/deltaspike/modules/jsf/impl/src/main/resources/META-INF/resources/deltaspike/windowhandler.js
+++ b/deltaspike/modules/jsf/impl/src/main/resources/META-INF/resources/deltaspike/windowhandler.js
@@ -238,7 +238,7 @@ window.dswh = window.dswh || {
 
                 dswh.utils.log('--- #tokenizedRedirect');
 
-                var requestToken = dswh.utils.generateRequestToken();
+                var requestToken = dswh.utils.generateNewRequestToken();
                 dswh.utils.storeCookie('dsrwid-' + requestToken, dswh.windowId, 3);
                 window.location = dswh.utils.setUrlParam(link.href, 'dsrid', requestToken);
             },
@@ -563,9 +563,13 @@ window.dswh = window.dswh || {
             document.cookie = cookieName + "=" + expires + "; path=/";
         },
 
-        generateRequestToken : function() {
+        generateNewRequestToken : function() {
             return "" + Math.floor(Math.random() * 999);
         },
+        
+        generateNewWindowId : function() {
+            return "" + Math.floor((Math.random() * (9999 - 1000)) + 1000);
+        },
 
         storeCookie : function(name, value, seconds) {
             var expiresDate = new Date();

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/f21e0266/deltaspike/modules/jsf/impl/src/main/resources/static/windowhandler.html
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/resources/static/windowhandler.html b/deltaspike/modules/jsf/impl/src/main/resources/static/windowhandler.html
index 0374484..60bea75 100644
--- a/deltaspike/modules/jsf/impl/src/main/resources/static/windowhandler.html
+++ b/deltaspike/modules/jsf/impl/src/main/resources/static/windowhandler.html
@@ -173,7 +173,7 @@
                     }
                 }
 
-                var requestToken = dswh.utils.generateRequestToken();
+                var requestToken = dswh.utils.generateNewRequestToken();
 
                 var redirectUrl = '$$requestUrl$$';
                 redirectUrl = dswh.utils.setUrlParam(redirectUrl, "dsrid", requestToken);


Mime
View raw message