r1417 - in xwiki/trunk: core/src/main/java/com/xpn/xwiki src/main/web/templates

Phung Hai Nam namphunghai at users.forge.objectweb.org
Fri Oct 20 09:56:05 CEST 2006


Author: namphunghai
Date: 2006-10-20 09:56:04 +0200 (Fri, 20 Oct 2006)
New Revision: 1417

Modified:
   xwiki/trunk/core/src/main/java/com/xpn/xwiki/XWiki.java
   xwiki/trunk/src/main/web/templates/attachwysiwyg.vm
   xwiki/trunk/src/main/web/templates/macros.txt
   xwiki/trunk/src/main/web/templates/macrowysiwyg.vm
Log:
Modified something to optimize code for macros

Modified: xwiki/trunk/core/src/main/java/com/xpn/xwiki/XWiki.java
===================================================================
--- xwiki/trunk/core/src/main/java/com/xpn/xwiki/XWiki.java	2006-10-20 04:34:05 UTC (rev 1416)
+++ xwiki/trunk/core/src/main/java/com/xpn/xwiki/XWiki.java	2006-10-20 07:56:04 UTC (rev 1417)
@@ -154,7 +154,7 @@
     private boolean isReadOnly = false;
 
     public static final String CFG_ENV_NAME = "XWikiConfig";
-    public static final String MACROS_FILE = "/template/macros.txt";
+    public static final String MACROS_FILE = "/templates/macros.txt";
 
     /* i don't like using static variables like, but this avoid making a JNDI lookup with
        each request ...
@@ -3981,7 +3981,7 @@
         XWiki xwiki = context.getWiki();
 
         try {
-            macrosmapping = xwiki.getResourceContent(MACROS_FILE);
+            macrosmapping = getResourceContent(MACROS_FILE);
         } catch (IOException e) {}
 
         macrosmapping += "\r\n" + xwiki.getXWikiPreference("macros_mapping", "", context);

Modified: xwiki/trunk/src/main/web/templates/attachwysiwyg.vm
===================================================================
--- xwiki/trunk/src/main/web/templates/attachwysiwyg.vm	2006-10-20 04:34:05 UTC (rev 1416)
+++ xwiki/trunk/src/main/web/templates/attachwysiwyg.vm	2006-10-20 07:56:04 UTC (rev 1417)
@@ -1,44 +1,41 @@
 #set($attachments = $doc.attachmentList)
 <div id="xwikiattachmentscontent" class="xwikidatacontent">
-<br />
-<form id="attach" action="$doc.getURL("upload")" enctype="multipart/form-data" method="post"
-      onsubmit="return updateAttachName(this)" >
-<input type="hidden" name="xredirect" value="" />
-<p>
-$msg.get("choosetargetfilename"):
-<input type="text" name="filename" value="" size="20" />
-<br /><br />
-$msg.get("choosefiletoupload"):
-<input type="file" name="filepath" value="" size="40"  />
-<br /><br />
-<input type="submit" value="$msg.get("attachthisfile")" />
-</p>
-</form>
-#set($counter=0)
-#foreach ($attach in $attachments)
-#if((!$request.images)||$attach.isImage())
-#if($counter==0)
-<table>
-<tr><th></th><th> <b>$msg.get("filename")</b> </th><th> <b>$msg.get("version")</b> </th>
-<th> <b>$msg.get("author")</b> </th></tr>
-#end
-<tr>
-<td>
-#if ($attach.isImage())
-<a href="$doc.getAttachmentURL("${attach.filename}", "download")" onclick="document.forms[0].href.value='$attach.filename'; return false;" >
-<img src="$doc.getAttachmentURL("${attach.filename}", "download", "width=80")" alt="${attach.filename}" width="80" border="0" />
-</a>
-#end
-</td><td><a href="$doc.getAttachmentURL("${attach.filename}", "download")" onclick="document.forms[0].href.value='$attach.filename'; return false;" >$attach.filename</a></td>
-<td>$attach.version</td><td>$xwiki.getLocalUserName($attach.author)</td>
-</tr>
-#end
-#set( $counter = $counter + 1)
-#end
-</table>
-</div>
-<div class="xwikidatafooter2">
-<div class="xwikidatafooter1">&nbsp;</div>
-<div class="xwikidatafooter">&nbsp;</div>
-</div>
+  <form id="attach" action="$doc.getURL("upload")" enctype="multipart/form-data" method="post"
+        onsubmit="return updateAttachName(this)" >
+    <input type="hidden" name="xredirect" value="" />
+    <p>
+      $msg.get("choosetargetfilename"):
+      <input type="text" name="filename" value="" size="20" />
+      <br /><br />
+      $msg.get("choosefiletoupload"):
+      <input type="file" name="filepath" value="" size="40"  /> <br /><br />
+      <input type="submit" value="$msg.get("attachthisfile")" />
+    </p>
+  </form>
+  #set($counter=0)
+  #foreach ($attach in $attachments)
+    #if((!$request.images)||$attach.isImage())
+      #if($counter==0)
+        <table>
+          <tr class="title"><th></th><th>$msg.get("filename")</th><th>$msg.get("version")</th><th>$msg.get("author")</th></tr>
+      #end
+      <tr>
+        <td>
+          #if ($attach.isImage())
+            <a href="$doc.getAttachmentURL("${attach.filename}", "download")" onclick="document.forms[0].href.value='$attach.filename'; return false;" >
+              <img src="$doc.getAttachmentURL("${attach.filename}", "download", "width=80")" alt="${attach.filename}" width="80" border="0" />
+            </a>
+          #end
+        </td><td align="center"><a href="$doc.getAttachmentURL("${attach.filename}", "download")" onclick="document.forms[0].href.value='$attach.filename'; return false;" >$attach.filename</a></td>
+        <td align="center">$attach.version</td><td align="center">$xwiki.getLocalUserName($attach.author)</td>
+      </tr>
+    #end
+    #set( $counter = $counter + 1)
+  #end
+  </table>
+  </div>
+  <div class="xwikidatafooter2">
+    <div class="xwikidatafooter1">&nbsp;</div>
+    <div class="xwikidatafooter">&nbsp;</div>
+  </div>
 </div>
\ No newline at end of file

Modified: xwiki/trunk/src/main/web/templates/macros.txt
===================================================================
--- xwiki/trunk/src/main/web/templates/macros.txt	2006-10-20 04:34:05 UTC (rev 1416)
+++ xwiki/trunk/src/main/web/templates/macros.txt	2006-10-20 07:56:04 UTC (rev 1417)
@@ -2,7 +2,8 @@
 includeForm=velocity:includeForm:topic
 includeTopic=velocity:includeTopic:topic
 includeMacros=velocity:includeMacros:topic
-code=radeox:code:type:contentskype=velocity:skype:id
+code=radeox:code:type:content
+skype=velocity:skype:id
 yahoo=velocity:yahoo:id
 jabber=velocity:jabber:id
 aim=velocity:aim:id

Modified: xwiki/trunk/src/main/web/templates/macrowysiwyg.vm
===================================================================
--- xwiki/trunk/src/main/web/templates/macrowysiwyg.vm	2006-10-20 04:34:05 UTC (rev 1416)
+++ xwiki/trunk/src/main/web/templates/macrowysiwyg.vm	2006-10-20 07:56:04 UTC (rev 1417)
@@ -12,7 +12,7 @@
                     <table cellspacing="0" cellpadding="0" width="100%" style="border: 0px">
                          <tr>
                             <td>
-                                <select id="selmacro" name="selmacro" style="border: 1px solid #808080; width:100%;" size="5" onchange="inputMacro();">
+                                <select id="selmacro" name="selmacro" style="border: 1px solid #808080; width:100%;" size="7" onchange="inputMacro();">
                                     #foreach ($macro in $macros)
                                         #if (!$macro.trim().equals(""))
                                             #set($macroname = $macro.toString().substring(0,$macro.indexOf("=")))





More information about the Xwiki-notifications mailing list