incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r462983 - in /incubator/graffito/trunk/applications/browser/src/webapp/kupu-1.3.5: fulldoc.html kupu.vm kupueditor.js kupuinit.js
Date Wed, 11 Oct 2006 21:54:32 GMT
Author: clombart
Date: Wed Oct 11 14:54:31 2006
New Revision: 462983

URL: http://svn.apache.org/viewvc?view=rev&rev=462983
Log:
* Redirect to the folder edit page after inserting a cms object
* Small bug fix in the kupu edito

Removed:
    incubator/graffito/trunk/applications/browser/src/webapp/kupu-1.3.5/fulldoc.html
Modified:
    incubator/graffito/trunk/applications/browser/src/webapp/kupu-1.3.5/kupu.vm
    incubator/graffito/trunk/applications/browser/src/webapp/kupu-1.3.5/kupueditor.js
    incubator/graffito/trunk/applications/browser/src/webapp/kupu-1.3.5/kupuinit.js

Modified: incubator/graffito/trunk/applications/browser/src/webapp/kupu-1.3.5/kupu.vm
URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/applications/browser/src/webapp/kupu-1.3.5/kupu.vm?view=diff&rev=462983&r1=462982&r2=462983
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/webapp/kupu-1.3.5/kupu.vm (original)
+++ incubator/graffito/trunk/applications/browser/src/webapp/kupu-1.3.5/kupu.vm Wed Oct 11
14:54:31 2006
@@ -1,5 +1,15 @@
 #set ($MESSAGES = $portletConfig.getResourceBundle($renderRequest.Locale))
+#set ($browserSession = $renderRequest.getPortletSession().getAttribute("browserSession"))
 #set ($document = $documentDTO.getDocument())
+#set ($parentFolder = $document.getParentFolder())
+
+#if($parentFolder)
+   #set ($parentFolderUri = $parentFolder.getUri())
+#else
+   #set ($parentFolderUri = $pathDTO.getServer().getScope())
+#end
+$parentFolderUri
+
 #set ($browserSession = $renderRequest.getPortletSession().getAttribute("browserSession"))
 
 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:i18n="http://xml.zope.org/namespaces/i18n"
i18n:domain="kupu">
@@ -45,7 +55,10 @@
         <kupuconfig>
           
     <dst>$graffitoTools.getUpdaterServlet()</dst>
-    <use_css>1</use_css>
+    #if($browserSession.isInsert())
+       <redirect>$renderResponse.createActionURL()?uri=$parentFolderUri&portletForward_folderEdit</redirect>
+    #end       
+    <use_css>0</use_css>
     <reload_after_save>0</reload_after_save>
     <strict_output>1</strict_output>
     <content_type>application/xhtml+xml</content_type>
@@ -516,7 +529,7 @@
     </table>
   
     <div class="kupu-editorframe">
-      <form>
+      <form id="kupu-form-editor" action="$renderResponse.createActionURL()?uri=$document.getParentFolder().getUri()&portletForward_folderEdit"
>
         #if($document.getUri())
 			#set($src= "$graffitoTools.getViewerServlet()?uri=$document.getUri()")
 		#else

Modified: incubator/graffito/trunk/applications/browser/src/webapp/kupu-1.3.5/kupueditor.js
URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/applications/browser/src/webapp/kupu-1.3.5/kupueditor.js?view=diff&rev=462983&r1=462982&r2=462983
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/webapp/kupu-1.3.5/kupueditor.js (original)
+++ incubator/graffito/trunk/applications/browser/src/webapp/kupu-1.3.5/kupueditor.js Wed
Oct 11 14:54:31 2006
@@ -199,7 +199,6 @@
             this is used for saveOnPart, though)
         */
         
-
         // if no dst is available, bail out
         if (!this.config.dst) {
             this.logMessage(_('No destination URL available!'), 2);
@@ -241,22 +240,25 @@
         
         this.logMessage(_("Cleanup done, sending document to server"));
         var request = new XMLHttpRequest();
-    
-        if (!synchronous) {
+        
+        if (!synchronous) {        
             request.onreadystatechange = (new ContextFixer(this._saveCallback, 
                                                this, request, redirect)).execute;
             
             request.open("PUT", this.config.dst, true);
             request.setRequestHeader("Content-type", this.config.content_type);
             request.send(contents);
-            this.logMessage(_("Request sent to server"));
-        } else {
+            this.logMessage(_("Request sent to server"));            
+            
+        } else 
+        {
             this.logMessage(_('Sending request to server'));
             
             request.open("PUT", this.config.dst, false);
             request.setRequestHeader("Content-type", this.config.content_type);
             request.send(contents);
-            this.handleSaveResponse(request,redirect)
+            this.handleSaveResponse(request,redirect);
+            
         };
     };
     
@@ -463,6 +465,7 @@
             alert(msg);
             window.status = _("Error saving document");
         } else if (redirect) { // && (!request.status || request.status == '200'
|| request.status == '204'))
+            this.content_changed = false;
             window.document.location = redirect;
             this.content_changed = false;
         } else {

Modified: incubator/graffito/trunk/applications/browser/src/webapp/kupu-1.3.5/kupuinit.js
URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/applications/browser/src/webapp/kupu-1.3.5/kupuinit.js?view=diff&rev=462983&r1=462982&r2=462983
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/webapp/kupu-1.3.5/kupuinit.js (original)
+++ incubator/graffito/trunk/applications/browser/src/webapp/kupu-1.3.5/kupuinit.js Wed Oct
11 14:54:31 2006
@@ -22,8 +22,7 @@
         to do some customization, this should probably be overridden. For 
         larger customization actions you will have to subclass or roll your 
         own UI object.
-    */
-
+    */   
     // first we create a logger
     var l = new PlainLogger('kupu-toolbox-debuglog', 5);
     
@@ -47,7 +46,7 @@
     kupu.registerTool('ui', ui); // XXX Should this be a different method?
 
     // add the buttons to the toolbar
-    var savebuttonfunc = function(button, editor) {editor.saveDocument()};
+    var savebuttonfunc = function(button, editor) {editor.saveDocument(conf['redirect'],
true);};
     var savebutton = new KupuButton('kupu-save-button', savebuttonfunc);
     kupu.registerTool('savebutton', savebutton);
 
@@ -158,6 +157,7 @@
     kupu.registerTool('linktool', linktool);
     var linktoolbox = new LinkToolBox("kupu-link-input", "kupu-link-button", 'kupu-toolbox-links',
'kupu-toolbox', 'kupu-toolbox-active');
     linktool.registerToolBox('linktoolbox', linktoolbox);
+
 
     var imagetool = new ImageTool();
     kupu.registerTool('imagetool', imagetool);



Mime
View raw message