diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2011-03-27 21:58:51 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2011-03-27 21:58:51 +0000 |
commit | 093d169f38327c96964f9a42bc8fcd8f9eb32179 (patch) | |
tree | 0b3f612558ab97c02428314e97d159d764c1c1f7 /sca-cpp/trunk/modules/js/htdocs/ui.js | |
parent | 50fd6e0d7427c7d3332d7550b73245075e3879f1 (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/htdocs/ui.js')
-rw-r--r-- | sca-cpp/trunk/modules/js/htdocs/ui.js | 23 |
1 files changed, 15 insertions, 8 deletions
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); } |