summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/js/htdocs/ui.js
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-06-13 07:57:39 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-06-13 07:57:39 +0000
commit2d73791e1d6fe81a262df6ffcc06875462d585b7 (patch)
treeb8a9bfb3fb75ec1a4613489e0515a7066dc6adb0 /sca-cpp/trunk/modules/js/htdocs/ui.js
parentd3bdc051ec4a6499c73d00e80f744aa375a01687 (diff)
Add the ability to configure page headers and footers.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1135049 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.js65
1 files changed, 16 insertions, 49 deletions
diff --git a/sca-cpp/trunk/modules/js/htdocs/ui.js b/sca-cpp/trunk/modules/js/htdocs/ui.js
index b0d159d07e..b5843d8916 100644
--- a/sca-cpp/trunk/modules/js/htdocs/ui.js
+++ b/sca-cpp/trunk/modules/js/htdocs/ui.js
@@ -228,66 +228,33 @@ ui.queryParams = function() {
qp[qs[i].substring(0, e)] = unescape(qs[i].substring(e + 1));
}
return qp;
-}
-
-/**
- * Bind a widget iframe to an element.
- */
-ui.widgets = {};
-ui.onload = {};
-
-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 + '" onload="window.ui.onload[this.id]()"></iframe>';
- document.body.appendChild(div);
- return f;
};
/**
- * Show the current document body.
+ * Return true if the client is a mobile device.
*/
-ui.showbody = function() {
- document.body.style.visibility = 'visible';
+ui.isMobile = function() {
+ var ua = navigator.userAgent;
+ if (ua.match(/iPhone/i) || ua.match(/iPad/i) || ua.match(/Android/i) || ua.match(/Blackberry/i) || ua.match(/WebOs/i))
+ return true;
+ return false;
};
/**
- * Reload the current page.
+ * Initialize a document after it's loaded.
*/
-ui.reload = function() {
- window.open(window.location, '_self');
- return true;
-};
+ui.onload = function() {
-/**
- * Install a widget into the element bound to its iframe.
- */
-ui.installwidget = function() {
- if (isNil(window.parent) || isNil(window.parent.ui) || isNil(window.parent.ui.widgets))
+ // Make the document visible
+ document.body.style.visibility = 'visible';
+
+ // Install orientation handler
+ document.body.onorientationchange = function() {
+ window.open(window.location, '_self');
return true;
- var pdoc = ui.content(window.parent);
- for (w in window.parent.ui.widgets) {
- var ww = ui.elementByID(pdoc, w).contentWindow;
- if (ww == window) {
- document.widget = ui.elementByID(pdoc, window.parent.ui.widgets[w]);
- document.widget.innerHTML = document.body.innerHTML;
- return true;
- }
- }
- return true;
-};
+ };
-/**
- * Load an iframe into an element.
- */
-ui.loadiframe = function(el, doc) {
- var f = el + 'Frame';
- $(el).innerHTML =
- '<iframe id="' + f + '" class="loadedframe" scrolling="no" frameborder="0" src="' + doc + '"></iframe>';
- return f;
+ return true;
};
/**