From 093d169f38327c96964f9a42bc8fcd8f9eb32179 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Sun, 27 Mar 2011 21:58:51 +0000 Subject: 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 --- sca-cpp/trunk/modules/edit/apps.py | 2 + sca-cpp/trunk/modules/edit/htdocs/app/index.html | 292 ++++++++++++++++++--- .../trunk/modules/edit/htdocs/dash/dashboard.html | 46 +++- sca-cpp/trunk/modules/edit/htdocs/dash/index.html | 16 +- sca-cpp/trunk/modules/edit/htdocs/data/index.html | 28 +- sca-cpp/trunk/modules/edit/htdocs/favicon.ico | Bin 0 -> 2238 bytes sca-cpp/trunk/modules/edit/htdocs/graph/graph.html | 59 ++++- sca-cpp/trunk/modules/edit/htdocs/graph/graph.js | 20 +- sca-cpp/trunk/modules/edit/htdocs/graph/index.html | 22 +- sca-cpp/trunk/modules/edit/htdocs/index.html | 22 +- sca-cpp/trunk/modules/edit/htdocs/login/index.html | 5 +- .../trunk/modules/edit/htdocs/logout/index.html | 5 +- sca-cpp/trunk/modules/edit/htdocs/main.html | 9 +- sca-cpp/trunk/modules/edit/htdocs/menu.html | 15 +- sca-cpp/trunk/modules/edit/htdocs/page/index.html | 23 +- sca-cpp/trunk/modules/edit/htdocs/page/page.html | 30 ++- sca-cpp/trunk/modules/edit/htdocs/page/page.js | 38 ++- sca-cpp/trunk/modules/edit/htdocs/props/index.html | 22 +- sca-cpp/trunk/modules/edit/htdocs/props/props.html | 7 +- sca-cpp/trunk/modules/edit/htdocs/public/app.png | Bin 635 -> 258 bytes sca-cpp/trunk/modules/edit/htdocs/public/app.xcf | Bin 0 -> 1294 bytes .../trunk/modules/edit/htdocs/public/iframe.html | 32 +++ sca-cpp/trunk/modules/edit/htdocs/public/img.png | Bin 0 -> 368 bytes sca-cpp/trunk/modules/edit/htdocs/public/img.xcf | Bin 0 -> 1639 bytes .../trunk/modules/edit/htdocs/public/notauth.html | 26 +- .../trunk/modules/edit/htdocs/public/notfound.html | 20 +- sca-cpp/trunk/modules/edit/htdocs/public/oops.html | 18 +- .../trunk/modules/edit/htdocs/public/touchicon.png | Bin 0 -> 606 bytes .../trunk/modules/edit/htdocs/public/touchicon.xcf | Bin 0 -> 3400 bytes sca-cpp/trunk/modules/edit/htdocs/robots.txt | 2 + sca-cpp/trunk/modules/edit/htdocs/store/index.html | 21 +- sca-cpp/trunk/modules/edit/htdocs/store/store.html | 57 +++- sca-cpp/trunk/modules/edit/mkapplinks | 2 + sca-cpp/trunk/modules/http/httpd-conf | 4 + sca-cpp/trunk/modules/js/htdocs/component.js | 7 + sca-cpp/trunk/modules/js/htdocs/ui.css | 18 +- sca-cpp/trunk/modules/js/htdocs/ui.js | 23 +- sca-cpp/trunk/modules/js/htdocs/uicyan.css | 18 +- sca-cpp/trunk/modules/js/htdocs/util.js | 37 +++ 39 files changed, 732 insertions(+), 214 deletions(-) create mode 100644 sca-cpp/trunk/modules/edit/htdocs/favicon.ico create mode 100644 sca-cpp/trunk/modules/edit/htdocs/public/app.xcf create mode 100644 sca-cpp/trunk/modules/edit/htdocs/public/iframe.html create mode 100644 sca-cpp/trunk/modules/edit/htdocs/public/img.png create mode 100644 sca-cpp/trunk/modules/edit/htdocs/public/img.xcf create mode 100644 sca-cpp/trunk/modules/edit/htdocs/public/touchicon.png create mode 100644 sca-cpp/trunk/modules/edit/htdocs/public/touchicon.xcf create mode 100644 sca-cpp/trunk/modules/edit/htdocs/robots.txt (limited to 'sca-cpp') diff --git a/sca-cpp/trunk/modules/edit/apps.py b/sca-cpp/trunk/modules/edit/apps.py index 600a841ed5..233202040f 100644 --- a/sca-cpp/trunk/modules/edit/apps.py +++ b/sca-cpp/trunk/modules/edit/apps.py @@ -36,6 +36,8 @@ def mkapplink(id): os.symlink('../../../htdocs/public', 'apps/' + car(id) + '/htdocs/public'); os.symlink('../../../htdocs/data', 'apps/' + car(id) + '/htdocs/data'); os.symlink('../../../htdocs/app/index.html', 'apps/' + car(id) + '/htdocs/index.html'); + os.symlink('../../../htdocs/robots.txt', 'apps/' + car(id) + '/htdocs/robots.txt'); + os.symlink('../../../htdocs/favicon.ico', 'apps/' + car(id) + '/htdocs/favicon.ico'); os.symlink('../app.html', 'apps/' + car(id) + '/htdocs/app.html'); except: pass diff --git a/sca-cpp/trunk/modules/edit/htdocs/app/index.html b/sca-cpp/trunk/modules/edit/htdocs/app/index.html index 29f9efae65..bc8eb78e7d 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/app/index.html +++ b/sca-cpp/trunk/modules/edit/htdocs/app/index.html @@ -22,6 +22,10 @@ + + @@ -33,34 +37,83 @@ + +
+
+ +
+ diff --git a/sca-cpp/trunk/modules/edit/htdocs/dash/dashboard.html b/sca-cpp/trunk/modules/edit/htdocs/dash/dashboard.html index 89091c0517..d2bebe5114 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/dash/dashboard.html +++ b/sca-cpp/trunk/modules/edit/htdocs/dash/dashboard.html @@ -27,7 +27,7 @@ - +
@@ -46,7 +46,7 @@ - + @@ -71,34 +71,59 @@ if (ui.isIE()) $('bodydiv').style.right = -20; var editWidget = sca.component("EditWidget"); var dashboard = sca.reference(editWidget, "dashboard"); +/** + * Return the link to an app. + */ +function applink(appname) { + var protocol = window.location.protocol; + var host = window.location.hostname; + var port = ':' + window.location.port; + if (port == ':80' || port == ':443' || port == ':') + port = ''; + var link = protocol + '//' + appname + '.' + host + port + '/'; + return link; +} + /** * Get and display list of apps. */ function getapps(sync) { function display(doc) { var apps = '
App Name:
 
App Title:
Category:
'; - apps += '' + + apps += '' + + '' + + '' + '' + - ''; + '' + + ''; var feed = car(elementsToValues(atom.readATOMFeed(mklist(doc)))); var entries = cadr(assoc("'entry", cdr(feed))); for (var i = 0; i < length(entries); i++) { var entry = entries[i]; - title = cadr(assoc("'title", entry)) - name = cadr(assoc("'id", entry)) - hreflink = ''; - sharing = 'Shared with everybody'; + var title = cadr(assoc("'title", entry)) + var name = cadr(assoc("'id", entry)) + var editlink = ''; + var domainlink = '' + name + '.' + window.location.hostname + ''; + var category = 'coolapps'; + var updated = 'Feb 4, 2011'; + var sharing = 'Public'; apps += ''; + apps += editlink + '' + ''; + apps += ' ' + editlink + name + ''; + apps += ''; + apps += ''; apps += ''; + apps += ''; apps += ''; apps += ''; } apps += '
App
AppDomainCategoryTitleSharing
UpdatedSharing
'; - apps += hreflink + '' + ''; - apps += ' ' + hreflink + name + '' + domainlink + '' + category + '' + title + '' + updated + '' + sharing + '
'; $('apps').innerHTML = apps; + + // Show the page + ui.showbody(); } if (sync) { @@ -123,6 +148,7 @@ var defdesc = 'Enter a short description of your app here'; */ $('createAppButton').onclick = function() { $('appName').value = ''; + $('appDomain').innerHTML = '.' + window.location.hostname; $('appTitle').value = deftitle; $('appCategory').value = defcategory; $('appDescription').value = defdesc; diff --git a/sca-cpp/trunk/modules/edit/htdocs/dash/index.html b/sca-cpp/trunk/modules/edit/htdocs/dash/index.html index 281e2afff2..ea1b2f03b6 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/dash/index.html +++ b/sca-cpp/trunk/modules/edit/htdocs/dash/index.html @@ -22,6 +22,7 @@ + @@ -29,24 +30,25 @@ - - -

App Edit

+


+ diff --git a/sca-cpp/trunk/modules/edit/htdocs/data/index.html b/sca-cpp/trunk/modules/edit/htdocs/data/index.html index 9fe5b1b5a0..8a7a63e798 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/data/index.html +++ b/sca-cpp/trunk/modules/edit/htdocs/data/index.html @@ -17,11 +17,16 @@ * under the License. --> - -Results + +View + + @@ -32,7 +37,7 @@ - +
@@ -52,9 +57,18 @@ var comp = sca.component(cname); */ function display(e) { $('bodydiv').innerHTML = e; + + ui.showbody(); return true; } +/** + * Convert data to an HTML table. + */ +function datatable(e) { + return ui.datatable(e); +} + /** * Wrap a document in an HTML table. */ @@ -70,15 +84,15 @@ function getdata() { comp.get('', function(doc) { if (json.isJSON(mklist(doc))) - return display(ui.datatable(json.readJSON(mklist(doc)))); + return display(datatable(json.readJSON(mklist(doc)))); if (atom.isATOMEntry(mklist(doc))) - return display(ui.datatable(atom.readATOMEntry(mklist(doc)))); + return display(datatable(atom.readATOMEntry(mklist(doc)))); if (atom.isATOMFeed(mklist(doc))) - return display(ui.datatable(atom.readATOMFeed(mklist(doc)))); + return display(datatable(atom.readATOMFeed(mklist(doc)))); - return display(mkdoctable(doc)); + return display(mkdoctable(''; } -// Display the editor for the current app -document.title = 'Page - ' + appname; -$('appNameHeader').innerHTML = ' - ' + appname; editapp(appname); +ui.showbody(); diff --git a/sca-cpp/trunk/modules/edit/htdocs/page/page.html b/sca-cpp/trunk/modules/edit/htdocs/page/page.html index 6cd828ea74..219374a3d1 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/page/page.html +++ b/sca-cpp/trunk/modules/edit/htdocs/page/page.html @@ -28,7 +28,7 @@ - +
@@ -52,19 +52,20 @@

Header1

-

Header2

-section - - - -checkbox - - -
namevalue
namevalue
+

Header2

+section + + + +checkbox + + +
table...
......
-link -text - +link +text +frame ... +
@@ -129,6 +130,9 @@ function getpage(name, edit) { }, nodeList(buffer.childNodes[0].childNodes)); savedpagexhtml = pagexhtml(); + + // Show the page + ui.showbody(); }); } diff --git a/sca-cpp/trunk/modules/edit/htdocs/page/page.js b/sca-cpp/trunk/modules/edit/htdocs/page/page.js index 1fb136236b..54b3751900 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/page/page.js +++ b/sca-cpp/trunk/modules/edit/htdocs/page/page.js @@ -337,12 +337,23 @@ if (ui.isIE()) { page.text = function(e) { if (e.className == 'h1' || e.className == 'h2' || e.className == 'text' || e.className == 'section') return car(childElements(e)).innerHTML; - if (e.className == 'button' || e.className == 'entry' || e.className == 'password' || e.className == 'checkbox') + if (e.className == 'button' || e.className == 'checkbox') return car(childElements(e)).value; + if (e.className == 'entry' || e.className == 'password') + return car(childElements(e)).defaultValue; if (e.className == 'list') return car(childElements(car(childElements(e)))).value; - if (e.className == 'link') - return car(childElements(car(childElements(e)))).innerHTML; + if (e.className == 'link') { + var hr = car(childElements(e)).href; + var t = car(childElements(car(childElements(e)))).innerHTML; + return hr == t? hr : hr + ',' + t; + } + if (e.className == 'img') { + var src = car(childElements(e)).src; + return src == window.location.href? '' : src; + } + if (e.className == 'iframe') + return car(childElements(e)).href; if (e.className == 'table') return ''; return ''; @@ -357,7 +368,7 @@ page.settext = function(e, t) { return t; } if (e.className == 'button' || e.className == 'entry' || e.className == 'password') { - car(childElements(e)).value = t; + car(childElements(e)).defaultValue = t; return t; } if (e.className == 'checkbox') { @@ -371,14 +382,23 @@ page.settext = function(e, t) { ce.innerHTML = t; return t; } + if (e.className == 'table') { + return ''; + } if (e.className == 'link') { - var ce = car(childElements(car(childElements(e)))); - ce.href = t; - ce.innerHTML = t; + var l = t.split(','); + var ce = car(childElements(e)); + ce.href = car(l); + car(childElements(ce)).innerHTML = isNil(cdr(l))? car(l) : cadr(l); return t; } - if (e.className == 'table') { - return ''; + if (e.className == 'img') { + car(childElements(e)).src = t; + return t; + } + if (e.className == 'iframe') { + car(childElements(e)).href = t; + return t; } return ''; }; diff --git a/sca-cpp/trunk/modules/edit/htdocs/props/index.html b/sca-cpp/trunk/modules/edit/htdocs/props/index.html index 650c68a350..9c7553bef2 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/props/index.html +++ b/sca-cpp/trunk/modules/edit/htdocs/props/index.html @@ -18,10 +18,11 @@ --> -App Settings +Settings + @@ -29,6 +30,11 @@ +

+
+ +
+ - -

App Edit

-
-
- - + diff --git a/sca-cpp/trunk/modules/edit/htdocs/props/props.html b/sca-cpp/trunk/modules/edit/htdocs/props/props.html index 36d4e075ad..698dfb2b57 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/props/props.html +++ b/sca-cpp/trunk/modules/edit/htdocs/props/props.html @@ -27,7 +27,7 @@ - +
@@ -45,6 +45,8 @@
+ + @@ -97,6 +99,9 @@ function getapp(name) { $('appUpdated').innerHTML = defdate; $('appDescription').innerHTML = defdesc; savedappentryxml = car(atom.writeATOMEntry(valuesToElements(mklist(appentry)))); + + // Show the page + ui.showbody(); }); } diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/app.png b/sca-cpp/trunk/modules/edit/htdocs/public/app.png index bae5415d0c..d3bf372316 100644 Binary files a/sca-cpp/trunk/modules/edit/htdocs/public/app.png and b/sca-cpp/trunk/modules/edit/htdocs/public/app.png differ diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/app.xcf b/sca-cpp/trunk/modules/edit/htdocs/public/app.xcf new file mode 100644 index 0000000000..741b7ff43f Binary files /dev/null and b/sca-cpp/trunk/modules/edit/htdocs/public/app.xcf differ diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/iframe.html b/sca-cpp/trunk/modules/edit/htdocs/public/iframe.html new file mode 100644 index 0000000000..140ff48b8b --- /dev/null +++ b/sca-cpp/trunk/modules/edit/htdocs/public/iframe.html @@ -0,0 +1,32 @@ + + + +frame + + + + + + + +
frame ...
+ + + diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/img.png b/sca-cpp/trunk/modules/edit/htdocs/public/img.png new file mode 100644 index 0000000000..42fcce9212 Binary files /dev/null and b/sca-cpp/trunk/modules/edit/htdocs/public/img.png differ diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/img.xcf b/sca-cpp/trunk/modules/edit/htdocs/public/img.xcf new file mode 100644 index 0000000000..ffcc124584 Binary files /dev/null and b/sca-cpp/trunk/modules/edit/htdocs/public/img.xcf differ diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/notauth.html b/sca-cpp/trunk/modules/edit/htdocs/public/notauth.html index f49c914057..a4c808deb7 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/public/notauth.html +++ b/sca-cpp/trunk/modules/edit/htdocs/public/notauth.html @@ -18,7 +18,7 @@ --> -App Edit - Sorry +Sorry @@ -29,20 +29,27 @@ - - -

App Edit

+


+
Sorry, you're not authorized to view this page.
+ + - diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/notfound.html b/sca-cpp/trunk/modules/edit/htdocs/public/notfound.html index 980d1e1960..a69cd7dd6e 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/public/notfound.html +++ b/sca-cpp/trunk/modules/edit/htdocs/public/notfound.html @@ -18,7 +18,7 @@ --> -App Edit - Page not found +Page not found @@ -29,16 +29,22 @@ +

+
+ +
Sorry, that page was not found.
+
You may have clicked an expired link or mistyped the address.
+ +if (!issubdomain(window.location.hostname)) + ui.loadwidget('menu', '/menu.html', ui.showbody); -

App Edit

-
-
Sorry, that page was not found.
-
You may have clicked an expired link or mistyped the address.
+$('h1').innerHTML = domaintitle(window.location.hostname); + +ui.showbody(); + diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/oops.html b/sca-cpp/trunk/modules/edit/htdocs/public/oops.html index f4f23d2f60..e7e5085db5 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/public/oops.html +++ b/sca-cpp/trunk/modules/edit/htdocs/public/oops.html @@ -18,7 +18,7 @@ --> -App Edit - Oops +Oops @@ -29,15 +29,21 @@ +

+
+ +
Oops, something went wrong...
+ +if (!issubdomain(window.location.hostname)) + ui.loadwidget('menu', '/menu.html', ui.showbody); -

App Edit

-
-
Oops, something went wrong...
+$('h1').innerHTML = domaintitle(window.location.hostname); + +ui.showbody(); + diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/touchicon.png b/sca-cpp/trunk/modules/edit/htdocs/public/touchicon.png new file mode 100644 index 0000000000..f22c33d2a0 Binary files /dev/null and b/sca-cpp/trunk/modules/edit/htdocs/public/touchicon.png differ diff --git a/sca-cpp/trunk/modules/edit/htdocs/public/touchicon.xcf b/sca-cpp/trunk/modules/edit/htdocs/public/touchicon.xcf new file mode 100644 index 0000000000..fc713b478b Binary files /dev/null and b/sca-cpp/trunk/modules/edit/htdocs/public/touchicon.xcf differ diff --git a/sca-cpp/trunk/modules/edit/htdocs/robots.txt b/sca-cpp/trunk/modules/edit/htdocs/robots.txt new file mode 100644 index 0000000000..1f53798bb4 --- /dev/null +++ b/sca-cpp/trunk/modules/edit/htdocs/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / diff --git a/sca-cpp/trunk/modules/edit/htdocs/store/index.html b/sca-cpp/trunk/modules/edit/htdocs/store/index.html index f425c0117a..849600d84e 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/store/index.html +++ b/sca-cpp/trunk/modules/edit/htdocs/store/index.html @@ -22,6 +22,7 @@ + @@ -29,24 +30,30 @@ +

+
+ +
+ -

App Edit

-
+$('h1').innerHTML = domaintitle(window.location.hostname); -
- - + diff --git a/sca-cpp/trunk/modules/edit/htdocs/store/store.html b/sca-cpp/trunk/modules/edit/htdocs/store/store.html index d8b0f44e01..79717a01ef 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/store/store.html +++ b/sca-cpp/trunk/modules/edit/htdocs/store/store.html @@ -27,15 +27,11 @@ - +
-
App Icon:
App Title:
Category:
- - - -
Cool Apps
+

@@ -43,7 +39,39 @@ diff --git a/sca-cpp/trunk/modules/edit/mkapplinks b/sca-cpp/trunk/modules/edit/mkapplinks index 9114210d8c..ac7baf4f17 100755 --- a/sca-cpp/trunk/modules/edit/mkapplinks +++ b/sca-cpp/trunk/modules/edit/mkapplinks @@ -38,6 +38,8 @@ for n in `ls apps | awk '{ printf "apps/%s/htdocs\n", $1 }'`; do ln -s ../../../htdocs/public "$n/public" ln -s ../../../htdocs/data "$n/data" ln -s ../../../htdocs/app/index.html "$n/index.html" + ln -s ../../../htdocs/robots.txt "$n/robots.txt" + ln -s ../../../htdocs/favicon.ico "$n/favicon.ico" ln -s ../app.html "$n/app.html" fi done diff --git a/sca-cpp/trunk/modules/http/httpd-conf b/sca-cpp/trunk/modules/http/httpd-conf index e32acf2268..46a8fc3cce 100755 --- a/sca-cpp/trunk/modules/http/httpd-conf +++ b/sca-cpp/trunk/modules/http/httpd-conf @@ -109,6 +109,10 @@ Require all granted AuthType None Require all granted + +AuthType None +Require all granted + # Listen on HTTP port Listen $listen 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 @@ -406,6 +406,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. */ 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 '' + this.name + ''; - return '' + this.name + ''; + return '' + this.name + ''; + return '' + this.name + ''; }; } - 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 '' + indent(i) + elementName(e).slice(1) + '' + - '' + v + '' + + '' + v + '' + rows(cdr(l), i); } return rows(expandElementValues(elementName(e), v), i) + rows(cdr(l), i); } + // Generate table row for an element with children return '' + indent(i) + elementName(e).slice(1) + '' + - '' + '' + + '' + '' + 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 @@ -285,6 +285,43 @@ function properties(o) { return a; } +/** + * 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. */ -- cgit v1.2.3