summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/js
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-03-27 21:58:51 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-03-27 21:58:51 +0000
commit093d169f38327c96964f9a42bc8fcd8f9eb32179 (patch)
tree0b3f612558ab97c02428314e97d159d764c1c1f7 /sca-cpp/trunk/modules/js
parent50fd6e0d7427c7d3332d7550b73245075e3879f1 (diff)
HTML cleanup, improve layout on different browsers, iOS and android devices and add robots.txt and some icons. Support execution and preview of components from the edit pages.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1086046 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/js')
-rw-r--r--sca-cpp/trunk/modules/js/htdocs/component.js7
-rw-r--r--sca-cpp/trunk/modules/js/htdocs/ui.css18
-rw-r--r--sca-cpp/trunk/modules/js/htdocs/ui.js23
-rw-r--r--sca-cpp/trunk/modules/js/htdocs/uicyan.css18
-rw-r--r--sca-cpp/trunk/modules/js/htdocs/util.js37
5 files changed, 85 insertions, 18 deletions
diff --git a/sca-cpp/trunk/modules/js/htdocs/component.js b/sca-cpp/trunk/modules/js/htdocs/component.js
index beef9357e5..3712ee59cb 100644
--- a/sca-cpp/trunk/modules/js/htdocs/component.js
+++ b/sca-cpp/trunk/modules/js/htdocs/component.js
@@ -407,6 +407,13 @@ HTTPBindingClient.getHTTPRequest = function() {
var sca = {};
/**
+ * Return an HTTP client proxy.
+ */
+sca.httpclient = function(name, uri) {
+ return new HTTPBindingClient(name, uri);
+};
+
+/**
* Return a component proxy.
*/
sca.component = function(name) {
diff --git a/sca-cpp/trunk/modules/js/htdocs/ui.css b/sca-cpp/trunk/modules/js/htdocs/ui.css
index 9b960e95ca..d3089c8ff3 100644
--- a/sca-cpp/trunk/modules/js/htdocs/ui.css
+++ b/sca-cpp/trunk/modules/js/htdocs/ui.css
@@ -20,6 +20,7 @@
body {
white-space: margin: 0px;
font-family: arial,sans-serif; font-style: normal; font-variant: normal; font-size: 13px;
+-webkit-text-size-adjust: none;
}
.delayed {
@@ -81,11 +82,11 @@ padding-left: 2px; padding-top: 2px; padding-right: 8px; white-space: normal; ve
}
.datatdl {
-border-right: 1px; border-top: 1px; border-bottom: 1px; border-style: solid; border-color: #dcdcdc; width: 10px;
+border-right: 1px; border-top: 1px; border-bottom: 1px; border-style: solid; border-color: #dcdcdc; width: 10px; vertical-align: top;
}
.datatdr {
-border-left: 1px; border-top: 1px; border-bottom: 1px; border-style: solid; border-color: #dcdcdc;
+border-left: 1px; border-top: 1px; border-bottom: 1px; border-style: solid; border-color: #dcdcdc; vertical-align: top;
}
.datatable {
@@ -99,19 +100,26 @@ opacity: .6;
filter: alpha(opacity=60);
}
+iframe {
+border: 0px; margin: 0px; padding: 0px;
+}
+
.widgetframe {
visibility: hidden; width: 0px; height: 0px; border: 0px;
}
.loadedframe {
-width: 100%; height: 100%; border: 0px;
-margin: 0px; padding: 0px;
+width: 100%; height: 100%;
+}
+
+.fakeframe {
+padding: 3px; background-color: #dcdcdc; color: #000000;
}
input {
vertical-align: middle;
font-family: arial,sans-serif; font-style: normal; font-variant: normal; font-size: 13px;
--webkit-text-size-adjust: 140%;
+-webkit-text-size-adjust: 100%;
}
textarea {
diff --git a/sca-cpp/trunk/modules/js/htdocs/ui.js b/sca-cpp/trunk/modules/js/htdocs/ui.js
index db8c439de4..5c1f45e244 100644
--- a/sca-cpp/trunk/modules/js/htdocs/ui.js
+++ b/sca-cpp/trunk/modules/js/htdocs/ui.js
@@ -36,10 +36,11 @@ ui.isIE = function() {
/**
* Build a menu bar.
*/
-ui.menu = function(name, href) {
- function Menu(n, h) {
+ui.menu = function(name, href, target) {
+ function Menu(n, h, t) {
this.name = n;
this.href = h;
+ this.target = isNil(t)? '_parent' : t;
this.content = function() {
function complete(uri) {
@@ -54,11 +55,11 @@ ui.menu = function(name, href) {
}
if (complete(this.href) != complete(window.top.location.pathname))
- return '<a href="' + this.href + '" target="_parent"><span class=amenu>' + this.name + '</span></a>';
- return '<a href="' + this.href + '" target="_parent"><span class=smenu>' + this.name + '</span></a>';
+ return '<a href="' + this.href + '" target="' + this.target + '"><span class=amenu>' + this.name + '</span></a>';
+ return '<a href="' + this.href + '" target="' + this.target + '"><span class=smenu>' + this.name + '</span></a>';
};
}
- return new Menu(name, href);
+ return new Menu(name, href, target);
};
ui.menubar = function(left, right) {
@@ -295,7 +296,6 @@ ui.csspos = function(p) {
* Convert a list of elements to an HTML table.
*/
ui.datatable = function(l) {
- log('datatable', writeValue(l));
function indent(i) {
if (i == 0)
@@ -308,22 +308,29 @@ ui.datatable = function(l) {
return '';
var e = car(l);
+ // Convert a list of simple values into a list of name value pairs
if (!isList(e))
return rows(expandElementValues("'value", l), i);
+ // Convert a list of complex values into a list of name value pairs
+ if (isList(car(e)))
+ return rows(expandElementValues("'value", l), i);
+
+ // Generate table row for a simple element value
if (elementHasValue(e)) {
var v = elementValue(e);
if (!isList(v)) {
return '<tr><td class="datatdl">' + indent(i) + elementName(e).slice(1) + '</td>' +
- '<td class="datatdr">' + v + '</td></tr>' +
+ '<td class="datatdr tdw">' + v + '</td></tr>' +
rows(cdr(l), i);
}
return rows(expandElementValues(elementName(e), v), i) + rows(cdr(l), i);
}
+ // Generate table row for an element with children
return '<tr><td class="datatdl">' + indent(i) + elementName(e).slice(1) + '</td>' +
- '<td class="datatdr">' + '</td></tr>' +
+ '<td class="datatdr tdw">' + '</td></tr>' +
rows(elementChildren(e), i + 1) +
rows(cdr(l), i);
}
diff --git a/sca-cpp/trunk/modules/js/htdocs/uicyan.css b/sca-cpp/trunk/modules/js/htdocs/uicyan.css
index 9b960e95ca..d3089c8ff3 100644
--- a/sca-cpp/trunk/modules/js/htdocs/uicyan.css
+++ b/sca-cpp/trunk/modules/js/htdocs/uicyan.css
@@ -20,6 +20,7 @@
body {
white-space: margin: 0px;
font-family: arial,sans-serif; font-style: normal; font-variant: normal; font-size: 13px;
+-webkit-text-size-adjust: none;
}
.delayed {
@@ -81,11 +82,11 @@ padding-left: 2px; padding-top: 2px; padding-right: 8px; white-space: normal; ve
}
.datatdl {
-border-right: 1px; border-top: 1px; border-bottom: 1px; border-style: solid; border-color: #dcdcdc; width: 10px;
+border-right: 1px; border-top: 1px; border-bottom: 1px; border-style: solid; border-color: #dcdcdc; width: 10px; vertical-align: top;
}
.datatdr {
-border-left: 1px; border-top: 1px; border-bottom: 1px; border-style: solid; border-color: #dcdcdc;
+border-left: 1px; border-top: 1px; border-bottom: 1px; border-style: solid; border-color: #dcdcdc; vertical-align: top;
}
.datatable {
@@ -99,19 +100,26 @@ opacity: .6;
filter: alpha(opacity=60);
}
+iframe {
+border: 0px; margin: 0px; padding: 0px;
+}
+
.widgetframe {
visibility: hidden; width: 0px; height: 0px; border: 0px;
}
.loadedframe {
-width: 100%; height: 100%; border: 0px;
-margin: 0px; padding: 0px;
+width: 100%; height: 100%;
+}
+
+.fakeframe {
+padding: 3px; background-color: #dcdcdc; color: #000000;
}
input {
vertical-align: middle;
font-family: arial,sans-serif; font-style: normal; font-variant: normal; font-size: 13px;
--webkit-text-size-adjust: 140%;
+-webkit-text-size-adjust: 100%;
}
textarea {
diff --git a/sca-cpp/trunk/modules/js/htdocs/util.js b/sca-cpp/trunk/modules/js/htdocs/util.js
index 5697ad27d4..3719a9cecc 100644
--- a/sca-cpp/trunk/modules/js/htdocs/util.js
+++ b/sca-cpp/trunk/modules/js/htdocs/util.js
@@ -286,6 +286,43 @@ function properties(o) {
}
/**
+ * Convert a host name to a domain name.
+ */
+function domainname(host) {
+ var h = reverse(host.split('.'));
+ return reverse(mklist(car(h), cadr(h))).join('.');
+}
+
+/**
+ * Return true if a host name is a subdomain.
+ */
+function issubdomain(host) {
+ return host.split('.').length > 2;
+}
+
+/**
+ * Convert a host name to a domain name title.
+ */
+function domaintitle(host) {
+ var h = reverse(host.split('.'));
+ var d = isNil(cdr(h))? car(h) : cadr(h);
+ return d.substr(0, 1).toUpperCase() + d.substr(1);
+}
+
+/**
+ * Format a string like Python format.
+ */
+function format() {
+ var i = 0;
+ var s = '';
+ for (a in arguments) {
+ s = i == 0? arguments[a] : s.replace('{' + a + '}', arguments[a]);
+ i++;
+ }
+ return s;
+}
+
+/**
* Functions with side effects. Use with moderation.
*/