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/03/21 08:42:11 UTC
svn commit: r1083694 [2/2] - in /tuscany/sca-cpp/trunk/modules: edit/
edit/apps/test/ edit/apps/testsocial/ edit/apps/testtext/
edit/apps/testvalues/ edit/htdocs/ edit/htdocs/app/ edit/htdocs/dash/
edit/htdocs/data/ edit/htdocs/graph/ edit/htdocs/login...
Modified: tuscany/sca-cpp/trunk/modules/js/htdocs/component.js
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/js/htdocs/component.js?rev=1083694&r1=1083693&r2=1083694&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/js/htdocs/component.js (original)
+++ tuscany/sca-cpp/trunk/modules/js/htdocs/component.js Mon Mar 21 07:42:09 2011
@@ -102,9 +102,9 @@ JSONClient.toJSON = function(o) {
/**
* Construct an HTTPBindingClient.
*/
-function HTTPBindingClient(cname, uri, objectID) {
- this.uri = "/references/" + cname + "/" + uri;
- this.objectID = objectID;
+function HTTPBindingClient(name, uri) {
+ this.name = name;
+ this.uri = uri;
this.apply = this.createApplyMethod();
}
@@ -407,21 +407,17 @@ HTTPBindingClient.getHTTPRequest = funct
var sca = {};
/**
- * Return a component.
+ * Return a component proxy.
*/
sca.component = function(name) {
- function ClientComponent(name) {
- this.name = name;
- }
-
- return new ClientComponent(name);
+ return new HTTPBindingClient(name, '/components/' + name);
};
/**
* Return a reference proxy.
*/
-sca.reference = function(comp, name) {
- return new HTTPBindingClient(comp.name, name);
+sca.reference = function(comp, rname) {
+ return new HTTPBindingClient(comp.name + '/' + rname, "/references/" + comp.name + "/" + rname);
};
/**
Modified: tuscany/sca-cpp/trunk/modules/js/htdocs/jsonutil.js
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/js/htdocs/jsonutil.js?rev=1083694&r1=1083693&r2=1083694&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/js/htdocs/jsonutil.js (original)
+++ tuscany/sca-cpp/trunk/modules/js/htdocs/jsonutil.js Mon Mar 21 07:42:09 2011
@@ -80,7 +80,7 @@ json.jsValToValue = function(jsv) {
if (isList(jsv))
return json.jsPropertiesToValues(mklist(), jsv, reverse(range(0, jsv.length)));
if (typeof jsv == 'object')
- return json.jsPropertiesToValues(mklist(), jsv, properties(jsv));
+ return json.jsPropertiesToValues(mklist(), jsv, reverse(properties(jsv)));
if (typeof jsv == 'string')
return '' + jsv;
return jsv;
Modified: tuscany/sca-cpp/trunk/modules/js/htdocs/ui.css
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/js/htdocs/ui.css?rev=1083694&r1=1083693&r2=1083694&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/js/htdocs/ui.css (original)
+++ tuscany/sca-cpp/trunk/modules/js/htdocs/ui.css Mon Mar 21 07:42:09 2011
@@ -22,10 +22,18 @@ white-space: margin: 0px;
font-family: arial,sans-serif; font-style: normal; font-variant: normal; font-size: 13px;
}
+.delayed {
+visibility: hidden;
+}
+
table {
border: 0px; border-collapse: collapse; border-color: #a2bae7; border-style: solid;
font-family: arial,sans-serif; font-style: normal; font-variant: normal; font-size: 13px;
-overflow: hidden;
+overflow: visible;
+}
+
+.trb {
+border-bottom: 1px; border-bottom-style: solid; border-color: #dcdcdc;
}
th {
@@ -36,6 +44,14 @@ border-style: solid; border-top-color: #
overflow: hidden;
}
+.section {
+font-weight: bold; background-color: #e5ecf9; color: #000000;
+text-align: left; padding-left: 2px; padding-right: 8px; padding-top: 2px; padding-bottom: 4px; vertical-align: text-top; white-space: nowrap;
+border-top: 1px; border-bottom: 1px; border-left: 0px; border-right: 0px;
+border-style: solid; border-top-color: #a2bae7; border-bottom-color: #d1d3d4; border-left-color: #a2bae7; border-right-color: #a2bae7;
+overflow: hidden;
+}
+
.thl {
border-left: 0px;
}
@@ -50,11 +66,10 @@ padding: 0px;
td {
padding-left: 2px; padding-top: 2px; padding-right: 8px; white-space: nowrap; vertical-align: text-top; border: 0px;
-overflow: hidden;
}
.tdl {
-border-right: 1px; border-style: solid; border-color: #a2bae7;
+border-right: 1px; border-style: solid; border-color: #a2bae7; width: 10px;
}
.tdr {
@@ -65,6 +80,25 @@ border-left: 1px; border-style: solid; b
padding-left: 2px; padding-top: 2px; padding-right: 8px; white-space: normal; vertical-align: text-top;
}
+.datatdl {
+border-right: 1px; border-top: 1px; border-bottom: 1px; border-style: solid; border-color: #dcdcdc; width: 10px;
+}
+
+.datatdr {
+border-left: 1px; border-top: 1px; border-bottom: 1px; border-style: solid; border-color: #dcdcdc;
+}
+
+.datatable {
+border-top: 1px; border-bottom: 1px; border-style: solid; border-color: #dcdcdc;
+overflow: visible;
+}
+
+.databg {
+opacity: .6;
+-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";
+filter: alpha(opacity=60);
+}
+
.widgetframe {
visibility: hidden; width: 0px; height: 0px; border: 0px;
}
@@ -125,6 +159,10 @@ font-size: 200%; font-weight: bold;
font-size: 150%; font-weight: bold;
}
+img {
+border: 0px;
+}
+
.imgbutton {
width: 142px; height: 64px; margin-left: 20px; margin-right: 20px; padding: 0px; border: 1px;
cursor: pointer; cursor: hand;
Modified: tuscany/sca-cpp/trunk/modules/js/htdocs/ui.js
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/js/htdocs/ui.js?rev=1083694&r1=1083693&r2=1083694&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/js/htdocs/ui.js (original)
+++ tuscany/sca-cpp/trunk/modules/js/htdocs/ui.js Mon Mar 21 07:42:09 2011
@@ -233,19 +233,28 @@ ui.queryParams = function() {
/**
* Bind a widget iframe to an element.
*/
-ui.widgets = new Array();
+ui.widgets = {};
+ui.onload = {};
-ui.loadwidget = function(el, doc) {
+ui.loadwidget = function(el, doc, cb) {
var f = el + 'Frame';
+ window.ui.widgets[f] = el;
+ window.ui.onload[f] = cb;
var div = document.createElement('div');
div.id = f + 'Div';
- div.innerHTML = '<iframe id="' + f + '" class="widgetframe" scrolling="no" frameborder="0" src="' + doc + '"></iframe>';
+ div.innerHTML = '<iframe id="' + f + '" class="widgetframe" scrolling="no" frameborder="0" src="' + doc + '" onload="window.ui.onload[this.id]()"></iframe>';
document.body.appendChild(div);
- window.ui.widgets[f] = el;
return f;
};
/**
+ * Show the current document body.
+ */
+ui.showbody = function() {
+ document.body.style.visibility = 'visible';
+};
+
+/**
* Install a widget into the element bound to its iframe.
*/
ui.installwidget = function() {
@@ -282,3 +291,43 @@ ui.csspos = function(p) {
return Number(p.substr(0, p.length - 2));
};
+/**
+ * Convert a list of elements to an HTML table.
+ */
+ui.datatable = function(l) {
+ log('datatable', writeValue(l));
+
+ function indent(i) {
+ if (i == 0)
+ return '';
+ return ' ' + indent(i - 1);
+ }
+
+ function rows(l, i) {
+ if (isNil(l))
+ return '';
+ var e = car(l);
+
+ if (!isList(e))
+ return rows(expandElementValues("'value", l), i);
+
+ 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>' +
+ rows(cdr(l), i);
+ }
+
+ return rows(expandElementValues(elementName(e), v), i) + rows(cdr(l), i);
+ }
+
+ return '<tr><td class="datatdl">' + indent(i) + elementName(e).slice(1) + '</td>' +
+ '<td class="datatdr">' + '</td></tr>' +
+ rows(elementChildren(e), i + 1) +
+ rows(cdr(l), i);
+ }
+
+ return '<table class="datatable ' + (window.name == 'dataFrame'? ' databg' : '') + '" style="width: 100%;">' + rows(l, 0) + '</table>';
+}
+
Modified: tuscany/sca-cpp/trunk/modules/js/htdocs/uicyan.css
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/js/htdocs/uicyan.css?rev=1083694&r1=1083693&r2=1083694&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/js/htdocs/uicyan.css (original)
+++ tuscany/sca-cpp/trunk/modules/js/htdocs/uicyan.css Mon Mar 21 07:42:09 2011
@@ -22,10 +22,18 @@ white-space: margin: 0px;
font-family: arial,sans-serif; font-style: normal; font-variant: normal; font-size: 13px;
}
+.delayed {
+visibility: hidden;
+}
+
table {
border: 0px; border-collapse: collapse; border-color: #a2bae7; border-style: solid;
font-family: arial,sans-serif; font-style: normal; font-variant: normal; font-size: 13px;
-overflow: hidden;
+overflow: visible;
+}
+
+.trb {
+border-bottom: 1px; border-bottom-style: solid; border-color: #dcdcdc;
}
th {
@@ -36,6 +44,14 @@ border-style: solid; border-top-color: #
overflow: hidden;
}
+.section {
+font-weight: bold; background-color: #e5ecf9; color: #000000;
+text-align: left; padding-left: 2px; padding-right: 8px; padding-top: 2px; padding-bottom: 4px; vertical-align: text-top; white-space: nowrap;
+border-top: 1px; border-bottom: 1px; border-left: 0px; border-right: 0px;
+border-style: solid; border-top-color: #a2bae7; border-bottom-color: #d1d3d4; border-left-color: #a2bae7; border-right-color: #a2bae7;
+overflow: hidden;
+}
+
.thl {
border-left: 0px;
}
@@ -50,11 +66,10 @@ padding: 0px;
td {
padding-left: 2px; padding-top: 2px; padding-right: 8px; white-space: nowrap; vertical-align: text-top; border: 0px;
-overflow: hidden;
}
.tdl {
-border-right: 1px; border-style: solid; border-color: #a2bae7;
+border-right: 1px; border-style: solid; border-color: #a2bae7; width: 10px;
}
.tdr {
@@ -65,6 +80,25 @@ border-left: 1px; border-style: solid; b
padding-left: 2px; padding-top: 2px; padding-right: 8px; white-space: normal; vertical-align: text-top;
}
+.datatdl {
+border-right: 1px; border-top: 1px; border-bottom: 1px; border-style: solid; border-color: #dcdcdc; width: 10px;
+}
+
+.datatdr {
+border-left: 1px; border-top: 1px; border-bottom: 1px; border-style: solid; border-color: #dcdcdc;
+}
+
+.datatable {
+border-top: 1px; border-bottom: 1px; border-style: solid; border-color: #dcdcdc;
+overflow: visible;
+}
+
+.databg {
+opacity: .6;
+-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";
+filter: alpha(opacity=60);
+}
+
.widgetframe {
visibility: hidden; width: 0px; height: 0px; border: 0px;
}
@@ -125,6 +159,10 @@ font-size: 200%; font-weight: bold;
font-size: 150%; font-weight: bold;
}
+img {
+border: 0px;
+}
+
.imgbutton {
width: 142px; height: 64px; margin-left: 20px; margin-right: 20px; padding: 0px; border: 1px;
cursor: pointer; cursor: hand;
Modified: tuscany/sca-cpp/trunk/modules/js/htdocs/util.js
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/js/htdocs/util.js?rev=1083694&r1=1083693&r2=1083694&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/js/htdocs/util.js (original)
+++ tuscany/sca-cpp/trunk/modules/js/htdocs/util.js Mon Mar 21 07:42:09 2011
@@ -25,7 +25,9 @@
* Scheme-like lists.
*/
function cons(car, cdr) {
- return new Array(car).concat(cdr);
+ var a = new Array();
+ a.push(car);
+ return a.concat(cdr);
}
function car(l) {
Modified: tuscany/sca-cpp/trunk/modules/server/mod-eval.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/server/mod-eval.hpp?rev=1083694&r1=1083693&r2=1083694&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/server/mod-eval.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/server/mod-eval.hpp Mon Mar 21 07:42:09 2011
@@ -134,6 +134,8 @@ const failable<int> get(request_rec* r,
// Write a simple value as a JSON value
if (!isList(c)) {
js::JSContext cx;
+ if (isSymbol(c))
+ return httpd::writeResult(json::writeJSON(valuesToElements(mklist<value>(mklist<value>("name", value(string(c))))), cx), "application/json", r);
return httpd::writeResult(json::writeJSON(valuesToElements(mklist<value>(mklist<value>("value", c))), cx), "application/json", r);
}