[xwiki-notifications] r10954 - xwiki-products/curriki/trunk/web/src/main/webapp/templates
nmayer (SVN)
notifications at xwiki.org
Tue Jul 1 00:56:50 CEST 2008
Author: nmayer
Date: 2008-07-01 00:56:50 +0200 (Tue, 01 Jul 2008)
New Revision: 10954
Modified:
xwiki-products/curriki/trunk/web/src/main/webapp/templates/lpattachments.vm
Log:
added javascript:getAttachmentsExts()
Modified: xwiki-products/curriki/trunk/web/src/main/webapp/templates/lpattachments.vm
===================================================================
--- xwiki-products/curriki/trunk/web/src/main/webapp/templates/lpattachments.vm 2008-06-30 22:37:38 UTC (rev 10953)
+++ xwiki-products/curriki/trunk/web/src/main/webapp/templates/lpattachments.vm 2008-06-30 22:56:50 UTC (rev 10954)
@@ -20,10 +20,13 @@
## Compute velocity vars for attachments that are made available to
## framing app via javascript getAttachmentsSize() and getAttachmentsNames().
##
-#set( $total_attachments_size = 0 ) ## javascript:getAttachmentsSize()
+#set( $total_attachments_size = 0 ) ## javascript:getAttachmentsSize()
#set( $total_attachments_names = [] ) ## javascript:getAttachmentsNames()
+#set( $total_attachments_exts = [] ) ## javascript:getAttachmentsExts()
#foreach ($attach in $doc.attachmentList) ## {
+ #mimeicon($attach.filename) ## this hack-macro sets ${macro_iconUrl} and ${m_fileExt} as side-effect
#set( $ok = $total_attachments_names.add("'${attach.filename}'") ) ## append attachment filename to ArrayList
+ #set( $ok = $total_attachments_icons.add("'${m_fileExt}'") ) ## append attachment icon to ArrayList
#set( $total_attachments_size = ${total_attachments_size} + ${attach.getFilesize()} ) ## compute total size of atttachments
#end ## } -- foreach
##
@@ -34,7 +37,7 @@
<input id="xwikiuploadname" type="hidden" name="filename" value="" size="40"/>
<input id="xwikiuploadfile" type="file" name="filepath" value="" size="40"/>
<script language="javascript" type="text/javascript" src="$xwiki.getSkinFile("xwiki.js")"></script>
- <script type="text/javascript">function getAttachmentsNames() { return (${total_attachments_names}); } function getAttachmentsSize() { return (${total_attachments_size}); } function updateXRedirect(formName, returnValue) { var xredirect = document.forms[formName].xredirect; xredirect.value = '${doc.getURL("view", "xpage=lpattachments")}'; return returnValue; }</script>
+ <script type="text/javascript">function getAttachmentsNames() { return (${total_attachments_names}); } function getAttachmentsExts() { return (${total_attachments_exts}); } function getAttachmentsSize() { return (${total_attachments_size}); } function updateXRedirect(formName, returnValue) { var xredirect = document.forms[formName].xredirect; xredirect.value = '${doc.getURL("view", "xpage=lpattachments")}'; return returnValue; }</script>
<input class="button button-orange" type="submit" value="$msg.get("attachthisfile")" onclick="try { if (getAttachmentsSize() < $msg.get("lesson.plan.file.size.maximum")) { return updateXRedirect('attachmentAddForm', updateAttachName(this.form, '$msg.get('doyouwanttoreplace')')); } else { alert('$msg.get('lesson.plan.file.size.dialog')'); return false; } } catch(e) { alert('$msg.get('attachthisfile') button onclick error: ' + e + ' ...'); return false; }" />
</form>
##
More information about the notifications
mailing list