Index: lams_central/web/author.jsp =================================================================== diff -u --- lams_central/web/author.jsp (revision 0) +++ lams_central/web/author.jsp (revision e2a3221c89c3bf651bcec75bdaafde21dabee7c7) @@ -0,0 +1,248 @@ + + +
+ + +<% +String protocol = request.getProtocol(); +if(protocol.startsWith("HTTPS")){ + protocol = "https://"; +}else{ + protocol = "http://"; +} +String pathToRoot = protocol+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/"; +String pathToShare = protocol+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/../.."; + +%> + +\n'); +} + +function doAlert(arg){ + alert(arg); +} + +function doConfirm(arg){ + var answer = confirm (arg) + if (answer) + alert ("Oh yeah?") + else + alert ("Why not?") +} + +function openPopUp(args){ + if(thePopUp && thePopUp.open && !thePopUp.closed){ + thePopUp.focus(); + }else{ + //mozilla seems to want a full url + args = getHostURL()+args; + thePopUp = window.open(args,"learnerPop","HEIGHT=450,WIDTH=550,resizable,scrollbars"); + } +} + + +function closeWindow(win){ + if(win == 'previewWin'){ + previewWin.close(); + } + + +} + +var learnWin = null; +function openPreview(sessionId) { + //debug: To check we are gettin a session Id to open + var welcomeLearnerOpen = false; + previewSessionId = sessionId; + var url = getHostURL() + '/lams/home.do?method=learner&sessionId='+sessionId; + //var url = 'home.do?method=learner&sessionId='+sessionId; + //alert('Opening Preview, url='+url); + + + learnWin = window.open(url,'lWindow','width=796,height=570,resizable,status=yes'); + learnWin.focus(); + + +} + + +function openFilePopUp(args){ + //mozilla seems to want a full url + //alert('args:'+args); + args = location.protocol+'//'+location.host+args; + //alert('openFilePopUp url:'+args); + var POP_UP_WIDTH = 372; + var POP_UP_HEIGHT = 125; + var size = getWindowSize(); + theFilePopUp = window.open(args,"filePop","HEIGHT="+POP_UP_HEIGHT+",WIDTH="+POP_UP_WIDTH+""); + var xPos =((size.w - POP_UP_WIDTH) / 2) + theFilePopUp.opener.screenLeft; + var yPos =((size.h - POP_UP_HEIGHT) / 2) + theFilePopUp.opener.screenTop; + //alert("xPos:"+xPos+"yPos:"+yPos); + theFilePopUp.moveTo(xPos, yPos); +} + +function closeUI(){ + window.close(); +} + +function getHostURL(){ + // http: uklams.net:8080 + var p = location.protocol+'//'+location.host; + //alert('pathname:'+location.pathname); + //debug: + //alert('getPathToRoot:'+p); + return p; +} + +function setSaved(args){ + //convert the strings returned from flash to proper boolean values + if(args=="true"){ + saved = true; + }else{ + saved = false; + } +} + +function myOnBeforeUnload(){ + if(!saved && !mac){ + window.event.returnValue = "Your design is not saved, any changes you have made since you last saved will be lost."; + } +} + +function endPreviewSession(){ + if(previewSessionId != null){ + //debug: alert('Opening URL:'+"staff/staff.do?method=removeSession&sid="+previewSessionId+"&session=preview"); + document.location = "staff/staff.do?method=removeSession&sid="+previewSessionId+"&session=preview"; + } +} + +window.onbeforeunload = myOnBeforeUnload; + + +/* +function checkSaved(){ + if(saved){ + alert("closing"); + return true; + }else{ + var answer = confirm ("Your design is not saved, any changes you have made since you last saved will be lost.\nare you sure you want to close?") + if (answer) + //alert ("Oh yeah?") + return true; + else + return false; + } +} +*/ +//--> + +