Index: lams_tool_wookie/conf/hibernate/mappings/org/lamsfoundation/lams/tool/wookie/model/Wookie.hbm.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_wookie/conf/hibernate/mappings/org/lamsfoundation/lams/tool/wookie/model/Attic/Wookie.hbm.xml,v diff -u -r1.1 -r1.2 --- lams_tool_wookie/conf/hibernate/mappings/org/lamsfoundation/lams/tool/wookie/model/Wookie.hbm.xml 28 Jul 2009 05:30:22 -0000 1.1 +++ lams_tool_wookie/conf/hibernate/mappings/org/lamsfoundation/lams/tool/wookie/model/Wookie.hbm.xml 31 Jul 2009 02:05:28 -0000 1.2 @@ -96,15 +96,6 @@ /> - - + + + + - + - <fmt:message key="pageTitle.admin" /> + <fmt:message key="admin.page.title" /> @@ -14,7 +14,7 @@

- +

@@ -30,25 +30,28 @@

-

+

+

- + - - + + + + + +
- -
@@ -58,4 +61,4 @@ - +
Index: lams_tool_wookie/web/pages/authoring/authoring.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_wookie/web/pages/authoring/authoring.jsp,v diff -u -r1.1 -r1.2 --- lams_tool_wookie/web/pages/authoring/authoring.jsp 28 Jul 2009 05:30:19 -0000 1.1 +++ lams_tool_wookie/web/pages/authoring/authoring.jsp 31 Jul 2009 02:05:28 -0000 1.2 @@ -37,8 +37,7 @@ - - +
Index: lams_tool_wookie/web/pages/authoring/basic.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_wookie/web/pages/authoring/basic.jsp,v diff -u -r1.1 -r1.2 --- lams_tool_wookie/web/pages/authoring/basic.jsp 28 Jul 2009 05:30:19 -0000 1.1 +++ lams_tool_wookie/web/pages/authoring/basic.jsp 31 Jul 2009 02:05:28 -0000 1.2 @@ -10,51 +10,58 @@ var origImageHeight; var origImageWidth; var pageCount = ${widgetPages}; + var browseAreaLoaded = false; function submitForm(dispatch) { document.getElementById("dispatch").value = dispatch; document.getElementById("authoringForm").submit(); } - - function openImage(url) - { - openPopup(url, origImageHeight, origImageWidth); - } jQuery(document).ready(function() { // Set the initial width of the pager div var width = getAppropriateWidth(pageCount) + "px"; document.getElementById("container").style.width = width; - jQuery("#pager").pager({ pagenumber: 1, pagecount: pageCount, buttonClickCallback: PageClick }); - jQuery.ajax({ - type: "GET", - url: "/authoring.do", - data: {dispatch : "getWidgets", pageNumber : 1}, - cache: false, - success: function (html) { - jQuery("#result").html(html); - } - - }); + + + // No saved widget so load the view + loadBrowseArea(1); + document.getElementById("widgetViewArea").style.display="none"; + document.getElementById("widgetBrowseArea").style.display="block"; + + + // Load the widget if it has previously been saved + document.getElementById("widgetBrowseArea").style.display="none"; + document.getElementById("widgetViewArea").style.display="block"; + enableWidgetIframe("${formBean.widgetAuthorUrl}", "${formBean.widgetHeight}", "${formBean.widgetWidth}"); + + }); PageClick = function(pageclickednumber) { - jQuery("#pager").pager({ pagenumber: pageclickednumber, pagecount: pageCount, buttonClickCallback: PageClick }); + loadBrowseArea(pageclickednumber); + } + + // Loads the brows area to the specified page number + function loadBrowseArea(pageNumber) { + + alert("Loading browse area"); + jQuery("#pager").pager({ pagenumber: pageNumber, pagecount: pageCount, buttonClickCallback: PageClick }); jQuery.ajax({ type: "GET", url: "/authoring.do", - data: {dispatch : "getWidgets", pageNumber : pageclickednumber}, + data: {dispatch : "getWidgets", pageNumber : 1}, cache: false, success: function (html) { jQuery("#result").html(html); } - }); + browseAreaLoaded = true; } + // Get the appropriate width for the pager div function getAppropriateWidth(pages) { var maxPageButtons = 9; var width = 170; @@ -67,12 +74,77 @@ return width; } + // Callback to server when a widget is selected + function selectWookieWidget(widgetid) { + document.getElementById("widgetIdentifier").value = widgetid; + jQuery.ajax({ + type: "GET", + url: "/authoring.do", + data: {dispatch :"initiateWidget", widgetid:widgetid, toolContentID:"${sessionMap.toolContentID}" }, + cache: false, + error: function (XMLHttpRequest, textStatus, errorThrown) { + + // TODO: Good error message + alert(errorThrown); + }, + success: function (xml) { + + // Set the parameters from the returned xml + var widgetUrl = jQuery(xml).find("url").text(); + document.getElementById("widgetAuthorUrl").value = widgetUrl; + + var widgetHeight = jQuery(xml).find("height").text(); + document.getElementById("widgetHeight").value = widgetHeight; + + var widgetWidth = jQuery(xml).find("width").text(); + document.getElementById("widgetWidth").value = widgetWidth; + + var widgetMaximize = jQuery(xml).find("widgetMaximize").text(); + document.getElementById("widgetMaximise").value = widgetMaximize; + + enableWidgetIframe(widgetUrl, widgetHeight, widgetWidth); + } + + }); + } + + // Loads the widget in an iframe + function enableWidgetIframe(url, height, width) { + var iframe = document.getElementById("widgetIframe"); + iframe.style.height = height + "px"; + iframe.style.width = width + "px"; + iframe.src=url; + iframe.style.display="block"; + jQuery("#widgetBrowseArea").toggle("slow"); + setTimeout('jQuery("#widgetViewArea").toggle("slow");',1000); + } + + // Cancel a widget and return to browse mode + function cancelWidget(){ + document.getElementById("widgetAuthorUrl").value = ""; + document.getElementById("widgetHeight").value = ""; + document.getElementById("widgetWidth").value = ""; + document.getElementById("widgetMaximise").value = ""; + document.getElementById("widgetIdentifier").value = ""; + jQuery("#widgetViewArea").toggle("fast"); + if (browseAreaLoaded == false) { + loadBrowseArea(1); + document.getElementById("widgetBrowseArea").style.display="block"; + } else { + jQuery("#widgetBrowseArea").toggle("fast"); + } + + } //--> + + + + + - @@ -95,10 +167,25 @@
-
-
-
+
+
+
+
+
+ +
+ + + +
+
Index: lams_tool_wookie/web/pages/authoring/widgetList.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_wookie/web/pages/authoring/widgetList.jsp,v diff -u -r1.1 -r1.2 --- lams_tool_wookie/web/pages/authoring/widgetList.jsp 28 Jul 2009 05:30:19 -0000 1.1 +++ lams_tool_wookie/web/pages/authoring/widgetList.jsp 31 Jul 2009 02:05:28 -0000 1.2 @@ -15,7 +15,7 @@ - ${widget.title} + ${widget.title} @@ -44,9 +44,10 @@ - ${widget.title} + ${widget.title} + ${widget.description}