You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2011/02/27 08:34:28 UTC

svn commit: r1074997 - in /tuscany/sca-cpp/trunk/modules/edit: dashboards/joe@sca-store.com htdocs/graph/graph.js htdocs/login/index.html

Author: jsdelfino
Date: Sun Feb 27 07:34:28 2011
New Revision: 1074997

URL: http://svn.apache.org/viewvc?rev=1074997&view=rev
Log:
Fixes to make the edit module work with HTTPS.

Added:
    tuscany/sca-cpp/trunk/modules/edit/dashboards/joe@sca-store.com
Modified:
    tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/graph.js
    tuscany/sca-cpp/trunk/modules/edit/htdocs/login/index.html

Added: tuscany/sca-cpp/trunk/modules/edit/dashboards/joe@sca-store.com
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/dashboards/joe%40sca-store.com?rev=1074997&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/dashboards/joe@sca-store.com (added)
+++ tuscany/sca-cpp/trunk/modules/edit/dashboards/joe@sca-store.com Sun Feb 27 07:34:28 2011
@@ -0,0 +1 @@
+(("An App that shows my Aggregated Social Profile" "myprofile" ()) ("An advanced version of the Aggregated Social Profile App" "myprofile2" ()) ("An App that shows Friends Near Me" "nearme" ()) ("An advanced version of the Friends Near Me App" "nearme2" ()) ("Sample Online Store App" "store" ()) ("Layout Variation of the Online Store App" "store2" ()) ("Another Variation of the Online Store App" "store3" ()) ("Travel Tutorial App" "travel" ()) ("An Empty Test App" "test" ()) ("Test Values and Lists" "testvalues" ()) ("Test Social Components" "testsocial" ()) ("Test URL Components" "testurl" ()) ("Test Logic Components" "testlogic" ()) ("Test Text Processing Components" "testtext" ()))
\ No newline at end of file

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/graph.js
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/graph.js?rev=1074997&r1=1074996&r2=1074997&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/graph.js (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/graph.js Sun Feb 27 07:34:28 2011
@@ -1838,10 +1838,12 @@ graph.edit = function(appname, compos, n
  * Return the link to a component value.
  */
 graph.compvaluelink = function(appname, cname) {
-    var scheme = 'http';
-    var domain = "sca-store.com";
-    var port = '8090';
-    var link = scheme + '://' + appname + '.' + domain + ':' + port + '/components/' + cname;
+    var protocol = window.location.protocol;
+    var host = window.location.hostname;
+    var port = ':' + window.location.port;
+    if (port == ':80' || port == ':443')
+        port = '';
+    var link = protocol + '//' + appname + '.' + host + port + '/components/' + cname;
     return '<a href="' + link + '">' + link + '</a>';
 
 };

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/login/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/login/index.html?rev=1074997&r1=1074996&r2=1074997&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/login/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/login/index.html Sun Feb 27 07:34:28 2011
@@ -29,9 +29,37 @@
 <br/>
 
 <script type="text/javascript">
+function queryParams() {
+    qp = new Array();
+    qs = window.location.search.substring(1).split('&');
+    for (i = 0; i < qs.length; i++) {
+        e = qs[i].indexOf('=');
+        if (e > 0)
+            qp[qs[i].substring(0, e)] = unescape(qs[i].substring(e + 1));
+    }
+    return qp;
+}
+
+function oauthReferrer() {
+    r = queryParams()['openauth_referrer'];
+    if (typeof(r) == 'undefined')
+        return r;
+    s = r.indexOf('//');
+    if (s > 0)
+        r = r.substring(s + 2);
+    s = r.indexOf('/');
+    if (s > 0)
+        r = r.substring(s);
+    return r;
+}
+
+if (typeof(oauthReferrer()) == 'undefined') {
+    document.location = '/';
+}
+
 function submitFormSignin() {
     document.cookie = 'TuscanyOpenAuth=;expires=' + new Date(1970,01,01).toGMTString() + ';path=/;secure=TRUE';
-    document.formSignin.httpd_location.value = '/';
+    document.formSignin.httpd_location.value = oauthReferrer();
     document.formSignin.submit();
 }
 </script>