Update of
/var/cvs/contributions/CMSContainer/cmsc/contentrepository/src/webapp/editors/recyclebin
In directory
james.mmbase.org:/tmp/cvs-serv910/cmsc/contentrepository/src/webapp/editors/recyclebin
Modified Files:
assettrash.jsp recyclebin.js contenttrash.jsp
Log Message:
CMSC-1331 Recyclebin actions throw errors when in the asset tab
See also:
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer/cmsc/contentrepository/src/webapp/editors/recyclebin
See also: http://www.mmbase.org/jira/browse/CMSC-1331
Index: assettrash.jsp
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer/cmsc/contentrepository/src/webapp/editors/recyclebin/assettrash.jsp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- assettrash.jsp 20 Feb 2009 05:33:36 -0000 1.7
+++ assettrash.jsp 18 Mar 2009 11:16:13 -0000 1.8
@@ -97,9 +97,9 @@
<tr <mm:even
inverse="true">class="swap"</mm:even>>
<td nowrap>
- <a href="javascript:info('<mm:field
name="number" />', '<mm:nodeinfo type="guitype"/>')"><img
src="../gfx/icons/info.png" width="16" height="16" alt="<fmt:message
key="recyclebin.info" />" title="<fmt:message key="recyclebin.info" />"/></a>
+ <a
href="javascript:infoAsset('<mm:field name="number" />', '<mm:nodeinfo
type="type"/>')"><img src="../gfx/icons/info.png" width="16" height="16"
alt="<fmt:message key="recyclebin.info" />" title="<fmt:message
key="recyclebin.info" />"/></a>
<a
href="javascript:permanentDelete('<mm:field name="number" />', '<fmt:message
key="recyclebin.removeconfirm" />', '${offset}','asset');"><img
src="../gfx/icons/delete.png" width="16" height="16" alt="<fmt:message
key="recyclebin.remove" />" title="<fmt:message key="recyclebin.remove"
/>"/></a>
- <a href="javascript:restore('<mm:field
name="number" />', '${offset}','<mm:nodeinfo type="guitype"/>');"><img
src="../gfx/icons/restore.png" width="16" height="16" alt="<fmt:message
key="recyclebin.restore" />" title="<fmt:message key="recyclebin.restore"
/>"/></a>
+ <a
href="javascript:restoreAsset('<mm:field name="number" />', '${offset}');"><img
src="../gfx/icons/restore.png" width="16" height="16" alt="<fmt:message
key="recyclebin.restore" />" title="<fmt:message key="recyclebin.restore"
/>"/></a>
</td>
<td>
<mm:nodeinfo type="guitype"/>
Index: recyclebin.js
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer/cmsc/contentrepository/src/webapp/editors/recyclebin/recyclebin.js,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- recyclebin.js 30 Dec 2008 08:51:12 -0000 1.8
+++ recyclebin.js 18 Mar 2009 11:16:13 -0000 1.9
@@ -1,33 +1,37 @@
- function restore(objectnumber, offset, type, url) {
- if(type=="Attachment"||type=="Image"||type=="URL"){
- url = "RestoreAssetAction.do";
+ function restoreAsset(objectnumber, offset) {
+ return restore(objectnumber, offset, "RestoreAssetAction.do");
}
- else{
- url = "RestoreAction.do";
+
+ function restoreContent(objectnumber, offset) {
+ return restore(objectnumber, offset, "RestoreAction.do");
}
+
+ function restore(objectnumber, offset, url) {
url += "?objectnumber=" + objectnumber;
url += "&returnurl=" + escape(document.location);
url += "&offset=" + offset;
document.location.href = url;
}
- function info(objectNumber, type) {
- var url;
- if(type=="Attachment"||type=="Image"||type=="URL"){
+ function infoAsset(objectNumber, type) {
+ type = type.toLowerCase();
+ // The info jsp's are called with the singular name and not the
plural name
+ // The nodetype is for the below types in plural
+ if (type == 'images') type = 'image';
+ if (type == 'attachments') type = 'attachment';
+ if (type == 'urls') type = 'url';
+
url = '../resources/';
- url += type.toLowerCase();
+ url += type;
url += 'info.jsp?objectnumber=';
url += objectNumber;
openPopupWindow('imageinfo', '900', '500', url);
}
- else{
+
+ function infoContent(objectNumber, type) {
url = "../repository/showitem.jsp";
url += "?objectnumber=" + objectNumber;
-
- var options = 'width=500,height=500,scrollbars=yes,resizable=yes'
- var w = window.open(url, 'viewItem', options);
- w.focus();
- }
+ openPopupWindow('contentinfo', '500', '500', url);
}
function permanentDelete(objectnumber, message, offset, type) {
Index: contenttrash.jsp
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer/cmsc/contentrepository/src/webapp/editors/recyclebin/contenttrash.jsp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- contenttrash.jsp 11 Feb 2009 13:55:01 -0000 1.4
+++ contenttrash.jsp 18 Mar 2009 11:16:13 -0000 1.5
@@ -98,9 +98,9 @@
<tr <mm:even
inverse="true">class="swap"</mm:even>>
<td nowrap>
- <a href="javascript:info('<mm:field
name="number" />', '<mm:nodeinfo type="guitype"/>')"><img
src="../gfx/icons/info.png" width="16" height="16" alt="<fmt:message
key="recyclebin.info" />" title="<fmt:message key="recyclebin.info" />"/></a>
+ <a
href="javascript:infoContent('<mm:field name="number" />', '<mm:nodeinfo
type="type"/>')"><img src="../gfx/icons/info.png" width="16" height="16"
alt="<fmt:message key="recyclebin.info" />" title="<fmt:message
key="recyclebin.info" />"/></a>
<a
href="javascript:permanentDelete('<mm:field name="number" />', '<fmt:message
key="recyclebin.removeconfirm" />', '${offset}', 'content');"><img
src="../gfx/icons/delete.png" width="16" height="16" alt="<fmt:message
key="recyclebin.remove" />" title="<fmt:message key="recyclebin.remove"
/>"/></a>
- <a href="javascript:restore('<mm:field
name="number" />', '${offset}', '<mm:nodeinfo type="guitype"/>');"><img
src="../gfx/icons/restore.png" width="16" height="16" alt="<fmt:message
key="recyclebin.restore" />" title="<fmt:message key="recyclebin.restore"
/>"/></a>
+ <a
href="javascript:restoreContent('<mm:field name="number" />',
'${offset}');"><img src="../gfx/icons/restore.png" width="16" height="16"
alt="<fmt:message key="recyclebin.restore" />" title="<fmt:message
key="recyclebin.restore" />"/></a>
</td>
<td>
<mm:nodeinfo type="guitype"/>
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs