r1526 - in xwiki/trunk: core/src/main/resources web/standard/src/main/webapp/templates web/standard/src/main/webapp/tiny_mce_2/langs web/standard/src/main/webapp/tiny_mce_2/themes/wikieditor web/standard/src/main/webapp/tiny_mce_2/themes/wikieditor/css web/standard/src/main/webapp/tiny_mce_2/themes/wikieditor/jscripts web/standard/src/main/webapp/wiki_editor_2/plugins

Phung Hai Nam namphunghai at users.forge.objectweb.org
Thu Nov 9 09:56:28 CET 2006


Author: namphunghai
Date: 2006-11-09 09:56:27 +0100 (Thu, 09 Nov 2006)
New Revision: 1526

Modified:
   xwiki/trunk/core/src/main/resources/ApplicationResources.properties
   xwiki/trunk/web/standard/src/main/webapp/templates/browsewysiwyg.vm
   xwiki/trunk/web/standard/src/main/webapp/templates/recentdocwysiwyg.vm
   xwiki/trunk/web/standard/src/main/webapp/templates/searchwysiwyg.vm
   xwiki/trunk/web/standard/src/main/webapp/templates/wysiwyg.vm
   xwiki/trunk/web/standard/src/main/webapp/tiny_mce_2/langs/en.js
   xwiki/trunk/web/standard/src/main/webapp/tiny_mce_2/themes/wikieditor/css/editor_popup.css
   xwiki/trunk/web/standard/src/main/webapp/tiny_mce_2/themes/wikieditor/jscripts/image.js
   xwiki/trunk/web/standard/src/main/webapp/tiny_mce_2/themes/wikieditor/jscripts/link.js
   xwiki/trunk/web/standard/src/main/webapp/tiny_mce_2/themes/wikieditor/link.htm
   xwiki/trunk/web/standard/src/main/webapp/wiki_editor_2/plugins/attachments.js
   xwiki/trunk/web/standard/src/main/webapp/wiki_editor_2/plugins/core.js
Log:
Fixed " the link text when there is a white space shows up %20 in the text box
in the link popup and an empty list item in the wysiwyg editor breaks when saving and reediting"

Modified: xwiki/trunk/core/src/main/resources/ApplicationResources.properties
===================================================================
--- xwiki/trunk/core/src/main/resources/ApplicationResources.properties	2006-11-09 08:28:08 UTC (rev 1525)
+++ xwiki/trunk/core/src/main/resources/ApplicationResources.properties	2006-11-09 08:56:27 UTC (rev 1526)
@@ -495,5 +495,7 @@
 listofallexistspages=List of all exists pages
 listofallattachments=List of all attachments
 listofrecentlyviewedpages=List of recently viewed pages
+listofrecentlymodifiedpages=List of recently modified pages
 listofresultspages= List of result
-choosespace=Choose space
\ No newline at end of file
+choosespace=Choose space
+inspace=in
\ No newline at end of file

Modified: xwiki/trunk/web/standard/src/main/webapp/templates/browsewysiwyg.vm
===================================================================
--- xwiki/trunk/web/standard/src/main/webapp/templates/browsewysiwyg.vm	2006-11-09 08:28:08 UTC (rev 1525)
+++ xwiki/trunk/web/standard/src/main/webapp/templates/browsewysiwyg.vm	2006-11-09 08:56:27 UTC (rev 1526)
@@ -17,7 +17,7 @@
                 <tr>
                     #set($bentrydoc = $xwiki.getDocument($item))
                     <td>* <a href="#" onclick="document.forms[0].wiki_page.value='$bentrydoc.name';if ('$doc.web' != '$bentrydoc.web') document.forms[0].wiki_space.value='$bentrydoc.web'; else document.forms[0].wiki_space.value=''; return false;">
-                        $bentrydoc.name </a>created by  $xwiki.getLocalUserName($bentrydoc.author) on $xwiki.formatDate($bentrydoc.date,"MMMM dd, yyyy HH:mm")
+                        $bentrydoc.name</a>  $msg.get("lastmodifiedby")  $xwiki.getLocalUserName($bentrydoc.author) $msg.get("lastmodifiedon") $xwiki.formatDate($bentrydoc.date,"MMMM dd, yyyy HH:mm")
                      </td>
                  </tr>
             #end

Modified: xwiki/trunk/web/standard/src/main/webapp/templates/recentdocwysiwyg.vm
===================================================================
--- xwiki/trunk/web/standard/src/main/webapp/templates/recentdocwysiwyg.vm	2006-11-09 08:28:08 UTC (rev 1525)
+++ xwiki/trunk/web/standard/src/main/webapp/templates/recentdocwysiwyg.vm	2006-11-09 08:56:27 UTC (rev 1526)
@@ -1,33 +1,44 @@
 <div class="xwikidatacontent">
     #set($rsvc= $xwiki.xWiki.getRightService())
-    #if ($request.getParameter("text"))
-    #set ($text = $request.getParameter("text") )
+
+    #if ($request.getParameter("action"))
+        #set ($action = $request.getParameter("action") )
     #else
-    #set($text = "")
+        #set($action = "")
     #end
-    <p style="font-weight:bold"> $msg.get("listofrecentlyviewedpages") : </p>
-    #set ($sql = "where doc.name like '%$text%' order by doc.date desc")
+
     #set ($start = 0)
     #set ($nb = 50)
 
-    <!--
-    Sql: $sql
-    Sql: $start
-    Sql: $nb
-    -->
+    #if ($action == "view")
+        #set ($collect = $xwiki.getRecentActions("view", 13))
+        #set ($title = $msg.get("listofrecentlyviewedpages"))
+    #else
+        #set ($text = "")
+        #set ($sql = "where doc.name like '%$text%' order by doc.date desc")
+        #set ($start = 0)
+        #set ($nb = 50)
+        #set ($collect = $xwiki.searchDocuments($sql , $nb , $start))
+        #set ($title = $msg.get("listofrecentlymodifiedpages"))
+    #end
+
+    <p style="font-weight:bold"> $title : </p>
+
     <table width="95%">
-    #set($counter=0)
-    #foreach ($item in $xwiki.searchDocuments($sql , $nb , $start))
-    #if ($xwiki.hasAccessLevel("view", "${context.database}:${item}"))
-    #if($counter < 13)
-    <tr>
-    #set($bentrydoc = $xwiki.getDocument($item))
-      <td>* <a href="#" onclick="document.forms[0].wiki_page.value='$bentrydoc.name';if ('$doc.web' != '$bentrydoc.web') document.forms[0].wiki_space.value='$bentrydoc.web'; else document.forms[0].wiki_space.value=''; return false;">
-          $bentrydoc.name </a>in $bentrydoc.web space. Created by  $xwiki.getLocalUserName($bentrydoc.author) on $xwiki.formatDate($bentrydoc.date,"MMMM dd, yyyy HH:mm") </td>
-    </tr>
-    #end
-    #end
-    #set( $counter = $counter + 1)
-    #end
+        #set($counter=0)
+        #foreach ($item in $collect)
+            #if ($xwiki.hasAccessLevel("view", "${context.database}:${item}"))
+                #if($counter < 13)
+                    <tr>
+                        #set($bentrydoc = $xwiki.getDocument($item))
+                        <td>* <a href="#" onclick="document.forms[0].wiki_page.value='$bentrydoc.name';if ('$doc.web' != '$bentrydoc.web') document.forms[0].wiki_space.value='$bentrydoc.web'; else document.forms[0].wiki_space.value=''; return false;">
+                                $bentrydoc.name</a>  $msg.get("inspace") $bentrydoc.web $msg.get("wikiweb"), $msg.get("lastmodifiedby")
+                                $xwiki.getLocalUserName($bentrydoc.author) $msg.get("lastmodifiedon") $xwiki.formatDate($bentrydoc.date,"MMMM dd, yyyy HH:mm")
+                        </td>
+                    </tr>
+                #end
+            #end
+            #set( $counter = $counter + 1)
+        #end
     </table>
 </div>
\ No newline at end of file

Modified: xwiki/trunk/web/standard/src/main/webapp/templates/searchwysiwyg.vm
===================================================================
--- xwiki/trunk/web/standard/src/main/webapp/templates/searchwysiwyg.vm	2006-11-09 08:28:08 UTC (rev 1525)
+++ xwiki/trunk/web/standard/src/main/webapp/templates/searchwysiwyg.vm	2006-11-09 08:56:27 UTC (rev 1526)
@@ -24,7 +24,7 @@
             <tr>
                 #set($bentrydoc = $xwiki.getDocument($item))
                 <td>* <a href="#" onclick="document.forms[0].wiki_page.value='$bentrydoc.name';if ('$doc.web' != '$bentrydoc.web') document.forms[0].wiki_space.value='$bentrydoc.web'; else document.forms[0].wiki_space.value=''; return false;">
-                       $bentrydoc.name </a>created by  $xwiki.getLocalUserName($bentrydoc.author) on $xwiki.formatDate($bentrydoc.date,"MMMM dd, yyyy HH:mm")
+                       $bentrydoc.name</a>  $msg.get("lastmodifiedby")  $xwiki.getLocalUserName($bentrydoc.author) $msg.get("lastmodifiedon") $xwiki.formatDate($bentrydoc.date,"MMMM dd, yyyy HH:mm")
                 </td>
             </tr>
         #end

Modified: xwiki/trunk/web/standard/src/main/webapp/templates/wysiwyg.vm
===================================================================
--- xwiki/trunk/web/standard/src/main/webapp/templates/wysiwyg.vm	2006-11-09 08:28:08 UTC (rev 1525)
+++ xwiki/trunk/web/standard/src/main/webapp/templates/wysiwyg.vm	2006-11-09 08:56:27 UTC (rev 1526)
@@ -20,8 +20,8 @@
 #if ($sectionNumber != 0)
    #set($switchParam = "section=$sectionNumber")
 #end
-<script language="javascript" type="text/javascript" src="${request.contextPath}/tiny_mce/tiny_mce.js"></script>
-<script language="javascript" type="text/javascript" src="${request.contextPath}/wiki_editor/wiki_editor.js"></script>
+<script language="javascript" type="text/javascript" src="${request.contextPath}/tiny_mce_2/tiny_mce.js"></script>
+<script language="javascript" type="text/javascript" src="${request.contextPath}/wiki_editor_2/wiki_editor.js"></script>
 <script language="javascript" type="text/javascript">
     if ( browser.isIE || browser.isMozilla || browser.isGecko  || browser.isSafari) {
         wikiEditor.init({

Modified: xwiki/trunk/web/standard/src/main/webapp/tiny_mce_2/langs/en.js
===================================================================
--- xwiki/trunk/web/standard/src/main/webapp/tiny_mce_2/langs/en.js	2006-11-09 08:28:08 UTC (rev 1525)
+++ xwiki/trunk/web/standard/src/main/webapp/tiny_mce_2/langs/en.js	2006-11-09 08:56:27 UTC (rev 1526)
@@ -31,7 +31,8 @@
 link_page_title : 'Link',
 link_wiki_browse_tab : 'Browse',
 link_wiki_search_tab : 'Search',
-link_wiki_recent_tab : 'Recently Viewed',
+link_wiki_recent_viewed_tab : 'Recently Viewed',
+link_wiki_recent_modified_tab : 'Recently Modified',        
 link_attach_title : 'Attachment title',
 link_attachment_title : 'Attachment name',
 link_email_title : 'Email Address',

Modified: xwiki/trunk/web/standard/src/main/webapp/tiny_mce_2/themes/wikieditor/css/editor_popup.css
===================================================================
--- xwiki/trunk/web/standard/src/main/webapp/tiny_mce_2/themes/wikieditor/css/editor_popup.css	2006-11-09 08:28:08 UTC (rev 1525)
+++ xwiki/trunk/web/standard/src/main/webapp/tiny_mce_2/themes/wikieditor/css/editor_popup.css	2006-11-09 08:56:27 UTC (rev 1526)
@@ -256,7 +256,7 @@
 }
 
 .innertabs a:link, .tabs a:visited, .tabs a:hover {
-	color: black;
+	color: #6666cc;
 }
 
 .innertabs a:hover {

Modified: xwiki/trunk/web/standard/src/main/webapp/tiny_mce_2/themes/wikieditor/jscripts/image.js
===================================================================
--- xwiki/trunk/web/standard/src/main/webapp/tiny_mce_2/themes/wikieditor/jscripts/image.js	2006-11-09 08:28:08 UTC (rev 1525)
+++ xwiki/trunk/web/standard/src/main/webapp/tiny_mce_2/themes/wikieditor/jscripts/image.js	2006-11-09 08:56:27 UTC (rev 1526)
@@ -13,7 +13,8 @@
 
 function init() {
     editor_id = tinyMCE.getWindowArg('editor_id');
-    document.forms[0].href.value = tinyMCE.getWindowArg('src');;
+    var href = tinyMCE.getWindowArg('src')
+    document.forms[0].href.value = href.replace(/%20/gi, " ");
     document.forms[0].width.value = tinyMCE.getWindowArg('width');
 	document.forms[0].height.value = tinyMCE.getWindowArg('height');
 

Modified: xwiki/trunk/web/standard/src/main/webapp/tiny_mce_2/themes/wikieditor/jscripts/link.js
===================================================================
--- xwiki/trunk/web/standard/src/main/webapp/tiny_mce_2/themes/wikieditor/jscripts/link.js	2006-11-09 08:28:08 UTC (rev 1525)
+++ xwiki/trunk/web/standard/src/main/webapp/tiny_mce_2/themes/wikieditor/jscripts/link.js	2006-11-09 08:56:27 UTC (rev 1526)
@@ -12,7 +12,7 @@
            document.forms[0].web_page.value = href;
         } else if (href.search(/wikiattachment:-:(.*?)/gi) > -1) {
             mcTabs.displayTab('attachments_tab','attachments_panel');
-            document.forms[0].attach.value = href.replace(/wikiattachment:-:/gi, "");
+            document.forms[0].attach.value = href.replace(/wikiattachment:-:/gi, "").replace(/%20/gi, " ");
         } else if (href.search(/mailto:(.*?)/gi) > -1) {
             mcTabs.displayTab('email_tab','email_panel')
             document.forms[0].email.value = href.replace(/mailto:/gi, "");

Modified: xwiki/trunk/web/standard/src/main/webapp/tiny_mce_2/themes/wikieditor/link.htm
===================================================================
--- xwiki/trunk/web/standard/src/main/webapp/tiny_mce_2/themes/wikieditor/link.htm	2006-11-09 08:28:08 UTC (rev 1525)
+++ xwiki/trunk/web/standard/src/main/webapp/tiny_mce_2/themes/wikieditor/link.htm	2006-11-09 08:56:27 UTC (rev 1526)
@@ -121,15 +121,24 @@
         spaceEl.innerHTML = '<select id="space" name="space" onchange="loadBrowseList(baseurl, this);">' + e+  '</select>';
         spaceE2.innerHTML = '<select id="search_space" name="search_space" >' + e + '</select>';
     }
-    function loadRecentlyViewedList(baseurl) {
+    function loadRecentlyList(baseurl, action) {
         var url = baseurl + "?xpage=recentdocwysiwyg";
-        executeCommand(url, loadRecentlyViewedCallback);
+        if (action != null && action != "" && action == "view") {
+            url += "&action=" + action;
+            executeCommand(url, loadRecentlyViewedCallback);
+        } else 
+            executeCommand(url, loadRecentlyModifiedCallback);
     }
 
     function loadRecentlyViewedCallback(e) {
         var recentEl = document.getElementById("recentviewed");
         recentEl.innerHTML = e;
     }
+
+    function loadRecentlyModifiedCallback(e) {
+        var recentE2 = document.getElementById("recentmodified");
+        recentE2.innerHTML = e;
+    }
 </script>
 </head>
 <body id="link" onload="tinyMCEPopup.executeOnLoad('init();');"  style="display: none">
@@ -181,7 +190,8 @@
                                             <ul>
                                                 <li id="browse_tab" class="current"><span><a href="javascript:mcTabs.displayTab('browse_tab','browse_panel');" onmousedown="return false;">{$lang_link_wiki_browse_tab}</a></span></li>
                                                 <li id="search_tab"><span><a href="javascript:mcTabs.displayTab('search_tab','search_panel');" onmousedown="return false;">{$lang_link_wiki_search_tab}</a></span></li>
-                                                <li id="recent_tab"><span><a href="javascript:mcTabs.displayTab('recent_tab','recent_panel');" onmousedown="return false;">{$lang_link_wiki_recent_tab}</a></span></li>
+                                                <li id="recent_viewed_tab"><span><a href="javascript:mcTabs.displayTab('recent_viewed_tab','recent_viewed_panel');" onmousedown="return false;">{$lang_link_wiki_recent_viewed_tab}</a></span></li>
+                                                <li id="recent_modified_tab"><span><a href="javascript:mcTabs.displayTab('recent_modified_tab','recent_modified_panel');" onmousedown="return false;">{$lang_link_wiki_recent_modified_tab}</a></span></li>
                                             </ul>
                                         </div>
 
@@ -242,18 +252,31 @@
                                                 </table>
                                             </div>
 
-                                            <div id="recent_panel" class="panel">
+                                            <div id="recent_viewed_panel" class="panel">
                                                 <table border="0" cellpadding="4" cellspacing="0" width="100%">
                                                     <tr>
                                                         <td>
                                                             <div style="margin: 3px" id="recentviewed"></div>
                                                             <script type="text/javascript">
-                                                                loadRecentlyViewedList(baseurl);
+                                                                loadRecentlyList(baseurl, "view");
                                                             </script>
                                                         </td>
                                                     </tr>
                                                 </table>
                                             </div>
+
+                                            <div id="recent_modified_panel" class="panel">
+                                                <table border="0" cellpadding="4" cellspacing="0" width="100%">
+                                                    <tr>
+                                                        <td>
+                                                            <div style="margin: 3px" id="recentmodified"></div>
+                                                            <script type="text/javascript">
+                                                                loadRecentlyList(baseurl);
+                                                            </script>
+                                                        </td>
+                                                    </tr>
+                                                </table>
+                                            </div>
                                         </div>
                                     </td>
                                 </tr>

Modified: xwiki/trunk/web/standard/src/main/webapp/wiki_editor_2/plugins/attachments.js
===================================================================
--- xwiki/trunk/web/standard/src/main/webapp/wiki_editor_2/plugins/attachments.js	2006-11-09 08:28:08 UTC (rev 1525)
+++ xwiki/trunk/web/standard/src/main/webapp/wiki_editor_2/plugins/attachments.js	2006-11-09 08:56:27 UTC (rev 1526)
@@ -214,6 +214,8 @@
 }
 
 WikiEditor.prototype.convertAttachmentInternal = function(regexp, result, content) {
+    result[1] = result[1].replace(/%20/gi, " ");
+    result[3] = result[3].replace(/%20/gi, " ");
     var str;
     if (result[1] == result[3]) str = "{attach:" + result[1] + "}";
     else  if ((result[1] == "undefined") || (this.trimString(result[1]) == "")) str = "{attach:" + result[3] + "}";

Modified: xwiki/trunk/web/standard/src/main/webapp/wiki_editor_2/plugins/core.js
===================================================================
--- xwiki/trunk/web/standard/src/main/webapp/wiki_editor_2/plugins/core.js	2006-11-09 08:28:08 UTC (rev 1525)
+++ xwiki/trunk/web/standard/src/main/webapp/wiki_editor_2/plugins/core.js	2006-11-09 08:56:27 UTC (rev 1526)
@@ -44,8 +44,7 @@
 
     this.addInternalProcessor((/&lt;%([\s\S]+?)%&gt;/i), 'convertGroovyScriptsInternal');
 
-    // Remove &nbsp;'s
-    this.addInternalProcessor((/&nbsp;(?!\|)/gi), "");
+    //this.addInternalProcessor((/&nbsp;(?!\|)/gi), "");
 
     var charStr = "À|Á|Â|Ã|Ä|Å|" +
                   "Æ|Ç|È|É|Ê|Ë|" +
@@ -815,9 +814,9 @@
 	var str = "";
 	if(bounds && bounds["start"] > -1) {
 		str = this._convertListInternal(content.substring(bounds["start"], bounds["end"]));
-		return content.substring(0, bounds["start"]) + "\r\n" + str + content.substring(bounds["end"], content.length);
+        return content.substring(0, bounds["start"]) + "\r\n" + str + content.substring(bounds["end"], content.length);
 	}
-	return content;
+    return content;
 }
 
 /*
@@ -835,8 +834,10 @@
 		RegExp.lastIndex = result["index"];  // Reset position so it will find the same tag when replacing
 
 		var tstr = result[2];
+        if (tstr == "<br />") tstr = "&nbsp;<br />";
+        if (tstr == "") tstr = "&nbsp;";
 
-		if(attributes && attributes["wikieditorlisttype"] && attributes["wikieditorlistdepth"]) { // Must have at least 2 wikieditor attributes + the string
+        if(attributes && attributes["wikieditorlisttype"] && attributes["wikieditorlistdepth"]) { // Must have at least 2 wikieditor attributes + the string
 
 			//tstr = this.convertBlockInternal(tstr); // Read line and convert
 





More information about the Xwiki-notifications mailing list