Index: lams_tool_laqa/web/BasicContent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/web/Attic/BasicContent.jsp,v diff -u -r1.12 -r1.13 --- lams_tool_laqa/web/BasicContent.jsp 5 Jan 2006 04:36:32 -0000 1.12 +++ lams_tool_laqa/web/BasicContent.jsp 27 Jan 2006 06:07:08 -0000 1.13 @@ -11,43 +11,58 @@ - - + - + - @@ -59,10 +74,22 @@ - - + + - + + + + +
: - - - + : + + + + +
: : - - - + + + + +
+ : - "> -   - - - + + + + +
: " value="" - size="50" maxlength="255"> -   + : + + " style="visibility: hidden; display: none;"> + +
.text">
+
+ "> + + + + -
+ + + +
Index: lams_tool_laqa/web/InstructionsContent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/web/Attic/InstructionsContent.jsp,v diff -u -r1.12 -r1.13 --- lams_tool_laqa/web/InstructionsContent.jsp 15 Dec 2005 08:02:52 -0000 1.12 +++ lams_tool_laqa/web/InstructionsContent.jsp 27 Jan 2006 06:07:08 -0000 1.13 @@ -15,13 +15,19 @@ : - - - + + +
+ Open Richtext Editor +
+ +
- @@ -53,11 +59,18 @@ - - - + + +
+ Open Richtext Editor +
+ +
@@ -94,7 +107,7 @@ - +

Index: lams_tool_laqa/web/author_page.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/web/Attic/author_page.jsp,v diff -u -r1.2 -r1.3 --- lams_tool_laqa/web/author_page.jsp 15 Dec 2005 08:02:52 -0000 1.2 +++ lams_tool_laqa/web/author_page.jsp 27 Jan 2006 06:07:07 -0000 1.3 @@ -17,17 +17,21 @@ %> - + + + Tool - + - + - - + + + + + + + + + + + - + + + +

Question & Answers

+ - - - - - - - -
- - - - - - - -
- -
- - - - - - - -
- -
- - - - - - - -
- -
+ - - - + -
-

Basic tab content

-
- -
-
-Cancel -Save +
+

Basic tab content

+
+ +
+ +
+ Cancel + Save +
+ - -
+ +
+

Advanced tab content

+
+ +
+ Cancel + Save +
+ + +
+

Instructions tab content

+
+ +
+
+ Cancel + Save +
+ + - -
-

Advanced tab content

-
- -
-Cancel -Save - - -
- - -
-

Instructions tab content

-
- -
-
-Cancel -Save - - - -
-
+
\ No newline at end of file Index: lams_tool_laqa/web/author_page/css/aqua.css =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/web/author_page/css/Attic/aqua.css,v diff -u -r1.1 -r1.2 --- lams_tool_laqa/web/author_page/css/aqua.css 30 Sep 2005 05:51:40 -0000 1.1 +++ lams_tool_laqa/web/author_page/css/aqua.css 27 Jan 2006 06:07:07 -0000 1.2 @@ -3,7 +3,7 @@ body { font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #A2BCF9; - font-size: small; + } h1 { @@ -71,42 +71,62 @@ text-align: left; } -/*tab styles*/ -.tab{ - text-align:center; +/********* tab styles **********/ +/** Tab layout **/ +.tabmenu ul{ + list-style: none; + padding: 0px; + margin: 0px; } -.tab a{ - font-size: 11px; - color: #000000; - text-decoration:none; +.tabmenu li{ + float: left; + margin: 0px 0px; + padding: 0px; + text-align: center } -.tab a:hover{ - font-size: 11px; - color: #000000; - text-decoration:underline + +/** Non Selected tab style **/ +.tabitem .tableft{ + background: url(../images/aqua_tab_left.gif) no-repeat top left; } -.tabcentre{ - background-image:url(../images/aqua_tab_centre.gif); - background-repeat:repeat-x; +.tabitem .tabright{ + background: url(../images/aqua_tab_right.gif) no-repeat top right; } +.tabitem a, .tabitem a:hover, .tabitem a:active, .tabitem a:visited{ + background: url(../images/aqua_tab_centre.gif) 0 0 repeat-x; + margin:0px 8px; + font-size: 11px; + padding: 4px 10px 1px 10px; + color: #000000; + text-decoration:none; +} - -.tabcentre_selected{ - background-image:url(../images/aqua_tab_s_centre.gif); - background-repeat:repeat-x; +/** Selected tab style **/ +.tabitem_selected .tableft{ + background: url(../images/aqua_tab_s_left.gif) no-repeat top left; } +.tabitem_selected .tabright{ + background: url(../images/aqua_tab_s_right.gif) no-repeat top right; +} +.tabitem_selected a, .tabitem_selected a:hover, .tabitem_selected a:active, .tabitem_selected a:visited{ + background: url(../images/aqua_tab_s_centre.gif) 0 0 repeat-x; + margin:0px 8px; + font-size: 11px; + padding: 4px 10px 1px 10px; + color: #000000; + text-decoration:none; +} - /*Tab content containers*/ .tabbody{ - + width: 98%; background-color : #D9E8FF; float:left; - margin : 0; + margin : 0px 0px 0px 0px; border-right-width: 1px; border-left-width: 1px; border-right-style: solid; @@ -119,85 +139,4 @@ border-bottom-color: #0D3F59; padding:5px; -} - - -/*specific styles for the content divs of the tabs*/ -.content_b{ - z-index: 0; - position:relative; - visibility:visible; -} -.content_a{ - z-index: 0; - position:absolute; - visibility: hidden; -} -.content_i{ - z-index: 0; - position:absolute; - visibility: hidden; -} -/*end tabs*/ - -a.button{ - float:right; - font-size: 12px; - color: #000000; - text-decoration:none; - text-align: center; - background-color:#B4C8FE; - margin: 2px 5px 2px 5px; - padding:3px; - width: 80px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-style: solid; - border-right-style: solid; - border-bottom-style: solid; - border-left-style: solid; - border-top-color: #FFFFFF; - border-right-color: #0D3F59; - border-bottom-color: #0D3F59; - border-left-color: #FFFFFF; -} - - - -a.button:link{ - color: #000000; - text-decoration:none; - background-color:#B4C8FE; -} - -a.button:visited{ - color: #000000; - text-decoration:none; - background-color:#B4C8FE; -} - - - -a.button:hover{ - text-decoration:none; - background-color:#FFFFFF; -} - -a.button:active{ - text-decoration:none; - background-color:#CCCCCC; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-style: solid; - border-right-style: solid; - border-bottom-style: solid; - border-left-style: solid; - border-bottom-color: #FFFFFF; - border-left-color: #0D3F59; - border-top-color: #0D3F59; - border-right-color: #FFFFFF; -} +} \ No newline at end of file Index: lams_tool_laqa/web/author_page/css/fckeditor_style.css =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/web/author_page/css/Attic/fckeditor_style.css,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_laqa/web/author_page/css/fckeditor_style.css 27 Jan 2006 06:07:07 -0000 1.1 @@ -0,0 +1,38 @@ +.previewPanel{ + width: 700px; + height: 220px; + border-style: none; + border-width: 1px; + padding: 5px; +} + +.textareaPanel{ + width: 700px; + height: 220px; +} + +#wyswygEditor{ + /*position the wyswygEditor in the centre*/ + position: absolute; + /*top: 15%; + left: 50%; + margin-left: -400px; + margin-top: -260px;*/ + + width: 100%; + height: 100%; + + + /*border-style: solid; + border-width: 3px;*/ +} + +#wyswygEditorScreen{ + position: absolute; + + width: 700px; + height: 220px; + + padding: 0px; + margin: 0px; +} \ No newline at end of file Index: lams_tool_laqa/web/author_page/js/fckcontroller.js =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/web/author_page/js/Attic/fckcontroller.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_laqa/web/author_page/js/fckcontroller.js 27 Jan 2006 06:07:07 -0000 1.1 @@ -0,0 +1,155 @@ +var activeEditorIndex = 0; +var commentFlag = ""; +var commentFlagLength = 13; +var oFCKeditor; + + +// 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){ + + 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"; + + + showElementById("wyswygEditorScreen"); +} + + +function saveWYSWYGEdittedText(index){ + var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ; + var text = oEditor.GetXHTML( true ) + + + // add in to indicate that we have used the wyswyg editor + var testText = text.substring(0,commentFlagLength); + if ( commentFlag != testText ) { + text = commentFlag + text; + } + + 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); +} + + + + +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); +} + + +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; +} + + +/*** 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_laqa/web/author_page/js/tabcontroller.js =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/web/author_page/js/Attic/tabcontroller.js,v diff -u -r1.1 -r1.2 --- lams_tool_laqa/web/author_page/js/tabcontroller.js 30 Sep 2005 05:51:41 -0000 1.1 +++ lams_tool_laqa/web/author_page/js/tabcontroller.js 27 Jan 2006 06:07:07 -0000 1.2 @@ -1,137 +1,39 @@ +var tabSize = 0; +var selectedTabID = 0; -var tabsContents = new Array(); -var tab_lefts = new Array(); -//TODO:we need to set this variable, maybe from the praent or direct from JSP/Java -var themeName = "aqua"; -var currentTab = ""; - -function initTabs(){ - //put all the tab contents in an array - tabsContents.push(document.getElementById('content_b')); - tabsContents.push(document.getElementById('content_a')); - tabsContents.push(document.getElementById('content_i')); - - //position the advanced (a) and instructions (i) layers over the basic (b) layer - var bTabC_x = findPosX(tabsContents[0]); - var bTabC_y = findPosY(tabsContents[0]); - - tabsContents[1].style.left = bTabC_x+'px'; - tabsContents[1].style.top = bTabC_y+'px'; - tabsContents[2].style.left = bTabC_x+'px'; - tabsContents[2].style.top = bTabC_y+'px'; - tabsContents[1].style.visibility="hidden"; - tabsContents[2].style.visibility="hidden"; +/* Initialise the number of tabs in the page */ +function initTabSize(size){ + tabSize = size; } -function deSelectTab(tabId){ - //swap images of side parts - var tl = document.getElementById("tab_left_"+tabId); - tl.src="author_page/images/"+themeName+"_tab_left.gif"; - tl.height = 22; - var tr = document.getElementById("tab_right_"+tabId); - tr.src="author_page/images/"+themeName+"_tab_right.gif"; - tr.height = 22; - //swap css of centre class - var tc = document.getElementById("tab_tbl_centre_"+tabId); - tc.className="tab tabcentre"; -} +function selectTab(tabID) { + + if(selectedTabID == tabID) + return; -function selectTab(tabId){ - //alert('selecttab'); - //swap images of side parts - var tl = document.getElementById("tab_left_"+tabId); - tl.src="author_page/images/"+themeName+"_tab_s_left.gif"; - tl.height = 25; - var tr = document.getElementById("tab_right_"+tabId); - tr.src="author_page/images/"+themeName+"_tab_s_right.gif"; - tr.height = 25; - //swap css of centre class - var tc = document.getElementById("tab_tbl_centre_"+tabId); - tc.className="tab tabcentre_selected"; - - //if(tabId=="a"){ - //enableFCKEditor(); - //} - -} - -function enableFCKEditor(){ - //alert('enableFCKEditor'); - // This is a hack for Gecko... it stops editing when the editor is hidden. - if ( !document.all ){ - var oEditor = FCKeditorAPI.GetInstance( 'FCKeditor1' ) ; - - if ( oEditor.EditMode == FCK_EDITMODE_WYSIWYG ) - { - oEditor.SwitchEditMode() ; - oEditor.SwitchEditMode() ; - } - } -} - - -function showTab(tabId){ - if (currentTab == tabId){ - return; - }else{ - currentTab = tabId; - } - - selectTab(tabId); - - if(tabId == "i"){ - deSelectTab("a"); - deSelectTab("b"); - }else if(tabId=="a"){ - deSelectTab("i"); - deSelectTab("b"); - }else{ - deSelectTab("i"); - deSelectTab("a"); - } - - //sort out the content - var contentId = "content_"+tabId; - for(var i=0; i < tabsContents.length; i++){ - if(tabsContents[i].id==contentId){ - //document.getElementById(tabsContents[i].id).style.display = '' ; - tabsContents[i].style.visibility="visible"; - }else{ - //document.getElementById(tabsContents[i].id).style.display = 'none' ; - tabsContents[i].style.visibility="hidden"; - } - } - - - -} - -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; - } + if(selectedTabID == 0) + selectedTabID = tabID; + + //change the old tab's class + document.getElementById("tab" + selectedTabID).className = "tabitem"; + + //change the new tab's class + document.getElementById("tab" + tabID).className = "tabitem_selected"; + + //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