lenya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ed...@apache.org
Subject svn commit: r177947 - in /lenya/branches/BRANCH_1_2_X/src/webapp/lenya: resources/i18n/cmsui.xml resources/i18n/cmsui_de.xml xslt/bxeng/asset.xsl xslt/bxeng/image.xsl
Date Mon, 23 May 2005 09:33:30 GMT
Author: edith
Date: Mon May 23 02:33:30 2005
New Revision: 177947

URL: http://svn.apache.org/viewcvs?rev=177947&view=rev
Log:
Thanks to Simon Litwan: testing for selected file in insertImage/insertAsset popup; bug#34982

Modified:
    lenya/branches/BRANCH_1_2_X/src/webapp/lenya/resources/i18n/cmsui.xml
    lenya/branches/BRANCH_1_2_X/src/webapp/lenya/resources/i18n/cmsui_de.xml
    lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/bxeng/asset.xsl
    lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/bxeng/image.xsl

Modified: lenya/branches/BRANCH_1_2_X/src/webapp/lenya/resources/i18n/cmsui.xml
URL: http://svn.apache.org/viewcvs/lenya/branches/BRANCH_1_2_X/src/webapp/lenya/resources/i18n/cmsui.xml?rev=177947&r1=177946&r2=177947&view=diff
==============================================================================
--- lenya/branches/BRANCH_1_2_X/src/webapp/lenya/resources/i18n/cmsui.xml (original)
+++ lenya/branches/BRANCH_1_2_X/src/webapp/lenya/resources/i18n/cmsui.xml Mon May 23 02:33:30
2005
@@ -325,13 +325,15 @@
   <message key="Asset Library">Asset Library</message>
   <message key="No assets available">No assets available</message>
   <message key="Insert Asset">Insert Asset</message>
-
+  <message key="lenya.assetuploa.no.asset.selected">No asset selected. Please select
one.</message>
+  
   <!-- Image Upload/Insert Dialog -->
   <message key="lenya.imageupload.title">Insert Image</message>
   <message key="lenya.imageupload.selectimage.label">Select Image</message>
   <message key="lenya.imageupload.info.noimages">No images available.</message>
   <message key="lenya.imageupload.links.hint">External links have to start with 'http://',
internal links have to start with '/'</message>
-
+  <message key="lenya.imageupload.no.image.selected">No image selected. Please select
one.</message>
+  
   <!-- Revision Controller -->
   <message key="Reason">Reason</message>
   <message key="Filename">File name</message>

Modified: lenya/branches/BRANCH_1_2_X/src/webapp/lenya/resources/i18n/cmsui_de.xml
URL: http://svn.apache.org/viewcvs/lenya/branches/BRANCH_1_2_X/src/webapp/lenya/resources/i18n/cmsui_de.xml?rev=177947&r1=177946&r2=177947&view=diff
==============================================================================
--- lenya/branches/BRANCH_1_2_X/src/webapp/lenya/resources/i18n/cmsui_de.xml (original)
+++ lenya/branches/BRANCH_1_2_X/src/webapp/lenya/resources/i18n/cmsui_de.xml Mon May 23 02:33:30
2005
@@ -319,12 +319,13 @@
   <message key="Asset Library">Objektbibliothek</message>
   <message key="No assets available">Keine Objekte verfügbar</message>
   <message key="lenya.assetupload.title">Objekt einfügen</message>
+  <message key="lenya.assetuploa.no.asset.selected">Es wurde kein Asset ausgewählt.
Bitte wählen Sie eines aus.</message>
 
   <!-- Image Upload/Insert Dialog -->
   <message key="lenya.imageupload.title">Bild einfügen</message>
   <message key="lenya.imageupload.selectimage.label">Bild auswählen</message>
   <message key="lenya.imageupload.info.noimages">Keine Bilder verfügbar.</message>
   <message key="lenya.imageupload.links.hint">Externe Verweise müssen mit 'http://'
und interne Verweise mit '/' beginnen.</message>  
-
+  <message key="lenya.imageupload.no.image.selected">Es wurde kein Bild ausgewählt.
Bitte wählen Sie eines aus.</message>
 </catalogue>
 

Modified: lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/bxeng/asset.xsl
URL: http://svn.apache.org/viewcvs/lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/bxeng/asset.xsl?rev=177947&r1=177946&r2=177947&view=diff
==============================================================================
--- lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/bxeng/asset.xsl (original)
+++ lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/bxeng/asset.xsl Mon May 23 02:33:30
2005
@@ -46,10 +46,17 @@
 	  title = title.replace(/&amp;/g, "&");          
 	  title = title.replace(/&/g, "&amp;");
 	  title = title.replace(/&lt;/g, "<");          
-	  title = title.replace(/</g, "&lt;");       
-      window.opener.bxe_insertContent('<asset xmlns="http://apache.org/cocoon/lenya/page-envelope/1.0"
src="'+src+'" size="'+size+'" type="">'+title+'</asset>',window.opener.BXE_SELECTION,window.opener.BXE_SPLIT_IF_INLINE);
-      ]]>
-      window.close();
+	  title = title.replace(/</g, "&lt;"); 
+	  ]]>    
+	  if(src)
+	  {  
+        window.opener.bxe_insertContent('<asset xmlns="http://apache.org/cocoon/lenya/page-envelope/1.0"
src="'+src+'" size="'+size+'" type="">'+title+'</asset>',window.opener.BXE_SELECTION,window.opener.BXE_SPLIT_IF_INLINE);
+        window.close();
+      }
+      else
+      {
+        alert('<i18n:text key="lenya.assetuploa.no.asset.selected"/>')
+      }  
     }
     
   </script>
@@ -57,7 +64,7 @@
 
 
 <xsl:template name="library-buttons">
-  <input i18n:attr="value" type="submit"
+  <input i18n:attr="value" type="button"
          onClick="insertAsset(document.getElementById('assetSource').value,
                               document.getElementById('assetExtent').value,
                               document.getElementById('assetTitle').value);" value="Submit"/>&#160;

Modified: lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/bxeng/image.xsl
URL: http://svn.apache.org/viewcvs/lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/bxeng/image.xsl?rev=177947&r1=177946&r2=177947&view=diff
==============================================================================
--- lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/bxeng/image.xsl (original)
+++ lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/bxeng/image.xsl Mon May 23 02:33:30
2005
@@ -85,8 +85,17 @@
                                                                                         
  
                       var content = '<object xmlns="'+window.opener.XHTMLNS+'" href="'+link+'"
title="'+title+'" type="'+type+'" data="'+nodeid + src+'">'+caption+'</object>';

                       ]]>
-                      window.opener.bxe_insertContent(content,window.opener.bxe_ContextNode);

-                      window.close();
+                      if(src)
+                      {
+                        window.opener.bxe_insertContent(content,window.opener.bxe_ContextNode);

+                        window.close();
+                      }
+                      else
+                      {
+                        alert('<i18n:text key="lenya.imageupload.no.image.selected"/>')
+                      }
+                      
+                      
                    }
 
                    function insertCaption() { 
@@ -169,7 +178,7 @@
                 </div>
 				 <div class="lenya-box">
 				    <div class="lenya-box-title"><i18n:text>Asset Library</i18n:text></div>
-				      <form id="image">
+				      <form id="image" action="" method="post">
 				        <table class="lenya-table-noborder">
 				        <xsl:choose>
 				        <xsl:when test="not(lenya-info:asset)">
@@ -209,7 +218,7 @@
 				          <tr>
 				            <td/>
 				            <td colspan="4">
-								 <input i18n:attr="value" type="submit"
+								 <input i18n:attr="value" type="button"
 				      		   onClick="javascript:insertImage(document.getElementById('imageSource').value,
escape(document.getElementById('imageFormat').value));" value="Submit"/>&#160;
 				 			 <input i18n:attr="value" type="button" onClick="location.href='javascript:window.close();';"
value="Cancel"/>
 				            </td>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org


Mime
View raw message