Index: openacs-4/packages/imsld/www/resources/imsld.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/resources/imsld.css,v diff -u -r1.3 -r1.4 --- openacs-4/packages/imsld/www/resources/imsld.css 5 Jun 2008 17:36:53 -0000 1.3 +++ openacs-4/packages/imsld/www/resources/imsld.css 8 Jul 2008 15:36:32 -0000 1.4 @@ -95,25 +95,31 @@ div.frame { position:absolute; overflow: auto; + border: 1px #000 solid; } div#tree { left:0; padding:0; width:30%; - height:50%; } div#environment { left:0; padding:0; width:30%; - height:50%; - top:50%; } div#content { - width:70%; - height:99%; + width:69%; left:30%; } + +div#runtime { + left:0; + width:100%; + padding:0; + height:5%; + top:0; +} + Index: openacs-4/packages/imsld/www/resources/imsld.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/resources/imsld.js,v diff -u -r1.3 -r1.4 --- openacs-4/packages/imsld/www/resources/imsld.js 5 Jun 2008 17:36:53 -0000 1.3 +++ openacs-4/packages/imsld/www/resources/imsld.js 8 Jul 2008 15:36:32 -0000 1.4 @@ -7,6 +7,9 @@ function resizeobject() { f = document.forms[0]; o = document.getElementById('object'); + if (!o) { + return; + } var bodies = document.getElementsByTagName("body"); var body = bodies[0]; if (document.documentElement && document.documentElement.currentStyle && typeof document.documentElement.clientWidth != "undefined" && document.documentElement.clientWidth != 0) @@ -41,7 +44,9 @@ function objecturl(url) { var o = document.getElementById('object'); - o.src = url; + if (o) { + o.src = url; + } } /*==================================================*/ @@ -82,10 +87,12 @@ var a = as[i]; a.setAttribute('target', 'object'); } - for (var i = 0; i < as.length; i++) { - if (!as[i].getAttribute('href').match(/#/i)) { - document.getElementById('object').src = as[i].getAttribute('href'); - break; + if (document.getElementById('object')) { + for (var i = 0; i < as.length; i++) { + if (!as[i].getAttribute('href').match(/#/i)) { + document.getElementById('object').src = as[i].getAttribute('href'); + break; + } } } @@ -112,8 +119,21 @@ objXmlHttp.onreadystatechange = function() { if (objXmlHttp.readyState==4 || objXmlHttp.readyState=="complete"){ document.getElementById('content').innerHTML = objXmlHttp.responseText; + var e; + if (document.forms['choose'] && (e = document.forms['choose'].elements['ok'])) { + e.style.display = "none"; + } init_activity(); convertTrees(); + if (unescape(url).match(/activity_id=/i)) { + var env_url = url.replace(/[^\?]+/, "environment-frame"); + loadEnvironment(env_url); + } else { + if ( !(unescape(url).match(/service_id=|learning_object_id=/i))) { + document.getElementById('environment').innerHTML = ''; + } + } + // tabberAutomatic(); } } @@ -144,17 +164,48 @@ objXmlHttp.onreadystatechange = function() { if (objXmlHttp.readyState==4 || objXmlHttp.readyState=="complete"){ document.getElementById('environment').innerHTML = objXmlHttp.responseText; - var as = document.getElementById("environment").getElementsByTagName("a"); - for (var i = 0; i < as.length; i++) { - var a = as[i]; - a.setAttribute('target', 'content'); - var oldEvent = a.onclick; - a.onclick = function() { - if (oldEvent) { oldEvent(); } - loadContent(a.href); - return(false); - } +// var as = document.getElementById("environment").getElementsByTagName("a"); +// for (var i = 0; i < as.length; i++) { +// var a = as[i]; +// var oldEvent = a.onclick; +// a.onclick = function() { +// if (oldEvent) { oldEvent(); } +// loadContent(a.href); +// return(false); +// } +// } + convertTrees(); + } + } + + objXmlHttp.open("GET",url,true); + objXmlHttp.send(null); + return(false); +} + + + +/*==================================================*/ + +function loadTree(url) { + var objXmlHttp=null + try { + objXmlHttp = new XMLHttpRequest(); + } catch(e) { + try { + objXmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch(e) { + try { + objXmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch(e) { + alert("error opening XMLHTTP") } + } + } + + objXmlHttp.onreadystatechange = function() { + if (objXmlHttp.readyState==4 || objXmlHttp.readyState=="complete"){ + document.getElementById('tree').innerHTML = objXmlHttp.responseText; convertTrees(); } } @@ -194,3 +245,109 @@ return false; } + +function submitForm(form, contentDiv) { + var objXmlHttp=null + try { + objXmlHttp = new XMLHttpRequest(); + } catch(e) { + try { + objXmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch(e) { + try { + objXmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch(e) { + alert("error opening XMLHTTP") + } + } + } + + objXmlHttp.onreadystatechange = function() { + if (objXmlHttp.readyState==4 || objXmlHttp.readyState=="complete"){ + if (contentDiv !== undefined) { + document.getElementById(contentDiv).innerHTML = objXmlHttp.responseText; + var e; + if (document.forms['choose'] && (e = document.forms['choose'].elements['ok'])) { + e.style.display = "none"; + } + } + } + } + + var method = (form.method == "") ? "POST" : form.method; + + var url = form.action; + if (url == "") { + l = window.location; + url = l.protocol+'//'+l.host+l.pathname; + if (url.match(/\/$/)) { + url = url.replace(/\/$/, ''); + } + } + objXmlHttp.open(method,url,true); + + var enctype = (form.enctype == "application/x-www-form-urlencoded") ? "POST" : form.enctype; + objXmlHttp.setRequestHeader('Content-Type', enctype); + + var list = new Array(); + for (var i=0; i