You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by sn...@apache.org on 2010/07/08 04:17:32 UTC

svn commit: r961557 - in /roller/trunk/weblogger-web/src/main: resources/ApplicationResources.properties webapp/WEB-INF/jsps/editor/MediaFileEdit.jsp webapp/WEB-INF/jsps/editor/MediaFileView.jsp

Author: snoopdave
Date: Thu Jul  8 02:17:32 2010
New Revision: 961557

URL: http://svn.apache.org/viewvc?rev=961557&view=rev
Log:
Fix for ROL-1872: Media File pages do not make URLs available
https://issues.apache.org/jira/browse/ROL-1872

Added to Media File Edit page these ways to copy the link to the Media File:
1) Image of a chain-link, which provides direct link to file and opens it in a new browser window
2) Read-only text field, which user can select and copy
3) Commented out code for using ZeroClipboard to provide a copy-to-clipboard feature. It is commented out because we cannot ship Zero Clipboard with Roller, because it has an LGPL license and ASF policy does not allow LGPL dependencies.

Modified:
    roller/trunk/weblogger-web/src/main/resources/ApplicationResources.properties
    roller/trunk/weblogger-web/src/main/webapp/WEB-INF/jsps/editor/MediaFileEdit.jsp
    roller/trunk/weblogger-web/src/main/webapp/WEB-INF/jsps/editor/MediaFileView.jsp

Modified: roller/trunk/weblogger-web/src/main/resources/ApplicationResources.properties
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-web/src/main/resources/ApplicationResources.properties?rev=961557&r1=961556&r2=961557&view=diff
==============================================================================
--- roller/trunk/weblogger-web/src/main/resources/ApplicationResources.properties (original)
+++ roller/trunk/weblogger-web/src/main/resources/ApplicationResources.properties Thu Jul  8 02:17:32 2010
@@ -1051,6 +1051,9 @@ mediaFileEdit.updateFileContents=Update 
 mediaFileEdit.clickToView=Click to view in new window
 mediaFile.createWeblogPost=Post in weblog
 mediaFile.createPodcastPost=Post in weblog as podcast
+mediaFileEdit.permalink=Link (URL)
+mediaFileEdit.linkTitle=Link to Media File, opens in new window
+mediaFileEdit.copyToClipboard=Copy Link (URL) to Clipboard
 
 mediaFileEdit.includesEnclosure=This weblog entry includes the following media file enclosure:
 

Modified: roller/trunk/weblogger-web/src/main/webapp/WEB-INF/jsps/editor/MediaFileEdit.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-web/src/main/webapp/WEB-INF/jsps/editor/MediaFileEdit.jsp?rev=961557&r1=961556&r2=961557&view=diff
==============================================================================
--- roller/trunk/weblogger-web/src/main/webapp/WEB-INF/jsps/editor/MediaFileEdit.jsp (original)
+++ roller/trunk/weblogger-web/src/main/webapp/WEB-INF/jsps/editor/MediaFileEdit.jsp Thu Jul  8 02:17:32 2010
@@ -18,6 +18,42 @@
 <%@ include file="/WEB-INF/jsps/taglibs-struts2.jsp" %>
 <script type="text/javascript" src='<s:url value="/roller-ui/scripts/jquery-1.4.2.min.js" />'></script>
 
+<script type="text/javascript" src='<s:url value="/custom-ui/ZeroClipboard.js" />'></script>
+
+<%-- 
+<!-- Can't distribute ZeroClipboard with Roller, LGPL violates ASF policy -->
+<!-- (1/2) For ZeroClipboard you would add this: -->
+<style type="text/css">
+#d_clip_button {
+    text-align:center;
+    border:1px solid black;
+    background-color:#ccc;
+    margin:5px; padding:5px;
+}
+#d_clip_button.hover { background-color:#eee; }
+#d_clip_button.active { background-color:#aaa; }
+</style>
+
+<script type="text/javascript">
+$("#d_clip_button").ready(function() {
+    // assuming ZeroClipboard is at context/custom-ui path
+    ZeroClipboard.setMoviePath( '<s:url value="/custom-ui/ZeroClipboard.swf" />' );
+    var clip = new ZeroClipboard.Client();
+    clip.setText(''); // will be set later on mouseDownv
+    clip.setHandCursor( true );
+    clip.setCSSEffects( true );
+    clip.addEventListener( 'mouseDown', function(client) {
+        // set text to copy here
+        clip.setText( document.getElementById('clip_text').value );
+        } );
+    clip.addEventListener( 'complete', function(client, text) {
+        alert("Copied link to the Clipboard.");
+    } );
+    clip.glue( 'd_clip_button' );
+});
+</script>
+--%>
+
 <s:if test="bean.isImage">
     <div class="mediaFileThumbnail">
         <a href='<s:property value="bean.permalink" />' target="_blank">
@@ -53,7 +89,7 @@
                 <label for="status"><s:text name="mediaFileEdit.name" /></label>
             </td>
             <td>
-                <s:textfield name="bean.name" size="30" maxlength="100" tabindex="1" />
+                <s:textfield name="bean.name" size="40" maxlength="100" tabindex="1" />
             </td>
        </tr>
 
@@ -77,6 +113,26 @@
 
        <tr>
             <td class="entryEditFormLabel">
+                <label for="status"><s:text name="mediaFileEdit.permalink" /></label>
+            </td>
+            <td>
+                <a href='<s:text name="bean.permalink" />' target="_blank"
+                   title='<s:text name="mediaFileEdit.linkTitle" />'>
+                   <s:url id="linkIconURL" value="/images/link.png"></s:url>
+                   <img border="0" src='<s:property value="%{linkIconURL}" />'
+                       style="padding:2px 2px;" alt="link" />
+                </a>
+                <input type="text" id="clip_text" size="50" value='<s:text name="bean.permalink" />' readonly />
+
+                <%-- 
+                <!-- (2/2) For ZeroClipboard you would add this: -->
+                <div id="d_clip_button"><s:text name="mediaFileEdit.copyToClipboard" /></div>
+                --%>
+            </td>
+       </tr>
+
+       <tr>
+            <td class="entryEditFormLabel">
                 <label for="status"><s:text name="mediaFileEdit.description" /></label>
             </td>
             <td>

Modified: roller/trunk/weblogger-web/src/main/webapp/WEB-INF/jsps/editor/MediaFileView.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-web/src/main/webapp/WEB-INF/jsps/editor/MediaFileView.jsp?rev=961557&r1=961556&r2=961557&view=diff
==============================================================================
--- roller/trunk/weblogger-web/src/main/webapp/WEB-INF/jsps/editor/MediaFileView.jsp (original)
+++ roller/trunk/weblogger-web/src/main/webapp/WEB-INF/jsps/editor/MediaFileView.jsp Thu Jul  8 02:17:32 2010
@@ -145,7 +145,7 @@
             "mediafile_edit_lightbox", {
                 modal:    true,
                 width:   "600px",
-                height:  "600px",
+                height:  "700px",
                 visible: false,
                 fixedcenter: true,
                 constraintoviewport: true