Move common Javascript code into a separate file

[?]
Jun 24, 2013, 11:16 PM
2P7VNAACFSXMH42JCXQZ7GDAAEIFDGDWJOK6XD6G36AGEYQSRO2AC

Dependencies

  • [2] OCRZNLGS Update jquery/jqueryui
  • [3] YG6VGK4F "Evaluate" command: push the jobset to the front of the eval queue
  • [4] ILEDGCVA When a tab is selected, change the fragment id
  • [5] OEPUOUNB Using twitter bootstrap for more consistent looks for Hydra
  • [6] CM2QYOQ7 Revert to jQuery 1.8.3
  • [7] BIVZGPUT Optimise clickable rows
  • [8] GN3JXNQS
  • [9] UVMFS73T * Some jQuery / CSS hackery.
  • [10] KKJNJHO5 Update bootstrap to 2.0.3
  • [11] YJAHR4FU * jQuery 1.8.4.
  • [12] J5UVLXOK * Start of a basic Catalyst web interface.
  • [13] KT2SLXPU Move <style> to hydra.css
  • [14] OIBSCXGI Use a popover to show how to use the build reproduction script
  • [15] GCHNNFZP
  • [16] F2YSY4BK update jquery versions in templates
  • [17] BA46C5LN * Pretty-print the logs.
  • [18] MGOGOKQP add tracker html code via HYDRA_TRACKER
  • [19] HRAFVVOE make logo configurable via HYDRA_LOGO env var
  • [20] O3CGTZFG Simplify the log tree implementation a bit
  • [21] QB3LWT7N * Ouch.
  • [22] 3JCIP7EZ Use a span instead of a div in the pretty logs
  • [23] HJLYC753 * Adding input value alternatives.
  • [24] PZL3SZM3 Give every page a consistent title
  • [25] 4JPNFWRB * Use jquery for the logfile manipulation.
  • [26] SMCOU72F hydra: add some admin for adding/enabling/etc build machines
  • [27] LP66DSH2 * hydra: updated jquery version, needed for tabs (to be added later)
  • [28] 5L7IWOIW Use https://ajax.googleapis.com if we're on https
  • [*] TLJC6BJ3 Add a menu item for deleting jobsets

Change contents

  • replacement in src/root/layout.tt at line 36
    [5.5][5.1901:1937](),[5.364][5.1901:1937](),[5.459][5.1901:1937](),[5.619][5.1901:1937](),[5.6743][5.1901:1937](),[5.1901][5.1901:1937](),[5.1937][5.1518:1555](),[5.1555][5.0:1](),[5.623][5.62:108](),[5.62][5.62:108]()
    <script type="text/javascript">
    $(document).ready(function() {
    /*** Tree toggles in logfiles. ***/
    [5.345]
    [5.54]
    <script type="text/javascript" src="/static/js/common.js"></script>
  • edit in src/root/layout.tt at line 38
    [5.55][5.55:194](),[5.194][5.0:45](),[5.45][5.241:500](),[5.241][5.241:500](),[5.500][5.46:93](),[5.93][5.549:893](),[5.549][5.549:893](),[5.893][5.94:230](),[5.91][5.1027:1203](),[5.230][5.1027:1203](),[5.1027][5.1027:1203](),[5.1203][5.231:369](),[5.183][5.1339:1457](),[5.369][5.1339:1457](),[5.1339][5.1339:1457](),[5.110][5.110:111](),[5.111][5.1163:1460](),[5.1460][3.11:46](),[3.46][5.1460:1461](),[5.1460][5.1460:1461](),[5.1461][5.1167:1210](),[5.1210][4.0:607](),[5.111][5.1601:1611](),[4.607][5.1601:1611](),[5.1210][5.1601:1611](),[5.1457][5.1601:1611](),[5.1461][5.1601:1611](),[5.1601][5.1601:1611](),[5.1611][2.237:238](),[2.238][5.2058:2072](),[5.1611][5.2058:2072](),[5.2058][5.2058:2072](),[5.2072][5.365:366]()
    /* Set the appearance of the toggle depending on whether the
    corresponding subtree is initially shown or hidden. */
    $(".tree-toggle").map(function() {
    if ($(this).siblings("ul:hidden").length == 0) {
    $(this).text("-");
    } else {
    $(this).text("+");
    }
    });
    /* When a toggle is clicked, show or hide the subtree. */
    $(".tree-toggle").click(function() {
    if ($(this).siblings("ul:hidden").length != 0) {
    $(this).siblings("ul").show();
    $(this).text("-");
    } else {
    $(this).siblings("ul").hide();
    $(this).text("+");
    }
    });
    /* Implementation of the expand all link. */
    $(".tree-expand-all").click(function() {
    $(".tree-toggle", $(this).parent().siblings(".tree")).map(function() {
    $(this).siblings("ul").show();
    $(this).text("-");
    });
    });
    /* Implementation of the collapse all link. */
    $(".tree-collapse-all").click(function() {
    $(".tree-toggle", $(this).parent().siblings(".tree")).map(function() {
    $(this).siblings("ul").hide();
    $(this).text("+");
    });
    });
    $("table.clickable-rows").click(function(event) {
    if ($(event.target).closest("a").length) return;
    link = $(event.target).parents("tr").find("a.row-link");
    if (link.length == 1)
    window.location = link.attr("href");
    });
    bootbox.animate(false);
    $(".hydra-popover").popover({});
    /* Ensure that pressing the back button on another page
    navigates back to the previously selected tab on this
    page. */
    $(function() {
    $('.nav-tabs').bind('show', function(e) {
    var pattern = /#.+/gi;
    var id = e.target.toString().match(pattern)[0];
    history.replaceState(null, "", id);
    });
    });
    $(function() {
    if (window.location.hash) {
    $(".nav a[href='" + window.location.hash + "']").tab('show');
    }
    })
    });
    </script>
  • file addition: common.js (----------)
    [30.80]
    $(document).ready(function() {
    /*** Tree toggles in logfiles. ***/
    /* Set the appearance of the toggle depending on whether the
    corresponding subtree is initially shown or hidden. */
    $(".tree-toggle").map(function() {
    if ($(this).siblings("ul:hidden").length == 0) {
    $(this).text("-");
    } else {
    $(this).text("+");
    }
    });
    /* When a toggle is clicked, show or hide the subtree. */
    $(".tree-toggle").click(function() {
    if ($(this).siblings("ul:hidden").length != 0) {
    $(this).siblings("ul").show();
    $(this).text("-");
    } else {
    $(this).siblings("ul").hide();
    $(this).text("+");
    }
    });
    /* Implementation of the expand all link. */
    $(".tree-expand-all").click(function() {
    $(".tree-toggle", $(this).parent().siblings(".tree")).map(function() {
    $(this).siblings("ul").show();
    $(this).text("-");
    });
    });
    /* Implementation of the collapse all link. */
    $(".tree-collapse-all").click(function() {
    $(".tree-toggle", $(this).parent().siblings(".tree")).map(function() {
    $(this).siblings("ul").hide();
    $(this).text("+");
    });
    });
    $("table.clickable-rows").click(function(event) {
    if ($(event.target).closest("a").length) return;
    link = $(event.target).parents("tr").find("a.row-link");
    if (link.length == 1)
    window.location = link.attr("href");
    });
    bootbox.animate(false);
    $(".hydra-popover").popover({});
    /* Ensure that pressing the back button on another page
    navigates back to the previously selected tab on this
    page. */
    $('.nav-tabs').bind('show', function(e) {
    var pattern = /#.+/gi;
    var id = e.target.toString().match(pattern)[0];
    history.replaceState(null, "", id);
    });
    $(function() {
    if (window.location.hash) {
    $(".nav a[href='" + window.location.hash + "']").tab('show');
    }
    })
    });