diff options
Diffstat (limited to '')
-rw-r--r-- | sca-cpp/trunk/modules/js/htdocs/all-min.js | 9 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/js/htdocs/ui-min.css | 24 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/js/htdocs/ui.css | 26 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/js/htdocs/ui.js | 65 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/js/htdocs/util.js | 2 |
5 files changed, 34 insertions, 92 deletions
diff --git a/sca-cpp/trunk/modules/js/htdocs/all-min.js b/sca-cpp/trunk/modules/js/htdocs/all-min.js index b73c9ad5ea..05ae9ce35b 100644 --- a/sca-cpp/trunk/modules/js/htdocs/all-min.js +++ b/sca-cpp/trunk/modules/js/htdocs/all-min.js @@ -46,8 +46,7 @@ function debug(o){try{for(f in o){try{log('debug '+f+'='+o[f]);}catch(e){}}}catc return true;} function isIE(){if(typeof isIE.detected!='undefined') return isIE.detected;isIE.detected=navigator.appName=='Microsoft Internet Explorer';return isIE.detected;};var config;if(isNil(config)) -config={} -function AssertException(){} +config={};function AssertException(){} AssertException.prototype.toString=function(){return'AssertException';};function assert(exp){if(!exp) throw new AssertException();} function writeStrings(l){if(isNil(l)) @@ -277,10 +276,8 @@ return null;};function $(id){if(id==document){if(!isNil(document.widget)) return document.widget;return document;} return ui.elementByID($(document),id);};ui.queryParams=function(){var qp=new Array();var qs=window.location.search.substring(1).split('&');for(var i=0;i<qs.length;i++){var e=qs[i].indexOf('=');if(e>0) qp[qs[i].substring(0,e)]=unescape(qs[i].substring(e+1));} -return qp;} -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;};ui.showbody=function(){document.body.style.visibility='visible';};ui.reload=function(){window.open(window.location,'_self');return true;};ui.installwidget=function(){if(isNil(window.parent)||isNil(window.parent.ui)||isNil(window.parent.ui.widgets)) -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;};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;};ui.numpos=function(p){if(p=='') +return qp;};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;};ui.onload=function(){document.body.style.visibility='visible';document.body.onorientationchange=function(){window.open(window.location,'_self');return true;};return true;};ui.numpos=function(p){if(p=='') return 0;return Number(p.substr(0,p.length-2));};ui.pixpos=function(p){return p+'px';};ui.datatable=function(l){function indent(i){if(i==0) return'';return' '+indent(i-1);} function rows(l,i){if(isNil(l)) diff --git a/sca-cpp/trunk/modules/js/htdocs/ui-min.css b/sca-cpp/trunk/modules/js/htdocs/ui-min.css index 40301e8e00..c4cdc288a1 100644 --- a/sca-cpp/trunk/modules/js/htdocs/ui-min.css +++ b/sca-cpp/trunk/modules/js/htdocs/ui-min.css @@ -1,21 +1,3 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ body{margin:2px;font-family:"Helvetica Neue", Helvetica;font-style:normal;font-variant:normal;font-size:13px;-webkit-text-size-adjust:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-user-select:none;} .delayed{visibility:hidden;} .devicewidth{position:absolute;top:0px;left:0px;right:0px;height:5000px;overflow:hidden;} @@ -23,6 +5,8 @@ table{border:0px;border-collapse:collapse;border-color:#a2bae7;border-style:soli .trb{border-bottom:1px;border-bottom-style:solid;border-color:#dcdcdc;} th{font-weight:bold;background-color:#e5ecf9;color:#000000;height:18px;text-align:left;padding-left:2px;padding-right:8px;padding-top:0px;padding-bottom:0px;vertical-align:middle;white-space:nowrap;border-top:1px;border-bottom:1px;border-left:1px;border-right:1px;border-style:solid;border-top-color:#a2bae7;border-bottom-color:#d1d3d4;border-left-color:#a2bae7;border-right-color:#a2bae7;overflow:hidden;} .section{font-weight:bold;background-color:#e5ecf9;color:#000000;height:24px;padding-top:1px;padding-bottom:0px;padding-left:2px;padding-right:2px;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;} +.hsection{width:100%;height:50px;border-top:0px;border-bottom:1px;border-left:0px;border-right:0px;border-style:solid;border-bottom-color:#000000;background-color:#ffffff;padding:0px;margin-bottom:4px;margin-left:auto;margin-right:auto;text-align:center;} +.fsection{width:100%;height:50px;border-top:0px;border-bottom:0px;border-left:0px;border-right:0px;border-style:solid;border-top-color:#a2bae7;padding:0px;margin-top:4px;margin-left:auto;margin-right:auto;text-align:center;} .text{padding-top:3px;padding-bottom:4px;vertical-align:middle;} .thl{border-left:0px;} .thr{border-right:0px;} @@ -38,8 +22,6 @@ td{padding-left:2px;padding-top:2px;padding-right:8px;white-space:nowrap;vertica .databg{opacity:.6;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";filter:alpha(opacity=60);} .guide{border:1px;border-style:solid;border-color:#c0c0c0;} iframe{border:0px;margin:0px;padding:0px;} -.widgetframe{visibility:hidden;width:0px;height:0px;border:0px;} -.loadedframe{width:100%;height:100%;} .fakeframe{padding:3px;background-color:#dcdcdc;color:#000000;} input{vertical-align:middle;font-family:"Helvetica Neue", Helvetica;font-style:normal;font-variant:normal;font-size:13px;-webkit-text-size-adjust:100%;} textarea{font-family:"Helvetica Neue", Helvetica;font-style:normal;font-variant:normal;font-size:13px;overflow:auto;resize:none;} @@ -68,4 +50,4 @@ img{border:0px;} .suggest{background-color:#e5ecf9;color:#598edd;border-top:1px;border-bottom:1px;border-left:1px;border-right:1px;border-style:solid;border-top-color:#a2bae7;border-bottom-color:#d1d3d4;border-left-color:#d1d3d4;border-right-color:#d1d3d4;position:absolute;overflow:auto;overflow-x:hidden;padding:0px;margin:0px;cursor:default;} .suggestTable{border:0px;border-collapse:separate;padding-left:5px;padding-right:5px;padding-top:2px;padding-bottom:2px;margin:0px;} .suggestItem{padding-left:2px;padding-top:0px;padding-bottom:0px;padding-right:2px;vertical-align:middle;background-color:#e5ecf9;color:#598edd;} -.suggestHilighted{padding-left:2px;padding-top:0px;padding-bottom:0px;padding-right:2px;vertical-align:middle;background-color:#598edd;color:#e5ecf9;} +.suggestHilighted{padding-left:2px;padding-top:0px;padding-bottom:0px;padding-right:2px;vertical-align:middle;background-color:#598edd;color:#e5ecf9;}
\ No newline at end of file diff --git a/sca-cpp/trunk/modules/js/htdocs/ui.css b/sca-cpp/trunk/modules/js/htdocs/ui.css index aa03b7570a..0842523bf2 100644 --- a/sca-cpp/trunk/modules/js/htdocs/ui.css +++ b/sca-cpp/trunk/modules/js/htdocs/ui.css @@ -56,6 +56,17 @@ border-top: 1px; border-bottom: 1px; border-left: 0px; border-right: 0px; border overflow: hidden; } +.hsection { +width: 100%; height: 50px; +border-top: 0px; border-bottom: 1px; border-left: 0px; border-right: 0px; border-style: solid; border-bottom-color: #000000; background-color: #ffffff; +padding: 0px; margin-bottom: 4px; margin-left: auto; margin-right: auto; text-align: center; +} + +.fsection{ +width: 100%; height: 50px; border-top: 0px; border-bottom: 0px; border-left: 0px; border-right: 0px; border-style: solid; border-top-color: #a2bae7; +padding: 0px; margin-top: 4px; margin-left: auto; margin-right: auto; text-align: center; +} + .text { padding-top: 3px; padding-bottom: 4px; vertical-align: middle; } @@ -119,14 +130,6 @@ iframe { border: 0px; margin: 0px; padding: 0px; } -.widgetframe { -visibility: hidden; width: 0px; height: 0px; border: 0px; -} - -.loadedframe { -width: 100%; height: 100%; -} - .fakeframe { padding: 3px; background-color: #dcdcdc; color: #000000; } @@ -313,10 +316,3 @@ padding-left: 2px; padding-top: 0px; padding-bottom: 0px; padding-right: 2px; ve padding-left: 2px; padding-top: 0px; padding-bottom: 0px; padding-right: 2px; vertical-align: middle; background-color: #598edd; color: #e5ecf9; } -/* -v\: * { -behavior:url(#default#VML); -display:inline-block; -} -*/ - 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; }; /** diff --git a/sca-cpp/trunk/modules/js/htdocs/util.js b/sca-cpp/trunk/modules/js/htdocs/util.js index b74eedc6ed..4c09b2b13c 100644 --- a/sca-cpp/trunk/modules/js/htdocs/util.js +++ b/sca-cpp/trunk/modules/js/htdocs/util.js @@ -222,7 +222,7 @@ function isIE() { */ var config; if (isNil(config)) - config = {} + config = {}; /** * Simple assert function. |