summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/js/htdocs/ui.js
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-05-02 05:58:26 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-05-02 05:58:26 +0000
commit8cfb387f9129dcff5ff74922a3be8f1662529037 (patch)
tree5a21e215aeddafb6669f9f12b89507217939f558 /sca-cpp/trunk/modules/js/htdocs/ui.js
parentc5541eed95f492f5fd615e6159115b0840ef0c37 (diff)
Simplify HTML and Javascript to improve UI and performance on iOS devices. Fix offline cache manifest. Add an app clone page.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1098489 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--sca-cpp/trunk/modules/js/htdocs/ui.js28
1 files changed, 19 insertions, 9 deletions
diff --git a/sca-cpp/trunk/modules/js/htdocs/ui.js b/sca-cpp/trunk/modules/js/htdocs/ui.js
index 20b2cd0579..db58f8b4e5 100644
--- a/sca-cpp/trunk/modules/js/htdocs/ui.js
+++ b/sca-cpp/trunk/modules/js/htdocs/ui.js
@@ -34,17 +34,12 @@ ui.isIE = function() {
};
/**
- * Build a portable href attribute.
- */
-ui.href = function(loc, target) {
- return 'javascript:window.open(\'' + loc + '\', \'' + target + '\');';
-};
-
-/**
* Build a portable <a href> tag.
*/
ui.ahref = function(loc, target, html) {
- return '<a href="' + ui.href(loc, target) + '">' + html + '</a>';
+ if (target == '_blank')
+ return '<a href="' + loc + '" target="_blank">' + html + '</a>';
+ return '<a href="javascript:void(0)" onclick="window.open(\'' + loc + '\', \'' + target + '\');">' + html + '</a>';
};
/**
@@ -270,6 +265,14 @@ ui.showbody = function() {
};
/**
+ * Reload the current page.
+ */
+ui.reload = function() {
+ window.open(window.location, '_self');
+ return true;
+};
+
+/**
* Install a widget into the element bound to its iframe.
*/
ui.installwidget = function() {
@@ -300,13 +303,20 @@ ui.loadiframe = function(el, doc) {
/**
* Convert a CSS position to a numeric position.
*/
-ui.csspos = function(p) {
+ui.numpos = function(p) {
if (p == '')
return 0;
return Number(p.substr(0, p.length - 2));
};
/**
+ * Convert a numeric position to a CSS pixel position.
+ */
+ui.pixpos = function(p) {
+ return p + 'px';
+};
+
+/**
* Convert a list of elements to an HTML table.
*/
ui.datatable = function(l) {