[Libreoffice-commits] .: bug/bug bug/bug.xhtml

Loic Dachary loic at kemper.freedesktop.org
Tue Sep 20 08:10:46 PDT 2011


 bug/bug.xhtml                    |   16 +++++---
 bug/bug/bug.css                  |   72 +++++++++++++++++++++++++++++++++++----
 bug/bug/bug.js                   |    8 +++-
 bug/bug/images/upload-browse.png |binary
 bug/bug/images/upload-hover.png  |binary
 bug/bug/images/upload-input.png  |binary
 bug/bug/images/upload.png        |binary
 7 files changed, 84 insertions(+), 12 deletions(-)

New commits:
commit d71220144894a4839f94b7780335c5e553b73e79
Author: Loic Dachary <loic at dachary.org>
Date:   Tue Sep 20 17:10:39 2011 +0200

    integrate file upload

diff --git a/bug/bug.xhtml b/bug/bug.xhtml
index 1135cf1..f12362a 100644
--- a/bug/bug.xhtml
+++ b/bug/bug.xhtml
@@ -145,11 +145,17 @@
 	     <input type="hidden" name="description" value="SCREENSHOT"></input>
 	     <input type="hidden" name="comment" value="SCREENSHOT COMMENT"></input>
 	     <input type="hidden" name="contenttypemethod" value="autodetect"></input>
-             <div class="attach-file">
-	       <input type="file" name="data"></input>
-             </div>
-             <div class="attach-submit">
-	       <input type="submit" value="Upload"></input>
+             <div class="attach-file-and-submit">
+               <div class="attach-file">
+	         <input type="file" name="data" />
+	         <div class="attach-file-style">
+		   <div><input type="text" name="ignored"></input></div>
+		   <div class="attach-browse">Browse</div>
+	         </div>
+               </div>
+               <div class="attach-submit">
+	         <input type="submit" value="Upload"></input>
+               </div>
              </div>
 	  </form>
 	  <img title="screenshot" />
diff --git a/bug/bug/bug.css b/bug/bug/bug.css
index 8680d87..2b77811 100644
--- a/bug/bug/bug.css
+++ b/bug/bug/bug.css
@@ -414,17 +414,25 @@ body {
     padding: 10px;
 }
 
+.state_attach .attach-file-and-submit {
+    text-align: right;
+    vertical-align: top;
+    width: 79%;
+}
+
+.state_attach .attach-file-style > div {
+    display: inline-block;
+}
+
 .state_attach .attach-submit input {
-    margin-left: auto;
-    margin-right: 40px;
     background: url('images/upload.png') no-repeat;
-    width: 163px;
-    height: 49px;
+    width: 94px;
+    height: 38px;
     font-weight: bold;
-    font-size: 20px;
+    font-size: 14px;
     color: #fff;
     text-align: center;
-    line-height: 49px;
+    line-height: 38px;
     border: 0;
 }
 
@@ -432,6 +440,58 @@ body {
     background: url('images/upload-hover.png') no-repeat;
 }
 
+.state_attach .attach-file {
+    position: relative;
+    height: 38px;
+}
+
+.state_attach .attach-file .attach-file-style {
+    position: absolute;
+    top: 0;
+    right: 0;
+    z-index: 1;
+}
+
+.state_attach .attach-file .attach-file-style > div {
+    vertical-align: top;
+}
+
+.state_attach .attach-file input[type='file'] {
+    position: relative;
+    text-align: right;
+    -moz-opacity:0 ;
+    filter:alpha(opacity: 0);
+    opacity: 0;
+    z-index: 2;
+    width: 400px;
+    height: 39px;
+}
+
+.state_attach .attach-file input[type='text'] {
+    margin-top: 6px;
+    width: 242px;
+    height: 27px;
+    background: url('images/upload-input.png') no-repeat;
+    border: 0;
+    padding: 0;
+}
+
+.state_attach .attach-browse {
+    background: url('images/upload-browse.png') no-repeat;
+    width: 94px;
+    height: 39px;
+    font-weight: bold;
+    font-size: 14px;
+    color: #057cc0;
+    text-align: center;
+    line-height: 38px;
+    border: 0;
+}
+
+.state_attach img {
+    display: none;
+}
+
 /* skin */
 .skin {
     display: none;
diff --git a/bug/bug/bug.js b/bug/bug/bug.js
index db5a6c2..c765dc2 100644
--- a/bug/bug/bug.js
+++ b/bug/bug/bug.js
@@ -207,8 +207,14 @@
                 var attachment = $.bug.lookup_result(data,
                                                      $.bug.state_attach_error_regexp,
                                                      $.bug.state_attach_success_regexp);
-                $('img', element).attr('src', '/attachment.cgi?id=' + attachment);
+                $('img', element).
+                    attr('src', '/attachment.cgi?id=' + attachment).
+                    show();
+                
             }});
+            $("input[type='file']", element).change(function() {
+                $("input[type='text']", element).val($(this).val());
+            });
             $.bug.current_step('attach');
             element.show();
         },
diff --git a/bug/bug/images/upload-browse.png b/bug/bug/images/upload-browse.png
new file mode 100644
index 0000000..ab210f1
Binary files /dev/null and b/bug/bug/images/upload-browse.png differ
diff --git a/bug/bug/images/upload-hover.png b/bug/bug/images/upload-hover.png
index 886c540..489785a 100644
Binary files a/bug/bug/images/upload-hover.png and b/bug/bug/images/upload-hover.png differ
diff --git a/bug/bug/images/upload-input.png b/bug/bug/images/upload-input.png
new file mode 100644
index 0000000..a77e5ed
Binary files /dev/null and b/bug/bug/images/upload-input.png differ
diff --git a/bug/bug/images/upload.png b/bug/bug/images/upload.png
index 886c540..489785a 100644
Binary files a/bug/bug/images/upload.png and b/bug/bug/images/upload.png differ


More information about the Libreoffice-commits mailing list