~minos-archive/minos/firefox-minos-settings

« back to all changes in this revision

Viewing changes to mozilla/firefox/h5xyzl6e.default/gm_scripts/LP_DetailedDescription-1/lp_prefilled_description.user.js

  • Committer: Javier Lopez
  • Date: 2015-07-08 01:10:19 UTC
  • Revision ID: git-v1:d8c3500bae00a8a67d74f8f96235ec11d75231be
rename mozilla-minos-settings -> firefox-minos-settings

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// ==UserScript==
2
 
// @name           LP_DetailedDescription
3
 
// @namespace      http://murraytwins.com/greasemonkey/
4
 
// @description    (Launchpad) Prefill bug description
5
 
// @include        https://launchpad.net/*
6
 
// @include        https://*.launchpad.net/*
7
 
// @include        https://*.edge.launchpad.net/*
8
 
// @date           2009-02-11
9
 
// @creator        Brian Murray <brian@ubuntu.com>
10
 
// ==/UserScript==
11
 
// This would be more awesome if worked like buttontags
12
 
// and you could have different descriptions for different
13
 
// projects
14
 
 
15
 
 
16
 
// ------  User settable data  -------------
17
 
// Description to use
18
 
var description = "Release of Ubuntu:\nPackage Version:\nExpected Results:\nActual Results:\n"
19
 
 
20
 
// ------- End of User settable data -------
21
 
 
22
 
function xpath(query, context) {
23
 
    context = context ? context : document;
24
 
    return document.evaluate(query, context, null,
25
 
                            XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
26
 
}
27
 
 
28
 
(function() {
29
 
 
30
 
    // grab the part after bugs.launchpad.net - pathname looks like /ubuntu/+source/pkgname/+bug/1
31
 
    var pathname = window.location.pathname;
32
 
    // find the project name
33
 
    var project_name = pathname.split('/')[1]
34
 
    // project for the description to apply to
35
 
    if ( project_name == 'ubuntu' ) {
36
 
        if (xpath('//form[contains(@action,"filebug")]').snapshotItem(0)) {
37
 
            xpath('//textarea[@id="field.comment"]').snapshotItem(0).value = description;
38
 
        }
39
 
    }
40
 
})();