Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi All,

Here 3 small patches for the bugzilla assistant.

- The first fixes the problem that some debug-options (set with the skin-variable) didn't give the correct screen
- The second removes trailing white-spaces
- The thirth solves a bug when the bugzilla can't be reached. It gives an error now, while it used to give java-script errors.

--
Greetings,
Rob Snelders
From 2e922d4f9f81fe129ee2d613295c3184ca4058e3 Mon Sep 17 00:00:00 2001
From: Rob Snelders <programming@ertai.nl>
Date: Thu, 5 Jul 2012 21:04:54 +0200
Subject: [PATCH] Select the first options in the select-boxes so the
 skin-options always work.

---
 bug/bug/skin.js |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bug/bug/skin.js b/bug/bug/skin.js
index 1399fac..7858f67 100644
--- a/bug/bug/skin.js
+++ b/bug/bug/skin.js
@@ -26,18 +26,18 @@
       }
       function subcomponent() {
           component();
-          $('.state_component .choice:nth(3)').click();
+          $('.state_component .choice:nth(0)').click();
       }
       function version() {
           subcomponent();
           $.bug.ajax = function(settings) {
               return $.Deferred().resolve('NUM,DESC\n100,"BUG 1"\n200,"BUG 2"\n');
           };
-          $('.state_subcomponent .active_subcomponent .choice:nth(2)').click();
+          $('.state_subcomponent .active_subcomponent .choice:nth(0)').click();
       }
       function description() {
           version();
-          $('.state_version .choice:nth(2)').click();
+          $('.state_version .choice:nth(0)').click();
           $('.state_description .short').val('12');
       }
       function submit() {
-- 
1.7.9.5

From 52c3e6d644b08e669edd7fb8873c09ccc1a7de62 Mon Sep 17 00:00:00 2001
From: Rob Snelders <programming@ertai.nl>
Date: Thu, 5 Jul 2012 22:19:47 +0200
Subject: [PATCH] Remove trailing whitespaces

---
 bug/bug.xhtml         |    4 ++--
 bug/bug/bug.css       |    2 +-
 bug/bug/bug.js        |   14 +++++++-------
 bug/bug/qunit.css     |   10 +++++-----
 bug/bug/select.js     |    2 +-
 bug/bug/test.html     |    2 +-
 bug/bug/test.js       |    2 +-
 bug/subcomponents.xsl |    2 +-
 8 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/bug/bug.xhtml b/bug/bug.xhtml
index 254731a..d43008b 100644
--- a/bug/bug.xhtml
+++ b/bug/bug.xhtml
@@ -92,12 +92,12 @@
               </div>
             </div>
           </div>
-    
+
           <div class="state_success">
             <p>The bug report has been successfully submitted.</p>
             <p>You can edit it or add attachments using <a class="bug">the corresponding bugzilla 
page</a>.</p>
           </div>
-      
+
           <div class="username"></div>
 
           <div class="state signin">
diff --git a/bug/bug/bug.css b/bug/bug/bug.css
index 6fde858..a932f2a 100644
--- a/bug/bug/bug.css
+++ b/bug/bug/bug.css
@@ -15,7 +15,7 @@
      along with this program.  If not, see <http:www.gnu.org/licenses/>.
 */
 /* javascript and old browsers fallback */
-.javascript, .unsupported, .compatibility .version { 
+.javascript, .unsupported, .compatibility .version {
     display: none;
 }
 
diff --git a/bug/bug/bug.js b/bug/bug/bug.js
index d670092..9b7f906 100644
--- a/bug/bug/bug.js
+++ b/bug/bug/bug.js
@@ -53,7 +53,7 @@
                 $.bug.error_set(error[1]);
                 throw error;
             } else {
-                var success = data.match(success_regexp);                
+                var success = data.match(success_regexp);
                 if(success !== null) {
                     return success[1];
                 } else {
@@ -114,23 +114,23 @@
             element.show();
             $('.select', element).select();
             $('.select .choice, img', element).hover(function() {
-                var component = $(this).attr('data');                
+                var component = $(this).attr('data');
                 $('.comment', element).hide();
                 $('.comment.' + component, element).show();
             });
             $('.select .choice', element).click(function() {
                 $(this).mouseenter();
-                var component = $(this).attr('data');                
+                var component = $(this).attr('data');
                 $('img', element).removeClass('selected');
                 $('img[data="' + component + '"]').addClass('selected');
                 $.bug.state_subcomponent();
             });
             $('img', element).click(function() {
-                var component = $(this).attr('data');                
+                var component = $(this).attr('data');
                 $(".select .choice[data='" + component + "']", element).click();
             });
             $('.components_icons').mouseleave(function() {
-                $('img.selected', element).mouseenter();                
+                $('img.selected', element).mouseenter();
             });
         },
 
@@ -263,7 +263,7 @@
             element.show();
         },
 
-        // if this string is found in the page returned when 
+        // if this string is found in the page returned when
         // trying to fill a bug, it means the user is not logged in
         logged_in_false: 'form name="login"',
 
@@ -274,7 +274,7 @@
                 return data.indexOf($.bug.logged_in_false) < 0;
             });
         },
-        
+
         refresh_related_bugs: function() {
             $('.related_bugs').empty();
             var component = $('.state_component .chosen').attr('data').replace('_','%20');
diff --git a/bug/bug/qunit.css b/bug/bug/qunit.css
index a6a831c..9b74192 100644
--- a/bug/bug/qunit.css
+++ b/bug/bug/qunit.css
@@ -27,7 +27,7 @@
        font-size: 1.5em;
        line-height: 1em;
        font-weight: normal;
-       
+
        border-radius: 15px 15px 0 0;
        -moz-border-radius: 15px 15px 0 0;
        -webkit-border-top-right-radius: 15px;
@@ -81,13 +81,13 @@
 #qunit-tests ol {
        margin-top: 0.5em;
        padding: 0.5em;
-       
+
        background-color: #fff;
-       
+
        border-radius: 15px;
        -moz-border-radius: 15px;
        -webkit-border-radius: 15px;
-       
+
        box-shadow: inset 0px 2px 13px #999;
        -moz-box-shadow: inset 0px 2px 13px #999;
        -webkit-box-shadow: inset 0px 2px 13px #999;
@@ -150,7 +150,7 @@
 
 #qunit-tests .pass                          { color: #528CE0; background-color: #D2E0E6; }
 #qunit-tests .pass .test-name               { color: #366097; }
- 
+
 #qunit-tests .pass .test-actual,
 #qunit-tests .pass .test-expected           { color: #999999; }
 
diff --git a/bug/bug/select.js b/bug/bug/select.js
index 74432c7..54aef31 100644
--- a/bug/bug/select.js
+++ b/bug/bug/select.js
@@ -44,5 +44,5 @@
 
     $.fn.select.defaults = {
     };
-                   
+
 })(jQuery);
diff --git a/bug/bug/test.html b/bug/bug/test.html
index 54f2665..72a84fb 100644
--- a/bug/bug/test.html
+++ b/bug/bug/test.html
@@ -76,7 +76,7 @@
     <div class="state_subcomponent">
       <div class="active_subcomponent"></div>
     </div>
-    
+
     <div class="state_subcomponent">
       <div class="subcomponents">
         <div xmlns="" class="Formula_editor">
diff --git a/bug/bug/test.js b/bug/bug/test.js
index 73b194b..defb842 100644
--- a/bug/bug/test.js
+++ b/bug/bug/test.js
@@ -271,7 +271,7 @@ test("state_submit", function() {
     });
     form.submit();
     form.submit(); // noop
-    
+
     $.bug.state_submit_element = 'div'; // because <html> can't be inserted in the dom
 
     // <title> cannot be inserted by IE8
diff --git a/bug/subcomponents.xsl b/bug/subcomponents.xsl
index eddc70d..ba87311 100644
--- a/bug/subcomponents.xsl
+++ b/bug/subcomponents.xsl
@@ -60,5 +60,5 @@
         </xsl:element>
        </xsl:if>
     </xsl:template>
-    
+
 </xsl:stylesheet>
-- 
1.7.9.5

From 2918b98b10f3a1b55f10210354c35a9d2829b2fa Mon Sep 17 00:00:00 2001
From: Rob Snelders <programming@ertai.nl>
Date: Thu, 5 Jul 2012 23:05:42 +0200
Subject: [PATCH] Solves a crash of javascript when running on your own
 machine without the skin-option

---
 bug/bug/bug.js |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/bug/bug/bug.js b/bug/bug/bug.js
index 9b7f906..9947ff2 100644
--- a/bug/bug/bug.js
+++ b/bug/bug/bug.js
@@ -26,7 +26,12 @@
                 url: url,
                 data: args
             }).pipe(null, function(error) {
-                var message = url + '(' + $.param(args) + ') XHR error. ';
+                var message;
+               if (args == undefined) {
+                 message = url + '() XHR error. ';
+               } else {
+                 message = url + '(' + $.param(args) + ') XHR error. ';
+               }
                 if('status' in error) {
                     message += 'status = ' + error.status + ' ';
                 }
@@ -300,7 +305,7 @@
             }
         },
 
-        main: function() {
+        main: function(in_isTest) {
             $.bug.compatibility();
             $.bug.frame();
             $.bug.logged_in().done(function(status) {
-- 
1.7.9.5


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.