[Jaws-commits] r13208 - in trunk/jaws/html/gadgets/Contact: . images languages resources templates

afz at jaws-project.com afz at jaws-project.com
Thu Aug 2 17:11:37 UTC 2012


Author: afz
Date: 2012-08-02 17:11:37 +0000 (Thu, 02 Aug 2012)
New Revision: 13208

Modified:
   trunk/jaws/html/gadgets/Contact/AdminHTML.php
   trunk/jaws/html/gadgets/Contact/images/attachment.png
   trunk/jaws/html/gadgets/Contact/languages/en.php
   trunk/jaws/html/gadgets/Contact/resources/script.js
   trunk/jaws/html/gadgets/Contact/resources/style.css
   trunk/jaws/html/gadgets/Contact/templates/AdminMailer.html
Log:
[Contact]: Mailer attachment...

Modified: trunk/jaws/html/gadgets/Contact/AdminHTML.php
===================================================================
--- trunk/jaws/html/gadgets/Contact/AdminHTML.php	2012-08-02 17:11:18 UTC (rev 13207)
+++ trunk/jaws/html/gadgets/Contact/AdminHTML.php	2012-08-02 17:11:37 UTC (rev 13208)
@@ -787,15 +787,15 @@
         $entry->SetSize(1);
         $entry->AddEvent(ON_CHANGE, 'uploadFile();');
         $tpl->SetVariable('attachment', $entry->Get());
-        $label =& Piwi::CreateWidget('Label', _t('CONTACT_MAILER_ATTACHMENT'), $entry);
-        $tpl->SetVariable('lbl_attachment', $label->Get());
 
-        $button =& Piwi::CreateWidget('Button', 'btn_upload', '', 'gadgets/Contact/images/attachment.png');
+        $button =& Piwi::CreateWidget('Button', 'btn_upload', _t('CONTACT_MAILER_ADD_ATTACHMENT'));
         $tpl->SetVariable('btn_upload', $button->Get());
 
-        // $button =& Piwi::CreateWidget('Button', 'btn_remove', '', STOCK_DELETE);
-        // $button->AddEvent(ON_CLICK, 'removeAttachment()');
-        // $tpl->SetVariable('btn_remove', $button->Get());
+        $link =& Piwi::CreateWidget('Link',
+                                    _t('CONTACT_MAILER_REMOVE_ATTACHMENT'),
+                                    'javascript:removeAttachment();',
+                                    'images/stock/cancel.png');
+        $tpl->SetVariable('remove', $link->get());
 
         // Message
         $editor =& $GLOBALS['app']->LoadEditor('Contact', 'message');

Modified: trunk/jaws/html/gadgets/Contact/images/attachment.png
===================================================================
(Binary files differ)

Modified: trunk/jaws/html/gadgets/Contact/languages/en.php
===================================================================
--- trunk/jaws/html/gadgets/Contact/languages/en.php	2012-08-02 17:11:18 UTC (rev 13207)
+++ trunk/jaws/html/gadgets/Contact/languages/en.php	2012-08-02 17:11:37 UTC (rev 13208)
@@ -99,7 +99,7 @@
 define('_EN_CONTACT_MAILER_FROM', "From");
 define('_EN_CONTACT_MAILER_SUBJECT', "Subject");
 define('_EN_CONTACT_MAILER_MESSAGE', "Message");
-define('_EN_CONTACT_MAILER_ATTACHMENT', "Attachment");
+define('_EN_CONTACT_MAILER_ADD_ATTACHMENT', "Add attachment");
 define('_EN_CONTACT_MAILER_REMOVE_ATTACHMENT', "Remove");
 define('_EN_CONTACT_MAILER_BUTTON_NEW', "New");
 define('_EN_CONTACT_MAILER_BUTTON_PREVIEW', "Preview");

Modified: trunk/jaws/html/gadgets/Contact/resources/script.js
===================================================================
--- trunk/jaws/html/gadgets/Contact/resources/script.js	2012-08-02 17:11:18 UTC (rev 13207)
+++ trunk/jaws/html/gadgets/Contact/resources/script.js	2012-08-02 17:11:37 UTC (rev 13208)
@@ -420,9 +420,7 @@
     $('attachment').show();
     $('btn_upload').show();
     $('attach_loading').hide();
-    $('btn_remove').hide();
-    $('file_link').hide();
-    $('file_size').hide();
+    $('attach_actions').hide();
     toggleDisableForm(false);
 }
 
@@ -474,9 +472,7 @@
         $('filename').value = response.filename;
         $('file_link').update(response.filename);
         $('file_size').update('(' + response.filesize + ')');
-        $('file_link').show();
-        $('file_size').show();
-        $('btn_remove').show();
+        $('attach_actions').show();
         $('attachment').hide();
     }
     $('attach_loading').hide();
@@ -489,9 +485,7 @@
 function removeAttachment() {
     $('filename').value = '';
     $('frm_file').reset();
-    $('btn_remove').hide();
-    $('file_link').hide();
-    $('file_size').hide();
+    $('attach_actions').hide();
     $('file_link').update('');
     $('file_size').update('');
     $('btn_upload').show();

Modified: trunk/jaws/html/gadgets/Contact/resources/style.css
===================================================================
--- trunk/jaws/html/gadgets/Contact/resources/style.css	2012-08-02 17:11:18 UTC (rev 13207)
+++ trunk/jaws/html/gadgets/Contact/resources/style.css	2012-08-02 17:11:37 UTC (rev 13208)
@@ -75,34 +75,43 @@
 #frm_file {
   padding: 5px 0;
 }
+#frm_file a, #frm_file small, #frm_file img {
+  vertical-align: middle;
+}
 #frm_file .actions {
   position: relative;
 }
 #frm_file .actions button {
-  width: 24px;
   height: 24px;
   margin: 0;
 }
 #frm_file .wrapper {
   position: absolute;
+  left: 0;
   top: 0;
-  width: 24px;
-  height: 24px;
+  width: 110px;
+  height: 20px;
   overflow: hidden;
 }
 #frm_file .wrapper input {
+  position: absolute;
+  right: 0;
   margin: 0;
   font-size: 30px;
   opacity: 0;
   filter: alpha(opacity=0);
 }
+#attach_actions {
+  display: inline-block;
+}
 #file_size {
   font-style: italic;
   color: #555;
 }
-a#btn_remove {
-  color: red;
-  text-decoration: none;
+#btn_upload {
+  border: none;
+  background: none;
+  color: #3465A4;
 }
 .buttons {
     text-align: right;

Modified: trunk/jaws/html/gadgets/Contact/templates/AdminMailer.html
===================================================================
--- trunk/jaws/html/gadgets/Contact/templates/AdminMailer.html	2012-08-02 17:11:18 UTC (rev 13207)
+++ trunk/jaws/html/gadgets/Contact/templates/AdminMailer.html	2012-08-02 17:11:37 UTC (rev 13208)
@@ -15,24 +15,27 @@
     <tbody>
       <tr><th>{lbl_from}:</th><td>{from}</td></tr>
       <tr><th>{lbl_subject}:</th><td>{subject}</td></tr>
-      <tr><th>{lbl_attachment}:</th>
-          <td>
-            <input type="hidden" name="filename" id="filename" value="" />
-            <form id="frm_file" name="frm_file" method="post"
-                  target="ifrm_upload" action="{base_script}"
-                  enctype="multipart/form-data" onsubmit="return true">
-              <input type="hidden" name="gadget" value="Contact" />
-              <input type="hidden" name="action" value="UploadFile" />
-              <div class="actions">
-                {btn_upload}
-                <img id="attach_loading" src="images/loading.gif" />
+      <tr><th></th><td>
+          <input type="hidden" name="filename" id="filename" value="" />
+          <form id="frm_file" name="frm_file" method="post"
+                target="ifrm_upload" action="{base_script}"
+                enctype="multipart/form-data" onsubmit="return true">
+            <input type="hidden" name="gadget" value="Contact" />
+            <input type="hidden" name="action" value="UploadFile" />
+            <div class="actions">
+              {btn_upload}
+              <img id="attach_loading" src="images/loading.gif" />
+              <div id="attach_actions">
+                <img src="gadgets/Contact/images/attachment.png" />
                 <a id="file_link"></a> <small id="file_size"></small>
-                <a id="btn_remove" href="javascript:removeAttachment()"><img src="images/stock/cancel.png" /></a>
-                <div class="wrapper">{attachment}</div>
+                {remove}
               </div>
-            </form>
-          </td>
-      </tr>
+              <div class="wrapper" 
+                   onmouseover="$('btn_upload').style.textDecoration='underline'"
+                   onmouseout ="$('btn_upload').style.textDecoration='none'">{attachment}</div>
+            </div>
+          </form>
+      </td></tr>
       <tr><th colspan="2">{lbl_message}:</th></tr>
       <tr><td colspan="2">{message}</td></tr>
     </tbody>



More information about the Jaws-commits mailing list