From a7a8f4f9c9bbbd3bd16605235440dec29f581ad7 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Mon, 28 May 2012 16:49:36 +0000 Subject: Improvements to the hosted composite management app. Simplify and optimize the Web UI a bit. Add test cases and fix some of the logic in the management components. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1343316 13f79535-47bb-0310-9956-ffa450edef68 --- .../trunk/hosting/server/htdocs/account/index.html | 66 +- sca-cpp/trunk/hosting/server/htdocs/app/index.html | 279 ++++--- .../trunk/hosting/server/htdocs/cache-manifest.cmf | 2 +- .../trunk/hosting/server/htdocs/clone/index.html | 87 +-- sca-cpp/trunk/hosting/server/htdocs/config.js | 31 + .../trunk/hosting/server/htdocs/create/index.html | 70 +- .../trunk/hosting/server/htdocs/delete/index.html | 127 +++ .../trunk/hosting/server/htdocs/graph/index.html | 865 +++++++++------------ .../trunk/hosting/server/htdocs/home/index.html | 49 +- sca-cpp/trunk/hosting/server/htdocs/index.html | 214 +++-- .../trunk/hosting/server/htdocs/login/index.html | 173 +++-- .../trunk/hosting/server/htdocs/page/index.html | 572 ++++++++------ .../server/htdocs/proxy/public/oops/index.html | 171 ++++ .../trunk/hosting/server/htdocs/public/config.js | 29 + .../server/htdocs/public/notauth/index.html | 64 +- .../server/htdocs/public/notfound/index.html | 64 +- .../hosting/server/htdocs/public/notyet/index.html | 64 +- .../hosting/server/htdocs/public/oops/index.html | 64 +- .../trunk/hosting/server/htdocs/stats/index.html | 84 +- .../trunk/hosting/server/htdocs/store/index.html | 79 +- 20 files changed, 1853 insertions(+), 1301 deletions(-) create mode 100644 sca-cpp/trunk/hosting/server/htdocs/config.js create mode 100644 sca-cpp/trunk/hosting/server/htdocs/delete/index.html create mode 100644 sca-cpp/trunk/hosting/server/htdocs/proxy/public/oops/index.html create mode 100644 sca-cpp/trunk/hosting/server/htdocs/public/config.js (limited to 'sca-cpp/trunk/hosting/server/htdocs') diff --git a/sca-cpp/trunk/hosting/server/htdocs/account/index.html b/sca-cpp/trunk/hosting/server/htdocs/account/index.html index 291f6dea1c..dce34d2ef3 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/account/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/account/index.html @@ -17,29 +17,18 @@ * specific language governing permissions and limitations * under the License. --> -
+
- - - - - -

- - - - - -
Account
+
- + - +
Photo:
Name:
Description:

@@ -50,11 +39,11 @@ - - - - - + + + + +

@@ -65,28 +54,31 @@ - - - - - - - - - - + + + + + + + + + +
+
+ + +
diff --git a/sca-cpp/trunk/hosting/server/htdocs/graph/index.html b/sca-cpp/trunk/hosting/server/htdocs/graph/index.html index 34b7ead90e..6f73aec5ec 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/graph/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/graph/index.html @@ -17,42 +17,11 @@ * specific language governing permissions and limitations * under the License. --> -
+
- - - - - -

- - - - - -
- - - - - - - -
-- - -c - -+ - -> - - -
- -
- +
+
+
diff --git a/sca-cpp/trunk/hosting/server/htdocs/home/index.html b/sca-cpp/trunk/hosting/server/htdocs/home/index.html index 6fb9b558bf..914eb1df00 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/home/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/home/index.html @@ -17,25 +17,22 @@ * specific language governing permissions and limitations * under the License. --> -
+
- - - - - -

+
-
+
+
+
-
- -
+ - +

-
Requires Safari 5+, Chrome 11+, Firefox 4+, IE 9+
+
Requires Safari 5+, Chrome 11+, Firefox 4+, IE 9+
@@ -43,23 +40,25 @@ // Set page titles document.title = ui.windowtitle(location.hostname); -$('h1').innerHTML = ui.hometitle(location.hostname); +$('viewhead').innerHTML = '' + config.pagetitle + ''; +$('hometitle').innerHTML = config.hometitle; -$('maintitle').innerHTML = isNil(config.maintitle)? 'Simple App Builder' : config.maintitle; $('getstarted').onclick = function() { return ui.navigate('/#view=store', '_view'); }; -// Display the main diagram -var diagram = $('diagram'); -diagram.style.background = 'url(\'' + ui.b64img(appcache.get('/home/home.b64')) + '\')'; -var bgpos = 0; -setInterval(function() { - bgpos = bgpos -280; - if (bgpos == -2800) - bgpos = 0; - diagram.style.backgroundPosition = '0px ' + ui.pixpos(bgpos); -}, 2000); +// Display animation +var anim = $('homeanimation'); +if (!isNil(anim)) { + anim.style.background = 'url(\'' + ui.b64img(appcache.get('/home/home.b64')) + '\')'; + var bgpos = 0; + setInterval(function() { + bgpos = bgpos -280; + if (bgpos == -2800) + bgpos = 0; + anim.style.backgroundPosition = '0px ' + ui.pixpos(bgpos); + }, 2000); +} showStatus(defaultStatus()); diff --git a/sca-cpp/trunk/hosting/server/htdocs/index.html b/sca-cpp/trunk/hosting/server/htdocs/index.html index 468461cedc..b46141919d 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/index.html @@ -37,28 +37,31 @@ appcache.get = function(uri) { var u = h == -1? uri : uri.substring(0, h); // Get resource from local storage first - var item = localStorage.getItem(u); + var ls = window.lstorage || localStorage; + var item = null; + try { item = ls.getItem(u); } catch(e) {} if (item != null && item != '') return item; // Get resource from network var http = new XMLHttpRequest(); http.open("GET", u, false); + http.setRequestHeader("Accept", "*/*"); http.send(null); if (http.status == 200) { if (http.getResponseHeader("X-Login") != null) { - if (log) log('http error', u, 'X-Login'); + if (debug) debug('http error', u, 'X-Login'); // Redirect to login page if not signed in document.location = '/login/'; return null; } else if (http.responseText == '' || http.getResponseHeader("Content-Type") == null) { - if (log) log('http error', u, 'No-Content'); + if (debug) debug('http error', u, 'No-Content'); return null; } - localStorage.setItem(u, http.responseText); + try { ls.setItem(u, http.responseText); } catch(e) {} return http.responseText; } - if (log) log('http error', u, http.status, http.statusText); + if (debug) debug('http error', u, http.status, http.statusText); // Redirect to login page if not signed in if (http.status == 403) document.location = '/login/'; @@ -72,6 +75,10 @@ appcache.get = function(uri) { bootjs.text = appcache.get('/all-min.js'); document.head.appendChild(bootjs); document.head.appendChild(ui.declareCSS(appcache.get('/ui-min.css'))); + + // Disable cache for testing + lstorage.enabled = false; + })(); @@ -84,7 +91,7 @@ if (document.location.protocol == 'https:' && !hasauthcookie()) -
+
- + + - +
+
-
-
+ -
+
+ +
+ +
-

Sign in

+ + -
- - - -
Sign in with your Google account (using OpenID)
-
+
+
+Sign in +
-
- - - -
Sign in with your Facebook account (using OAuth)
-
+
+
+
-
- - - -
Sign in with your Google account (using OAuth)
+ +

Sign in with your Facebook account

+

-
- - - - - -
Sign in with your user id and password
User id:
Password:
-

- + +

Sign in with your Google account

+

-
- + +

+

+

+

+
+
@@ -78,7 +125,37 @@
+
+
+
+ diff --git a/sca-cpp/trunk/hosting/server/htdocs/proxy/public/oops/index.html b/sca-cpp/trunk/hosting/server/htdocs/proxy/public/oops/index.html new file mode 100644 index 0000000000..9c795bf843 --- /dev/null +++ b/sca-cpp/trunk/hosting/server/htdocs/proxy/public/oops/index.html @@ -0,0 +1,171 @@ + + + + +Oops + + + + + + + +
+ +
+ +
+ + + + +
+
+ +
+
+
+ +
+
Oops, something went wrong...
+ +
+
+
+ + + +
+
+ +
+ + diff --git a/sca-cpp/trunk/hosting/server/htdocs/public/config.js b/sca-cpp/trunk/hosting/server/htdocs/public/config.js new file mode 100644 index 0000000000..41a3bf6771 --- /dev/null +++ b/sca-cpp/trunk/hosting/server/htdocs/public/config.js @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +if (isNil(config)) + config = {}; + +/** + * UI configuration. + */ +config.windowtitle = 'App Builder' +config.pagetitle = 'App Builder'; +config.loginprompt = 'Sign in with your userid and password'; + diff --git a/sca-cpp/trunk/hosting/server/htdocs/public/notauth/index.html b/sca-cpp/trunk/hosting/server/htdocs/public/notauth/index.html index 0c0435d8a7..959c6be327 100644 --- a/sca-cpp/trunk/hosting/server/htdocs/public/notauth/index.html +++ b/sca-cpp/trunk/hosting/server/htdocs/public/notauth/index.html @@ -36,26 +36,29 @@ appcache.get = function(uri) { var u = h == -1? uri : uri.substring(0, h); // Get resource from local storage first - var item = localStorage.getItem(u); + var ls = window.lstorage || localStorage; + var item = null; + try { item = ls.getItem(u); } catch(e) {} if (item != null && item != '') return item; // Get resource from network var http = new XMLHttpRequest(); http.open("GET", u, false); + http.setRequestHeader("Accept", "*/*"); http.send(null); if (http.status == 200) { if (http.getResponseHeader("X-Login") != null) { - if (log) log('http error', u, 'X-Login'); + if (debug) debug('http error', u, 'X-Login'); return null; } else if (http.responseText == '' || http.getResponseHeader("Content-Type") == null) { - if (log) log('http error', u, 'No-Content'); + if (debug) debug('http error', u, 'No-Content'); return null; } - localStorage.setItem(u, http.responseText); + try { ls.setItem(u, http.responseText); } catch(e) {} return http.responseText; } - if (log) log('http error', u, http.status, http.statusText); + if (debug) debug('http error', u, http.status, http.statusText); return null; }; @@ -71,7 +74,7 @@ appcache.get = function(uri) { -
+
- + + -
+
+
- - -

+
+
+
-
+
Sorry, you're not authorized to view this page.
-
+
+
-
+
- + + -
+
+
- - -

+
+
+
-
+
Sorry, that page was not found.
You may have clicked an expired link or mistyped the address.
-
+
+
-
+
- + + -
+
+
- - -

+
+
+
-
+
Sorry, that page is still under construction.
Please check back later.
-
+
+
-
+
- + + -
+
+
- - -

+
+
+
-
+
Oops, something went wrong...
-
+
+