all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 12b827f30bbae8c8879ad62406b8425fdb341a32 2443 bytes (raw)
name: website/static/base/js/packages.js 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
 
/* license: CC0 */

function set_build_status (pkg_string)
{
  /* Find the element to put the status icon in. */
  var pkgIcon = document.getElementById("icon-"+ pkg_string);

  /* Don't bother when the icon doesn't exist. */
  if (pkgIcon != null)
  {
    var xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function() {
      if (xhttp.readyState == 4 && xhttp.status == 200) {

          /* The API call returns JSON. Parse it, and change the icon's source. */
          var pkgInfo = JSON.parse(xhttp.responseText);
          pkgIcon.src = "../static/base/img/status-icons/"+ pkgInfo[0]["buildstatus"] + ".png";
      }
    }
      xhttp.open("GET", window.location.href.split(":")[0] + "://hydra.gnu.org/api/latestbuilds?nr=1&project=gnu&jobset=master&job="+ pkg_string, true);
    xhttp.send();
  }
}

function show_hide(idThing)
{
  if(document.getElementById && document.createTextNode) {
    var thing = document.getElementById(idThing);
    /* Used to change the link text, depending on whether description is
       collapsed or expanded */
    var thingLink = thing.previousSibling.lastChild.firstChild;
    if (thing) {
      if (thing.style.display == "none") {
        var column = thing.parentNode;
        var pkg_icons = column.getElementsByTagName('img')
        for (var i=0; i < pkg_icons.length; i++) {
            set_build_status (pkg_icons[i].id.slice(5));
        }
        thing.style.display = "";
        thingLink.data = 'Collapse';
      } else {
        thing.style.display = "none";
        thingLink.data = 'Expand';
      }
    }
  }
}

/* Add controllers used for collapse/expansion of package descriptions */
function prep(idThing)
{
  var tdThing = document.getElementById(idThing).parentNode;
  if (tdThing) {
    var aThing = tdThing.firstChild.appendChild(document.createElement('a'));
    aThing.setAttribute('href', 'javascript:void(0)');
    aThing.setAttribute('title', 'show/hide package description');
    aThing.appendChild(document.createTextNode('Expand'));
    aThing.onclick=function(){show_hide(idThing);};
    /* aThing.onkeypress=function(){show_hide(idThing);}; */
  }
}

/* Take n element IDs, prepare them for javascript enhanced
   display and hide the IDs by default. */
function prep_pkg_descs()
{
  if(document.getElementById && document.createTextNode) {
    for(var i=0; i<arguments.length; i++) {
      prep(arguments[i])
      show_hide(arguments[i]);
    }
  }
}

debug log:

solving 12b827f ...
found 12b827f in https://yhetil.org/guix/8737rrv2ey.fsf@gnu.org/
found 246d828 in https://yhetil.org/guix/87r3hx85ow.fsf@gnu.org/ ||
	https://yhetil.org/guix/87fuzvo7i3.fsf@gnu.org/
found c8d9fc4 in https://yhetil.org/guix/87mw02nlqa.fsf@openmailbox.org/

applying [1/3] https://yhetil.org/guix/87mw02nlqa.fsf@openmailbox.org/
diff --git a/website/static/base/js/packages.js b/website/static/base/js/packages.js
new file mode 100644
index 0000000..c8d9fc4


applying [2/3] https://yhetil.org/guix/87r3hx85ow.fsf@gnu.org/
diff --git a/website/static/base/js/packages.js b/website/static/base/js/packages.js
index c8d9fc4..246d828 100644

Checking patch website/static/base/js/packages.js...
Applied patch website/static/base/js/packages.js cleanly.
Checking patch website/static/base/js/packages.js...
Applied patch website/static/base/js/packages.js cleanly.

skipping https://yhetil.org/guix/87fuzvo7i3.fsf@gnu.org/ for 246d828
index at:
100644 246d828d61991d1378f954f9484fbedcf79817d0	website/static/base/js/packages.js

applying [3/3] https://yhetil.org/guix/8737rrv2ey.fsf@gnu.org/
diff --git a/website/static/base/js/packages.js b/website/static/base/js/packages.js
index 246d828..12b827f 100644

Checking patch website/static/base/js/packages.js...
Applied patch website/static/base/js/packages.js cleanly.

index at:
100644 12b827f30bbae8c8879ad62406b8425fdb341a32	website/static/base/js/packages.js

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.