diff options
Diffstat (limited to '')
-rw-r--r-- | sca-cpp/trunk/modules/js/htdocs/scdl.js | 27 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/js/htdocs/ui.css | 12 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/js/htdocs/ui.js | 26 |
3 files changed, 58 insertions, 7 deletions
diff --git a/sca-cpp/trunk/modules/js/htdocs/scdl.js b/sca-cpp/trunk/modules/js/htdocs/scdl.js index d0b229cae6..561a3e446b 100644 --- a/sca-cpp/trunk/modules/js/htdocs/scdl.js +++ b/sca-cpp/trunk/modules/js/htdocs/scdl.js @@ -23,6 +23,16 @@ var scdl = new Object(); /** + * Returns a composite element. + */ +scdl.composite = function(l) { + var cs = namedElementChildren("'composite", l); + if (isNil(cs)) + return cs; + return car(cs); +}; + +/** * Returns a list of components in a composite. */ scdl.components = function(l) { @@ -60,6 +70,23 @@ scdl.name = function(l) { }; /** + * Returns the description of a component, componentType, service or reference. + */ +scdl.documentation = function(l) { + var d = namedElementChildren("'documentation", l); + if (isNil(d)) + return null; + if (!elementHasValue(car(d))) + return null; + var v = elementValue(car(d)); + if (v == 'gt') + return '>' + if (v == 'lt') + return '<'; + return v; +}; + +/** * Returns the color of a component or componentType. */ scdl.color = function(l) { diff --git a/sca-cpp/trunk/modules/js/htdocs/ui.css b/sca-cpp/trunk/modules/js/htdocs/ui.css index d1413018a0..014cc5110d 100644 --- a/sca-cpp/trunk/modules/js/htdocs/ui.css +++ b/sca-cpp/trunk/modules/js/htdocs/ui.css @@ -35,10 +35,14 @@ border-style: solid; border-top-color: #a2bae7; border-bottom-color: #d1d3d4; } td { -padding-left: 2px; padding-top: 2px; padding-right: 8px; vertical-align: text-top; +padding-left: 2px; padding-top: 2px; padding-right: 8px; white-space: nowrap; vertical-align: text-top; } -iframe { +.tdw { +padding-left: 2px; padding-top: 2px; padding-right: 8px; white-space: normal; vertical-align: text-top; +} + +.widgetframe { visibility: hidden; width: 0px; height: 0px; } @@ -55,10 +59,6 @@ a:visited { color: blue; } -.tdw { -padding-left: 2px; padding-top: 2px; padding-right: 8px; white-space: normal; vertical-align: text-top; -} - .hd1 { font-size: 150%; font-weight: bold; } diff --git a/sca-cpp/trunk/modules/js/htdocs/ui.js b/sca-cpp/trunk/modules/js/htdocs/ui.js index d8266c7af6..60ca01568e 100644 --- a/sca-cpp/trunk/modules/js/htdocs/ui.js +++ b/sca-cpp/trunk/modules/js/htdocs/ui.js @@ -24,6 +24,16 @@ var ui = new Object(); /** + * Return true if the current browser is Internet Explorer. + */ +ui.isIE = function() { + if (typeof ui.isIE.detected != 'undefined') + return ui.isIE.detected; + ui.isIE.detected = navigator.appName == 'Microsoft Internet Explorer'; + return ui.isIE.detected; +}; + +/** * Build a menu bar. */ ui.menu = function(name, href) { @@ -222,7 +232,12 @@ ui.queryParams = function() { */ ui.widgets = new Array(); -ui.bindwidget = function(f, el) { +ui.loadwidget = function(el, doc) { + var f = el + 'Frame'; + var div = document.createElement('div'); + div.id = f + 'Div'; + div.innerHTML = '<iframe id="' + f + '" class="widgetframe" src="' + doc + '"></iframe>'; + document.body.appendChild(div); window.ui.widgets[f] = el; return f; }; @@ -245,3 +260,12 @@ ui.installwidget = function() { return true; }; +/** + * Convert a CSS position to a numeric position. + */ +ui.posn = function(p) { + if (p == '') + return 0; + return Number(p.substr(0, p.length - 2)); +}; + |