[Libreoffice-commits] .: bug/bug

Loic Dachary loic at kemper.freedesktop.org
Wed Oct 19 11:24:27 PDT 2011


 bug/bug/frame.html |    2 +-
 bug/bug/test.js    |    6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 1db346445ff8298c5e715f7763d44d0c1dd6b094
Author: Loic Dachary <loic at dachary.org>
Date:   Wed Oct 19 20:24:19 2011 +0200

    Compute the bugzilla_url based on the protocol and hostname of the enclosing document. The same snippet can be used to define the bugzilla url for https://libreoffice.org/ and https://www.libreoffice.org/ with a single line.

diff --git a/bug/bug/frame.html b/bug/bug/frame.html
index fd8920c..d46cbae 100644
--- a/bug/bug/frame.html
+++ b/bug/bug/frame.html
@@ -20,7 +20,7 @@
     <title>Load bug.html in a frame</title>
   </head>
   <body>
-    <script>var bugzilla_url = '/bugzilla';</script>
+    <script>var bugzilla_url = location.protocol + '//' + location.hostname + '/bugzilla';</script>
     <iframe src="bug.html?version=2" width="892" height="1600" frameborder="0"> </iframe>
   </body>
 </html>
diff --git a/bug/bug/test.js b/bug/bug/test.js
index 98c1f65..b470292 100644
--- a/bug/bug/test.js
+++ b/bug/bug/test.js
@@ -17,9 +17,11 @@
 module("bug");
 
 test("frame", function() {
-    expect(2);
+    expect(3);
+
+    var bugzilla_url = location.protocol + '//' + location.hostname;
 
-    bugzilla_url = 'BUGZILLA_URL';
+    equal(location.href.indexOf(bugzilla_url), 0, bugzilla_url);
 
     $.bug.window = {
         top: 'something',


More information about the Libreoffice-commits mailing list