Bug 395466 Checking in patch by Ben_H for QA Extension

This commit is contained in:
ctalbert@mozilla.com 2007-09-10 15:01:06 -07:00
Родитель 3980c50d5d
Коммит a3a9a2c311
42 изменённых файлов: 3219 добавлений и 2315 удалений

Просмотреть файл

@ -5,29 +5,28 @@ build.xml adapted from Shawn Wilsher's rtse
(http://shawnwilsher.com/extensions/rtse/)
-->
<project name="qa" default="createxpi">
<tstamp>
<format property="build.number" pattern="yyyyMMdd" offset="-1" unit="hour"/>
</tstamp>
<property name="build.version" value="0.1.${build.number}"/>
<target name="createxpi" depends="createjar">
<zip destfile="qa.xpi">
<zipfileset dir="" includes="chrome/qa.jar"/>
<zipfileset dir="" includes="chatzilla.jar"/>
<zipfileset dir="" includes="install.rdf"/>
<zipfileset dir="" includes="jar-chrome.manifest" fullpath="chrome.manifest"/>
<zipfileset dir="" includes="README" />
<zipfileset dir="" includes="defaults/**" excludes="**CVS"/>
<zipfileset dir="" includes="platform/**" excludes="**CVS"/>
<zipfileset dir="" includes="components/chatzilla-service.js" />
</zip>
</target>
<target name="createjar">
<target name="createxpi" depends="createjar">
<zip destfile="qa.xpi">
<zipfileset dir="" includes="chrome/qa.jar"/>
<zipfileset dir="" includes="chatzilla.jar"/>
<zipfileset dir="" includes="install.rdf"/>
<zipfileset dir="" includes="jar-chrome.manifest" fullpath="chrome.manifest"/>
<zipfileset dir="" includes="README" />
<zipfileset dir="" includes="defaults/**" excludes="**CVS"/>
<zipfileset dir="" includes="platform/**" excludes="**CVS"/>
<zipfileset dir="" includes="components/chatzilla-service.js" />
</zip>
</target>
<target name="createjar">
<zip destfile="chrome/qa.jar">
<zipfileset dir="chrome" includes="content/**" excludes="**CVS"/>
<zipfileset dir="chrome" includes="skin/**" excludes="**CVS"/>
<zipfileset dir="chrome" includes="locale/**" excludes="**CVS"/>
</zip>
</zip>
</target>
</project>

Просмотреть файл

@ -1,6 +1,6 @@
content qa chrome/content/
skin qa classic/1.0 chrome/skin/
locale qa en-US chrome/locale/en-US/
content qa chrome/content/
skin qa classic/1.0 chrome/skin/
locale qa en-US chrome/locale/en-US/
overlay chrome://browser/content/browser.xul chrome://qa/content/browserOverlays.xul

Просмотреть файл

@ -1,106 +1,78 @@
<!-- -*- Mode: HTML -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Mozilla Community QA Extension
#
# The Initial Developer of the Original Code is Zach Lipton.
# Portions created by the Initial Developer are Copyright (C) 2006
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Ben Hsieh <ben.hsieh@gmail.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the LGPL or the GPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK ***** -->
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla Community QA Extension
*
* The Initial Developer of the Original Code is the Mozilla Corporation.
* Portions created by the Initial Developer are Copyright (C) 2006
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Ben Hsieh <ben.hsieh@gmail.com>
*
* Portions taken from David Hamp-Gonsalves' Buggybar (buggybar@gmail.com)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
var accountCreate = {
oldPassword: null, //TODO: is this secure?
oldUsername: null,
updateFunction : null,
loadSetup : function() {
document.getElementById('qa-setup-createaccount-iframe').src =
litmus.baseURL+'extension.cgi?createAccount=1';
loadSetup : function() {
document.getElementById('qa-settings-createaccount-frame').src =
litmus.baseURL+'extension.cgi?createAccount=1';
accountCreate.updateFunction = window.arguments[0];
accountCreate.oldPassword = qaPref.litmus.getPassword();
accountCreate.oldUsername = qaPref.litmus.getUsername();
},
},
validateAccount : function() {
// we're creating a new account, so get the uname and passwd
// from the account created page:
var page = document.getElementById('qa-setup-createaccount-iframe').
contentDocument;
if (!page) {
alert("create account page is missing");
return false;
}
if (page.wrappedJSObject == null)
page.wrappedJSObject = page;
if (page.forms[0] && page.forms[0].wrappedJSObject == null)
page.forms[0].wrappedJSObject = page.forms[0];
if (page.location == litmus.baseURL+'extension.cgi?createAccount=1'
&& qaSetup.didSubmitForm==0) {
page.forms[0].wrappedJSObject.submit();
qaSetup.didSubmitForm = 1;
setTimeout("qaSetup.validateAccount()", 5000);
return false;
}
if (qaSetup.didSubmitForm == 1 && ! page.forms ||
! page.forms[0].wrappedJSObject ||
! page.forms[0].wrappedJSObject.email &&
! page.forms[0].wrappedJSObject.email.value)
{qaSetup.didSubmitForm = 2;
setTimeout("qaSetup.validateAccount()", 4000);
return false;}
var e = '';
var p = '';
if (page.forms && page.forms[0].wrappedJSObject &&
page.forms[0].wrappedJSObject.email &&
page.forms[0].wrappedJSObject.email.value)
{ e=page.forms[0].wrappedJSObject.email.value }
if (page.forms && page.forms[0].wrappedJSObject &&
page.forms[0].wrappedJSObject.password &&
page.forms[0].wrappedJSObject.password.value)
{ p=page.forms[0].wrappedJSObject.password.value }
// e is account, p is password
var uname = e;
var passwd = p;
var account = qaSetup.retrieveAccount("qa-settings-createaccount-frame");
var uname = account.name;
var passwd = account.password;
if (e == '' || p == '') {
if (uname == '' || passwd == '') {
alert("No username or password has been registered.");
return false; //we need better error handling.
}
var location = document.getElementById('qa-settings-createaccount-frame').contentDocument.location + "";
if (location.indexOf("createAccount") != -1) {
alert("Account not created! You most likely need to click the 'Create Account' button");
return false;
}
qaPref.litmus.setPassword(uname, passwd);
accountCreate.updateFunction();
// TODO: ideally we would validate against litmus, but...
return true;
},
// TODO: ideally we would validate against litmus, but...
return true;
},
handleCancel : function() {
qaPref.litmus.setPassword(oldUsername, oldPassword);

Просмотреть файл

@ -1,39 +1,39 @@
<?xml version="1.0"?><!-- -*- Mode: HTML -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Mozilla Community QA Extension
#
# The Initial Developer of the Original Code is Zach Lipton.
# Portions created by the Initial Developer are Copyright (C) 2006
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Ben Hsieh <ben.hsieh@gmail.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the LGPL or the GPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK ***** -->
- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is the Mozilla Community QA Extension
-
- The Initial Developer of the Original Code is the Mozilla Corporation.
- Portions created by the Initial Developer are Copyright (C) 2007
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Ben Hsieh <ben.hsieh@gmail.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<!DOCTYPE wizard PUBLIC "-//MOZILLA//DTD XUL V1.0//EN" "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
@ -63,7 +63,7 @@
</stringbundleset>
<vbox id="qa-setup-accountno" style="display: none" width="0px" height="0px" />
<html:iframe id="qa-setup-createaccount-iframe"
<html:iframe id="qa-settings-createaccount-frame"
height="280"/>
</dialog>

Просмотреть файл

@ -1,39 +1,40 @@
<?xml version="1.0"?><!-- -*- Mode: HTML -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Mozilla Community QA Extension
#
# The Initial Developer of the Original Code is the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2006
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Zach Lipton <zach@zachlipton.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the LGPL or the GPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK ***** -->
- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is the Mozilla Community QA Extension
-
- The Initial Developer of the Original Code is the Mozilla Corporation.
- Portions created by the Initial Developer are Copyright (C) 2007
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Zach Lipton <zach@zachlipton.com>
- Ben Hsieh <ben.hsieh@gmail.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<?xml-stylesheet href="chrome://qa/skin/browserOverlays.css" type="text/css"?>
@ -50,9 +51,8 @@
<script type="application/x-javascript" src="chrome://qa/content/notifications.js" />
<statusbar id="status-bar">
<statusbarpanel class="statusbarpanel-iconic" id="qa-statusbar-overlay"
src="chrome://qa/skin/qmo-16px.png"
onclick="qaMain.openQATool();" />
<statusbarpanel class="statusbarpanel-iconic" id="qa-statusbar-overlay"
onclick="qaMain.openQATool();" />
</statusbar>
<window id="main-window">
@ -75,15 +75,13 @@
<vbox id="qa-notify-content">
<description id="qa-notify-text" />
<label id="qa-notify-infolink" class="text-link" href=""
value="" />
value="" />
<label id="qa-notify-getstartedlink" class="text-link" href=""
value="" style="display: none;" />
value="" style="display: none;" />
</vbox>
</vbox>
</vbox>
</vbox>
</vbox>
</window>
</overlay>

Просмотреть файл

@ -21,6 +21,8 @@
* Zach Lipton <zach@zachlipton.com>
* Ben Hsieh <ben.hsieh@gmail.com>
*
* Portions taken from David Hamp-Gonsalves' Buggybar (buggybar@gmail.com)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
@ -41,102 +43,103 @@ const Cc = Components.classes;
const Cr = Components.results;
var qaTools = {
// load a JSON doc into a menulist/menupopup
// takes the url to load, the menulist to populate, the name of the method
// to use to get the name from the JSON doc, and the name of the method to
// use to get the value from the JSON doc, plus an optional callback
loadJsonMenu : function(url, menulist, nameMethod, valueMethod, callback) {
var d = loadJSONDoc(url);
d.addErrback(function (err) {
// load a JSON doc into a menulist/menupopup
// takes the url to load, the menulist to populate, the name of the method
// to use to get the name from the JSON doc, and the name of the method to
// use to get the value from the JSON doc, plus an optional callback
loadJsonMenu : function(url, menulist, nameMethod, valueMethod, callback) {
var d = loadJSONDoc(url);
d.addErrback(function (err) {
if (err instanceof CancelledError) {
return;
}
alert(err);
dump(err);
});
d.addCallback(function(obj) {
if (obj instanceof Array) {
for (var i=0; i<obj.length; i++) {
var item = obj[i];
if (! item) { continue; }
var newitem = menulist.appendItem(item[nameMethod],
item[valueMethod]);
}
} else {
var newitem = menulist.appendItem(obj[nameMethod], obj[valueMethod]);
}
// stash the JSON object in the userData attribute for
// later use (e.g. when filtering the list).
newitem.userData = item;
if (callback) {
callback();
}
});
},
fetchFeed : function(url, callback) {
var httpRequest = null;
function FeedResultListener() {}
FeedResultListener.prototype = {
handleResult : function(result) {
var feed = result.doc;
feed.QueryInterface(Ci.nsIFeed);
callback(feed);
},
};
d.addCallback(function(obj) {
if (obj instanceof Array) {
for (var i=0; i<obj.length; i++) {
var item = obj[i];
if (! item) { continue; }
var newitem = menulist.appendItem(item[nameMethod],
item[valueMethod]);
}
} else {
var newitem = menulist.appendItem(obj[nameMethod], obj[valueMethod]);
}
// stash the JSON object in the userData attribute for
// later use (e.g. when filtering the list).
newitem.userData = item;
if (callback) {
callback();
}
});
},
fetchFeed : function(url, callback) {
var httpRequest = null;
function FeedResultListener() {}
FeedResultListener.prototype = {
handleResult : function(result) {
var feed = result.doc;
feed.QueryInterface(Ci.nsIFeed);
callback(feed);
}
};
function infoReceived() {
var data = httpRequest.responseText;
var ioService = Cc['@mozilla.org/network/io-service;1']
.getService(Ci.nsIIOService);
var uri = ioService.newURI(url, null, null);
if (data.length) {
var processor = Cc["@mozilla.org/feed-processor;1"]
.createInstance(Ci.nsIFeedProcessor);
try {
processor.listener = new FeedResultListener;
processor.parseFromString(data, uri);
} catch(e) {
alert("Error parsing feed: " + e);
}
}
}
httpRequest = new XMLHttpRequest();
httpRequest.open("GET", url, true);
try {
httpRequest.onload = infoReceived;
httpRequest.send(null);
} catch(e) {
alert(e);
}
},
httpPostRequest : function (url, data, callback, errback) {
// do a xmlhttprequest sending data with the post method
var req = getXMLHttpRequest();
req.open("POST", url, true);
req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", data.length);
req.setRequestHeader("Connection", "close");
req = sendXMLHttpRequest(req, data);
req.addErrback(errback);
req.addCallback(callback);
},
showHideLoadingMessage : function(box, bool) {
if (bool == true) { // show
var loading = document.createElementNS("http://www.w3.org/1999/xhtml", "p");
loading.textContent = qaMain.bundle.getString("qa.extension.loading");
loading.setAttributeNS("http://www.w3.org/1999/xhtml", "class", "loading_message");
box.appendChild(loading);
} else { // hide
var elements = box.childNodes;
for (var i=0; i<elements.length; i++) {
if (elements[i] && elements[i].getAttributeNS &&
elements[i].getAttributeNS(
"http://www.w3.org/1999/xhtml", "class") == "loading_message") {
box.removeChild(elements[i]);
break;
}
}
}
},
function infoReceived() {
var data = httpRequest.responseText;
var ioService = Cc['@mozilla.org/network/io-service;1']
.getService(Ci.nsIIOService);
var uri = ioService.newURI(url, null, null);
if (data.length) {
var processor = Cc["@mozilla.org/feed-processor;1"]
.createInstance(Ci.nsIFeedProcessor);
try {
processor.listener = new FeedResultListener;
processor.parseFromString(data, uri);
} catch(e) {
alert("Error parsing feed: " + e);
}
}
}
httpRequest = new XMLHttpRequest();
httpRequest.open("GET", url, true);
try {
httpRequest.onload = infoReceived;
httpRequest.send(null);
} catch(e) {
alert(e);
}
},
httpPostRequest : function (url, data, callback, errback) {
// do a xmlhttprequest sending data with the post method
var req = getXMLHttpRequest();
req.open("POST", url, true);
req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", data.length);
req.setRequestHeader("Connection", "close");
req = sendXMLHttpRequest(req, data);
req.addErrback(errback);
req.addCallback(callback);
},
showHideLoadingMessage : function(box, bool) {
if (bool == true) { // show
var loading = document.createElementNS("http://www.w3.org/1999/xhtml", "p");
loading.textContent = qaMain.bundle.getString("qa.extension.loading");
loading.setAttributeNS("http://www.w3.org/1999/xhtml",
"class", "loading_message");
box.appendChild(loading);
} else { // hide
var elements = box.childNodes;
for (var i=0; i<elements.length; i++) {
if (elements[i] && elements[i].getAttributeNS &&
elements[i].getAttributeNS(
"http://www.w3.org/1999/xhtml", "class") == "loading_message") {
box.removeChild(elements[i]);
break;
}
}
}
},
arrayify : function(obj) {
if (obj instanceof Array) {
return obj;
@ -171,4 +174,25 @@ var qaTools = {
openUILinkIn(url, where);
event.preventDefault(); // prevent it from simply following the href
},
makeUniqueArray : function(array) {
var RV = new Array();
for( var i = 0; i < array.length; i++ ) {
if( RV.indexOf(array[i]) < 0 ) { RV.push( array[i] ); }
}
return RV;
}
};
function getCleanText(inputText)
{
inputText = inputText.replace(/&#64;/g,"@");
inputText = inputText.replace(/&quot;/g,"\"");
inputText = inputText.replace(/&lt;/g, "<");
inputText = inputText.replace(/&gt;/g, ">");
inputText = inputText.replace(/&amp;/g, "&");
inputText = inputText.replace(/<[^>]*>/g, "");
inputText = inputText.replace(/\s+/g, " ");
inputText = inputText.replace(/\n*/g, "");
return inputText;
}

Просмотреть файл

@ -19,7 +19,7 @@
*
* Contributor(s):
* Zach Lipton <zach@zachlipton.com>
* Ben Hsieh <bhsieh@mozilla.com>
* Ben Hsieh <bhsieh@mozilla.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
@ -39,13 +39,13 @@
const FIREFOX_ID = "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
var litmus = {
baseURL : qaPref.getPref(qaPref.prefBase+".litmus.url", "char"),
userStats : '',
baseURL : qaPref.getPref(qaPref.prefBase+".litmus.url", "char"),
userStats : '',
getTestcase : function(testcase_id, callback) {
getTestcase : function(testcase_id, callback) {
litmus.getLitmusJson(testcase_id, callback, "testcase_id=");
},
getSubgroup : function(subgroupID, callback) {
},
getSubgroup : function(subgroupID, callback) {
litmus.getLitmusJson(subgroupID, callback, "subgroup_id=");
},
getTestgroup : function(testgroupID, callback) {
@ -63,16 +63,16 @@
getLitmusJson : function(ID, callback, prefix) {
var url = litmus.baseURL+'json.cgi?' + prefix + ID;
var d = loadJSONDoc(url);
d.addBoth(function (res) {
d.deferred = null;
return res;
});
d.addCallback(callback);
d.addErrback(function (err) {
d.addBoth(function (res) {
d.deferred = null;
return res;
});
d.addCallback(callback);
d.addErrback(function (err) {
if (err instanceof CancelledError) {
return;
}
alert(err);
dump(err);
});
},
@ -141,28 +141,28 @@
litmus.undisableAll();
},
validateLogin : function(uname, passwd, callback) {
var qs = queryString({
validate_login: 1,
username: uname,
password: passwd
});
qaTools.httpPostRequest(litmus.baseURL+'json.cgi', qs, callback);
},
postResultXML : function(xml, callback, errback) {
var qs = queryString({ data: xml});
var fake_callback = function(resp) {
// only call callback() if we really had a sucuess. XML
// processing errors should result in a call to errback()
if ((/^ok/i).exec(resp.responseText)) {
callback(resp);
} else {
errback(resp);
}
};
qaTools.httpPostRequest(litmus.baseURL+'process_test.cgi',
qs, fake_callback, errback);
},
validateLogin : function(uname, passwd, callback) {
var qs = queryString({
validate_login: 1,
username: uname,
password: passwd
});
qaTools.httpPostRequest(litmus.baseURL+'json.cgi', qs, callback);
},
postResultXML : function(xml, callback, errback) {
var qs = queryString({ data: xml});
var fake_callback = function(resp) {
// only call callback() if we really had a sucuess. XML
// processing errors should result in a call to errback()
if ((/^ok/i).exec(resp.responseText)) {
callback(resp);
} else {
errback(resp);
}
};
qaTools.httpPostRequest(litmus.baseURL+'process_test.cgi',
qs, fake_callback, errback);
},
currentSubgroupID: null,
@ -182,21 +182,21 @@
litmus.getSubgroup(litmus.currentSubgroupID, function(subgroup) {litmus.statePopulateFields(subgroup); litmus.undisableAll();});
},
loadStats : function() {
// pull new user statistics from litmus
var url = litmus.baseURL+'json.cgi?' + 'user_stats=' + qaPref.litmus.getUsername();
var req = loadJSONDoc(url);
req.addCallback(function(data) {
litmus.userStats = data;
litmus.displayStats();
});
// pull new user statistics from litmus
var url = litmus.baseURL+'json.cgi?' + 'user_stats=' + qaPref.litmus.getUsername();
var req = loadJSONDoc(url);
req.addCallback(function(data) {
litmus.userStats = data;
litmus.displayStats();
});
},
displayStats : function() {
var statbox = $('qa-litmus-stats');
if (litmus.userStats != '') {
var statline = qaMain.bundle.getFormattedString('qa.extension.litmus.stats',
[litmus.userStats.week, litmus.userStats.month, litmus.userStats.alltime]);
statbox.value = statline;
}
var statbox = $('qa-litmus-stats');
if (litmus.userStats != '') {
var statline = qaMain.bundle.getFormattedString('qa.extension.litmus.stats',
[litmus.userStats.week, litmus.userStats.month, litmus.userStats.alltime]);
statbox.value = statline;
}
},
checkRadioButtons : function() {
var menu = document.getElementById('testlist');
@ -208,27 +208,27 @@
prevButton : function() {
$("testlist").selectedIndex--;
},
nextButton: function() {
// if they selected a result, then submit the result
if ($('qa-testcase-result').selectedItem) {
litmus.submitResult();
}
nextButton: function() {
// if they selected a result, then submit the result
if ($('qa-testcase-result').selectedItem) {
litmus.submitResult();
}
$("testlist").selectedIndex++;
},
},
handleSelect : function() {
if ($("testlist").selectedIndex == -1)
return;
litmus.disableAll();
litmus.getTestcase($("testlist").selectedItem.value, function(testcase) {
litmus.populateTestcase(testcase);
$('qa-testcase-progress').value =
qaMain.bundle.getFormattedString('qa.extension.litmus.progress',
[$("testlist").selectedIndex+1, $("testlist").getRowCount()]);
litmus.populateTestcase(testcase);
$('qa-testcase-progress').value =
qaMain.bundle.getFormattedString('qa.extension.litmus.progress',
[$("testlist").selectedIndex+1, $("testlist").getRowCount()]);
litmus.undisableAll();
});
},
populatePreviewBox : function(testcases) {
populatePreviewBox : function(testcases) {
var menu = document.getElementById('testlist');
if (!menu) return;
@ -260,7 +260,7 @@
}
document.getElementById('qa-testcase-id').value =
qaMain.bundle.getString("qa.extension.testcase.head")+testcase.testcase_id;
document.getElementById('qa-testcase-summary').value = testcase.summary;
document.getElementById('qa-testcase-summary').value = testcase.summary;
qaTools.writeSafeHTML('qa-testcase-steps', testcase.steps_formatted);
qaTools.writeSafeHTML('qa-testcase-expected', testcase.expected_results_formatted);
@ -268,12 +268,23 @@
qaTools.assignLinkHandlers($('qa-testcase-steps'));
qaTools.assignLinkHandlers($('qa-testcase-expected'));
if (testcase.regression_bug_id) {
bugzilla.loadBug(testcase.regression_bug_id);
} else {
var bugarray = bugzilla.findBugzillaLinks($("qa-testcase-expected"));
if (bugarray.length) {
bugzilla.loadBug(bugarray[0]);
for (var i = 1; i < bugarray.length; i++) {
bugzilla.loadBug(bugarray[i], true);
}
}
}
litmus.checkRadioButtons();
},
populateFields : function(subgroup) {
populateFields : function(subgroup) {
litmus.lastSubgroupObject = subgroup;
litmus.populatePreviewBox(subgroup.testcases);
$('qa-subgroup-label').value = subgroup.name;
litmus.populatePreviewBox(subgroup.testcases);
$('qa-subgroup-label').value = subgroup.name;
$("testlist").selectedIndex = 0;
},
statePopulateFields : function(subgroup) { //TODO: there's gotta be a better way to do this...
@ -299,169 +310,169 @@
$("qa-mainwindow-nextButton").disabled = false;
},
submitResult : function() {
var rs;
var item = $('qa-testcase-result').selectedItem;
if (item.id == "qa-testcase-pass") {
rs = 'Pass';
} else if (item.id == "qa-testcase-fail") {
rs = 'Fail';
} else if (item.id == "qa-testcase-unclearBroken") {
rs = 'Test unclear/broken';
} else {
// no result selected, so don't submit anything for thes test:
return false;
}
submitResult : function() {
var rs;
var item = $('qa-testcase-result').selectedItem;
if (item.id == "qa-testcase-pass") {
rs = 'Pass';
} else if (item.id == "qa-testcase-fail") {
rs = 'Fail';
} else if (item.id == "qa-testcase-unclearBroken") {
rs = 'Test unclear/broken';
} else {
// no result selected, so don't submit anything for thes test:
return false;
}
var menu = document.getElementById('testlist');
var l = new LitmusResults({username: qaPref.litmus.getUsername(),
password: qaPref.litmus.getPassword(),
server: litmus.baseURL});
l.sysconfig(new Sysconfig());
var l = new LitmusResults({username: qaPref.litmus.getUsername(),
password: qaPref.litmus.getPassword(),
server: litmus.baseURL});
l.sysconfig(new Sysconfig());
l.addResult(new Result({
testid: menu.selectedItem.value,
resultstatus: rs,
exitstatus: 'Exited Normally',
duration: 0,
comment: $('qa-testcase-comment').value,
isAutomatedResult: 0
}));
l.addResult(new Result({
testid: menu.selectedItem.value,
resultstatus: rs,
exitstatus: 'Exited Normally',
duration: 0,
comment: $('qa-testcase-comment').value,
isAutomatedResult: 0
}));
var callback = function(resp) {
// increment the stat counters:
for (var i in litmus.userStats) {
litmus.userStats[i]++;
}
litmus.displayStats();
};
var callback = function(resp) {
// increment the stat counters:
for (var i in litmus.userStats) {
litmus.userStats[i]++;
}
litmus.displayStats();
};
var errback = function(resp) {
alert(resp.responseText);
};
var errback = function(resp) {
dump(resp.responseText);
};
litmus.postResultXML(l.toXML(), callback, errback);
litmus.postResultXML(l.toXML(), callback, errback);
var item = menu.selectedItem;
item.firstChild.setAttribute("checked", "true");
return false; // ?? Got rid of strict warning...
},
};
}
};
// any missing fields will be autodetected
function Sysconfig(aProduct, aPlatform, aOpsys, aBranch, aBuildid, aLocale) {
this._load('product', aProduct);
this._load('platform', aPlatform);
this._load('opsys', aOpsys);
this._load('branch', aBranch);
this._load('buildid', aBuildid);
this._load('locale', aLocale);
this.populate();
}
// any missing fields will be autodetected
function Sysconfig(aProduct, aPlatform, aOpsys, aBranch, aBuildid, aLocale) {
this._load('product', aProduct);
this._load('platform', aPlatform);
this._load('opsys', aOpsys);
this._load('branch', aBranch);
this._load('buildid', aBuildid);
this._load('locale', aLocale);
this.populate();
}
Sysconfig.prototype = {
product: null,
platform: null,
opsys: null,
branch: null,
buildid: null,
locale: null,
Sysconfig.prototype = {
product: null,
platform: null,
opsys: null,
branch: null,
buildid: null,
locale: null,
// set a field according to the following priorities:
// 1. 'setting'
// 2. qa.extension.sysconfig.fieldname
// 3. null
_load: function(fieldname, setting) {
if (this[fieldname]) { return }
if (setting) {
this[fieldname] = setting;
return;
}
var pref = qaPref.getPref(qaPref.prefBase+'.sysconfig.'+fieldname, 'char');
if (pref) {
this[fieldname] = pref;
return;
}
},
// set a field according to the following priorities:
// 1. 'setting'
// 2. qa.extension.sysconfig.fieldname
// 3. null
_load: function(fieldname, setting) {
if (this[fieldname]) { return }
if (setting) {
this[fieldname] = setting;
return;
}
var pref = qaPref.getPref(qaPref.prefBase+'.sysconfig.'+fieldname, 'char');
if (pref) {
this[fieldname] = pref;
return;
}
},
// if something cannot be autodetected, an exception is thrown
// with the name of the missing field
populate: function() {
var appinfo = Components.classes["@mozilla.org/xre/app-info;1"]
// if something cannot be autodetected, an exception is thrown
// with the name of the missing field
populate: function() {
var appinfo = Components.classes["@mozilla.org/xre/app-info;1"]
.getService(Components.interfaces.nsIXULAppInfo);
// build id:
this.buildid = appinfo.appBuildID;
if (! this.buildid) { throw "buildid" }
this.buildid = appinfo.appBuildID;
if (! this.buildid) { throw "buildid" }
// product:
if (! this.product) {
if (appinfo.ID == FIREFOX_ID) {
this.product = 'Firefox';
}
if (! this.product) { throw "product" }
if (appinfo.ID == FIREFOX_ID) {
this.product = 'Firefox';
}
if (! this.product) { throw "product" }
}
// branch:
// people switch branches, so we detect this even though it might
// already be set in a pref
if ((/^3\.0/).exec(appinfo.version)) {
this.branch = '3.0 Branch';
} else if ((/^2\.0/).exec(appinfo.version)) {
this.branch = '2.0 Branch';
} else if ((/^1\.5\./).exec(appinfo.version)) {
this.branch = '1.5 Branch';
}
if (! this.branch) { throw "branch" }
if ((/^3\.0/).exec(appinfo.version)) {
this.branch = '3.0 Branch';
} else if ((/^2\.0/).exec(appinfo.version)) {
this.branch = '2.0 Branch';
} else if ((/^1\.5\./).exec(appinfo.version)) {
this.branch = '1.5 Branch';
}
if (! this.branch) { throw "branch" }
// platform:
if (! this.platform) {
if ((/^MacPPC/).exec(navigator.platform)) {
this.platform = 'Mac (PPC)';
} else if ((/^MacIntel/).exec(navigator.platform)) {
this.platform = 'Mac (Intel)';
} else if ((/^Win/).exec(navigator.platform)) {
this.platform = 'Windows';
} else if ((/^Linux/).exec(navigator.platform)) {
this.platform = 'Linux';
} else if ((/^Solaris/).exec(navigator.platform)) {
this.platform = 'Solaris';
}
if (! this.platform) { throw "platform" }
if ((/^MacPPC/).exec(navigator.platform)) {
this.platform = 'Mac (PPC)';
} else if ((/^MacIntel/).exec(navigator.platform)) {
this.platform = 'Mac (Intel)';
} else if ((/^Win/).exec(navigator.platform)) {
this.platform = 'Windows';
} else if ((/^Linux/).exec(navigator.platform)) {
this.platform = 'Linux';
} else if ((/^Solaris/).exec(navigator.platform)) {
this.platform = 'Solaris';
}
if (! this.platform) { throw "platform" }
}
// opsys
if (this.platform == 'Windows') {
switch (navigator.oscpu) {
case 'Windows NT 5.1':
this.opsys = 'Windows XP';
break;
case 'Windows NT 5.2':
this.opsys = 'Windows XP';
break;
case 'Windows NT 6.0':
this.opsys = 'Windows Vista';
break;
case 'Windows NT 5.0':
this.opsys = 'Windows 2000';
break;
case 'Win 9x 4.90':
this.opsys = 'Windows ME';
break;
case 'Win98':
this.opsys = 'Windows 98';
break;
}
switch (navigator.oscpu) {
case 'Windows NT 5.1':
this.opsys = 'Windows XP';
break;
case 'Windows NT 5.2':
this.opsys = 'Windows XP';
break;
case 'Windows NT 6.0':
this.opsys = 'Windows Vista';
break;
case 'Windows NT 5.0':
this.opsys = 'Windows 2000';
break;
case 'Win 9x 4.90':
this.opsys = 'Windows ME';
break;
case 'Win98':
this.opsys = 'Windows 98';
break;
}
} else if (this.platform == 'Linux') {
this.opsys = 'Linux';
this.opsys = 'Linux';
} else if (this.platform == 'Mac (PPC)' || this.platform == 'Mac (Intel)') {
// no way to detect the OS on mac, so just assume
// it's 10.4. The user can provide the real OS in setup
this.opsys = 'Mac OS 10.4';
// no way to detect the OS on mac, so just assume
// it's 10.4. The user can provide the real OS in setup
this.opsys = 'Mac OS 10.4';
}
if (! this.opsys) {throw "opsys" }
// locale
this.locale = navigator.language;
if (!this.locale) { throw "locale" }
},
this.locale = navigator.language;
if (!this.locale) { throw "locale" }
}
};

Просмотреть файл

@ -1,40 +1,38 @@
// ***** BEGIN LICENSE BLOCK *****
// Version: MPL 1.1/GPL 2.0/LGPL 2.1
//
// The contents of this file are subject to the Mozilla Public License Version
// 1.1 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
//
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
// for the specific language governing rights and limitations under the
// License.
//
// The Original Code is Litmus.
//
// The Initial Developer of the Original Code is
// The Mozilla Corporation.
// Portions created by the Initial Developer are Copyright (C) 2006
// the Initial Developer. All Rights Reserved.
//
// Contributor(s):
// Zach Lipton <zach@zachlipton.com> (Original author)
//
// Alternatively, the contents of this file may be used under the terms of
// either the GNU General Public License Version 2 or later (the "GPL"), or
// the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
// in which case the provisions of the GPL or the LGPL are applicable instead
// of those above. If you wish to allow use of your version of this file only
// under the terms of either the GPL or the LGPL, and not to allow others to
// use your version of this file under the terms of the MPL, indicate your
// decision by deleting the provisions above and replace them with the notice
// and other provisions required by the GPL or the LGPL. If you do not delete
// the provisions above, a recipient may use your version of this file under
// the terms of any one of the MPL, the GPL or the LGPL.
//
// ***** END LICENSE BLOCK *****
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla Community QA Extension
*
* The Initial Developer of the Original Code is the Mozilla Corporation.
* Portions created by the Initial Developer are Copyright (C) 2007
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Zach Lipton <zach@zachlipton.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
// Generate XML result data and submit it to Litmus
// Note that this is essentially a direct port of the Test::Litmus perl
@ -50,94 +48,94 @@ const VERSION = '0.0.2';
* Result constructor.
*
* @param machinename
* (optional)
* The name of the machine running the tests
* (optional)
* The name of the machine running the tests
* @param username
* Username of the account submitting results
* Username of the account submitting results
* @param password
* Authentication token to be sent to the Litmus server
* @param server
* (optional)
* The server to send results to
* The server to send results to
*/
function LitmusResults(a) {
this.machinename = a.machinename || '';
this.requireField('username', a);
this.requireField('password', a);
this.server = a.server || 'http://litmus.mozilla.org/process_test.cgi';
this.action = 'submit';
this.machinename = a.machinename || '';
this.requireField('username', a);
this.requireField('password', a);
this.server = a.server || 'http://litmus.mozilla.org/process_test.cgi';
this.action = 'submit';
this.results = new Array();
this.logs = new Array();
this.results = new Array();
this.logs = new Array();
}
LitmusResults.prototype = {
// add fieldname to this unless it's missing, at which point we throw an
// exception to the caller
requireField : function (name, args) {
if (args[name] === undefined) {
throw "Missing required field in Litmus result submission: "+name;
}
this[name] = args[name];
},
sysconfig : function (a) {
this.requireField('product', a);
this.requireField('platform', a);
this.requireField('opsys', a);
this.requireField('branch', a);
this.requireField('buildid', a);
this.requireField('locale', a);
this.buildtype = a.buildtype;
},
addLog : function(log) {
this.logs.push(log);
},
addResult : function(result) {
this.results.push(result);
},
toXML : function() {
var d = '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'+"\n";
d += '<!DOCTYPE litmusresults PUBLIC' +
// add fieldname to this unless it's missing, at which point we throw an
// exception to the caller
requireField : function (name, args) {
if (args[name] === undefined) {
throw "Missing required field in Litmus result submission: "+name;
}
this[name] = args[name];
},
sysconfig : function (a) {
this.requireField('product', a);
this.requireField('platform', a);
this.requireField('opsys', a);
this.requireField('branch', a);
this.requireField('buildid', a);
this.requireField('locale', a);
this.buildtype = a.buildtype;
},
addLog : function(log) {
this.logs.push(log);
},
addResult : function(result) {
this.results.push(result);
},
toXML : function() {
var d = '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'+"\n";
d += '<!DOCTYPE litmusresults PUBLIC' +
' "-//Mozilla Corporation//Litmus Result Submission DTD//EN/"' +
' "http://litmus.mozilla.org/litmus_results.dtd">'+"\n";
d += '<litmusresults action="'+this.action+'" useragent="'+
'litmusReporter.js/'+VERSION+' ('+this.machinename+')" '+
(this.machinename ? 'machinename="'+this.machinename+'">' : '>') +"\n";
d += ' <testresults username="'+this.username+'"'+"\n";
d += ' authtoken="'+this.password+'"'+"\n";
d += ' product="'+this.product+'"'+"\n";
d += ' platform="'+this.platform+'"'+"\n";
d += ' opsys="'+this.opsys+'"'+"\n";
d += ' branch="'+this.branch+'"'+"\n";
d += ' buildid="'+this.buildid+'"'+"\n";
d += ' locale="'+this.locale+'"';
if (this.buildtype) {
d += "\n"+' buildtype="'+this.buildtype+'"'+">\n";
} else {
d += ">\n";
}
if (this.logs) {
if (this.logs instanceof Array) {
for(var i=0; i<this.logs.length; i++) {
if (this.logs[i] instanceof Log) {
d += this.logs[i].toXML();
}
}
} else {
if (this.logs instanceof Log) {
d += this.logs.toXML();
}
}
}
if (this.results) {
for(var i=0; i<this.results.length; i++) {
d += this.results[i].toXML();
}
}
d += ' </testresults>'+"\n";
d += '</litmusresults>'+"\n";
return d;
},
d += '<litmusresults action="'+this.action+'" useragent="'+
'litmusReporter.js/'+VERSION+' ('+this.machinename+')" '+
(this.machinename ? 'machinename="'+this.machinename+'">' : '>') +"\n";
d += ' <testresults username="'+this.username+'"'+"\n";
d += ' authtoken="'+this.password+'"'+"\n";
d += ' product="'+this.product+'"'+"\n";
d += ' platform="'+this.platform+'"'+"\n";
d += ' opsys="'+this.opsys+'"'+"\n";
d += ' branch="'+this.branch+'"'+"\n";
d += ' buildid="'+this.buildid+'"'+"\n";
d += ' locale="'+this.locale+'"';
if (this.buildtype) {
d += "\n"+' buildtype="'+this.buildtype+'"'+">\n";
} else {
d += ">\n";
}
if (this.logs) {
if (this.logs instanceof Array) {
for(var i=0; i<this.logs.length; i++) {
if (this.logs[i] instanceof Log) {
d += this.logs[i].toXML();
}
}
} else {
if (this.logs instanceof Log) {
d += this.logs.toXML();
}
}
}
if (this.results) {
for(var i=0; i<this.results.length; i++) {
d += this.results[i].toXML();
}
}
d += ' </testresults>'+"\n";
d += '</litmusresults>'+"\n";
return d;
}
};
/**
@ -149,25 +147,25 @@ LitmusResults.prototype = {
* The log data to submit
*/
function Log(a) {
this.requireField('type', a);
this.requireField('data', a);
this.requireField('type', a);
this.requireField('data', a);
}
Log.prototype = {
type: null,
data: null,
requireField : function (name, args) {
if (args[name] === undefined) {
throw "Missing required field in Litmus result submission: "+name;
}
this[name] = args[name];
},
toXML : function () {
var d = '<log logtype="'+this.type+'">'+"\n";
d += ' <![CDATA['+this.data+']]>'+"\n";
d += '</log>'+"\n";
return d;
},
type: null,
data: null,
requireField : function (name, args) {
if (args[name] === undefined) {
throw "Missing required field in Litmus result submission: "+name;
}
this[name] = args[name];
},
toXML : function () {
var d = '<log logtype="'+this.type+'">'+"\n";
d += ' <![CDATA['+this.data+']]>'+"\n";
d += '</log>'+"\n";
return d;
}
};
/**
@ -175,67 +173,67 @@ Log.prototype = {
*
*/
function Result(a) {
this.requireField('testid', a);
this.requireField('resultstatus', a);
this.requireField('exitstatus', a);
this.requireField('duration', a);
this.requireField('testid', a);
this.requireField('resultstatus', a);
this.requireField('exitstatus', a);
this.requireField('duration', a);
// if no timestamp specified, use the current time
if (a.timestamp) { this.timestamp = a.timestamp; }
else {
var d = new Date();
this.timestamp=''+d.getFullYear()+leadZero((d.getMonth()+1))+
leadZero(d.getDate())+leadZero(d.getHours())+leadZero(d.getMinutes())+
leadZero(d.getSeconds());
}
// if no timestamp specified, use the current time
if (a.timestamp) { this.timestamp = a.timestamp; }
else {
var d = new Date();
this.timestamp=''+d.getFullYear()+leadZero((d.getMonth()+1))+
leadZero(d.getDate())+leadZero(d.getHours())+leadZero(d.getMinutes())+
leadZero(d.getSeconds());
}
this.comment = a.comment;
this.bugnumber = a.bugnumber;
this.logs = a.log;
this.automated = a.isAutomatedResult ? a.isAutomatedResult : 1;
}
this.comment = a.comment;
this.bugnumber = a.bugnumber;
this.logs = a.log;
this.automated = a.isAutomatedResult ? a.isAutomatedResult : 1;
}
Result.prototype = {
requireField : function (name, args) {
if (args[name] === undefined) {
throw "Missing required field in Litmus result submission: "+name;
}
this[name] = args[name];
},
toXML : function() {
var d = '<result testid="'+this.testid+'"'+"\n";
d += ' is_automated_result="'+this.automated+'"'+"\n";
d += ' resultstatus="'+this.resultstatus+'"'+"\n";
d += ' exitstatus="'+this.exitstatus+'"'+"\n";
d += ' duration="'+this.duration+'"'+"\n";
d += ' timestamp="'+this.timestamp+'">'+"\n";
Result.prototype = {
requireField : function (name, args) {
if (args[name] === undefined) {
throw "Missing required field in Litmus result submission: "+name;
}
this[name] = args[name];
},
toXML : function() {
var d = '<result testid="'+this.testid+'"'+"\n";
d += ' is_automated_result="'+this.automated+'"'+"\n";
d += ' resultstatus="'+this.resultstatus+'"'+"\n";
d += ' exitstatus="'+this.exitstatus+'"'+"\n";
d += ' duration="'+this.duration+'"'+"\n";
d += ' timestamp="'+this.timestamp+'">'+"\n";
if (this.comment) {
d += ' <comment>'+this.comment+'</comment>'+"\n";
}
if (this.comment) {
d += ' <comment>'+this.comment+'</comment>'+"\n";
}
if (this.bugnumber) {
d += ' <bugnumber>'+this.bugnumber+'</bugnumber>'+"\n";
}
if (this.logs) {
if (this.logs instanceof Array) {
for(var i=0; i<this.logs.length; i++) {
if (this.logs[i] instanceof Log) {
d += this.logs[i].toXML();
}
}
} else {
if (this.logs instanceof Log) {
d += this.logs.toXML();
}
}
}
d += '</result>'+"\n";
return d;
},
if (this.bugnumber) {
d += ' <bugnumber>'+this.bugnumber+'</bugnumber>'+"\n";
}
if (this.logs) {
if (this.logs instanceof Array) {
for(var i=0; i<this.logs.length; i++) {
if (this.logs[i] instanceof Log) {
d += this.logs[i].toXML();
}
}
} else {
if (this.logs instanceof Log) {
d += this.logs.toXML();
}
}
}
d += '</result>'+"\n";
return d;
}
};
function leadZero(num) {
if (num.toString().length == 1) { return '0'+num }
return num;
if (num.toString().length == 1) { return '0'+num }
return num;
}

Просмотреть файл

@ -36,105 +36,105 @@
document.addEventListener('load', function() {
window.setInterval(qaNotifications.updateNotificationStore(), 3600000);
window.setInterval(qaNotifications.updateNotificationStore(), 3600000);
}, false)
var qaNotifications = {
storageService : Components.classes["@mozilla.org/storage/service;1"]
storageService : Components.classes["@mozilla.org/storage/service;1"]
.getService(Ci.mozIStorageService),
dbHandle : null,
dbHandle : null,
openDatabase : function() {
var file = Cc["@mozilla.org/file/directory_service;1"]
openDatabase : function() {
var file = Cc["@mozilla.org/file/directory_service;1"]
.getService(Ci.nsIProperties)
.get("ProfD", Ci.nsIFile);
file.append("mozqa.sqlite");
this.dbHandle = this.storageService.openDatabase(file);
this.createNotificationTable();
},
file.append("mozqa.sqlite");
this.dbHandle = this.storageService.openDatabase(file);
this.createNotificationTable();
},
closeDatabase : function() {
// there's no way to actually close a database, but setting
// the db reference to null will cause the db handle to become
// elegible for GC which is about as good as it gets
dbHandle = null;
},
closeDatabase : function() {
// there's no way to actually close a database, but setting
// the db reference to null will cause the db handle to become
// elegible for GC which is about as good as it gets
dbHandle = null;
},
createNotificationTable : function() {
this.db.executeSimpleSQL("CREATE TABLE if not exists notifications ( \
id text, \
datetime integer, \
firstNotification integer, \
secondNotification integer, \
serializedJSData string)");
},
createNotificationTable : function() {
this.db.executeSimpleSQL("CREATE TABLE if not exists notifications ( \
id text, \
datetime integer, \
firstNotification integer, \
secondNotification integer, \
serializedJSData string)");
},
updateNotificationStore : function() {
var req = new XMLHttpRequest();
var url = qaPref.getPref('qa.extension.hermes.url', 'char');
req.open('GET', url, true);
req.onreadystatechange = function(evt) {
if (req.readyState == 4 && req.status == 200) {
if (req.responseXML.getElementsByTagName('notifications') == null)
return;
var notifs = req.responseXML.getElementsByTagName('notification');
for (var i=0; i<notifs.length; i++) {
var notif = notifs[i];
notif = new Notification('xml', notif);
notif.serializeToDb();
}
}
};
req.send(null);
},
updateNotificationStore : function() {
var req = new XMLHttpRequest();
var url = qaPref.getPref('qa.extension.hermes.url', 'char');
req.open('GET', url, true);
req.onreadystatechange = function(evt) {
if (req.readyState == 4 && req.status == 200) {
if (req.responseXML.getElementsByTagName('notifications') == null)
return;
var notifs = req.responseXML.getElementsByTagName('notification');
for (var i=0; i<notifs.length; i++) {
var notif = notifs[i];
notif = new Notification('xml', notif);
notif.serializeToDb();
}
}
};
req.send(null);
},
checkNotificationStatus : function() {
// see if we are elegible for notification:
var time = qaPref.getPref(qaPref.prefBase+'.lastNotificationCheckTime', 'int');
var interval = qaPref.getPref(qaPref.prefBase+'.minNotificationCheckInterval', 'int');
if (time + interval > new Date().valueOf())
return; // nothing to see here, try again later
checkNotificationStatus : function() {
// see if we are elegible for notification:
var time = qaPref.getPref(qaPref.prefBase+'.lastNotificationCheckTime', 'int');
var interval = qaPref.getPref(qaPref.prefBase+'.minNotificationCheckInterval', 'int');
if (time + interval > new Date().valueOf())
return; // nothing to see here, try again later
var sth = this.db.createStatement("SELECT * FROM notifications");
var notifications = [];
try {
while (sth.executeStep()) {
notifications.push(new Notification('json', MochiKit.Base.evalJSON(
sth.getString(4))));
}
} finally {
sth.reset();
}
var sth = this.db.createStatement("SELECT * FROM notifications");
var notifications = [];
try {
while (sth.executeStep()) {
notifications.push(new Notification('json', MochiKit.Base.evalJSON(
sth.getString(4))));
}
} finally {
sth.reset();
}
if (notifications[0] && notifications[0].okToShow() == true) {
notifications[0].displayToBox();
$('qa-notify').removeAttribute('hidden');
}
// reset the interval timer
qaPref.setPref(qaPref.prefBase+'.lastNotificationCheckTime', new Date().valueOf(), 'int');
},
if (notifications[0] && notifications[0].okToShow() == true) {
notifications[0].displayToBox();
$('qa-notify').removeAttribute('hidden');
}
// reset the interval timer
qaPref.setPref(qaPref.prefBase+'.lastNotificationCheckTime', new Date().valueOf(), 'int');
},
showHideNotify: function(bool) {
var notify = $('qa-notify');
if (bool == true) {
notify.removeAttribute("hidden");
} else {
notify.setAttribute("hidden", "true");
}
},
showHideNotify: function(bool) {
var notify = $('qa-notify');
if (bool == true) {
notify.removeAttribute("hidden");
} else {
notify.setAttribute("hidden", "true");
}
},
getNotificationSettings : function(bool) {
var prefs = qaPref.getPref(qaPref.prefBase+'.notificationSettings', 'char');
return prefs.split(",");
},
getNotificationSettings : function(bool) {
var prefs = qaPref.getPref(qaPref.prefBase+'.notificationSettings', 'char');
return prefs.split(",");
},
};
qaNotifications.__defineGetter__('db', function() {
if (this.dbHandle != null)
return this.dbHandle;
else {
this.openDatabase();
return this.dbHandle;
}
if (this.dbHandle != null)
return this.dbHandle;
else {
this.openDatabase();
return this.dbHandle;
}
});
function Notification() {
@ -142,133 +142,133 @@ function Notification() {
}
function Notification(type, data) {
if (type == 'json') {
this.id = data.id;
this.notificationClass = data.notificationClass;
this.type = data.type;
this.headline = data.headline;
this.datetime = MochiKit.DateTime.isoTimestamp(data.datetime);
this.place = data.place;
this.infotext = data.infotext;
this.infolinktext = data.infolinktext;
this.infolinkhref = data.infolinkhref;
this.golinktext = data.golinktext;
this.golinkhref = data.golinkhref;
} else if (type == 'xml') {
var notif = data;
this.id = notif.getAttribute('id');
this.notificationClass = notif.getAttribute('class');
this.type = notif.getAttribute('type');
if (notif.getElementsByTagName('headline')[0] != null)
this.headline = notif.getElementsByTagName('headline')[0].textContent;
if (type == 'json') {
this.id = data.id;
this.notificationClass = data.notificationClass;
this.type = data.type;
this.headline = data.headline;
this.datetime = MochiKit.DateTime.isoTimestamp(data.datetime);
this.place = data.place;
this.infotext = data.infotext;
this.infolinktext = data.infolinktext;
this.infolinkhref = data.infolinkhref;
this.golinktext = data.golinktext;
this.golinkhref = data.golinkhref;
} else if (type == 'xml') {
var notif = data;
this.id = notif.getAttribute('id');
this.notificationClass = notif.getAttribute('class');
this.type = notif.getAttribute('type');
if (notif.getElementsByTagName('headline')[0] != null)
this.headline = notif.getElementsByTagName('headline')[0].textContent;
// eventinfo
if (this.notificationClass == 'event') {
var eventInfo = notif.getElementsByTagName('eventinfo')[0];
this.datetime = MochiKit.DateTime.isoTimestamp(
eventInfo.getElementsByTagName('datetime')[0].textContent);
this.place = eventInfo.getElementsByTagName('place')[0].textContent;
}
this.infotext = notif.getElementsByTagName('infotext')[0].textContent;
this.infolinktext = notif.getElementsByTagName('infolink')[0].textContent;
this.infolinkhref = notif.getElementsByTagName('infolink')[0]
.getAttribute('href');
this.golinktext = notif.getElementsByTagName('golink')[0].textContent;
this.golinkhref = notif.getElementsByTagName('golink')[0]
.getAttribute('href');
}
// eventinfo
if (this.notificationClass == 'event') {
var eventInfo = notif.getElementsByTagName('eventinfo')[0];
this.datetime = MochiKit.DateTime.isoTimestamp(
eventInfo.getElementsByTagName('datetime')[0].textContent);
this.place = eventInfo.getElementsByTagName('place')[0].textContent;
}
this.infotext = notif.getElementsByTagName('infotext')[0].textContent;
this.infolinktext = notif.getElementsByTagName('infolink')[0].textContent;
this.infolinkhref = notif.getElementsByTagName('infolink')[0]
.getAttribute('href');
this.golinktext = notif.getElementsByTagName('golink')[0].textContent;
this.golinkhref = notif.getElementsByTagName('golink')[0]
.getAttribute('href');
}
}
Notification.prototype = {
id : null,
notificationClass : null,
type : null,
headline : null,
datetime : null,
place : null,
infotext : null,
infolinktext : null,
infolinkhref : null,
golinktext : null,
golinkhref : null,
id : null,
notificationClass : null,
type : null,
headline : null,
datetime : null,
place : null,
infotext : null,
infolinktext : null,
infolinkhref : null,
golinktext : null,
golinkhref : null,
hasHadFirstNotification : false,
hasHadSecondNotification : false,
serializedJSData : null,
hasHadFirstNotification : false,
hasHadSecondNotification : false,
serializedJSData : null,
serializeToDb: function() {
var query = qaNotifications.db.createStatement("SELECT id FROM notifications \
WHERE id = ?1");
query.bindStringParameter(0, this.id);
var foundRow;
while (query.executeStep()) {
foundRow = 1;
}
query.reset();
if (foundRow == 1) { // it's already been inserted, so update
return;
}
serializeToDb: function() {
var query = qaNotifications.db.createStatement("SELECT id FROM notifications \
WHERE id = ?1");
query.bindStringParameter(0, this.id);
var foundRow;
while (query.executeStep()) {
foundRow = 1;
}
query.reset();
if (foundRow == 1) { // it's already been inserted, so update
return;
}
var sth = qaNotifications.db.createStatement("INSERT into notifications \
values (?1, ?2, ?3, ?4, ?5)");
sth.bindStringParameter(0, this.id);
sth.bindStringParameter(1, this.datetime);
sth.bindStringParameter(2, this.hasHadFirstNotification);
sth.bindStringParameter(3, this.hasHadSecondNotification);
var sth = qaNotifications.db.createStatement("INSERT into notifications \
values (?1, ?2, ?3, ?4, ?5)");
sth.bindStringParameter(0, this.id);
sth.bindStringParameter(1, this.datetime);
sth.bindStringParameter(2, this.hasHadFirstNotification);
sth.bindStringParameter(3, this.hasHadSecondNotification);
// avoid having serialized data inside serialized data:
this.serializedJSData = null;
var jsData = MochiKit.Base.serializeJSON(this);
sth.bindStringParameter(4, jsData);
// avoid having serialized data inside serialized data:
this.serializedJSData = null;
var jsData = MochiKit.Base.serializeJSON(this);
sth.bindStringParameter(4, jsData);
sth.execute();
},
displayToBox : function() {
$('qa-notify-header').value=this.headline;
sth.execute();
},
displayToBox : function() {
$('qa-notify-header').value=this.headline;
if ($('qa-notify-text').firstChild)
$('qa-notify-text').removeChild($('qa-notify-text').firstChild);
$('qa-notify-text').appendChild(document.createTextNode(this.infotext));
if ($('qa-notify-text').firstChild)
$('qa-notify-text').removeChild($('qa-notify-text').firstChild);
$('qa-notify-text').appendChild(document.createTextNode(this.infotext));
$('qa-notify-infolink').value=this.infolinktext;
$('qa-notify-infolink').href=this.infolinkhref;
$('qa-notify-infolink').style.display = '';
$('qa-notify-infolink').value=this.infolinktext;
$('qa-notify-infolink').href=this.infolinkhref;
$('qa-notify-infolink').style.display = '';
if (this.notificationClass == 'event') {
var inprogress = 0;
$('qa-notify-event-datetime').value=this.datetime;
$('qa-notify-event-place').value=this.place;
$('qa-notify-event').style.display = '';
$('qa-notify-inprogress').style.display = 'none';
if (this.notificationClass == 'event') {
var inprogress = 0;
$('qa-notify-event-datetime').value=this.datetime;
$('qa-notify-event-place').value=this.place;
$('qa-notify-event').style.display = '';
$('qa-notify-inprogress').style.display = 'none';
$('qa-notify-getstartedlink').value=this.golinktext;
$('qa-notify-getstartedlink').href=this.golinkhref;
$('qa-notify-getstartedlink').value=this.golinktext;
$('qa-notify-getstartedlink').href=this.golinkhref;
if (inprogress == 1) {
$('qa-notify-inprogress').style.display = '';
$('qa-notify-getstartedlink').style.display = '';
$('qa-notify-infolink').style.display = 'none';
}
}
},
okToShow : function() {
var prefs = qaNotifications.getNotificationSettings();
if (prefs[0] == '1') // all notifications disabled
return false;
if (this.type == 'testday' && ! prefs[1] == '0')
return true;
if (this.type == 'bugday' && ! prefs[2] == '0')
return true;
if (this.type == 'prerelease' && ! prefs[3] == '0')
return true;
if (this.type == 'news' && ! prefs[4] == '0')
return true;
if (this.type == 'newbuilds' && ! prefs[5] == '0')
return true;
if (this.type == 'special' && ! prefs[6] == '0')
return true;
if (inprogress == 1) {
$('qa-notify-inprogress').style.display = '';
$('qa-notify-getstartedlink').style.display = '';
$('qa-notify-infolink').style.display = 'none';
}
}
},
okToShow : function() {
var prefs = qaNotifications.getNotificationSettings();
if (prefs[0] == '1') // all notifications disabled
return false;
if (this.type == 'testday' && ! prefs[1] == '0')
return true;
if (this.type == 'bugday' && ! prefs[2] == '0')
return true;
if (this.type == 'prerelease' && ! prefs[3] == '0')
return true;
if (this.type == 'news' && ! prefs[4] == '0')
return true;
if (this.type == 'newbuilds' && ! prefs[5] == '0')
return true;
if (this.type == 'special' && ! prefs[6] == '0')
return true;
// catch all:
return false;
},
// catch all:
return false;
}
};

Просмотреть файл

@ -42,7 +42,7 @@ var qaPref = {
setPref : function(aName, aValue, aType) {
var pref = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
.getService(Components.interfaces.nsIPrefBranch);
try{
if(aType == "bool")
pref.setBoolPref(aName, aValue);
@ -57,7 +57,7 @@ var qaPref = {
getPref : function(aName, aType) {
var pref = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
.getService(Components.interfaces.nsIPrefBranch);
try{
var result;
if(aType == "bool")
@ -81,112 +81,112 @@ var qaPref = {
}
}
return null;
},
}
};
// public API:
// qaPref.litmus.getUsername()
// qaPref.litmus.getPassword()
// qaPref.litmus.setPassword()
// qaPref.litmus.getUsername()
// qaPref.litmus.getPassword()
// qaPref.litmus.setPassword()
// everything else is abstracted away to deal with fx2 vs fx3 changes
var CC_passwordManager = Components.classes["@mozilla.org/passwordmanager;1"];
var CC_loginManager = Components.classes["@mozilla.org/login-manager;1"];
if (CC_passwordManager != null) { // old-fashioned password manager
qaPref.litmus = {
passwordName : function() {return "mozqa-extension-litmus-"+litmus.baseURL},
if (CC_passwordManager != null) { // old-fashioned password manager
qaPref.litmus = {
passwordName : function() {return "mozqa-extension-litmus-"+litmus.baseURL},
manager : function() {
return Components.classes["@mozilla.org/passwordmanager;1"].
getService(Components.interfaces.nsIPasswordManager);
},
getPasswordObj : function() {
var m = this.manager();
var e = m.enumerator;
manager : function() {
return Components.classes["@mozilla.org/passwordmanager;1"].
getService(Components.interfaces.nsIPasswordManager);
},
getPasswordObj : function() {
var m = this.manager();
var e = m.enumerator;
// iterate through the PasswordManager service to find
// our password:
var password;
while(e.hasMoreElements()) {
try {
var pass = e.getNext().
QueryInterface(Components.interfaces.nsIPassword);
if (pass.host == this.passwordName()) {
password=pass; // found it
return password;
}
} catch (ex) { return false; }
}
if (!password) { return false; }
return password;
},
getUsername : function() {
var password = this.getPasswordObj();
try {
return password.user;
} catch (ex) { return false; }
},
getPassword : function() {
var password=this.getPasswordObj();
try {
return password.password;
} catch (ex) { return false; }
},
setPassword : function(username, password) {
var m = this.manager();
// check to see whether we already have a password stored
// for the current baseURL. If we do, remove it before adding
// any new passwords:
var p;
while (p = this.getPasswordObj()) {
m.removeUser(p.host, p.user);
}
m.addUser(this.passwordName(), username, password);
},
};
} else if (CC_loginManager != null) { // use the new login manager interface
qaPref.litmus = {
manager : function() {
return Components.classes["@mozilla.org/login-manager;1"]
.getService(Components.interfaces.nsILoginManager);
},
getUsername : function() {
var password = this.getPasswordObj();
try {
return password.username;
} catch (ex) { return false; }
},
getPassword : function() {
var password=this.getPasswordObj();
try {
return password.password;
} catch (ex) { return false; }
},
setPassword : function(username, password) {
// if we already have a password stored, remove it first:
var login = this.getPasswordObj();
if (login != false) {
this.manager().removeLogin(login);
}
// iterate through the PasswordManager service to find
// our password:
var password;
while(e.hasMoreElements()) {
try {
var pass = e.getNext().
QueryInterface(Components.interfaces.nsIPassword);
if (pass.host == this.passwordName()) {
password=pass; // found it
return password;
}
} catch (ex) { return false; }
}
if (!password) { return false; }
return password;
},
getUsername : function() {
var password = this.getPasswordObj();
try {
return password.user;
} catch (ex) { return false; }
},
getPassword : function() {
var password=this.getPasswordObj();
try {
return password.password;
} catch (ex) { return false; }
},
setPassword : function(username, password) {
var m = this.manager();
// check to see whether we already have a password stored
// for the current baseURL. If we do, remove it before adding
// any new passwords:
var p;
while (p = this.getPasswordObj()) {
m.removeUser(p.host, p.user);
}
m.addUser(this.passwordName(), username, password);
}
};
} else if (CC_loginManager != null) { // use the new login manager interface
qaPref.litmus = {
manager : function() {
return Components.classes["@mozilla.org/login-manager;1"]
.getService(Components.interfaces.nsILoginManager);
},
getUsername : function() {
var password = this.getPasswordObj();
try {
return password.username;
} catch (ex) { return false; }
},
getPassword : function() {
var password=this.getPasswordObj();
try {
return password.password;
} catch (ex) { return false; }
},
setPassword : function(username, password) {
// if we already have a password stored, remove it first:
var login = this.getPasswordObj();
if (login != false) {
this.manager().removeLogin(login);
}
var nsLoginInfo = new Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
var nsLoginInfo = new Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
Components.interfaces.nsILoginInfo,
"init");
var newLogin = new nsLoginInfo('chrome://qa', 'Litmus Login', litmus.baseURL,
username, password, null, null);
username, password, null, null);
this.manager().addLogin(newLogin);
},
getPasswordObj: function() {
try {
var logins = this.manager().findLogins({}, 'chrome://qa',
'Litmus Login', litmus.baseURL);
if (logins.length > 0 && logins[0] != null)
return logins[0];
return false;
} catch(ex) {
return false;
}
},
};
},
getPasswordObj: function() {
try {
var logins = this.manager().findLogins({}, 'chrome://qa',
'Litmus Login', litmus.baseURL);
if (logins.length > 0 && logins[0] != null)
return logins[0];
return false;
} catch(ex) {
return false;
}
}
};
}

Просмотреть файл

@ -36,34 +36,55 @@
var qaMain = {
htmlNS: "http://www.w3.org/1999/xhtml",
htmlNS: "http://www.w3.org/1999/xhtml",
openQATool : function() {
window.open("chrome://qa/content/qa.xul", "_blank", "chrome,all,dialog=no,resizable=no");
},
onToolOpen : function() {
if (qaPref.getPref(qaPref.prefBase+'.isFirstTime', 'bool') == true) {
window.open("chrome://qa/content/setup.xul", "_blank", "chrome,all,dialog=yes");
openQATool : function() {
window.open("chrome://qa/content/qa.xul", "_blank",
"chrome,all,dialog=no,resizable=no");
},
onToolOpen : function() {
if (qaPref.getPref(qaPref.prefBase+'.isFirstTime', 'bool') == true) {
window.open("chrome://qa/content/setup.xul", "_blank",
"chrome,all,dialog=yes");
}
if (qaPref.getPref(qaPref.prefBase + '.currentTestcase.testrunSummary', 'char') != null) {
if (qaPref.getPref(qaPref.prefBase + '.currentTestcase.testrunSummary', 'char') != null) {
litmus.readStateFromPref();
}
},
},
onSwitchTab : function() {
var newSelection = $('qa_tabrow').selectedItem;
// user is switching to the prefs tab:
if ($('qa_tabrow').selectedItem == $('qa-tabbar-prefs')) {
qaPrefsWindow.loadPrefsWindow();
} else if ($('qa_tabrow').selectedItem == $('qa-tabbar-bugzilla')) {
bugzilla.unhighlightTab();
}
// user is switching away from the prefs tab:
if (qaPrefsWindow.lastSelectedTab != null &&
qaPrefsWindow.lastSelectedTab == $('qa-tabbar-prefs')) {
qaPrefsWindow.savePrefsWindow();
}
qaPrefsWindow.lastSelectedTab = newSelection;
}
};
qaMain.__defineGetter__("bundle", function(){return $("bundle_qa");});
qaMain.__defineGetter__("urlbundle", function(){return $("bundle_urls");});
function $() {
var elements = new Array();
for (var i = 0; i < arguments.length; i++) {
var element = arguments[i];
if (typeof element == 'string')
element = document.getElementById(element);
for (var i = 0; i < arguments.length; i++) {
var element = arguments[i];
if (typeof element == 'string')
element = document.getElementById(element);
if (arguments.length == 1)
return element;
if (arguments.length == 1)
return element;
elements.push(element);
elements.push(element);
}
return elements;

Просмотреть файл

@ -1,39 +1,40 @@
<?xml version="1.0"?><!-- -*- Mode: HTML -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Mozilla Community QA Extension
#
# The Initial Developer of the Original Code is the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2007
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Zach Lipton <zach@zachlipton.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the LGPL or the GPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK ***** -->
- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is the Mozilla Community QA Extension
-
- The Initial Developer of the Original Code is the Mozilla Corporation.
- Portions created by the Initial Developer are Copyright (C) 2007
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Zach Lipton <zach@zachlipton.com>
- Ben Hsieh <ben.hsieh@gmail.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xml-stylesheet href="chrome://global/skin/browser.css" type="text/css"?>
@ -73,12 +74,23 @@
<script type="application/x-javascript" src="chrome://qa/content/litmus.js" />
<script type="application/x-javascript" src="chrome://qa/content/qa.js" />
<script type="application/x-javascript" src="chrome://qa/content/tabs/qmo.js" />
<script type="application/x-javascript" src="chrome://qa/content/tabs/bugzilla.js" />
<script type="application/x-javascript" src="chrome://qa/content/tabs/bugAccess.js" />
<script type="application/x-javascript">
// on load, set an event listener to deal with saving settings when
// changing tabs
window.addEventListener('load', function() {
$('qa_tabrow').addEventListener('select', qaMain.onSwitchTab, false);
}, false);
</script>
<tabbox id="qa_tabbox">
<tabs id="qa_tabrow">
<tab id="qa-tabbar-qmo" class="tabbrowser-tab" />
<tab label="&qa.litmus.title;" class="tabbrowser-tab" />
<tab label="&qa.bugzilla.title;" class="tabbrowser-tab" />
<tab label="&qa.bugzilla.title;" id="qa-tabbar-bugzilla" class="tabbrowser-tab" />
<tab label="&qa.chat.title;" class="tabbrowser-tab" />
<spacer id="qa-tabbar-spacer" />
<tab label="&qa.preferences.title;" id="qa-tabbar-prefs" class="tabbrowser-tab" />
@ -96,6 +108,4 @@
<tabpanel id="qa-tab-help"></tabpanel>
</tabpanels>
</tabbox>
</window>

Просмотреть файл

@ -19,6 +19,7 @@
*
* Contributor(s):
* Zach Lipton <zach@zachlipton.com>
* Ben Hsieh <ben.hsieh@gmail.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
@ -36,247 +37,234 @@
var qaPrefsWindow = {
lastSelectedTab : null,
lastSelectedTab : null,
onSwitchTab : function() {
var newSelection = $('qa_tabrow').selectedItem;
loadPrefsWindow : function() {
prefsTabOpen = true;
document.getElementById('qa-preferences-litmus-username').value =
qaPref.litmus.getUsername() || '';
document.getElementById('qa-preferences-litmus-password').value =
qaPref.litmus.getPassword() || '';
// user is switching to the prefs tab:
if ($('qa_tabrow').selectedItem == $('qa-tabbar-prefs')) {
qaPrefsWindow.loadPrefsWindow();
}
// load notification settings:
var prefs = qaPref.getPref(qaPref.prefBase+'.notificationSettings', 'char');
prefs = prefs.split(",");
var notify = $('qa-prefs-notify').childNodes;
var prefCounter = 0;
for (var i=0; i<notify.length; i++) {
if (notify[i].setChecked != null && notify[i].checked != null) { // it's a checkbox
if (prefs[prefCounter] == "1")
notify[i].checked = true;
else
notify[i].checked = false;
prefCounter++;
}
}
},
savePrefsWindow : function() {
// save notification settings
var notify = $('qa-prefs-notify').childNodes;
var prefs = '';
for (var i=0; i<notify.length; i++) {
if (notify[i].setChecked != null && (notify[i].checked == true
|| notify[i].checked == false)) { // it's a checkbox
if (notify[i].checked == false)
prefs += '0,';
else
prefs += '1,';
}
}
prefs = prefs.substring(0, prefs.length-1); // remove the trailing comma
qaPref.setPref(qaPref.prefBase+'.notificationSettings', prefs, 'char');
// user is switching away from the prefs tab:
if (qaPrefsWindow.lastSelectedTab != null &&
qaPrefsWindow.lastSelectedTab == $('qa-tabbar-prefs')) {
qaPrefsWindow.savePrefsWindow();
}
// save litmus account settings
var uname = document.getElementById('qa-preferences-litmus-username').value;
var passwd = document.getElementById('qa-preferences-litmus-password').value;
qaPrefsWindow.lastSelectedTab = newSelection;
},
// if uname and passwd are unchanged, we're done:
if (uname == qaPref.litmus.getUsername() &&
passwd == qaPref.litmus.getPassword())
return;
var callback = function(resp) {
if (resp.responseText == 0) {
alert(document.getElementById("bundle_qa").
getString("qa.extension.prefs.loginError"));
// snap the tab selection back to prefs:
$('qa_tabrow').selectedItem = $('qa-tabbar-prefs');
return false;
} else {
qaPref.litmus.setPassword(uname, passwd);
return true;
}
}
litmus.validateLogin(uname, passwd, callback);
return false; // not ready to close yet
},
loadUsernameAndPassword : function() {
var uname = document.getElementById('qa-preferences-litmus-username');
var passwd = document.getElementById('qa-preferences-litmus-password');
loadPrefsWindow : function() {
prefsTabOpen = true;
document.getElementById('qa-preferences-litmus-username').value =
qaPref.litmus.getUsername() || '';
document.getElementById('qa-preferences-litmus-password').value =
qaPref.litmus.getPassword() || '';
// load notification settings:
var prefs = qaPref.getPref(qaPref.prefBase+'.notificationSettings', 'char');
prefs = prefs.split(",");
var notify = $('qa-prefs-notify').childNodes;
var prefCounter = 0;
for (var i=0; i<notify.length; i++) {
if (notify[i].setChecked != null && notify[i].checked != null) { // it's a checkbox
if (prefs[prefCounter] == "1")
notify[i].checked = true;
else
notify[i].checked = false;
prefCounter++;
}
}
},
savePrefsWindow : function() {
// save notification settings
var notify = $('qa-prefs-notify').childNodes;
var prefs = '';
for (var i=0; i<notify.length; i++) {
if (notify[i].setChecked != null && (notify[i].checked == true
|| notify[i].checked == false)) { // it's a checkbox
if (notify[i].checked == false)
prefs += '0,';
else
prefs += '1,';
}
}
prefs = prefs.substring(0, prefs.length-1); // remove the trailing comma
qaPref.setPref(qaPref.prefBase+'.notificationSettings', prefs, 'char');
// save litmus account settings
var uname = document.getElementById('qa-preferences-litmus-username').value;
var passwd = document.getElementById('qa-preferences-litmus-password').value;
// if uname and passwd are unchanged, we're done:
if (uname == qaPref.litmus.getUsername() &&
passwd == qaPref.litmus.getPassword())
return;
var callback = function(resp) {
if (resp.responseText == 0) {
alert(document.getElementById("bundle_qa").
getString("qa.extension.prefs.loginError"));
// snap the tab selection back to prefs:
$('qa_tabrow').selectedItem = $('qa-tabbar-prefs');
return false;
} else {
qaPref.litmus.setPassword(uname, passwd);
return true;
}
}
litmus.validateLogin(uname, passwd, callback);
return false; // not ready to close yet
},
loadUsernameAndPassword : function() {
var uname = document.getElementById('qa-preferences-litmus-username');
var passwd = document.getElementById('qa-preferences-litmus-password');
uname.value = qaPref.litmus.getUsername();
passwd.value = qaPref.litmus.getPassword();
},
createAccount : function() {
window.openDialog("chrome://qa/content/accountcreate.xul", "_blank", "chrome,all,dialog=yes", qaPrefsWindow.loadUsernameAndPassword);
},
uname.value = qaPref.litmus.getUsername();
passwd.value = qaPref.litmus.getPassword();
},
createAccount : function() {
window.openDialog("chrome://qa/content/accountcreate.xul",
"_blank",
"chrome,all,dialog=yes",
qaPrefsWindow.loadUsernameAndPassword);
}
};
var qaSetup = {
didSubmitForm : 0,
didSubmitForm : 0,
hideAccountSettings : function() {
var accountyes = document.getElementById('qa-setup-accountyes');
var accountno = document.getElementById('qa-setup-accountno');
accountyes.style.display = 'none';
accountno.style.display = 'none';
},
loadAccountSettings : function() {
var uname = document.getElementById('username');
var passwd = document.getElementById('password');
uname.value = qaPref.litmus.getUsername() || '';
passwd.value = qaPref.litmus.getPassword() || '';
if (qaPref.litmus.getUsername()) {
document.getElementById("qa-setup-account-haveaccount").selectedIndex=1;
document.getElementById('qa-setup-accountyes').style.display = '';
}
document.getElementById('qa-setup-createaccount-iframe').src =
litmus.baseURL+'extension.cgi?createAccount=1';
},
hideAccountSettings : function() {
var accountyes = document.getElementById('qa-setup-accountyes');
var accountno = document.getElementById('qa-setup-accountno');
accountyes.style.display = 'none';
accountno.style.display = 'none';
},
loadAccountSettings : function() {
var uname = document.getElementById('username');
var passwd = document.getElementById('password');
uname.value = qaPref.litmus.getUsername() || '';
passwd.value = qaPref.litmus.getPassword() || '';
if (qaPref.litmus.getUsername()) {
document.getElementById("qa-setup-account-haveaccount").selectedIndex=1;
document.getElementById('qa-setup-accountyes').style.display = '';
}
document.getElementById('qa-setup-createaccount-iframe').src =
litmus.baseURL+'extension.cgi?createAccount=1';
},
accountSetting : function(yesno) {
var accountyes = document.getElementById('qa-setup-accountyes');
var accountno = document.getElementById('qa-setup-accountno');
qaSetup.hideAccountSettings();
if (yesno == '0') {
accountno.style.display = '';
} else {
accountyes.style.display = '';
}
},
validateAccount : function() {
if (document.getElementById('qa-setup-accountno').style.display == '') {
// we're creating a new account, so get the uname and passwd
// from the account created page:
var page = document.getElementById('qa-setup-createaccount-iframe').
contentDocument;
if (!page) {
alert("create account page is missing");
return false;
}
if (page.wrappedJSObject == null)
page.wrappedJSObject = page;
if (page.forms[0] && page.forms[0].wrappedJSObject == null)
page.forms[0].wrappedJSObject = page.forms[0];
accountSetting : function(yesno) {
var accountyes = document.getElementById('qa-setup-accountyes');
var accountno = document.getElementById('qa-setup-accountno');
qaSetup.hideAccountSettings();
if (yesno == '0') {
accountno.style.display = '';
} else {
accountyes.style.display = '';
}
},
retrieveAccount : function(frameid, loadingid) {
var page = document.getElementById(frameid).contentDocument;
if (!page) {
alert("create account page is missing");
return false;
}
if (page.wrappedJSObject == null)
page.wrappedJSObject = page;
if (page.forms[0] && page.forms[0].wrappedJSObject == null)
page.forms[0].wrappedJSObject = page.forms[0];
if (page.location == litmus.baseURL+'extension.cgi?createAccount=1'
&& qaSetup.didSubmitForm==0) {
document.getElementById('qa-setup-accountconfirmloading').value =
document.getElementById("bundle_qa").getString("qa.extension.prefs.loadingMsg");
page.forms[0].wrappedJSObject.submit();
qaSetup.didSubmitForm = 1;
setTimeout("qaSetup.validateAccount()", 5000);
return false;
}
if (qaSetup.didSubmitForm == 1 && ! page.forms ||
! page.forms[0].wrappedJSObject ||
! page.forms[0].wrappedJSObject.email &&
! page.forms[0].wrappedJSObject.email.value)
{qaSetup.didSubmitForm = 2;
setTimeout("qaSetup.validateAccount()", 4000);
return false;}
var e = '';
var p = '';
if (page.forms && page.forms[0].wrappedJSObject &&
page.forms[0].wrappedJSObject.email &&
page.forms[0].wrappedJSObject.email.value)
{ e=page.forms[0].wrappedJSObject.email.value }
if (page.forms && page.forms[0].wrappedJSObject &&
page.forms[0].wrappedJSObject.password &&
page.forms[0].wrappedJSObject.password.value)
{ p=page.forms[0].wrappedJSObject.password.value }
document.getElementById('username').value = e;
document.getElementById('password').value = p;
}
if (loadingid && page.location == litmus.baseURL+'extension.cgi?createAccount=1'
&& qaSetup.didSubmitForm==0) {
document.getElementById('loadingid').value =
document.getElementById("bundle_qa").getString("qa.extension.prefs.loadingMsg");
page.forms[0].wrappedJSObject.submit();
qaSetup.didSubmitForm = 1;
setTimeout("qaSetup.validateAccount()", 5000);
return false;
}
if (qaSetup.didSubmitForm == 1 && ! page.forms ||
! page.forms[0].wrappedJSObject ||
! page.forms[0].wrappedJSObject.email &&
! page.forms[0].wrappedJSObject.email.value)
{qaSetup.didSubmitForm = 2;
setTimeout("qaSetup.validateAccount()", 4000);
return false;}
var e = '';
var p = '';
if (page.forms && page.forms[0].wrappedJSObject &&
page.forms[0].wrappedJSObject.email &&
page.forms[0].wrappedJSObject.email.value)
{ e=page.forms[0].wrappedJSObject.email.value }
if (page.forms && page.forms[0].wrappedJSObject &&
page.forms[0].wrappedJSObject.password &&
page.forms[0].wrappedJSObject.password.value)
{ p=page.forms[0].wrappedJSObject.password.value }
document.getElementById('qa-setup-accountconfirmloading').value =
document.getElementById("bundle_qa").getString("qa.extension.prefs.loadingMsg");
return { name : e, password : p};
},
validateAccount : function() {
if (document.getElementById('qa-setup-accountno').style.display == '') {
var account = qaSetup.retrieveAccount("qa-setup-createaccount-iframe", "qa-setup-accountconfirmloading");
document.getElementById('username').value = account.name;
document.getElementById('password').value = account.password;
}
var uname = document.getElementById('username').value;
var passwd = document.getElementById('password').value;
document.getElementById('qa-setup-accountconfirmloading').value =
document.getElementById("bundle_qa").getString("qa.extension.prefs.loadingMsg");
var callback = function(resp) {
if (resp.responseText != 1) { // failure
alert(document.getElementById("bundle_qa").
getString("qa.extension.prefs.loginError"));
document.getElementById('qa-setup-accountconfirmloading').value = null;
return false;
} else { // all's well
qaPref.litmus.setPassword(uname, passwd);
document.getElementById('qa-setup-accountconfirmloading').value = null;
document.getElementById('qa-setup').pageIndex++; // advance
return true;
}
}
litmus.validateLogin(uname, passwd, callback);
return false; // not ready to advance yet
},
var uname = document.getElementById('username').value;
var passwd = document.getElementById('password').value;
loadSysconfig : function() {
$('qa-setup-sysconfig-loading').value =
$("bundle_qa").getString("qa.extension.sysconfig.loadingMsg");
var callback = function(resp) {
if (resp.responseText != 1) { // failure
alert(document.getElementById("bundle_qa").
getString("qa.extension.prefs.loginError"));
document.getElementById('qa-setup-accountconfirmloading').value = null;
return false;
} else { // all's well
qaPref.litmus.setPassword(uname, passwd);
document.getElementById('qa-setup-accountconfirmloading').value = null;
document.getElementById('qa-setup').pageIndex++; // advance
return true;
}
}
litmus.validateLogin(uname, passwd, callback);
return false; // not ready to advance yet
},
var guessInfo = function() {
var sysconfig;
try {
sysconfig = new Sysconfig();
} catch (ex) {}
var platItems = $('qa-setup-platform').menupopup.childNodes;
for (var i=0; i<platItems.length; i++) {
if (sysconfig.platform && platItems[i].label == sysconfig.platform)
$('qa-setup-platform').selectedIndex = i;
}
var opsysItems = $('qa-setup-opsys').menupopup.childNodes;
for (var i=0; i<opsysItems.length; i++) {
if (sysconfig.opsys && opsysItems[i].label == sysconfig.opsys)
$('qa-setup-opsys').selectedIndex = i;
}
$('qa-setup-sysconfig-loading').value = '';
};
loadSysconfig : function() {
$('qa-setup-sysconfig-loading').value =
$("bundle_qa").getString("qa.extension.sysconfig.loadingMsg");
qaTools.loadJsonMenu(litmus.baseURL+"/json.cgi?platforms=1",
$('qa-setup-platform'), 'name', 'name');
qaTools.loadJsonMenu(litmus.baseURL+"/json.cgi?opsyses=1",
$('qa-setup-opsys'), 'name', 'name', guessInfo);
},
var guessInfo = function() {
var sysconfig;
try {
sysconfig = new Sysconfig();
} catch (ex) {}
var platItems = $('qa-setup-platform').menupopup.childNodes;
for (var i=0; i<platItems.length; i++) {
if (sysconfig.platform && platItems[i].label == sysconfig.platform)
$('qa-setup-platform').selectedIndex = i;
}
var opsysItems = $('qa-setup-opsys').menupopup.childNodes;
for (var i=0; i<opsysItems.length; i++) {
if (sysconfig.opsys && opsysItems[i].label == sysconfig.opsys)
$('qa-setup-opsys').selectedIndex = i;
}
$('qa-setup-sysconfig-loading').value = '';
};
validateSysconfig : function() {
var sysconfig;
try {
sysconfig = new Sysconfig();
} catch (ex) {}
qaTools.loadJsonMenu(litmus.baseURL+"/json.cgi?platforms=1",
$('qa-setup-platform'), 'name', 'name');
qaTools.loadJsonMenu(litmus.baseURL+"/json.cgi?opsyses=1",
$('qa-setup-opsys'), 'name', 'name', guessInfo);
},
// only set prefs for things which differ from the automatically
// detected sysconfig for forward-compatibility
if (! sysconfig.platform == $('qa-setup-platform').selectedItem.label) {
qaPref.setPref(qaPref.prefBase+'.sysconfig.platform',
$('qa-setup-platform').selectedItem.label, 'char');
}
if (! sysconfig.opsys == $('qa-setup-opsys').selectedItem.label) {
qaPref.setPref(qaPref.prefBase+'.sysconfig.opsys',
$('qa-setup-opsys').selectedItem.label, 'char');
}
return true;
},
validateSysconfig : function() {
var sysconfig;
try {
sysconfig = new Sysconfig();
} catch (ex) {}
finish : function() {
qaPref.setPref(qaPref.prefBase+'.isFirstTime', false, 'bool');
},
// only set prefs for things which differ from the automatically
// detected sysconfig for forward-compatibility
if (! sysconfig.platform == $('qa-setup-platform').selectedItem.label) {
qaPref.setPref(qaPref.prefBase+'.sysconfig.platform',
$('qa-setup-platform').selectedItem.label, 'char');
}
if (! sysconfig.opsys == $('qa-setup-opsys').selectedItem.label) {
qaPref.setPref(qaPref.prefBase+'.sysconfig.opsys',
$('qa-setup-opsys').selectedItem.label, 'char');
}
return true;
},
finish : function() {
qaPref.setPref(qaPref.prefBase+'.isFirstTime', false, 'bool');
}
};

Просмотреть файл

@ -1,39 +1,39 @@
<?xml version="1.0"?><!-- -*- Mode: HTML -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Mozilla Community QA Extension
#
# The Initial Developer of the Original Code is Zach Lipton.
# Portions created by the Initial Developer are Copyright (C) 2006
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Zach Lipton <zach@zachlipton.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the LGPL or the GPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK ***** -->
- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is the Mozilla Community QA Extension
-
- The Initial Developer of the Original Code is the Mozilla Corporation.
- Portions created by the Initial Developer are Copyright (C) 2007
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Zach Lipton <zach@zachlipton.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://qa/skin/" type="text/css"?>
@ -85,10 +85,10 @@
<groupbox>
<hbox>
<vbox>
<label control="username" value="&qa.preferences.litmus.username;"/>
<textbox id="username" size="35"/>
<label control="password" value="&qa.preferences.litmus.password;"/>
<textbox id="password" type="password" size="35"/>
<label control="username" value="&qa.preferences.litmus.username;"/>
<textbox id="username" size="35"/>
<label control="password" value="&qa.preferences.litmus.password;"/>
<textbox id="password" type="password" size="35"/>
</vbox>
</hbox>
</groupbox>

Просмотреть файл

@ -0,0 +1,325 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the buggybar extension.
*
* The Initial Developer of the Original Code is
* David Hamp-Gonsalves
* Portions created by the Initial Developer are Copyright (C) 2007
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* David Hamp-Gonsalves
* Ben Hsieh <ben.hsieh@gmail.com> (modified for the QA Community Extension)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
//bugAccess Class
//used to comunicate with the bugzilla server, this will eventually be
//an interface so the webservices version can be pluged in here if the
//bugzilla instance supports it. Right now the http/xml version is used
function bugAccess()
{
var onloadBugList;
var onloadBugSpecs;
var onloadBugSearch;
var onloadBugSave;
var onloadLogin;
this.getBugSpecs = function(inputId,inUrl,onloadFunc)
{
if(onloadFunc!=undefined)
{
onloadBugSpecs = onloadFunc;
}else
alert("ERROR: getBugList called without function parameter");
var url = inUrl+"show_bug.cgi?ctype=xml&id=";
//get bug id and create URL
url += inputId;
//TODO: need pop alert if connect can't be made(onerror)
var xmlHttp=new XMLHttpRequest();
xmlHttp.open("GET", url, true);
var req=new XMLHttpRequest();
req.open("GET", url, true);
var callback = this.parseBugSpecs;
req.onreadystatechange = function (aEvt) {
if (req.readyState == 4) {
if(req.status == 200) {
// alert(req.responseXML);
callback(req);
}else
alert("Error loading page\n");
}
};
req.send(null);
// leave true for Gecko
xmlHttp.send(null);
//xmlHttp.onload=this.parseBugSpecs;
}
//parse individual bug page
this.parseBugSpecs = function(e)
{
var bugInfo = new Object();
//var xml = e.target.responseXML;
var xml = e.responseXML;
// alert(xml);
if(xml.getElementsByTagName("bug")[0].getAttribute("error")!=null)
{
alert("The requested bug was: "+ xml.getElementsByTagName("bug")[0].getAttribute("error"));
bugInfo["id"] = "";
bugInfo["title"] = "";
bugInfo["status"] = "";
bugInfo["info"] = "";
}else
{
bugInfo["id"] = xml.getElementsByTagName("bug_id")[0].firstChild.data;
bugInfo["title"] = xml.getElementsByTagName("short_desc")[0].firstChild.data;
bugInfo["status"] = xml.getElementsByTagName("bug_status")[0].firstChild.data
if (xml.getElementsByTagName("resolution").length)
bugInfo["status"] += "--" + xml.getElementsByTagName("resolution")[0].firstChild.data;
bugInfo["info"] = xml.getElementsByTagName("short_desc")[0].firstChild.data + "\n\n"
+ xml.getElementsByTagName("thetext")[0].firstChild.data;
}
onloadBugSpecs(bugInfo);
}
this.setBugListOnloadFunc = function(onloadFunc){onloadBugList = onloadFunc;}
this.setBugSearchOnloadFunc = function(onloadFunc){onloadBugSearch = onloadFunc;}
// get list of bugs html page
this.getBugList = function(inURL, params, mode)
{
var xmlHttp=new XMLHttpRequest();
xmlHttp.open("GET", inURL+"/buglist.cgi?"+params, true);
dump("searching: " + inURL+"/buglist.cgi?"+params);
// leave true for Gecko
xmlHttp.send(null);
if(mode == 1)//list mode
xmlHttp.onload=this.parseBugList;
else if(mode == 0)//search mode
xmlHttp.onload=this.parseBugSearch;
}
this.parseBugList = function(e)
{
var bugData = parseList(e.target.responseText);
onloadBugList(bugData);
}
this.parseBugSearch = function(e)
{
var bugData = parseList(e.target.responseText);
onloadBugSearch(bugData);
}
this.writeBugToBugzilla = function(inUrl,bugSpec,fn)
{
onloadBugSave=fn;
var names = new Array(bugSpecs.getFieldTotal());
names[0]="id";
names[1]="product";
names[2]="component";
names[3]="status";
names[4]="resolution";
names[5]="assigned_to";
names[6]="rep_platform";
names[7]="op_sys";
names[8]="version";
names[9]="priority";
names[10]="bug_severity";
names[11]="target_milestone";
names[12]="reporter";
names[13]="qa_contact";
names[14]="bug_file_loc";
names[15]="short_desc";
var fieldCount = bugSpecs.getFieldTotal();
var varString="";
for(i=0;i<fieldCount-1;i++)
{
if(names[i]!="reporter")
varString+=names[i]+"="+bugSpec.getSpec(i)+"&";
}
varString+="longdesclength=&knob="+bugSpec.getKnob();
var xmlHttp=new XMLHttpRequest();
xmlHttp.open("POST", inUrl+"/process_bug.cgi",true);
xmlHttp.setRequestHeader("Method", "POST "+inUrl+"/process_bug.cgi"+" HTTP/1.1");
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlHttp.send(varString);
//xmlHttp.onreadystatechange = this.writeBugToBugzillaStatus;
xmlHttp.onload = this.writeBugToBugzillaReturnStatus;
}
this.writeBugToBugzillaReturnStatus = function(e)
{
if (e.target.readyState == 4)
{
if (e.target.status == 200)
{
var start;//will hold first pos of error search string from responce text if its an error page
//window._content.document.write("<b> the responce status is: </b>"+self.xmlHttp.status+"<br/>");
if(e.target.responseText.indexOf('name="Bugzilla_login">')!=-1)
{
//login page returned which means user isn't logged in
alert("Your not logged in to this instance of bugzilla");
}else if(e.target.responseText.indexOf('Bug processed')!=-1)
{
var success = "Changes Made";
alert(success);
}else if((start = e.target.responseText.indexOf('<td bgcolor="#ff0000">'))!=-1)
{
//error was recieved
var error = "Error: "+e.target.responseText.substring(start,e.target.responseText.indexOf('</td>'));
error = error.replace(/\n|\t|/g,"");
error = error.replace(/<[^>]+>/g,"");
error = getCleanText(error);
alert(error);
}
}else
{
alert("Connection failed! possible network error");
}
onloadBugSave();
}else
{
//at one of the load phases before 4
alert("load phase: "+e.target.readyState);
}
}
this.loginToBugzilla = function(inUrl, user, passwd, fn)
{
onloadLogin = fn;
var varString = "&Bugzilla_login="+user+"&Bugzilla_password="+passwd;
var xmlHttp=new XMLHttpRequest();
xmlHttp.open("POST", inUrl+"/index.cgi?GoAheadAndLogIn=1",true);
xmlHttp.setRequestHeader("Method", "POST "+inUrl+"/index.cgi"+" HTTP/1.1");
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlHttp.send(varString);
xmlHttp.onload = this.loginToBugzillaStatus;
}
this.loginToBugzillaStatus = function(e)
{
//1 - success, -1 - failure, 0 - error unknown state
var rc=0;
var start;//will hold first pos of error search string from responce text if its an error page
if(e.target.responseText.indexOf('href="relogin.cgi"')!=-1)//success
{
//success
rc=1;
alert("Login successful");
}else if(e.target.responseText.toLowerCase().indexOf('invalid username or password')!=-1)//failure
{
rc=-1;
alert("Bugzilla reported that your user name or password was invalid please verify");
}
onloadLogin(rc);
}
}
//Kludge: couldn't find this fn when inside bugAccess for some reason ahould be moved to bug access class
//parse list of bugs html page and return array with ids and descriptions
function parseList(xmlHttp)
{
var beginLoc=0;
var endLoc=0;
var id;
var summary;
bugData=new Array();
//dump(xmlHttp);
for(var i = 0;(beginLoc = xmlHttp.indexOf('show_bug.cgi?id',endLoc)) != -1; i++)
{
endLoc = xmlHttp.indexOf('"',beginLoc);
beginLoc = xmlHttp.indexOf('=',beginLoc);
id=xmlHttp.substring(beginLoc+1, endLoc);
//move past other entries to get to summary
var curLoc=endLoc;
endLoc = xmlHttp.indexOf('</tr>',endLoc);
endLoc = xmlHttp.lastIndexOf('</td>',endLoc);
beginLoc = xmlHttp.lastIndexOf("<td >",endLoc);
if(beginLoc==-1)
{
beginLoc = xmlHttp.lastIndexOf("<td>",endLoc);//other option
}
summary = xmlHttp.substring(beginLoc, endLoc);
summary = getCleanText(summary);
bugData[i] = new Array(2);
bugData[i][0] = id;
bugData[i][1] = summary;
//alert("loop:" + i);
}
//alert("end loop:" + bugData, bugData.length);
return bugData;
}

Просмотреть файл

@ -0,0 +1,205 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla Community QA Extension
*
* The Initial Developer of the Original Code is the Mozilla Corporation.
* Portions created by the Initial Developer are Copyright (C) 2007
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Ben Hsieh <ben.hsieh@gmail.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
var bugzilla = {
trunkVersion : "3.0",
baseURL : qaPref.getPref(qaPref.prefBase+".bugzilla.url", "char"),
sysconfig: null,
bugReader : null,
doSearch : function() {
var words = $("qa-bugzilla-input-keywords").value;
var bugId = $("qa-bugzilla-input-id").value;
if ($("qa-bugzilla-radio-words").selected) { // keyword search
if ($("qa-bugzilla-input-os").checked && words.indexOf("os:") == -1) {
if (bugzilla.sysconfig == null) bugzilla.sysconfig = new Sysconfig();
words += " os:" + bugzilla.sysconfig.opsys.substr(0,3);
}
if ($("qa-bugzilla-input-version").checked && words.indexOf("version:") == -1) {
if (bugzilla.sysconfig == null) bugzilla.sysconfig = new Sysconfig();
var branch = bugzilla.sysconfig.branch.substr(0,3);
if (branch.indexOf(bugzilla.trunkVersion) != -1) branch = "Trunk";
words += " version:" + branch;
}
bugzilla.loadBugGroup(words);
} else { //id search
bugzilla.loadBug(bugId);
}
},
showRecent : function() {
$("qa-bugzilla-input-radiogroup").selectedItem = $("qa-bugzilla-radio-words");
bugzilla.disableOther();
bugzilla.loadBugGroup("product=Core&product=Firefox&product=Mozilla+Application+Suite&product=Thunderbird&product=Toolkit"
+"&bug_status=UNCONFIRMED,NEW,ASSIGNED,REOPENED,RESOLVED&chfield=%5BBug%20creation%5D&chfieldfrom=-24h"
, true);
},
loadBugGroup : function (param, detailsearch) {
var callback = function(bugarray) { // bugarray is a 2d array with id and summaries
var menu = document.getElementById('bugSearchList');
while (menu.getRowCount()) { // clear menu
menu.removeItemAt(0);
};
for (var i = 0; i < bugarray.length; i++) {
var row = document.createElement("listitem");
row.value = bugarray[i][0];
var number = document.createElement("listcell");
number.setAttribute("label", bugarray[i][0]);
var name = document.createElement("listcell");
name.setAttribute("label", bugarray[i][1]);
name.setAttribute("crop", "end");
name.setAttribute("maxwidth", "175");
row.appendChild(number);
row.appendChild(name);
menu.appendChild(row);
}
if(bugarray.length) menu.selectedIndex = 0;
$("qa-bugzilla-input-keywords").value = param;
if ($('qa_tabrow').selectedItem != $('qa-tabbar-bugzilla')) {
bugzilla.highlightTab();
}
}
if (bugzilla.bugReader == null) bugzilla.bugReader = new bugAccess();
bugzilla.bugReader.setBugSearchOnloadFunc(callback);
if (detailsearch) bugzilla.bugReader.getBugList(bugzilla.baseURL, "buglist.cgi?="+param, 0);
else bugzilla.bugReader.getBugList(bugzilla.baseURL, "quicksearch="+param, 0);
},
loadBug : function (bugId, preserveCurrent) {
var callback = function(bugObj) {
// menu
var menu = document.getElementById('bugSearchList');
while (menu.getRowCount() && !preserveCurrent) { // clear menu
menu.removeItemAt(0);
};
var row = document.createElement("listitem");
row.value = bugObj["id"];
var number = document.createElement("listcell");
number.setAttribute("label", bugObj["id"]);
var name = document.createElement("listcell");
name.setAttribute("label", bugObj["title"]);
name.setAttribute("crop", "end");
name.setAttribute("maxwidth", "175");
row.appendChild(number);
row.appendChild(name);
menu.appendChild(row);
// summary
$("qa-bugzilla-input-id").value = $("qa-bugzilla-output-id").value = bugObj["id"];
$("qa-bugzilla-output-status").value = bugObj["status"];
$("qa-bugzilla-output-summary").value = bugObj["info"];
qaTools.assignLinkHandlers($("qa-bugzilla-output-summary"));
if ($('qa_tabrow').selectedItem != $('qa-tabbar-bugzilla')) {
bugzilla.highlightTab();
}
}
if (bugzilla.bugReader == null) bugzilla.bugReader = new bugAccess();
bugzilla.bugReader.getBugSpecs(bugId, bugzilla.baseURL, callback);
},
disableOther : function() {
if ($("qa-bugzilla-radio-words").selected) {
$("qa-bugzilla-input-keywords").disabled = false;
$("qa-bugzilla-input-os").disabled = false;
$("qa-bugzilla-input-version").disabled = false;
$("qa-bugzilla-input-id").disabled = true;
} else {
$("qa-bugzilla-input-id").disabled = false;
$("qa-bugzilla-input-keywords").disabled = true;
$("qa-bugzilla-input-os").disabled = true;
$("qa-bugzilla-input-version").disabled = true;
}
},
handleSelect : function() {
var menu = $('bugSearchList');
if (menu.selectedItem.value == $("qa-bugzilla-output-id").value) return;
var callback = function(bugObj) {
$("qa-bugzilla-output-id").value = bugObj["id"];
$("qa-bugzilla-output-status").value = bugObj["status"];
$("qa-bugzilla-output-summary").value = bugObj["info"];
}
if (bugzilla.bugReader == null) bugzilla.bugReader = new bugAccess();
bugzilla.bugReader.getBugSpecs(menu.selectedItem.value, bugzilla.baseURL, callback);
},
highlightTab : function() {
$('qa-tabbar-bugzilla').className = "tabbrowser-tab highlight";
},
unhighlightTab : function() {
$('qa-tabbar-bugzilla').className = "tabbrowser-tab";
},
openInBugzilla : function() {
if ($("qa-bugzilla-output-id").value == "") {
alert("no value");
return;
}
var url = bugzilla.baseURL + "show_bug.cgi?id=" + $("qa-bugzilla-output-id").value;
var type = qaPref.getPref("browser.link.open_external", "int");
var where = "tab";
if (type == 2) where = "window";
openUILinkIn(url, where);
},
findBugzillaLinks : function(node) { // assumes HTML-ns node
var RV = new Array();
var innerstr = node.innerHTML;
var prefix = "show_bug.cgi?id=";
var index = innerstr.indexOf(prefix);
dump(innerstr);
if (index == -1) {
//TODO: search for "bug"? is that too broad?
} else {
while(index != -1) {
RV.push(innerstr.substr(index+prefix.length,6));
dump(RV.length + " found so far, current index: " + index+ " \n");
index = innerstr.indexOf(prefix, index + 1);
}
}
return qaTools.makeUniqueArray(RV);
}
}

Просмотреть файл

@ -1,39 +1,39 @@
<?xml version="1.0"?><!-- -*- Mode: HTML -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Mozilla Community QA Extension
#
# The Initial Developer of the Original Code is the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2007
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Zach Lipton <zach@zachlipton.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the LGPL or the GPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK ***** -->
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla Community QA Extension
*
* The Initial Developer of the Original Code is the Mozilla Corporation.
* Portions created by the Initial Developer are Copyright (C) 2007
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Zach Lipton <zach@zachlipton.com>
* Ben Hsieh <ben.hsieh@gmail.com> (rewrite)
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** -->
<!DOCTYPE overlay [
<!ENTITY % qaDTD SYSTEM "chrome://qa/locale/qa.dtd"> %qaDTD;
@ -42,35 +42,75 @@
<overlay id="qa-bz-overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml">
<tabpanel id="qa-tab-bugzilla">
<vbox>
<label href="http://bugzilla.mozilla.org"
value="Help us by filing and confirming bugs in Bugzilla"
class="text-link" />
<groupbox>
<caption label="Bug Search" />
<radiogroup id = "qa-bugzilla-input-radiogroup"
onselect="bugzilla.disableOther()">
<hbox>
<radio selected="true" id="qa-bugzilla-radio-id"
label="Bug id:" width="100px" />
<textbox width="200px" id="qa-bugzilla-input-id" />
</hbox>
<hbox><radio id="qa-bugzilla-radio-words" label="Keywords:" width="100px" />
<textbox width="200px" disabled="true" id="qa-bugzilla-input-keywords" /> </hbox>
</radiogroup>
<hbox>
<checkbox id="qa-bugzilla-input-os" label="Include OS" />
<checkbox id="qa-bugzilla-input-version" label="Include Version" />
</hbox>
<spacer height="20px" />
<hbox>
<button label="Find!" oncommand="bugzilla.doSearch(); "/>
<button label="Show all bugs filed today"
oncommand="bugzilla.showRecent()"/></hbox>
</groupbox>
<listbox id="bugSearchList" onselect="bugzilla.handleSelect();"
flex="1" seltype="single" maxheight="200px" height="200px">
<listhead>
<listheader label="Id"/>
<listheader label="Summary"/>
</listhead>
<listcols>
<listcol/>
<listcol flex="1"/>
</listcols>
</listbox>
<!-- <groupbox>
<div xmlns="http://www.w3.org/1999/xhtml" id="qa-bz-bugzilla">
</div>
</groupbox> -->
<groupbox>
<caption label= "Bug Summary" />
<hbox>
<label width="100px"> Bug id: </label>
<textbox style="color:black" id="qa-bugzilla-output-id"
width="197px" cols="31" disabled="true"/>
</hbox>
<hbox>
<label width="100px"> Status: </label>
<textbox style="color:black" id="qa-bugzilla-output-status"
width="197px" cols="31" disabled="true"/>
</hbox>
<hbox>
<label width="100px"> Summary: </label>
<textbox style="color:black" id="qa-bugzilla-output-summary"
width="197px" multiline="true" disabled="true" height="100px" rows="7"/> </hbox>
<hbox>
<spacer width="110px" />
<button label="Show in Bugzilla" width="200px"
oncommand="bugzilla.openInBugzilla();"/>
</hbox>
</groupbox>
<spacer height= "20px" />
</vbox>
</tabpanel>
<script type="application/x-javascript">
var bz = {
populateFields : function() {
var box = $('qa-bz-bugzilla');
qaTools.showHideLoadingMessage(box, true);
qaTools.fetchFeed(qaMain.urlbundle.getString("qa.extension.url.bz.content"),
function(feed) {
var items = feed.items;
var item = items.queryElementAt(0, Ci.nsIFeedEntry);
qaTools.showHideLoadingMessage(box, false);
if (item != null) {
var fragment = item.summary.createDocumentFragment(box);
box.appendChild(fragment);
}
}
);
}
};
window.addEventListener('load', bz.populateFields, false);
</script>
</overlay>

Просмотреть файл

@ -1,39 +1,39 @@
<?xml version="1.0"?><!-- -*- Mode: HTML -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Mozilla Community QA Extension
#
# The Initial Developer of the Original Code is the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2007
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Zach Lipton <zach@zachlipton.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the LGPL or the GPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK ***** -->
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla Community QA Extension
*
* The Initial Developer of the Original Code is the Mozilla Corporation.
* Portions created by the Initial Developer are Copyright (C) 2007
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Zach Lipton <zach@zachlipton.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** -->
<!DOCTYPE overlay [
<!ENTITY % qaDTD SYSTEM "chrome://qa/locale/qa.dtd"> %qaDTD;
@ -45,12 +45,12 @@
<script type="application/x-javascript"
src="chrome://chatzillaservice_qa/content/chatzilla-service.js" />
src="chrome://chatzillaservice_qa/content/chatzilla-service.js" />
<script type="application/x-javascript" >
window.addEventListener('load', function() {
qaTools.assignLinkHandler($("qa-chat-imo"));
qaTools.assignLinkHandler($("qa-chat-irchelp"));
}, false);
window.addEventListener('load', function() {
qaTools.assignLinkHandler($("qa-chat-imo"));
qaTools.assignLinkHandler($("qa-chat-irchelp"));
}, false);
</script>
<tabpanel id="qa-tab-chat">
@ -67,17 +67,21 @@
<caption label="&qa.chat.howdoItitle;" />
<div xmlns="http://www.w3.org/1999/xhtml" id="qa-qmo-forumposts">
<ul>
<li><a id="qa-chat-imo" href="&qa.chat.howdoI.imourl;" target="_blank">&qa.chat.howdoI.imo;</a></li>
<li><a id="qa-chat-irchelp" href="&qa.chat.howdoI.irchelpurl;" target="_blank">&qa.chat.howdoI.irchelp;</a></li>
<li><a id="qa-chat-imo" href="&qa.chat.howdoI.imourl;" target="_blank">
&qa.chat.howdoI.imo;</a>
</li>
<li><a id="qa-chat-irchelp" href="&qa.chat.howdoI.irchelpurl;" target="_blank">
&qa.chat.howdoI.irchelp;</a>
</li>
</ul>
</div>
<button style="margin-top: 12px; padding-left: 2em; padding-right: 2em;"
oncommand="openQAChat();" label="&qa.chat.howdoI.joinnow;" />
oncommand="openQAChat();" label="&qa.chat.howdoI.joinnow;" />
</groupbox>
<script type="application/x-javascript">
function openQAChat() {
spawnChatZilla('irc://irc.mozilla.org/qa', 0);
spawnChatZilla('irc://irc.mozilla.org/qa', 0);
}
</script>

Просмотреть файл

@ -1,39 +1,39 @@
<?xml version="1.0"?><!-- -*- Mode: HTML -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Mozilla Community QA Extension
#
# The Initial Developer of the Original Code is the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2007
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Zach Lipton <zach@zachlipton.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the LGPL or the GPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK ***** -->
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla Community QA Extension
*
* The Initial Developer of the Original Code is the Mozilla Corporation.
* Portions created by the Initial Developer are Copyright (C) 2007
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Zach Lipton <zach@zachlipton.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** -->
<!DOCTYPE overlay [
<!ENTITY % qaDTD SYSTEM "chrome://qa/locale/qa.dtd"> %qaDTD;

Просмотреть файл

@ -1,42 +1,41 @@
<?xml version="1.0"?><!-- -*- Mode: HTML -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Mozilla Community QA Extension
#
# The Initial Developer of the Original Code is the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2006
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Zach Lipton <zach@zachlipton.com>
# Ben Hsieh <bhsieh@mozilla.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the LGPL or the GPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK ***** -->
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla Community QA Extension
*
* The Initial Developer of the Original Code is the Mozilla Corporation.
* Portions created by the Initial Developer are Copyright (C) 2007
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Zach Lipton <zach@zachlipton.com>
* Ben Hsieh <bhsieh@mozilla.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** -->
<?xml-stylesheet href="chrome://qa/skin/" type="text/css"?>
<!DOCTYPE overlay [
<!ENTITY % qaDTD SYSTEM "chrome://qa/locale/qa.dtd"> %qaDTD;
@ -47,18 +46,19 @@
<tabpanel id="qa-tab-litmus" onload="litmus.readStateFromPref();">
<vbox align="start" pack="start">
<hbox align="start" pack="start">
<vbox minwidth="150">
<button maxwidth="110" label="&qa.litmus.selecttests;"
<hbox align="start" pack="start">
<vbox minwidth="150">
<button maxwidth="110" label="&qa.litmus.selecttests;"
oncommand="litmus.handleDialog()"
style="margin-left: 4px;" />
<label maxwidth="160" value="" id="qa-testrun-label"/>
<label maxwidth="160" value="" id="qa-testgroup-label"/>
<label maxwidth="160" value="" id="qa-subgroup-label"/>
<label maxwidth="160" value="" id="qa-testrun-label"/>
<label maxwidth="160" value="" id="qa-testgroup-label"/>
<label maxwidth="160" value="" id="qa-subgroup-label"/>
<label value="" />
<label value="" id="qa-testcase-progress" />
</vbox>
<listbox rows="7" minwidth="200" onselect="litmus.handleSelect()" id="testlist">
</vbox>
<listbox rows="7" minwidth="200" onselect="litmus.handleSelect()"
id="testlist">
<listcols>
<listcol />
<listcol />
@ -66,48 +66,57 @@
<listitem label="&qa.litmus.testlist.initiallabel;" />
</listbox>
</hbox>
<vbox>
<hbox style="font-weight: bold;">
<label id="qa-testcase-id" value="&qa.litmus.testlist.initialdescription;" />
<label value="&mdash;" />
<description id="qa-testcase-summary" maxwidth="230px" crop="end"></description>
</hbox>
</hbox>
<vbox>
<hbox style="font-weight: bold;">
<label id="qa-testcase-id" value="&qa.litmus.testlist.initialdescription;" />
<label value="&mdash;" />
<description id="qa-testcase-summary" maxwidth="230px" crop="end">
</description>
</hbox>
</vbox>
</vbox>
<vbox width="370px" minwidth="370px">
<groupbox maxheight="130px" minwidth="370px" width="370px">
<caption label="&qa.testcase.steps;" crop="end" maxwidth="200"/>
<div xmlns="http://www.w3.org/1999/xhtml" style="width: 350px; height: 140px; overflow: auto;" id="qa-testcase-steps" class="list"/>
</groupbox>
<splitter id="qa-mainwindow-splitter" state="open" collapse="none">
<grippy/>
</splitter>
<groupbox maxheight="120px" minwidth="370px" width="370px">
<caption label="&qa.testcase.expected;" />
<div xmlns="http://www.w3.org/1999/xhtml" style="width: 350px; height: 120px; overflow: auto;" id="qa-testcase-expected" class="list"/>
</groupbox>
</vbox>
<hbox>
<groupbox>
<caption label="Result:" />
<radiogroup id="qa-testcase-result">
<radio id="qa-testcase-pass" label="&qa.testcase.result.pass;"/>
<radio id="qa-testcase-fail" label="&qa.testcase.result.fail;"/>
<radio id="qa-testcase-unclearBroken" label="&qa.testcase.result.unclearbroken;"/>
</radiogroup>
</groupbox>
<groupbox>
<caption control="qa-testcase-comment" label="&qa.testcase.comment;"/>
<textbox id="qa-testcase-comment" style="min-height: 75px; width:150px;" class="plain"/>
<vbox width="370px" minwidth="370px">
<groupbox maxheight="130px" minwidth="370px" width="370px">
<caption label="&qa.testcase.steps;" crop="end" maxwidth="200"/>
<div xmlns="http://www.w3.org/1999/xhtml"
style="width: 350px; height: 140px; overflow: auto;"
id="qa-testcase-steps" class="list"/>
</groupbox>
</hbox>
<hbox flex="1" maxheight="30px">
<button id="qa-mainwindow-previousButton" label="Previous" oncommand="litmus.prevButton()"/>
<button id="qa-mainwindow-nextButton" label="Next (Submit)" oncommand="litmus.nextButton()"/>
</hbox>
<splitter id="qa-mainwindow-splitter" state="open" collapse="none">
<grippy/>
</splitter>
<groupbox maxheight="120px" minwidth="370px" width="370px">
<caption label="&qa.testcase.expected;" />
<div xmlns="http://www.w3.org/1999/xhtml"
style="width: 350px; height: 120px; overflow: auto;"
id="qa-testcase-expected" class="list"/>
</groupbox>
</vbox>
<hbox>
<groupbox>
<caption label="Result:" />
<radiogroup id="qa-testcase-result">
<radio id="qa-testcase-pass" label="&qa.testcase.result.pass;"/>
<radio id="qa-testcase-fail" label="&qa.testcase.result.fail;"/>
<radio id="qa-testcase-unclearBroken"
label="&qa.testcase.result.unclearbroken;"/>
</radiogroup>
</groupbox>
<groupbox>
<caption control="qa-testcase-comment" label="&qa.testcase.comment;"/>
<textbox id="qa-testcase-comment" rows="4" cols="30" multiline="true"
class="plain"/>
</groupbox>
</hbox>
<hbox flex="1" maxheight="30px">
<button id="qa-mainwindow-previousButton" label="Previous"
oncommand="litmus.prevButton()"/>
<button id="qa-mainwindow-nextButton" label="Next (Submit)"
oncommand="litmus.nextButton()"/>
</hbox>
<label id="qa-litmus-stats" value="" />
<script type="application/x-javascript">
this.addEventListener('load', litmus.loadStats, false);

Просмотреть файл

@ -35,108 +35,108 @@
* ***** END LICENSE BLOCK ***** */
var qmo = {
populateFields : function() {
qmo.populateForumPosts();
qmo.populateEvents();
qmo.populateQMONews();
qmo.populateHowHelp();
},
populateForumPosts : function() {
var numPosts = 5; // show top 5 topics
var postBox = $('qa-qmo-forumposts');
qaTools.showHideLoadingMessage(postBox, true);
var url = qaMain.urlbundle.getString("qa.extension.url.qmo.forum_topics");
var callback = function(feed) {
var items = feed.items;
qaTools.showHideLoadingMessage(postBox, false);
if (items.length < numPosts)
numPosts=items.length;
for (var i=0; i<numPosts; i++) {
var item = items.queryElementAt(i, Ci.nsIFeedEntry);
if (item != null) {
qmo.populateLinkBox(postBox,
[{text : item.title.plainText(), url : item.link.resolve("")}],
64);
}
}
};
qaTools.fetchFeed(url, callback);
},
populateEvents : function() {
var numEvents = 5; // show 5 events
var eventBox = $('qa-qmo-events');
qaTools.showHideLoadingMessage(eventBox, true);
var url = qaMain.urlbundle.getString("qa.extension.url.qmo.upcomingEvents");
var callback = function(feed) {
var items = feed.items;
qaTools.showHideLoadingMessage(eventBox, false);
if (items.length < numEvents)
numEvents=items.length;
for (var i=0; i<numEvents; i++) {
var item = items.queryElementAt(i, Ci.nsIFeedEntry);
if (item != null) {
qmo.populateLinkBox(eventBox,
[{text : item.title.plainText(), url : item.link.resolve("")}],
37);
}
}
};
qaTools.fetchFeed(url, callback);
},
populateQMONews : function() {
var box = $('qa-qmo-latest');
var url = qaMain.urlbundle.getString("qa.extension.url.qmo.news");
qaTools.showHideLoadingMessage(box, true);
var callback = function(feed) {
var items = feed.items;
var item = items.queryElementAt(0, Ci.nsIFeedEntry);
qaTools.showHideLoadingMessage(box, false);
if (item != null) { // just grab the first item
var content = item.summary;
var fragment = content.createDocumentFragment(box);
populateFields : function() {
qmo.populateForumPosts();
qmo.populateEvents();
qmo.populateQMONews();
qmo.populateHowHelp();
},
populateForumPosts : function() {
var numPosts = 5; // show top 5 topics
var postBox = $('qa-qmo-forumposts');
qaTools.showHideLoadingMessage(postBox, true);
var url = qaMain.urlbundle.getString("qa.extension.url.qmo.forum_topics");
var callback = function(feed) {
var items = feed.items;
qaTools.showHideLoadingMessage(postBox, false);
if (items.length < numPosts)
numPosts=items.length;
for (var i=0; i<numPosts; i++) {
var item = items.queryElementAt(i, Ci.nsIFeedEntry);
if (item != null) {
qmo.populateLinkBox(postBox,
[{text : item.title.plainText(), url : item.link.resolve("")}],
64);
}
}
};
qaTools.fetchFeed(url, callback);
},
populateEvents : function() {
var numEvents = 5; // show 5 events
var eventBox = $('qa-qmo-events');
qaTools.showHideLoadingMessage(eventBox, true);
var url = qaMain.urlbundle.getString("qa.extension.url.qmo.upcomingEvents");
var callback = function(feed) {
var items = feed.items;
qaTools.showHideLoadingMessage(eventBox, false);
if (items.length < numEvents)
numEvents=items.length;
for (var i=0; i<numEvents; i++) {
var item = items.queryElementAt(i, Ci.nsIFeedEntry);
if (item != null) {
qmo.populateLinkBox(eventBox,
[{text : item.title.plainText(), url : item.link.resolve("")}],
37);
}
}
};
qaTools.fetchFeed(url, callback);
},
populateQMONews : function() {
var box = $('qa-qmo-latest');
var url = qaMain.urlbundle.getString("qa.extension.url.qmo.news");
qaTools.showHideLoadingMessage(box, true);
var callback = function(feed) {
var items = feed.items;
var item = items.queryElementAt(0, Ci.nsIFeedEntry);
qaTools.showHideLoadingMessage(box, false);
if (item != null) { // just grab the first item
var content = item.summary;
var fragment = content.createDocumentFragment(box);
box.appendChild(fragment);
}
qaTools.assignLinkHandlers(box);
}
qaTools.fetchFeed(url, callback);
},
populateHowHelp : function() {
var box = $('qa-qmo-help');
var url = qaMain.urlbundle.getString("qa.extension.url.qmo.howhelp");
qaTools.showHideLoadingMessage(box, true);
var callback = function(feed) {
var items = feed.items;
var item = items.queryElementAt(0, Ci.nsIFeedEntry);
qaTools.showHideLoadingMessage(box, false);
if (item != null) { // just grab the first item
var content = item.summary;
var fragment = content.createDocumentFragment(box);
box.appendChild(fragment);
}
qaTools.assignLinkHandlers(box);
}
qaTools.fetchFeed(url, callback);
},
populateHowHelp : function() {
var box = $('qa-qmo-help');
var url = qaMain.urlbundle.getString("qa.extension.url.qmo.howhelp");
qaTools.showHideLoadingMessage(box, true);
var callback = function(feed) {
var items = feed.items;
var item = items.queryElementAt(0, Ci.nsIFeedEntry);
qaTools.showHideLoadingMessage(box, false);
if (item != null) { // just grab the first item
var content = item.summary;
var fragment = content.createDocumentFragment(box);
box.appendChild(fragment);
}
qaTools.assignLinkHandlers(box);
}
qaTools.fetchFeed(url, callback);
},
populateLinkBox : function(box, links, chars) {
var list = box.childNodes[1];
for (var i=0; i<links.length; i++) {
var elem = list.appendChild(document.createElementNS(qaMain.htmlNS,"li"));
var a = elem.appendChild(document.createElementNS(qaMain.htmlNS,"a"));
box.appendChild(fragment);
}
qaTools.assignLinkHandlers(box);
}
qaTools.fetchFeed(url, callback);
},
populateLinkBox : function(box, links, chars) {
var list = box.childNodes[1];
for (var i=0; i<links.length; i++) {
var elem = list.appendChild(document.createElementNS(qaMain.htmlNS,"li"));
var a = elem.appendChild(document.createElementNS(qaMain.htmlNS,"a"));
// limit text to chars characters:
var text = links[i].text;
if (chars && chars>0 && text.length > chars) {
a.setAttribute("tooltiptext", text);
text = text.substring(0, chars-3)+"...";
}
// limit text to chars characters:
var text = links[i].text;
if (chars && chars>0 && text.length > chars) {
a.setAttribute("tooltiptext", text);
text = text.substring(0, chars-3)+"...";
}
a.textContent = text;
a.href = links[i].url;
qaTools.assignLinkHandler(a);
}
},
a.textContent = text;
a.href = links[i].url;
qaTools.assignLinkHandler(a);
}
}
};
function $() {

Просмотреть файл

@ -1,39 +1,39 @@
<?xml version="1.0"?><!-- -*- Mode: HTML -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Mozilla Community QA Extension
#
# The Initial Developer of the Original Code is the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2007
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Zach Lipton <zach@zachlipton.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the LGPL or the GPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK ***** -->
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla Community QA Extension
*
* The Initial Developer of the Original Code is the Mozilla Corporation.
* Portions created by the Initial Developer are Copyright (C) 2007
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Zach Lipton <zach@zachlipton.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** -->
<!DOCTYPE overlay [
<!ENTITY % qaDTD SYSTEM "chrome://qa/locale/qa.dtd"> %qaDTD;
@ -53,24 +53,27 @@
<hbox>
<html:a href="http://quality.mozilla.org" target="blank">
<image src='chrome://qa/skin/qmo-badge.png'
style='max-width: 75px; max-height: 31px; margin-top: 3px; margin-left: 3px;' />
style='max-width: 75px; max-height: 31px;
margin-top: 3px; margin-left: 3px;' />
</html:a>
</hbox>
<hbox class="box-mheight">
<groupbox class="box-mheight">
<caption label="&qa.qmo.help;" />
<div class="box-mheight" xmlns="http://www.w3.org/1999/xhtml" id="qa-qmo-help">
</div>
</groupbox>
<groupbox class="box-mheight">
<caption label="&qa.qmo.events;" />
<div class="box-mheight" xmlns="http://www.w3.org/1999/xhtml" id="qa-qmo-events">
<ul>
</ul>
</div>
</groupbox>
<groupbox class="box-mheight">
<caption label="&qa.qmo.help;" />
<div class="box-mheight" xmlns="http://www.w3.org/1999/xhtml"
id="qa-qmo-help">
</div>
</groupbox>
<groupbox class="box-mheight">
<caption label="&qa.qmo.events;" />
<div class="box-mheight" xmlns="http://www.w3.org/1999/xhtml"
id="qa-qmo-events">
<ul>
</ul>
</div>
</groupbox>
</hbox>
<groupbox>
<caption label="&qa.qmo.forumposts;" />

Просмотреть файл

@ -19,7 +19,7 @@
*
* Contributor(s):
* Ben Hsieh <bhsieh@mozilla.com>
* Zach Lipton <zach@zachlipton.com>
* Zach Lipton <zach@zachlipton.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
@ -39,95 +39,98 @@
var updateFunction;
var handleCancel;
var handleOK;
var sTestrunsWrapper; // an array of things that are kind of like testruns, but w/o important fields.
//returned by "test_runs_by_branch_product_name="
var sTestrunsWrapper; // an array of things that are kind of like testruns,
// but w/o important fields.
//returned by "test_runs_by_branch_product_name="
var sTestrun; // actual testrun
var sTestgroup;
function handleLoad() {
if (window.arguments.length > 0) {
updateFunction = window.arguments[0]; // parent window passes in a function to update itself with data
handleCancel = window.arguments[1]; // parent window passes in a function to restore state if dialog canceled
handleOK = window.arguments[2]; // you get the idea
}
litmus.getTestruns(populateTestRuns);
if (window.arguments.length > 0) {
updateFunction = window.arguments[0]; // parent window passes in a function to update itself with data
handleCancel = window.arguments[1]; // parent window passes in a function to restore state if dialog canceled
handleOK = window.arguments[2]; // you get the idea
}
litmus.getTestruns(populateTestRuns);
}
function handleRunSelect() {
var id = document.getElementById("qa-st-testrun").selectedItem.getAttribute("value");
if (id == "") return; // oddly, this check doesn't seem necessary in the other handlers...
litmus.getTestrun(id, populateTestGroups);
var id = $("qa-st-testrun").selectedItem.getAttribute("value");
if (id == "") return;
// oddly, this check doesn't seem necessary in the other handlers...
litmus.getTestrun(id, populateTestGroups);
}
function handleTestgroupSelect() {
var id = document.getElementById("qa-st-testgroup").selectedItem.value;
litmus.getTestgroup(id, populateSubgroups);
var id = document.getElementById("qa-st-testgroup").selectedItem.value;
litmus.getTestgroup(id, populateSubgroups);
}
function handleSubgroupSelect() {
var id = document.getElementById("qa-st-subgroup").selectedItem.value;
updateCaller(sTestrun.name, sTestgroup.name, id, 0);
var id = document.getElementById("qa-st-subgroup").selectedItem.value;
updateCaller(sTestrun.name, sTestgroup.name, id, 0);
}
function populateTestRuns(testrunsWrapper) {
var menu = document.getElementById("qa-st-testrun");
testrunsWrapper = qaTools.arrayify(testrunsWrapper);
sTestrunsWrapper = testrunsWrapper;
var menu = document.getElementById("qa-st-testrun");
testrunsWrapper = qaTools.arrayify(testrunsWrapper);
sTestrunsWrapper = testrunsWrapper;
while (menu.firstChild) { // clear menu
menu.removeChild(menu.firstChild);
}
while (menu.firstChild) { // clear menu
menu.removeChild(menu.firstChild);
}
for (var i = 0; i < testrunsWrapper.length; i++) {
if (testrunsWrapper[i].enabled == 0) continue;
var item = menu.appendItem(testrunsWrapper[i].name, testrunsWrapper[i].test_run_id);
}
menu.selectedIndex = 0;
handleRunSelect();
for (var i = 0; i < testrunsWrapper.length; i++) {
if (testrunsWrapper[i].enabled == 0) continue;
var item = menu.appendItem(testrunsWrapper[i].name,
testrunsWrapper[i].test_run_id);
}
menu.selectedIndex = 0;
handleRunSelect();
}
function populateTestGroups(testrun) {
sTestrun = testrun;
var menu = document.getElementById("qa-st-testgroup");
while (menu.firstChild) { // clear menu
menu.removeChild(menu.firstChild);
}
sTestrun = testrun;
var menu = document.getElementById("qa-st-testgroup");
while (menu.firstChild) { // clear menu
menu.removeChild(menu.firstChild);
}
var testgroups = qaTools.arrayify(testrun.testgroups);
for (var i = 0; i < testgroups.length; i++) {
if (testgroups[i].enabled == 0) continue;
menu.appendItem(testgroups[i].name, testgroups[i].testgroup_id);
}
menu.selectedIndex = 0;
var testgroups = qaTools.arrayify(testrun.testgroups);
for (var i = 0; i < testgroups.length; i++) {
if (testgroups[i].enabled == 0) continue;
menu.appendItem(testgroups[i].name, testgroups[i].testgroup_id);
}
menu.selectedIndex = 0;
}
function populateSubgroups(testgroup) {
sTestgroup = testgroup;
var menu = document.getElementById("qa-st-subgroup");
while (menu.firstChild) { // clear menu
menu.removeChild(menu.firstChild);
}
var subgroups = qaTools.arrayify(testgroup.subgroups);
sTestgroup = testgroup;
var menu = document.getElementById("qa-st-subgroup");
while (menu.firstChild) { // clear menu
menu.removeChild(menu.firstChild);
}
var subgroups = qaTools.arrayify(testgroup.subgroups);
for (var i = 0; i < subgroups.length; i++) {
if (subgroups[i].enabled == 0) continue;
menu.appendItem(subgroups[i].name, subgroups[i].subgroup_id);
}
menu.selectedIndex = 0;
for (var i = 0; i < subgroups.length; i++) {
if (subgroups[i].enabled == 0) continue;
menu.appendItem(subgroups[i].name, subgroups[i].subgroup_id);
}
menu.selectedIndex = 0;
}
function OK() {
handleOK();
return true;
handleOK();
return true;
}
function updateCaller(testrunSummary, testgroupSummary, subgroupID, index) {
litmus.writeStateToPref(testrunSummary, testgroupSummary, subgroupID, index);
updateFunction();
litmus.writeStateToPref(testrunSummary, testgroupSummary, subgroupID, index);
updateFunction();
}
function Cancel() {
handleCancel();
return true;
handleCancel();
return true;
}

Просмотреть файл

@ -1,40 +1,39 @@
<?xml version="1.0"?><!-- -*- Mode: HTML -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Mozilla Community QA Extension
#
# The Initial Developer of the Original Code is the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2007
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Ben Hsieh <bhsieh@mozilla.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the LGPL or the GPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK ***** -->
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla Community QA Extension
*
* The Initial Developer of the Original Code is the Mozilla Corporation.
* Portions created by the Initial Developer are Copyright (C) 2007
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Ben Hsieh <ben.hsieh@gmail.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** -->
<!DOCTYPE dialog PUBLIC "-//MOZILLA//DTD XUL V1.0//EN" "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
[<!ENTITY % qaDTD SYSTEM "chrome://qa/locale/qa.dtd"> %qaDTD;
]>
@ -43,47 +42,48 @@
<?xml-stylesheet href="chrome://qa/skin/" type="text/css"?>
<dialog id="dialog-name"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
persist="screenX screenY width height"
buttons="accept,cancel"
ondialogaccept="return OK();"
ondialogcancel="return Cancel();"
onload="handleLoad();">
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
persist="screenX screenY width height"
buttons="accept,cancel"
ondialogaccept="return OK();"
ondialogcancel="return Cancel();"
onload="handleLoad();">
<script type="application/x-javascript" src="chrome://qa/content/MochiKit/MochiKit.js" />
<script type="application/x-javascript" src="chrome://qa/content/prefs.js" />
<script type="application/x-javascript" src="chrome://qa/content/litmus.js" />
<script type="application/x-javascript" src="chrome://qa/content/qa.js" />
<script type="application/x-javascript" src="chrome://qa/content/settings.js" />
<script type="application/x-javascript" src="chrome://qa/content/common.js" />
<script type="application/x-javascript" src="chrome://qa/content/tabs/selecttests.js" />
<script type="application/x-javascript" src="chrome://qa/content/MochiKit/MochiKit.js" />
<script type="application/x-javascript" src="chrome://qa/content/prefs.js" />
<script type="application/x-javascript" src="chrome://qa/content/litmus.js" />
<script type="application/x-javascript" src="chrome://qa/content/qa.js" />
<script type="application/x-javascript" src="chrome://qa/content/settings.js" />
<script type="application/x-javascript" src="chrome://qa/content/common.js" />
<script type="application/x-javascript" src="chrome://qa/content/tabs/selecttests.js" />
<dialogheader description="&qa.selecttests.header;" />
<spacer height="20" />
<vbox>
<hbox>
<description value="Test Run:" />
<menulist label=" " id="qa-st-testrun" onselect="handleRunSelect()">
<menupopup >
<menuitem label="&qa.selecttests.load;" selected="true" />
</menupopup>
</menulist>
</hbox>
<spacer height="20" />
<hbox>
<vbox>
<description value="Test Group:" />
<listbox id="qa-st-testgroup" rows = "5" onselect="handleTestgroupSelect()">
<listitem label="&qa.selecttests.load;" />
</listbox>
</vbox>
<vbox>
<description value="Subgroup" />
<listbox id="qa-st-subgroup" rows = "5" onselect="handleSubgroupSelect()">
<listitem label="&qa.selecttests.load;" />
</listbox>
</vbox>
</hbox>
</vbox>
<dialogheader description="&qa.selecttests.header;" />
<spacer height="20" />
<vbox>
<hbox>
<description value="Test Run:" />
<menulist label=" " id="qa-st-testrun" onselect="handleRunSelect()">
<menupopup >
<menuitem label="&qa.selecttests.load;" selected="true" />
</menupopup>
</menulist>
</hbox>
<spacer height="20" />
<hbox>
<vbox>
<description value="Test Group:" />
<listbox id="qa-st-testgroup" rows = "5"
onselect="handleTestgroupSelect()">
<listitem label="&qa.selecttests.load;" />
</listbox>
</vbox>
<vbox>
<description value="Subgroup" />
<listbox id="qa-st-subgroup" rows = "5"
onselect="handleSubgroupSelect()">
<listitem label="&qa.selecttests.load;" />
</listbox>
</vbox>
</hbox>
</vbox>
</dialog>

Просмотреть файл

@ -1,39 +1,39 @@
<?xml version="1.0"?><!-- -*- Mode: HTML -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Mozilla Community QA Extension
#
# The Initial Developer of the Original Code is the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2006
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Zach Lipton <zach@zachlipton.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the LGPL or the GPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK ***** -->
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla Community QA Extension
*
* The Initial Developer of the Original Code is the Mozilla Corporation.
* Portions created by the Initial Developer are Copyright (C) 2007
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Zach Lipton <zach@zachlipton.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** -->
<!DOCTYPE overlay [
<!ENTITY % qaDTD SYSTEM "chrome://qa/locale/qa.dtd"> %qaDTD;
@ -43,14 +43,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://qa/content/settings.js" />
<script type="application/x-javascript">
// on load, set an event listener to deal with saving settings when
// changing tabs
window.addEventListener('load', function() {
$('qa_tabrow').addEventListener('select', qaPrefsWindow.onSwitchTab, false);
}, false);
</script>
<stringbundleset id="stringbundleset">
<stringbundle id="bundle_qa" src="chrome://qa/locale/qa.properties" />
</stringbundleset>
@ -59,26 +52,36 @@
<vbox flex="1">
<groupbox>
<caption label="&qa.preferences.litmus.title;" />
<label control="qa-preferences-litmus-username" value="&qa.preferences.litmus.username;"/>
<label control="qa-preferences-litmus-username"
value="&qa.preferences.litmus.username;"/>
<textbox id="qa-preferences-litmus-username" />
<label control="qa-preferences-litmus-password" value="&qa.preferences.litmus.password;"/>
<label control="qa-preferences-litmus-password"
value="&qa.preferences.litmus.password;"/>
<textbox id="qa-preferences-litmus-password" type="password" />
<hbox>
<button id="qa-preferences-litmus-createAccount" label="&qa.preferences.litmus.createAccount;"
oncommand="qaPrefsWindow.createAccount();" />
<button id="qa-preferences-litmus-createAccount"
label="&qa.preferences.litmus.createAccount;"
oncommand="qaPrefsWindow.createAccount();" />
</hbox>
</groupbox>
<groupbox id="qa-prefs-notify">
<caption label="&qa.preferences.notification.title;" />
<checkbox id="qa-prefs-notify-disableall" label="&qa.preferences.notification.disableall;" />
<checkbox id="qa-prefs-notify-disableall"
label="&qa.preferences.notification.disableall;" />
<description>&qa.preferences.notification.header;</description>
<checkbox id="qa-prefs-notify-testday" label="&qa.preferences.notification.testday;" />
<checkbox id="qa-prefs-notify-bugday" label="&qa.preferences.notification.bugday;" />
<checkbox id="qa-prefs-notify-prerelease" label="&qa.preferences.notification.prerelease;" />
<checkbox id="qa-prefs-notify-qmo" label="&qa.preferences.notification.qmo;" />
<checkbox id="qa-prefs-notify-newbuild" label="&qa.preferences.notification.newbuild;" />
<checkbox id="qa-prefs-notify-other" label="&qa.preferences.notification.other;" />
<checkbox id="qa-prefs-notify-testday"
label="&qa.preferences.notification.testday;" />
<checkbox id="qa-prefs-notify-bugday"
label="&qa.preferences.notification.bugday;" />
<checkbox id="qa-prefs-notify-prerelease"
label="&qa.preferences.notification.prerelease;" />
<checkbox id="qa-prefs-notify-qmo"
label="&qa.preferences.notification.qmo;" />
<checkbox id="qa-prefs-notify-newbuild"
label="&qa.preferences.notification.newbuild;" />
<checkbox id="qa-prefs-notify-other"
label="&qa.preferences.notification.other;" />
</groupbox>
</vbox>

Просмотреть файл

@ -1,18 +1,55 @@
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is Mozilla QA Extension Code.
-
- The Initial Developer of the Original Code is the Mozilla Corporation.
- Portions created by the Initial Developer are Copyright (C) 2007
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Zach Lipton <zach@zachlipton.com>
- Ben Hsieh <bhsieh@mozilla.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<!ENTITY qa.litmus.title "Litmus">
<!ENTITY qa.litmus.selecttests "Select Tests">
<!ENTITY qa.litmus.testlist.initiallabel "No tests loaded, select some tests!">
<!ENTITY qa.litmus.testlist.initialdescription "No testcase">
<!ENTITY qa.statusbar.label "QA">
<!ENTITY qa.mainwindow.prefs "Preferences">
<!ENTITY qa.mainwindow.title "Mozilla QA">
<!ENTITY qa.testcase.steps "Steps to Perform">
<!ENTITY qa.testcase.expected "Expected Results">
<!ENTITY qa.testcase.result.pass "Test Passed">
<!ENTITY qa.testcase.result.fail "Test Failed">
<!ENTITY qa.testcase.result.unclearbroken "Test is unclear or broken">
<!ENTITY qa.testcase.comment "Comment (optional):">
<!ENTITY qa.statusbar.label "QA">
<!ENTITY qa.mainwindow.prefs "Preferences">
<!ENTITY qa.mainwindow.title "Mozilla QA">
<!ENTITY qa.testcase.steps "Steps to Perform">
<!ENTITY qa.testcase.expected "Expected Results">
<!ENTITY qa.testcase.result.pass "Test Passed">
<!ENTITY qa.testcase.result.fail "Test Failed">
<!ENTITY qa.testcase.result.unclearbroken "Test is unclear or broken">
<!ENTITY qa.testcase.comment "Comment (optional):">
<!ENTITY qa.selecttests.load "Loading...">
<!ENTITY qa.selecttests.load "Loading...">
<!ENTITY qa.selecttests.header "Select test group">
<!ENTITY qa.preferences.title "Settings">

Просмотреть файл

@ -1,9 +1,45 @@
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Mozilla QA Extension Code.
#
# The Initial Developer of the Original Code is the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2007
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Zach Lipton <zach@zachlipton.com>
# Ben Hsieh <bhsieh@mozilla.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
qa.extension.testcase.head = Testcase #
qa.extension.prefs.loginError = Login Error. Please check your username and password or create a new account.
qa.extension.prefs.loadingMsg = Validating account information. Please Wait...
qa.extension.prefs.savedMsg = Your settings have been saved
qa.extension.sysconfig.loadingMsg = Loading menu options...
qa.extension.loading = Loading...
qa.extension.litmus.progress = Test %1$S of %2$S
qa.extension.litmus.stats = My tests run - week: %1$S, month: %2$S, all time: %3$S

Просмотреть файл

@ -1,3 +1,40 @@
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Mozilla QA Extension Code.
#
# The Initial Developer of the Original Code is the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2007
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Zach Lipton <zach@zachlipton.com>
# Ben Hsieh <bhsieh@mozilla.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
qa.extension.url.qmo.upcomingEvents = http://quality.mozilla.org/event/2007/06/21/feed/all/all/
qa.extension.url.qmo.news = http://quality.mozilla.org/rss.xml
qa.extension.url.qmo.forum_topics = http://quality.mozilla.org/extension/forum_topics

Просмотреть файл

@ -1,3 +1,39 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla Community QA Extension
*
* The Initial Developer of the Original Code is the Mozilla Corporation.
* Portions created by the Initial Developer are Copyright (C) 2006
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Zach Lipton <zach@zachlipton.com>
* Ben Hsieh <ben.hsieh@gmail.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#qa-notify {
right: 18px;
bottom: 21px;
@ -23,3 +59,7 @@
font-size: 1.5em;
font-weight: bold;
}
#qa-statusbar-overlay {
list-style-image: url('chrome://qa/skin/qmo-16px.png');
}

Двоичные данные
testing/extensions/community/chrome/skin/highlight-end.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 3.0 KiB

Двоичные данные
testing/extensions/community/chrome/skin/highlight-hover-end.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 3.0 KiB

Двоичные данные
testing/extensions/community/chrome/skin/highlight-hover-mid.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.8 KiB

Двоичные данные
testing/extensions/community/chrome/skin/highlight-hover-start.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 3.1 KiB

Двоичные данные
testing/extensions/community/chrome/skin/highlight-mid.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.8 KiB

Двоичные данные
testing/extensions/community/chrome/skin/highlight-start.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 3.1 KiB

Просмотреть файл

@ -1,40 +1,40 @@
/* ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Mozilla Community QA Extension
#
# The Initial Developer of the Original Code is the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2007
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Zach Lipton <zach@zachlipton.com>
# Zach Linder <zakness@gmail.com>
# Ben Hsieh <bhsieh@stanford.edu>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the LGPL or the GPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK ***** --> */
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla Community QA Extension
*
* The Initial Developer of the Original Code is the Mozilla Corporation.
* Portions created by the Initial Developer are Copyright (C) 2006
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Zach Lipton <zach@zachlipton.com>
* Zach Linder <zakness@gmail.com>
* Ben Hsieh <ben.hsieh@gmail.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
@import url(chrome://global/skin/);
@ -71,7 +71,6 @@
#qa_tabbox html|a:active {
color: #333;
}
/*remove bullets for everything but lists contained inside testcase data */
html|li {
list-style-type: none !important;
@ -88,6 +87,7 @@ html|li {
}
/*-------------------------------
TABS
-------------------------------*/
@ -95,29 +95,60 @@ html|li {
height: 30px !important;
padding-top: 5px !important;
}
#qa_tabbox .tab-icon-image {
list-style-image: none;
width: 0;
}
#qa_tabbox #qa-tabbar-qmo {
list-style-image: url(qmo-16px.png);
width: 15px;
}
#qa_tabbox tab, #qa_tabbox tabs spacer {
border-bottom: 1px solid #ACA899 !important;
}
.tabs-left, .tabs-right {
-moz-border-bottom-colors: #ACA899 #ACA899 !important;
}
#qa_tabbox tab[selected="true"] {
border-bottom: 1px solid #E8E5D8 !important;
}
#qa_tabbox #qa-tabbar-spacer {
width: 93px;
}
#qa_tabbox tab, #qa_tabbox tabs spacer {
border-bottom: 1px solid #ACA899 !important;
}
.tabs-left, .tabs-right {
-moz-border-bottom-colors: #ACA899 !important;
}
#qa_tabbox tab[selected="true"] {
border-bottom: 1px solid #E8E5D8 !important;
}
tabs {
border-bottom: 3px solid #E8E5D8;
border-bottom: 1px solid #E8E5D8;
}
.tab-close-button {
display: none !important;
}
.tabbrowser-tab.highlight > .tab-image-right {
background: url("chrome://qa/skin/highlight-start.png") no-repeat !important;
}
.tabbrowser-tab.highlight > .tab-image-left {
background: url("chrome://qa/skin/highlight-end.png") no-repeat !important;
}
.tabbrowser-tab.highlight > .tab-image-middle {
background: url("chrome://qa/skin/highlight-mid.png") repeat-x !important;
}
.tabbrowser-tab.highlight:hover > .tab-image-right {
background: url("chrome://qa/skin/highlight-hover-start.png") no-repeat !important;
}
.tabbrowser-tab.highlight:hover > .tab-image-left {
background: url("chrome://qa/skin/highlight-hover-end.png") no-repeat !important;
}
.tabbrowser-tab.highlight:hover > .tab-image-middle {
background: url("chrome://qa/skin/highlight-hover-mid.png") repeat-x !important;
}
/* don't show outline around the middle of selected tabs */
@ -204,4 +235,3 @@ tab:focus > .tab-middle {
.list {
padding-left: 10px;
}

Просмотреть файл

@ -1,5 +1,43 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla Community QA Extension
*
* The Initial Developer of the Original Code is the Mozilla Corporation.
* Portions created by the Initial Developer are Copyright (C) 2007
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Zach Lipton <zach@zachlipton.com>
* Ben Hsieh <bhsieh@mozilla.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
pref("qa.extension.litmus.url", "http://litmus.mozilla.org/");
pref("qa.extension.hermes.url", "http://litmus.mozilla.org/hermes/1/");
pref("qa.extension.bugzilla.url", "http:/bugzilla.mozilla.org/");
pref("qa.extension.isFirstTime", true);
pref("qa.extension.minNotificationInterval", 5400000); // 90 minutes
pref("qa.extension.lastNotificationTime", 0);

Просмотреть файл

@ -1,6 +1,6 @@
content qa jar:chrome/qa.jar!/content/
skin qa classic/1.0 jar:chrome/qa.jar!/skin/
locale qa en-US jar:chrome/qa.jar!/locale/en-US/
content qa jar:chrome/qa.jar!/content/
skin qa classic/1.0 jar:chrome/qa.jar!/skin/
locale qa en-US jar:chrome/qa.jar!/locale/en-US/
overlay chrome://browser/content/browser.xul chrome://qa/content/browserOverlays.xul
@ -8,3 +8,4 @@ content chatzilla_qa jar:chatzilla.jar!/content/chatzilla/
skin chatzilla_qa modern/1.0 jar:chatzilla.jar!/skin/modern/chatzilla/
locale chatzilla_qa en-US jar:chatzilla.jar!/locale/en-US/chatzilla/
content chatzillaservice_qa components/chatzilla-service.js

Просмотреть файл

@ -1,10 +1,77 @@
#qa-tabbar-spacer { width: 17px !important; } #qa-tabbar-qmo { margin-left: 10px !important; margin-right: 17px !important; }
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla Community QA Extension
*
* The Initial Developer of the Original Code is the Mozilla Corporation.
* Portions created by the Initial Developer are Copyright (C) 2006
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Zach Lipton <zach@zachlipton.com>
* Ben Hsieh <ben.hsieh@gmail.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#qa_tabpanels * {
background-color: #ebebeb !important;
#qa-tabbar-spacer {
width: 17px !important;
}
groupbox * {
background: url("chrome://global/skin/10pct_transparent_grey.png") repeat !important;
#qa_tabbox tabpanel {
background-color: transparent !important;
}
#qa_tabbox tabpanels {
background-color: transparent !important;
}
#qa_tabbox groupbox {
background-color: transparent !important;
}
#qa_tabbox caption {
background-color: transparent !important;
}
/** causes weird behavior on branch, but needed for trunk **/
#qa-tabbar-qmo {
width:16px;
margin-left: 13px;
margin-right: 5px;
}
#qa-testcase-comment {
background-color: transparent !important;
max-width: 170px;
}
#qa-preferences-litmus-username {
max-width: 350px;
width: 350px;
}
#qa-preferences-litmus-password {
max-width: 400px;
width: 350px;
}

Просмотреть файл

@ -0,0 +1,5 @@
/**
* This file is intentionally left blank to prevent an error from being thrown
* on windows when attempting to overwrite the common CSS. If we need future
* specific windows CSS tweaks, they should go here.
**/