You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wookie.apache.org by ps...@apache.org on 2011/01/26 14:59:59 UTC

svn commit: r1063722 - in /incubator/wookie/branches/0.9.x/WebContent/admin: listall.jsp listallfordelete.jsp

Author: psharples
Date: Wed Jan 26 13:59:59 2011
New Revision: 1063722

URL: http://svn.apache.org/viewvc?rev=1063722&view=rev
Log:
The call widget.getWidgetTitle() can sometimes contain a span html tag, which upsets the jquery UI in this page and makes it fail. Substituted an empty string in the code until fixed properly (we need to parse the result before sending it to jscript). SEE WOOKIE-178.

Modified:
    incubator/wookie/branches/0.9.x/WebContent/admin/listall.jsp
    incubator/wookie/branches/0.9.x/WebContent/admin/listallfordelete.jsp

Modified: incubator/wookie/branches/0.9.x/WebContent/admin/listall.jsp
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/0.9.x/WebContent/admin/listall.jsp?rev=1063722&r1=1063721&r2=1063722&view=diff
==============================================================================
--- incubator/wookie/branches/0.9.x/WebContent/admin/listall.jsp (original)
+++ incubator/wookie/branches/0.9.x/WebContent/admin/listall.jsp Wed Jan 26 13:59:59 2011
@@ -139,7 +139,12 @@ var answer = confirm("Are you sure you w
 			if(widgets!=null){	
 				for (int i = 1; i < widgets.length; i++) {
 					IWidget widget = (IWidget) widgets[i];
-					
+					// TODO - sort out instances where the title can contain html data
+					// i.e. <span style="unicode-bidi:embed; direction:ltr">You decide</span>
+					// Setting the title as empty so that UI still works, but real value will need to be parsed in a future fix
+					// so the jquery code below will work correctly
+					String localWidgetTitle = "";
+					//String localWidgetTitle = widget.getWidgetTitle();
 			%>		 
 			<h3><a href="#"><img height="20" width="20" border="0" src="<%=widget.getWidgetIconLocation()%>"/>&nbsp;<%=widget.getWidgetTitle()%></a></h3>
 			<div>
@@ -265,18 +270,18 @@ var answer = confirm("Are you sure you w
 				               	if(widgetHashDefaults.containsKey(widgetTypes[j].getWidgetContext())){
 				               		// if it does contain this service then is it this widget that is default?
 				        	        	if(widgetHashDefaults.get(widgetTypes[j].getWidgetContext()).equals(widget.getId())){ //###
-				        					%>(<font color="red"><%=widgetTypes[j].getWidgetContext()%></font><a class="opendialog" href="./WidgetAdminServlet?operation=REMOVESINGLEWIDGETTYPE&widgetId=<%=widget.getId()%>&widgetType=<%=widgetTypes[j].getWidgetContext()%>" onclick="updateDialogText('<%=widget.getWidgetTitle()%>','<%=widgetTypes[j].getWidgetContext()%>',false);"><img src="../shared/images/delete_1.gif" width="16" height="16" border="0"></a>)<%
+				        					%>(<font color="red"><%=widgetTypes[j].getWidgetContext()%></font><a class="opendialog" href="./WidgetAdminServlet?operation=REMOVESINGLEWIDGETTYPE&widgetId=<%=widget.getId()%>&widgetType=<%=widgetTypes[j].getWidgetContext()%>" onclick="updateDialogText('<%=localWidgetTitle%>','<%=widgetTypes[j].getWidgetContext()%>',false);"><img src="../shared/images/delete_1.gif" width="16" height="16" border="0"></a>)<%
 				        				}
 				        				else{
-						        			%>(<a class="opendialog" href="./WidgetAdminServlet?operation=SETDEFAULTWIDGET&widgetId=<%=widget.getId()%>&widgetType=<%=widgetTypes[j].getWidgetContext()%>" onclick="updateDialogText('<%=widget.getWidgetTitle()%>','<%=widgetTypes[j].getWidgetContext()%>',true);"><%=widgetTypes[j].getWidgetContext()%></a>
+						        			%>(<a class="opendialog" href="./WidgetAdminServlet?operation=SETDEFAULTWIDGET&widgetId=<%=widget.getId()%>&widgetType=<%=widgetTypes[j].getWidgetContext()%>" onclick="updateDialogText('<%=localWidgetTitle%>','<%=widgetTypes[j].getWidgetContext()%>',true);"><%=widgetTypes[j].getWidgetContext()%></a>
 						        			
 						        				
-											<a class="opendialog" href="./WidgetAdminServlet?operation=REMOVESINGLEWIDGETTYPE&widgetId=<%=widget.getId()%>&widgetType=<%=widgetTypes[j].getWidgetContext()%>" onclick="updateDialogText('<%=widget.getWidgetTitle()%>','<%=widgetTypes[j].getWidgetContext()%>',false);"><img src="../shared/images/delete_1.gif" width="16" height="16" border="0"></a>)<%
+											<a class="opendialog" href="./WidgetAdminServlet?operation=REMOVESINGLEWIDGETTYPE&widgetId=<%=widget.getId()%>&widgetType=<%=widgetTypes[j].getWidgetContext()%>" onclick="updateDialogText('<%=localWidgetTitle%>','<%=widgetTypes[j].getWidgetContext()%>',false);"><img src="../shared/images/delete_1.gif" width="16" height="16" border="0"></a>)<%
 																	        			
 					        			}
 				        		}
 				        		else{
-					        		%>(<a class="opendialog" href="./WidgetAdminServlet?operation=SETDEFAULTWIDGET&widgetId=<%=widget.getId()%>&widgetType=<%=widgetTypes[j].getWidgetContext()%>" onclick="updateDialogText('<%=widget.getWidgetTitle()%>','<%=widgetTypes[j].getWidgetContext()%>',true);"><%=widgetTypes[j].getWidgetContext()%></a><a class="opendialog" href="./WidgetAdminServlet?operation=REMOVESINGLEWIDGETTYPE&widgetId=<%=widget.getId()%>&widgetType=<%=widgetTypes[j].getWidgetContext()%>" onclick="updateDialogText('<%=widget.getWidgetTitle()%>','<%=widgetTypes[j].getWidgetContext()%>',false);"><img src="../shared/images/delete_1.gif" width="16" height="16" border="0"></a>)<%
+					        		%>(<a class="opendialog" href="./WidgetAdminServlet?operation=SETDEFAULTWIDGET&widgetId=<%=widget.getId()%>&widgetType=<%=widgetTypes[j].getWidgetContext()%>" onclick="updateDialogText('<%=localWidgetTitle%>','<%=widgetTypes[j].getWidgetContext()%>',true);"><%=widgetTypes[j].getWidgetContext()%></a><a class="opendialog" href="./WidgetAdminServlet?operation=REMOVESINGLEWIDGETTYPE&widgetId=<%=widget.getId()%>&widgetType=<%=widgetTypes[j].getWidgetContext()%>" onclick="updateDialogText('<%=localWidgetTitle%>','<%=widgetTypes[j].getWidgetContext()%>',false);"><img src="../shared/images/delete_1.gif" width="16" height="16" border="0"></a>)<%
 				        		}	
 				        }
 				        %>

Modified: incubator/wookie/branches/0.9.x/WebContent/admin/listallfordelete.jsp
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/0.9.x/WebContent/admin/listallfordelete.jsp?rev=1063722&r1=1063721&r2=1063722&view=diff
==============================================================================
--- incubator/wookie/branches/0.9.x/WebContent/admin/listallfordelete.jsp (original)
+++ incubator/wookie/branches/0.9.x/WebContent/admin/listallfordelete.jsp Wed Jan 26 13:59:59 2011
@@ -99,6 +99,12 @@ $(document).ready(function(){
 	<%
 		for (int i = 1; i < widgets.length; i++) {
 			IWidget widget = (IWidget) widgets[i];
+			// TODO - sort out instances where the title can contain html data
+			// i.e. <span style="unicode-bidi:embed; direction:ltr">You decide</span>
+			// Setting the title as empty so that UI still works, but real value will need to be parsed in a future fix
+			// so the jquery code below will work correctly
+			String localWidgetTitle = "";
+			//String localWidgetTitle = widget.getWidgetTitle();
 	%>		 
 			<table width="500" class="ui-widget ui-widget-content" align="center">      
 		        <tr class="ui-widget-header"><td colspan="2"><img height="16" width="16" border="0" src="<%=widget.getWidgetIconLocation()%>"/>&nbsp;<%=widget.getWidgetTitle()%></td></tr>
@@ -108,7 +114,7 @@ $(document).ready(function(){
 		        <tr><td>Author</td><td><%=widget.getWidgetAuthor()%></td></tr>		        
 		        <tr><td colspan="2" align="center">
 					<a class="opendialog" href="./WidgetAdminServlet?operation=REMOVEWIDGET&widgetId=<%=widget.getId()%>" 
-					onclick="updateDialogText('<%=widget.getWidgetTitle()%>');">
+					onclick="updateDialogText('<%=localWidgetTitle%>');">
 					<img src="../shared/images/delete_1.gif" width="16" height="16" border="0">&nbsp;Delete this widget
 					</a>
 		        </td></tr>