roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r819364 - in /roller/trunk/apps/weblogger: src/java/org/apache/roller/weblogger/business/ src/java/org/apache/roller/weblogger/pojos/ src/java/org/apache/roller/weblogger/ui/struts2/editor/ web/WEB-INF/ web/WEB-INF/classes/ web/WEB-INF/jsps...
Date Sun, 27 Sep 2009 18:03:44 GMT
Author: snoopdave
Date: Sun Sep 27 18:03:43 2009
New Revision: 819364

URL: http://svn.apache.org/viewvc?rev=819364&view=rev
Log:
Replace ineffective YUI context menu in Media File View page with simple links in the appropriate
places.
   https://issues.apache.org/jira/browse/ROL-1836

Also made general improvements to Media File Edit and Media File Add Success pages.

There's also some remaining Xinha cleanup in this commit.

Removed:
    roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha/
Modified:
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/MultiWeblogURLStrategy.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/URLStrategy.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFile.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAddWithMediaFile.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBean.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileEdit.java
    roller/trunk/apps/weblogger/web/WEB-INF/classes/ApplicationResources.properties
    roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileAdd.jsp
    roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileAddSuccess.jsp
    roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileEdit.jsp
    roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileView.jsp
    roller/trunk/apps/weblogger/web/WEB-INF/jsps/taglibs-struts2.jsp
    roller/trunk/apps/weblogger/web/WEB-INF/tiles.xml

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/MultiWeblogURLStrategy.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/MultiWeblogURLStrategy.java?rev=819364&r1=819363&r2=819364&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/MultiWeblogURLStrategy.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/MultiWeblogURLStrategy.java
Sun Sep 27 18:03:43 2009
@@ -124,7 +124,17 @@
         return url.toString();
     }
 
-    
+
+    /**
+     * Get url for a single weblog media file on a given weblog.
+     */
+    public String getMediaFileThumbnailURL(Weblog weblog,
+            String fileAnchor,
+            boolean absolute) {
+            
+        return getMediaFileURL(weblog, fileAnchor, absolute) + "?t=true";
+    }
+
     
     /**
      * Get url for a single weblog entry comments on a given weblog.

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/URLStrategy.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/URLStrategy.java?rev=819364&r1=819363&r2=819364&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/URLStrategy.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/URLStrategy.java
Sun Sep 27 18:03:43 2009
@@ -156,6 +156,13 @@
                                                  boolean absolute);
 
     /**
+     * Get url for a single mediafile thumbnail on a given weblog.
+     */
+    public String getMediaFileThumbnailURL(Weblog weblog,
+                                                String fileAnchor,
+                                                boolean absolute);
+
+    /**
      * Get url for a collection of entries on a given weblog.
      */
     public String getWeblogCollectionURL(Weblog weblog,

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFile.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFile.java?rev=819364&r1=819363&r2=819364&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFile.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/MediaFile.java
Sun Sep 27 18:03:43 2009
@@ -245,6 +245,15 @@
                 this.weblog, this.id, true);
     }
 
+    /**
+     * Returns thumbnail URL for this media file resource.
+     * Resulting URL will be a 404 if media file is not an image.
+     */
+    public String getThumbnailURL() {
+        return WebloggerFactory.getWeblogger().getUrlStrategy().getMediaFileThumbnailURL(
+                this.weblog, this.id, true);
+    }
+
     public String getCreatorUserName() {
         return creatorUserName;
     }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAddWithMediaFile.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAddWithMediaFile.java?rev=819364&r1=819363&r2=819364&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAddWithMediaFile.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAddWithMediaFile.java
Sun Sep 27 18:03:43 2009
@@ -39,6 +39,7 @@
     private String weblog = null;
     private String enclosureUrl = null;
     private String[] selectedImages = null;
+    private String selectedImage = null;
     
 
     public EntryAddWithMediaFile() {
@@ -57,7 +58,15 @@
              WebloggerFactory.getWeblogger().getMediaFileManager();
         try {
 
+            if (StringUtils.isNotEmpty(selectedImage) && selectedImages == null)
{
+                selectedImages = new String[1];
+                selectedImages[0] = selectedImage;
+            }
+
+            StringBuilder sb = new StringBuilder();
+
             if (selectedImages != null) {
+
                 for (int i=0; i<selectedImages.length; i++) {
                     MediaFile mediaFile = manager.getMediaFile(selectedImages[i]);
                     String link = "";
@@ -70,18 +79,28 @@
                                    .replace("<width>", ""+mediaFile.getThumbnailWidth())
                                    .replace("<height>", ""+mediaFile.getThumbnailHeight());
                     } else {
-                        link = "<a href='<url>'><name></a>";
+                        link = "<a href='<url>'><name></a> (<size>
bytes, <type>)";
                         link = link.replace("<url>", getMediaFileURL(mediaFile))
-                                   .replace("<name>", mediaFile.getName());
+                                   .replace("<name>", mediaFile.getName())
+                                   .replace("<size>",""+mediaFile.getLength())
+                                   .replace("<type>",mediaFile.getContentType());
                     }
-                    bean.setText(link);
+                    sb.append(link);
                 }
             }
 
             if (StringUtils.isNotEmpty(enclosureUrl)) {
+                sb.append("<p>")
+                  .append(getText("mediaFileEdit.includesEnclosure"))
+                  .append("<br />")
+                  .append("<a href=''>")
+                  .append(enclosureUrl)
+                  .append("</a></p>");
                 bean.setEnclosureURL(enclosureUrl);
             }
 
+            bean.setText(sb.toString());
+
         } catch (Exception e) {
             log.error("Error while constructing media file link for new entry", e);
         }
@@ -138,4 +157,18 @@
         this.weblog = weblog;
     }
 
+    /**
+     * @return the selectedImage
+     */
+    public String getSelectedImage() {
+        return selectedImage;
+    }
+
+    /**
+     * @param selectedImage the selectedImage to set
+     */
+    public void setSelectedImage(String selectedImage) {
+        this.selectedImage = selectedImage;
+    }
+
 }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBean.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBean.java?rev=819364&r1=819363&r2=819364&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBean.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBean.java
Sun Sep 27 18:03:43 2009
@@ -29,13 +29,20 @@
  */
 public class MediaFileBean {
 
-    String id;
-    String name;
-    String description;
-    String copyrightText;
-    String tags;
-    String directoryId;
-    boolean isSharedForGallery;
+    private String  id;
+    private String  name;
+    private String  description;
+    private String  contentType;
+    private String  copyrightText;
+    private String  tags;
+    private String  directoryId;
+    private boolean isSharedForGallery;
+    private String  permalink;
+    private String  thumbnailURL;
+    private boolean isImage;
+    private int     width;
+    private int     height;
+    private long    length;
 
     public String getName() {
         return name;
@@ -134,5 +141,110 @@
 
         this.setSharedForGallery(dataHolder.isSharedForGallery());
         this.setDirectoryId(dataHolder.getDirectory().getId());
+        this.setPermalink(dataHolder.getPermalink());
+        this.setThumbnailURL(dataHolder.getThumbnailURL());
+        this.setIsImage(dataHolder.isImageFile());
+        this.setWidth(dataHolder.getWidth());
+        this.setHeight(dataHolder.getHeight());
+        this.setLength(dataHolder.getLength());
+        this.setContentType(dataHolder.getContentType());
+    }
+
+    /**
+     * @return the permalink
+     */
+    public String getPermalink() {
+        return permalink;
+    }
+
+    /**
+     * @param permalink the permalink to set
+     */
+    public void setPermalink(String permalink) {
+        this.permalink = permalink;
+    }
+
+    /**
+     * @return the isImage
+     */
+    public boolean isIsImage() {
+        return isImage;
+    }
+
+    /**
+     * @param isImage the isImage to set
+     */
+    public void setIsImage(boolean isImage) {
+        this.isImage = isImage;
+    }
+
+    /**
+     * @return the thumbnailURL
+     */
+    public String getThumbnailURL() {
+        return thumbnailURL;
+    }
+
+    /**
+     * @param thumbnailURL the thumbnailURL to set
+     */
+    public void setThumbnailURL(String thumbnailURL) {
+        this.thumbnailURL = thumbnailURL;
+    }
+
+    /**
+     * @return the width
+     */
+    public int getWidth() {
+        return width;
+    }
+
+    /**
+     * @param width the width to set
+     */
+    public void setWidth(int width) {
+        this.width = width;
+    }
+
+    /**
+     * @return the height
+     */
+    public int getHeight() {
+        return height;
+    }
+
+    /**
+     * @param height the height to set
+     */
+    public void setHeight(int height) {
+        this.height = height;
+    }
+
+    /**
+     * @return the length
+     */
+    public long getLength() {
+        return length;
+    }
+
+    /**
+     * @param length the length to set
+     */
+    public void setLength(long length) {
+        this.length = length;
+    }
+
+    /**
+     * @return the contentType
+     */
+    public String getContentType() {
+        return contentType;
+    }
+
+    /**
+     * @param contentType the contentType to set
+     */
+    public void setContentType(String contentType) {
+        this.contentType = contentType;
     }
 }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileEdit.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileEdit.java?rev=819364&r1=819363&r2=819364&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileEdit.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileEdit.java
Sun Sep 27 18:03:43 2009
@@ -38,6 +38,7 @@
     private MediaFileBean bean = new MediaFileBean();
     private MediaFileDirectory directory;
 
+
     public MediaFileEdit() {
         this.actionName = "mediaFileEdit";
         this.desiredMenu = "editor";
@@ -81,8 +82,10 @@
         try {
             MediaFile mediaFile = manager.getMediaFile(getMediaFileId());
             this.bean.copyFrom(mediaFile);
+
         } catch (FileIOException ex) {
             addError("uploadFiles.error.upload", bean.getName());
+
         } catch (Exception e) {
             log.error("Error saving new entry", e);
             // TODO: i18n
@@ -108,8 +111,10 @@
                 WebloggerFactory.getWeblogger().flush();
                 addMessage("mediaFile.update.success");
                 return SUCCESS;
+
             } catch (FileIOException ex) {
                 addError("uploadFiles.error.upload", bean.getName());
+
             } catch (Exception e) {
                 log.error("Error saving new entry", e);
                 // TODO: i18n

Modified: roller/trunk/apps/weblogger/web/WEB-INF/classes/ApplicationResources.properties
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/WEB-INF/classes/ApplicationResources.properties?rev=819364&r1=819363&r2=819364&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/web/WEB-INF/classes/ApplicationResources.properties (original)
+++ roller/trunk/apps/weblogger/web/WEB-INF/classes/ApplicationResources.properties Sun Sep
27 18:03:43 2009
@@ -988,8 +988,10 @@
 mediaFileAddSuccess.title=Media File Upload Complete
 mediaFileSuccess.subtitle=Create a new weblog entry?
 mediaFileSuccess.pageTip=Your upload was successful. If you would like to \
-create a new weblog entry with your new uploads then use the form \
-below to select the file(s) to be included.
+create a new weblog entry including your newly uploaded files then use the \
+form below to select the file(s) to be included. For images, we'll include \
+them in your post as thumbnails. For other file types you can choose one to \
+be attached to the new post as an enclosure (i.e. a podcast).
 mediaFileSuccess.uploaded=Uploaded Successfully
 mediaFileSuccess.createPost=Create a weblog post using your new upload
 mediaFileSuccess.addAnother=Add another media file
@@ -1009,19 +1011,45 @@
 mediaFileSuccess.pixels=pixels
 mediaFileSuccess.bytes=bytes
 
+mediaFileSuccess.noThanks=<b>Not interested?</b> Here are some other options:
+mediaFileSuccess.addAnother=Upload another media file
+mediaFileSuccess.mediaFileView=Return to Media File View
+
 
 # -- Media File Edit
 
 mediaFileEdit.title=Edit media file
+mediaFileEdit.subtitle=Editing media file <span>{0}</span>
+mediaFileEdit.pagetip=You may edit the informaton stored about this media \
+file. Each file must have a name, but all other fields are optional. \
+Or you can use the links at the bottom of the page to create a new weblog \
+entr that includes this file.
 mediaFileEdit.fileLocation=File Location
-mediaFileEdit.name=Title
+mediaFileEdit.name=Name
 mediaFileEdit.description=Description
-mediaFileEdit.tags=Tags (space separated)=
+mediaFileEdit.tags=Tags (space separated)
 mediaFileEdit.copyright=Copyright statement
 mediaFileEdit.directory=Place file under
-mediaFileEdit.includeGallery=Include in Gallery?
 mediaFileEdit.save=Save
 mediaFileEdit.cancel=Cancel
+mediaFileEdit.fileInfo=File info
+mediaFileEdit.fileTypeSize=<b>Type</b>: {0} <b>Size</b>: {1} bytes
+mediaFileEdit.fileDimensions=<b>Image</b>: {0} X {1} pixels
+mediaFileEdit.includeGallery=Include in Gallery?
+mediaFileEdit.includeGalleryHelp=Check this box if you would like this media \
+file included in the new media file RSS and Atom feeds for your weblog.
+
+mediaFileEdit.createWeblogPost=Create Weblog Post
+mediaFileEdit.createWeblogPostTip=Create a new weblog post with this file \
+included as an image.
+
+mediaFileEdit.createPodcastPost=Create Podcast Post
+mediaFileEdit.createPodcastPostTip=Create a new weblog post with this file \
+included as a podcast, an enclosure that is included in your RSS/Atom feeds \
+and automatically downloaded by feed readers and podcast clients (e.g. iTunes).
+
+mediaFileEdit.includesEnclosure=This weblog entry includes the following media file enclosure:
+
 
 # -- Media File View
 
@@ -1094,7 +1122,6 @@
 mediaFileSidebar.search=Search Uploaded Files
 
 
-mediaFile.edit.title=Edit media file
 mediaFile.search.title=Search media files
 mediaFile.delete.confirm=Delete selected media files?
 mediaFile.move.confirm=Move selected media files?

Modified: roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileAdd.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileAdd.jsp?rev=819364&r1=819363&r2=819364&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileAdd.jsp (original)
+++ roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileAdd.jsp Sun Sep 27 18:03:43
2009
@@ -16,7 +16,7 @@
   directory of this distribution.
 --%>
 <%@ include file="/WEB-INF/jsps/taglibs-struts2.jsp" %>
-<script type="text/javascript" src="<s:url value="/roller-ui/scripts/jquery-1.3.1.min.js"
/>"></script>
+<script type="text/javascript" src='<s:url value="/roller-ui/scripts/jquery-1.3.1.min.js"
/>'></script>
 
 
 <script type="text/javascript">
@@ -126,6 +126,7 @@
             </td>
             <td>
                 <s:checkbox name="bean.sharedForGallery" />
+                <s:text name="mediaFileEdit.includeGalleryHelp" />
             </td>
        </tr>
 

Modified: roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileAddSuccess.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileAddSuccess.jsp?rev=819364&r1=819363&r2=819364&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileAddSuccess.jsp (original)
+++ roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileAddSuccess.jsp Sun Sep 27
18:03:43 2009
@@ -101,7 +101,7 @@
                     <s:property value="%{#newImage.permalink}" /><br />
 
                     <span class="label"><s:text name="mediaFileSuccess.size" /></span>
-                    <s:property value="%{#newImage.length}" /> <s:text name="mediaFileSuccess.bytes"
/>, 
+                    <s:property value="%{#newImage.length}" /> <s:text name="mediaFileSuccess.bytes"
/>,
                     <s:property value="%{#newImage.width}" /> x
                     <s:property value="%{#newImage.height}" /> <s:text name="mediaFileSuccess.pixels"
/>
 
@@ -151,13 +151,26 @@
         <br/>
         <br/>
 
-        <%-- Link: Upload more files --%>
-        <s:url id="mediaFileAddURL" action="mediaFileAdd">
-            <s:param name="weblog" value="%{actionWeblog.handle}" />
-        </s:url>
-        <s:a href="%{mediaFileAddURL}">
-            <s:text name="mediaFileSuccess.addAnother" />
-        </s:a>
+        <s:text name="mediaFileSuccess.noThanks" />
+        <ul>
+            <li>
+                <s:url id="mediaFileAddURL" action="mediaFileAdd">
+                    <s:param name="weblog" value="%{actionWeblog.handle}" />
+                </s:url>
+                <s:a href="%{mediaFileAddURL}">
+                    <s:text name="mediaFileSuccess.addAnother" />
+                </s:a>
+            </li>
+
+            <li>
+                <s:url id="mediaFileViewURL" action="mediaFileView">
+                    <s:param name="weblog" value="%{actionWeblog.handle}" />
+                </s:url>
+                <s:a href="%{mediaFileViewURL}">
+                    <s:text name="mediaFileSuccess.mediaFileView" />
+                </s:a>
+            </li>
+        </ul>
 
     </div>
 

Modified: roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileEdit.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileEdit.jsp?rev=819364&r1=819363&r2=819364&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileEdit.jsp (original)
+++ roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileEdit.jsp Sun Sep 27 18:03:43
2009
@@ -16,14 +16,28 @@
   directory of this distribution.
 --%>
 <%@ include file="/WEB-INF/jsps/taglibs-struts2.jsp" %>
+<script type="text/javascript" src='<s:url value="/roller-ui/scripts/jquery-1.3.1.min.js"
/>'></script>
+
+<s:if test="bean.isImage">
+    <img align="right" alt="thumbnail"
+         src='<s:property value="bean.thumbnailURL" />' />
+</s:if>
 
 <p class="subtitle">
-    <s:text name="mediaFile.edit.title"  />
+    <s:text name="mediaFileEdit.subtitle">
+        <s:param value="bean.name" />
+    </s:text>
+</p>
+
+<p class="pagetip">
+    <s:text name="mediaFileEdit.pagetip"  />
 </p>
 
 <s:form id="entry" action="mediaFileEdit!save" method="POST">
     <s:hidden name="weblog" />
-    <s:hidden name="mediaFileId" />
+    <s:hidden name="mediaFileId" id="mediaFileId" />
+    <s:hidden name="bean.permalink" />
+
 
     <%-- ================================================================== --%>
     <%-- Title, category, dates and other metadata --%>
@@ -35,25 +49,34 @@
                 <label for="status"><s:text name="mediaFileEdit.name" /></label>
             </td>
             <td>
-                <s:textfield name="bean.name" size="50" maxlength="255" tabindex="1" />
+                <s:textfield name="bean.name" size="30" maxlength="100" tabindex="1" />
             </td>
        </tr>
 
-        <tr>
+       <tr>
             <td class="entryEditFormLabel">
-                <label for="status"><s:text name="mediaFileEdit.description" /></label>
+                <label for="fileInfo"><s:text name="mediaFileEdit.fileInfo" /></label>
             </td>
             <td>
-                <s:textarea name="bean.description" cols="50" rows="5" tabindex="3"/>
+                <s:text name="mediaFileEdit.fileTypeSize">
+                    <s:param value="bean.contentType" />
+                    <s:param value="bean.length" />
+                </s:text>
+                <s:if test="bean.isImage">
+                    <s:text name="mediaFileEdit.fileDimensions">
+                        <s:param value="bean.width" />
+                        <s:param value="bean.height" />
+                    </s:text>
+                </s:if>
             </td>
        </tr>
 
        <tr>
             <td class="entryEditFormLabel">
-                <label for="copyright"><s:text name="mediaFileEdit.copyright" /></label>
+                <label for="status"><s:text name="mediaFileEdit.description" /></label>
             </td>
             <td>
-                <s:textarea name="bean.copyrightText" cols="50" rows="3" tabindex="4"/>
+                <s:textarea name="bean.description" cols="50" rows="2" tabindex="2"/>
             </td>
        </tr>
 
@@ -62,7 +85,16 @@
                 <label for="tags"><s:text name="mediaFileEdit.tags" /></label>
             </td>
             <td>
-                <s:textfield name="bean.tags" size="50" maxlength="255" tabindex="5" />
+                <s:textfield name="bean.tags" size="30" maxlength="100" tabindex="3" />
+            </td>
+       </tr>
+
+       <tr>
+            <td class="entryEditFormLabel">
+                <label for="copyright"><s:text name="mediaFileEdit.copyright" /></label>
+            </td>
+            <td>
+                <s:textfield name="bean.copyrightText" size="30" maxlength="100" tabindex="4"/>
             </td>
        </tr>
 
@@ -71,7 +103,8 @@
                 <label for="directoryId"><s:text name="mediaFileEdit.directory"
/></label>
             </td>
             <td>
-                <s:select name="bean.directoryId" list="allDirectories" listKey="id" listValue="path"
/>
+                <s:select name="bean.directoryId" list="allDirectories"
+                    listKey="id" listValue="path" tabindex="5" />
             </td>
        </tr>
 
@@ -80,16 +113,37 @@
                 <label for="status"><s:text name="mediaFileEdit.includeGallery"
/></label>
             </td>
             <td>
-                <s:checkbox name="bean.sharedForGallery" />
+                <s:checkbox name="bean.sharedForGallery" tabindex="6" />
+                <s:text name="mediaFileEdit.includeGalleryHelp" />
             </td>
        </tr>
 
     </table>
 
-    <br>
     <div class="control">
-       <input type="submit" value="<s:text name="mediaFileEdit.save" />" name="submit"
/>
-       <input type="button" value="<s:text name="mediaFileEdit.cancel" />" onClick="javascript:window.parent.onClose();"
/>
+       <input type="submit" tabindex="7"
+              value="<s:text name="mediaFileEdit.save" />" name="submit" />
+       <input type="button" tabindex="8"
+              value="<s:text name="mediaFileEdit.cancel" />" onClick="javascript:window.parent.onClose();"
/>
     </div>
 
 </s:form>
+
+
+<%-- Create Weblog Entry and Create Podcast Entry links --%>
+<br />
+
+<p>
+<a href='#' onclick='javascript:window.parent.onCreateWeblogPost($("#mediaFileId").get(0).value)'>
+    <s:text name="mediaFileEdit.createWeblogPost" />
+</a><br />
+<s:text name="mediaFileEdit.createWeblogPostTip" />
+</p>
+
+<p>
+<a href='#' onclick='javascript:window.parent.onCreatePodcastPost($("#entry_bean_permalink").get(0).value)'>
+    <s:text name="mediaFileEdit.createPodcastPost" />
+</a><br />
+<s:text name="mediaFileEdit.createWeblogPostTip" /><br />
+</p>
+

Modified: roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileView.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileView.jsp?rev=819364&r1=819363&r2=819364&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileView.jsp (original)
+++ roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileView.jsp Sun Sep 27 18:03:43
2009
@@ -27,7 +27,7 @@
 <script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/dragdrop/dragdrop-min.js"></script>
 <script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/container/container-min.js"></script>
 
-<script type="text/javascript" src="<s:url value="/roller-ui/scripts/jquery-1.3.1.min.js"
/>"></script>
+<script type="text/javascript" src='<s:url value="/roller-ui/scripts/jquery-1.3.1.min.js"
/>'></script>
 
 
 <style>
@@ -51,104 +51,6 @@
 
 
 <script type="text/javascript">
-    YAHOO.util.Event.onContentReady("myMenu", function () {
-        var oClones = this;
-
-        function findMediaFileIdForLineItem(lineItemNode) {
-            var findMediaFileIdNode = function(node) {
-                return (node.id == 'mediafileidentity');
-            }
-            var temp_elements = YAHOO.util.Dom.getElementsBy(findMediaFileIdNode,"input",lineItemNode);
-            return temp_elements[0].value;
-        }
-
-        function deleteMedia(p_oLI) {
-            var lineItemNode = YAHOO.util.Dom.getAncestorByTagName(p_oLI, "LI");
-            var hidden_mediaFileId_value = findMediaFileIdForLineItem(lineItemNode);
-            document.mediaFileViewForm.mediaFileId.value=hidden_mediaFileId_value;
-            document.mediaFileViewForm.action='<s:url action="mediaFileView!delete" />';
-            document.mediaFileViewForm.submit();
-        }
-
-        function createPost(p_oLI) {
-            var lineItemNode = YAHOO.util.Dom.getAncestorByTagName(p_oLI, "LI");
-            var hidden_mediaFileId_value = findMediaFileIdForLineItem(lineItemNode);
-            document.mediaFileViewForm.mediaFileId.value = hidden_mediaFileId_value;
-            document.mediaFileViewForm.action = '<s:url action="entryAddWithMediaFile"></s:url>';
-            document.mediaFileViewForm.submit();
-        }
-
-        function includeMedia(p_oLI) {
-            var lineItemNode = YAHOO.util.Dom.getAncestorByTagName(p_oLI, "LI");
-            var hidden_mediaFileId_value = findMediaFileIdForLineItem(lineItemNode);
-            document.mediaFileViewForm.mediaFileId.value = hidden_mediaFileId_value;
-            document.mediaFileViewForm.action = '<s:url action="mediaFileView!includeInGallery"
/>';
-            document.mediaFileViewForm.submit();
-        }
-
-        function onEweContextMenuClick(p_sType, p_aArgs) {
-
-            var oItem = p_aArgs[1], // The MenuItem that was clicked
-            oTarget = this.contextEventTarget,
-            oLI;
-
-            if (oItem) {
-
-                oLI = oTarget.className == "contextMenu" ?
-                    oTarget : YAHOO.util.Dom.getAncestorByClassName(oTarget, "contextMenu");
-
-                switch (oItem.index) {
-
-                    case 0:     // delete
-                        deleteMedia(oLI);
-                        break;
-                    case 1:     // create post
-                        createPost(oLI);
-                        break;
-                    case 2:     // include in gallery
-                        includeMedia(oLI);
-                        break;
-                }
-            }
-        }
-
-        /*
-         Array of text labels for the MenuItem instances to be
-         added to the ContextMenu instanc.
-         */
-        var aMenuItems = [
-            '<s:text name="mediaFileView.delete" />',
-            '<s:text name="mediaFileView.createPost" />',
-            '<s:text name="mediaFileView.includeInGallery" />' ];
-
-        /*
-         Instantiate a ContextMenu:  The first argument passed to the constructor
-         is the id for the Menu element to be created, the second is an
-         object literal of configuration properties.
-         */
-        var oEweContextMenu = new YAHOO.widget.ContextMenu("ewecontextmenu", {
-            trigger: oClones.getElementsByClassName("contextMenu"),
-            itemdata: aMenuItems,
-            lazyload: true
-        });
-
-        oEweContextMenu.trigger = oClones.getElementsByClassName("contextMenu");
-
-        // "render" event handler for the ewe context menu
-        function onContextMenuRender(p_sType, p_aArgs) {
-            //  Add a "click" event handler to the ewe context menu
-            this.subscribe("click", onEweContextMenuClick);
-        }
-
-        // Add a "render" event handler to the ewe context menu
-        oEweContextMenu.subscribe("render", onContextMenuRender);
-    });
-
-</script>
-
-
-<script type="text/javascript">
-    <!--
 
     function onSelectDirectory(id) {
         window.location = "?directoryId=" + id + "&weblog=" + '<s:property value="actionWeblog.handle"
/>';
@@ -172,7 +74,7 @@
             document.mediaFileViewForm.submit();
         }
     }
--->
+
 </script>
 
 
@@ -272,7 +174,7 @@
 
 <s:if test="childFiles || childDirectories || (pager && pager.items.size() >
0)">
 
-<s:form id="mediaFileViewForm" name="mediaFileViewForm" action="mediaFileView">
+  <s:form id="mediaFileViewForm" name="mediaFileViewForm" action="mediaFileView">
 
     <%--
     <s:url id="mediaFileHierarchicalViewURL" action="mediaFileHierarchicalView">
@@ -314,14 +216,14 @@
 
             <s:if test="!pager">
 
+                <%-- ----------------------------------------------------- --%>
+
                 <%-- NOT SEARCH RESULTS --%>
 
                 <s:if test="childDirectories.size() == 0 && childFiles.size()
==0">
                     <p style="text-align: center"><s:text name="mediaFileView.noFiles"/></p>
                 </s:if>
 
-                <%-- --------------------------------------------------------- --%>
-
                 <%-- List media directories first --%>
 
                 <s:iterator id="directory" value="childDirectories">
@@ -338,8 +240,6 @@
                     </li>
                 </s:iterator>
 
-                <%-- --------------------------------------------------------- --%>
-
                 <%-- List media files next --%>
 
                 <s:iterator id="mediaFile" value="childFiles">
@@ -368,12 +268,8 @@
 
                         <div class="mediaObjectInfo">
 
-                            <label>
-                                <a class="contextMenu" href="#">
-                                    <img  border="0"
-                                        src='<s:url value="/images/control_play.png"/>'
alt="[v]" />
-                                </a>
-                                <str:truncateNicely upper="50">
+                            <label class="mediaFile">
+                                <str:truncateNicely lower="40" upper="50">
                                     <s:property value="#mediaFile.name" />
                                 </str:truncateNicely>
                                 <input type="checkbox" style="float:right"
@@ -383,18 +279,18 @@
                                        value="<s:property value='#mediaFile.id'/>">
                             </label>
 
-
                         </div>
 
                     </li>
 
                 </s:iterator>
 
-
             </s:if>
 
             <s:else>
 
+                <%-- ----------------------------------------------------- --%>
+
                 <%-- SEARCH RESULTS --%>
 
                 <s:iterator id="mediaFile" value="pager.items">
@@ -424,11 +320,7 @@
                         <div class="mediaObjectInfo">
 
                             <label>
-                                <a class="contextMenu" href="#">
-                                    <img  border="0"
-                                        src='<s:url value="/images/control_play.png"/>'
alt="[v]" />
-                                </a>
-                                <str:truncateNicely upper="50">
+                                <str:truncateNicely lower="40" upper="50">
                                     <s:property value="#mediaFile.name" />
                                 </str:truncateNicely>
                                 <input type="checkbox" style="float:right"
@@ -450,14 +342,8 @@
         </ul>
     </div>
 
-
-    <%-- ***************************************************************** --%>
-
     <div style="clear:left;"></div>
 
-    <div id="overlay_img" style="visibility:hidden">
-    </div>
-
 
     <%-- ***************************************************************** --%>
 
@@ -474,13 +360,14 @@
         </span>
     </div>
 
-</s:form>
+  </s:form>
 
+  <s:if test="!pager">
     <br/>
     <br/>
     <br/>
 
-    <%-- Create new direcrtory --%>
+    <%-- Only show Create New Directory control when NOT showing search results --%>
 
     <div>
         <s:text name="mediaFileView.newDirName" />
@@ -488,13 +375,42 @@
                name="newDirectoryName" size="30" />
         <input type="button" value='<s:text name="mediaFileView.create" />' onclick="onCreateDirectory()"
/>
     </div>
+  </s:if>
 
 </s:if>
 
 
+<%-- ***************************************************************** --%>
+
+<%-- code to create new weblog post when Media File Edit lightbox requests it --%>
 
 <script type="text/javascript">
-<!--
+
+    function onCreateWeblogPost(mediaFileId) {
+        $("#selectedImage").get(0).value = mediaFileId;
+        $("#createPostForm").get(0).submit();
+    }
+
+    function onCreatePodcastPost(enclosureURL) {
+        $("#enclosureUrl").get(0).value = enclosureURL;
+        $("#createPostForm").get(0).submit();
+    }
+
+</script>
+
+<s:form id="createPostForm" action='entryAddWithMediaFile'>
+    <input type="hidden" name="weblog" value='<s:property value="actionWeblog.handle"
/>' />
+    <input type="hidden" name="selectedImage" id="selectedImage" />
+    <input type="hidden" name="enclosureUrl" id="enclosureUrl" />
+</s:form>
+
+
+<%-- ***************************************************************** --%>
+
+<%-- code to launch Media File Edit lightbox when user clicks a media file --%>
+
+<script type="text/javascript">
+
     function onClickEdit(mediaFileId) {
         <s:url id="mediaFileEditURL" action="mediaFileEdit">
             <s:param name="weblog" value="%{actionWeblog.handle}" />
@@ -524,7 +440,7 @@
         YAHOO.mediaFileEditor.lightbox.render(document.body);
     }
     YAHOO.util.Event.addListener(window, "load", init);
--->
+
 </script>
 
 <div id="mediafile_edit_lightbox" style="visibility:hidden">

Modified: roller/trunk/apps/weblogger/web/WEB-INF/jsps/taglibs-struts2.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/WEB-INF/jsps/taglibs-struts2.jsp?rev=819364&r1=819363&r2=819364&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/web/WEB-INF/jsps/taglibs-struts2.jsp (original)
+++ roller/trunk/apps/weblogger/web/WEB-INF/jsps/taglibs-struts2.jsp Sun Sep 27 18:03:43 2009
@@ -22,5 +22,6 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt" %>
 <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
 <%@ taglib uri="/struts-tags" prefix="s" %>
-<%@ taglib uri="http://jakarta.apache.org/taglibs/string-1.0.1" prefix="str" %>
+<%@ taglib uri="http://jakarta.apache.org/taglibs/string-1.1" prefix="str" %>
+
 

Modified: roller/trunk/apps/weblogger/web/WEB-INF/tiles.xml
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/WEB-INF/tiles.xml?rev=819364&r1=819363&r2=819364&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/web/WEB-INF/tiles.xml (original)
+++ roller/trunk/apps/weblogger/web/WEB-INF/tiles.xml Sun Sep 27 18:03:43 2009
@@ -287,7 +287,7 @@
         <put-attribute name="head" value="/WEB-INF/jsps/tiles/head-ajax.jsp" />
         <put-attribute name="content" value="/WEB-INF/jsps/editor/MediaFileAddSuccess.jsp"
/>
         <put-attribute name="sidebar" value="/WEB-INF/jsps/tiles/empty.jsp" />
-        <put-attribute name="styles" value="/WEB-INF/jsps/tiles/css-sidebar.jsp" />
+        <put-attribute name="styles" value="/WEB-INF/jsps/tiles/css-nosidebar.jsp" />
     </definition>
 
     <definition name=".TabularView" extends=".tiles-tabbedpage" >



Mime
View raw message