Index: lams_tool_lamc/web/includes/javascript/fckcontroller.js
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_lamc/web/includes/javascript/Attic/fckcontroller.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_tool_lamc/web/includes/javascript/fckcontroller.js 29 Mar 2006 22:28:41 -0000 1.1
@@ -0,0 +1,212 @@
+var activeEditorIndex = 0;
+var oFCKeditor;
+
+//whether to initialise the editor in textarea mode or preview mode
+function initEditor(index){
+ var textareaElement = document.getElementById("tx" + index + ".textarea")
+ if(textareaElement == null)
+ return;
+ var text = textareaElement.value;
+
+ if(containsHTML(text)){
+ var previewTextElement = document.getElementById("preview" + index + ".text");
+ var previewText = document.getElementById("tx" + index + ".textarea").value;
+ previewTextElement.innerHTML = previewText;
+
+ hideElementById("tx"+index);
+ showElementById("preview"+index);
+ }
+ else{
+ hideElementById("preview"+index);
+ showElementById("tx"+index);
+ }
+}
+
+// FCKeditor_OnComplete is a special function that is called when an editor
+// instance is loaded ad available to the API. It must be named exactly in
+// this way.
+function FCKeditor_OnComplete( editorInstance )
+{
+ //hideElementById("wyswygEditorScreen");
+}
+
+
+function SetContents(content)
+{
+ // Get the editor instance that we want to interact with.
+ var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;
+
+ // Set the editor contents (replace the actual one).
+ oEditor.SetHTML(content) ;
+}
+
+
+function doWYSWYGEdit(index, size){
+
+ var oEditor;
+ try {
+ oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;
+ }
+ catch(error) {
+ //browsers like opera can't resolve the FCKeditorAPI classes
+ alert("The browser you are using doesn't support Rich Text Editor, Please use a supported browser instead.");
+ return;
+ }
+
+ if(activeEditorIndex != index && activeEditorIndex != 0){
+ saveWYSWYGEdittedText(activeEditorIndex); //save the existing content
+ doPreview(activeEditorIndex); //update preview panel
+ }
+
+ activeEditorIndex = index;
+
+ //hide html editor
+ doPreview(index);
+
+ var previewElement = document.getElementById("preview" + index + ".text");
+ var posX = findPosX(previewElement);
+ var posY = findPosY(previewElement);
+
+ var text = document.getElementById("tx" + index + ".textarea").value;
+
+ oEditor.SetHTML(text) ;
+
+ wyswygEditorScreenElement = document.getElementById("wyswygEditorScreen");
+ wyswygEditorScreenElement.style.top = posY + "px";
+ wyswygEditorScreenElement.style.left = posX + "px";
+
+ //resize the fck editor
+ fckFrameElement = document.getElementById("FCKeditor1___Frame");
+ if (size == "small") {
+ fckFrameElement.style.height = "100px";
+ wyswygEditorScreenElement.style.height = "120px";
+ } else {
+ fckFrameElement.style.height = "200px";
+ wyswygEditorScreenElement.style.height = "220px";
+ }
+
+ showElementById("wyswygEditorScreen");
+
+
+ showElementById("wyswygEditorScreen");
+}
+
+//convert the text to HTML first,
+function doTextToHTML(index){
+ var textareaElement = document.getElementById("tx" + index + ".textarea");
+ var text = covertTextToHTML(textareaElement.value);
+ textareaElement.value = text;
+}
+
+function saveWYSWYGEdittedText(index){
+ var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;
+ var text = oEditor.GetXHTML( true )
+
+
+ var htmlEditorElement = document.getElementById("tx" + index + ".textarea");
+ htmlEditorElement.value = text;
+
+}
+
+function doEdit(index){
+ hideElementById("wyswygEditorScreen");
+ hideElementById("preview"+index);
+ showElementById("tx"+index);
+}
+
+function doPreview(index){
+ var previewTextElement = document.getElementById("preview" + index + ".text");
+ var previewText = document.getElementById("tx" + index + ".textarea").value;
+ previewTextElement.innerHTML = previewText;
+
+ hideElementById("wyswygEditorScreen");
+ hideElementById("tx"+index);
+ showElementById("preview"+index);
+}
+
+
+/*** show/hide Elements ***/
+function showElement(element) {
+ element.style.visibility = 'visible';
+ element.style.display = "block";
+}
+function hideElement(element) {
+ element.style.visibility = 'hidden';
+ element.style.display = "none";
+}
+
+function showElementById(id) {
+ var element = document.getElementById(id);
+ showElement(element);
+}
+
+function hideElementById(id) {
+ var element = document.getElementById(id);
+ hideElement(element);
+}
+
+
+/*** findPosX and findPoxY functions are use to locate the x,y location of an element ***/
+function findPosX(obj) {
+ var curleft = 0;
+ if(obj.offsetParent)
+ while(1)
+ {
+ curleft += obj.offsetLeft;
+ if(!obj.offsetParent)
+ break;
+ obj = obj.offsetParent;
+ }
+ else if(obj.x)
+ curleft += obj.x;
+ return curleft;
+}
+
+function findPosY(obj) {
+ var curtop = 0;
+ if(obj.offsetParent)
+ while(1)
+ {
+ curtop += obj.offsetTop;
+ if(!obj.offsetParent)
+ break;
+ obj = obj.offsetParent;
+ }
+ else if(obj.y)
+ curtop += obj.y;
+ return curtop;
+}
+
+/**** Using the regular expressions defined below to convert Text to HTML ****/
+var NEWLINE = " ";
+var GREATER = ">";
+var LESSER = "<";
+//var SPACE = " ";
+
+var RE_ESCAPE_NEWLINE = new RegExp("\n", "g");
+var RE_ESCAPE_GREATER = new RegExp(">", "g");
+var RE_ESCAPE_LESSER = new RegExp("<", "g");
+//var RE_ESCAPE_SPACE = new RegExp(" ", "g");
+
+var RE_HTML_TAG = new RegExp("<.*>|" + LESSER + "|" + GREATER);
+
+function covertTextToHTML(str){
+ return str.replace(RE_ESCAPE_GREATER, GREATER)
+ .replace(RE_ESCAPE_LESSER, LESSER)
+ .replace(RE_ESCAPE_NEWLINE, NEWLINE);
+
+ //.replace(RE_ESCAPE_SPACE, SPACE)
+}
+
+/**** Detect whether HTML was used */
+function containsHTML(str){
+ return (str.match(RE_HTML_TAG) != null)? true:false;
+}
+
+
+
+/*** implement the event onSelectTab() which gets trigger when tabs is changed ***/
+function onSelectTab(tabID){
+ //hide all active editors
+ doPreview(activeEditorIndex);
+}
\ No newline at end of file
Index: lams_tool_lamc/web/includes/javascript/tabcontroller.js
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_lamc/web/includes/javascript/Attic/tabcontroller.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_tool_lamc/web/includes/javascript/tabcontroller.js 29 Mar 2006 22:28:41 -0000 1.1
@@ -0,0 +1,52 @@
+var tabSize = 0;
+var selectedTabID = 0;
+
+/* Initialise the number of tabs in the page */
+function initTabSize(size){
+ tabSize = size;
+}
+
+function selectTab(tabID) {
+
+ if(selectedTabID == tabID)
+ return;
+
+ if(selectedTabID == 0)
+ selectedTabID = tabID;
+
+ //change the old tab's class
+ document.getElementById("tab" + selectedTabID).className = "tab tabcentre";
+ //swap images of side parts
+ var tl = document.getElementById("tableft_"+selectedTabID);
+ tl.src= imgRoot + themeName + "_tab_left.gif";
+ tl.height = 22;
+ var tr = document.getElementById("tabright_"+selectedTabID);
+ tr.src= imgRoot + themeName + "_tab_right.gif";
+ tr.height = 22;
+
+ //change the new tab's class
+ document.getElementById("tab" + tabID).className = "tab tabcentre_selected";
+ var tl = document.getElementById("tableft_"+tabID);
+ tl.src= imgRoot + themeName + "_tab_s_left.gif";
+ tl.height = 25;
+ var tr = document.getElementById("tabright_"+tabID);
+ tr.src= imgRoot + themeName + "_tab_s_right.gif";
+ tr.height = 25;
+
+ //save tabID as selectedTabID
+ selectedTabID = tabID;
+
+ //switch the the selected tab on
+ for(i = 1; i <= tabSize; i++) {
+ document.getElementById("tabbody" + i).style.display = (i == tabID) ? 'block':'none';
+ }
+
+
+ try{
+ //trigger the custom event listener onSelectTab()
+ onSelectTab(tabID);
+ }
+ catch (error){
+ //catch reference error when onSelectTab() is not defined
+ }
+}
\ No newline at end of file
Index: lams_tool_lamc/web/includes/javascript/xmlrequest.js
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_lamc/web/includes/javascript/Attic/xmlrequest.js,v
diff -u -r1.1 -r1.2
--- lams_tool_lamc/web/includes/javascript/xmlrequest.js 26 Mar 2006 20:48:39 -0000 1.1
+++ lams_tool_lamc/web/includes/javascript/xmlrequest.js 29 Mar 2006 22:28:41 -0000 1.2
@@ -35,7 +35,12 @@
if (req.readyState == 4) {
// only if "OK"
if (req.status == 200) {
- var select = document.getElementById(target);
+ var select;
+ if(typeof target.id != "undefined")
+ select = target;
+ else
+ select = document.getElementById(target);
+
select.innerHTML = req.responseText;
} else {
alert("There was a problem retrieving the XML data:\n" +
Index: lams_tool_lamc/web/monitoring/Edit.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/Edit.jsp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_tool_lamc/web/monitoring/Edit.jsp 29 Mar 2006 22:28:42 -0000 1.1
@@ -0,0 +1,48 @@
+<%--
+Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+USA
+
+http://www.gnu.org/licenses/gpl.txt
+--%>
+
+<%@ taglib uri="tags-bean" prefix="bean"%>
+<%@ taglib uri="tags-html" prefix="html"%>
+<%@ taglib uri="tags-logic" prefix="logic" %>
+<%@ taglib uri="tags-logic-el" prefix="logic-el" %>
+<%@ taglib uri="tags-core" prefix="c"%>
+<%@ taglib uri="tags-fmt" prefix="fmt" %>
+<%@ taglib uri="fck-editor" prefix="FCK" %>
+<%@ taglib uri="tags-lams" prefix="lams" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_tool_lamc/web/monitoring/Instructions.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_lamc/web/monitoring/Attic/Instructions.jsp,v
diff -u -r1.4 -r1.5
--- lams_tool_lamc/web/monitoring/Instructions.jsp 24 Feb 2006 20:25:28 -0000 1.4
+++ lams_tool_lamc/web/monitoring/Instructions.jsp 29 Mar 2006 22:28:42 -0000 1.5
@@ -31,7 +31,6 @@
-
|