Check-in [2f8ac12d95]

Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix the javascript.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2f8ac12d955d1a86de12ca8c3c3cfb4e27cec6fd6066309ad99f1a4a6cba0d50
User & Date: dkf 2018-05-28 12:56:40
Context
2018-05-28
12:59
TIP 431 becomes 8.7; no implementation ready. check-in: 4192baaef1 user: dkf tags: trunk
12:56
Fix the javascript. check-in: 2f8ac12d95 user: dkf tags: trunk
11:52
JS is horrible. Closed-Leaf check-in: cd213bb0a3 user: dkf tags: fix-js, minor change
10:15
Turns out that the existing temp-dir code was Windows only, within tclWinLoad.c. check-in: 302cc3dd4e user: dkf tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to index.json.

cannot compute difference between binary files

Changes to index.md.

    17     17   </div></form>
    18     18   <p>
    19     19   
    20     20   <div><div>
    21     21   Filter Toggles:
    22     22   </div>
    23     23   <div>
           24  +<input type="checkbox" id="click_projectdraft">Drafts</button>
           25  +<input type="checkbox" id="click_projectfinal">Finals</button>
           26  +<input type="checkbox" id="click_project">Projects</button>
           27  +(<input type="checkbox" id="click_project84">8.4</button>
           28  + <input type="checkbox" id="click_project85">8.5</button>
           29  + <input type="checkbox" id="click_project86">8.6</button>
           30  + <input type="checkbox" id="click_project87">8.7</button>
           31  + <input type="checkbox" id="click_project90">9.0</button>)
           32  +<input type="checkbox" id="click_informational">Informationals</button>
           33  +<input type="checkbox" id="click_process">Processes</button>
           34  +<br>
           35  +<input type="checkbox" id="click_rejected">Rejected</button>
           36  +<input type="checkbox" id="click_withdrawn">Withdrawn</button>
           37  +<input type="checkbox" id="click_obsoleted">Obsoleted</button>
           38  +<input type="checkbox" id="click_deferred">Deferred</button>
           39  +<input type="checkbox" id="click_jest">Jokes</button>
           40  +</div></div>
    24     41   <style title="filtering">
    25         -.rejected {
    26         -    display: none;
    27         -}
    28         -.withdrawn {
    29         -    display: none;
    30         -}
    31         -.obsoleted {
    32         -    display: none;
    33         -}
    34         -.deferred {
    35         -    display: none;
    36         -}
    37         -.jest {
    38         -    display: none;
    39         -}
           42  +/*
           43  + * DO NOT MANUALLY PUT ANY STYLES IN HERE!
           44  + *
           45  + * This is manipulated by JS and it makes a lot of assumptions about the
           46  + * structure of this stylesheet. Use a different stylesheet instead!
           47  + */
    40     48   </style>
    41     49   <script>
    42     50   var sheet = (function(){
    43     51       for (var i=0; i<document.styleSheets.length; i++) {
    44         -	var s = document.styleSheets[i];
    45         -	if (s.title == "filtering") {
    46         -	    return s;
    47         -	}
           52  +        var s = document.styleSheets[i];
           53  +        if (s.title == "filtering") {
           54  +            return s;
           55  +        }
    48     56       }
    49     57   })();
    50     58   function toggleClass(cls) {
    51     59       r = sheet.cssRules;
    52     60       if (r) {
    53         -	var i = r.length;
    54         -	while (i--) {
    55         -	    if (r[i].selectorText && r[i].selectorText.toLowerCase() === cls) {
    56         -		sheet.deleteRule(i);
    57         -		return;
    58         -	    }
    59         -	}
           61  +        var i = r.length;
           62  +        while (i--) {
           63  +            if (r[i].selectorText && r[i].selectorText.toLowerCase() === cls) {
           64  +		console.log("removing hide rule for " + cls);
           65  +                sheet.deleteRule(i);
           66  +                return;
           67  +            }
           68  +        }
    60     69       }
           70  +    console.log("adding hide rule for " + cls);
    61     71       sheet.insertRule(cls + " {display:none;}", 0);
    62     72   }
    63         -</script>
    64         -<input type="checkbox" onclick="toggleClass('.projectdraft')">Drafts</button>
    65         -<input type="checkbox" onclick="toggleClass('.projectfinal')">Finals</button>
    66         -<input type="checkbox" onclick="toggleClass('.project')">Projects</button>
    67         -(<input type="checkbox" onclick="toggleClass('.project84')">8.4</button>
    68         - <input type="checkbox" onclick="toggleClass('.project85')">8.5</button>
    69         - <input type="checkbox" onclick="toggleClass('.project86')">8.6</button>
    70         - <input type="checkbox" onclick="toggleClass('.project87')">8.7</button>
    71         - <input type="checkbox" onclick="toggleClass('.project90')">9.0</button>)
    72         -<input type="checkbox" onclick="toggleClass('.informational')">Informationals</button>
    73         -<input type="checkbox" onclick="toggleClass('.process')">Processes</button>
    74         -<br>
    75         -<input type="checkbox" onclick="toggleClass('.rejected')" checked>Rejected</button>
    76         -<input type="checkbox" onclick="toggleClass('.widthdrawn')" checked>Withdrawn</button>
    77         -<input type="checkbox" onclick="toggleClass('.obsoleted')" checked>Obsoleted</button>
    78         -<input type="checkbox" onclick="toggleClass('.deferred')" checked>Deferred</button>
    79         -<input type="checkbox" onclick="toggleClass('.jest')" checked>Jokes</button>
    80         -</div></div>
           73  +document.addEventListener("DOMContentLoaded", function() {
           74  +    var TAGS = {
           75  +        "informational": 0, "process": 0,
           76  +        "projectdraft": 0, "projectfinal": 0, "project": 0,
           77  +        "project84": 0, "project85": 0, "project86": 0, "project87": 0,
           78  +        "project90": 0,
           79  +        "rejected": 1, "withdrawn": 1, "obsoleted": 1, "deferred": 1, "jest": 1
           80  +    };
           81  +    function toggler(selector) {
           82  +	return function() {
           83  +	    toggleClass(selector);
           84  +	}
           85  +    }
           86  +    for (var tag of Object.keys(TAGS)) {
           87  +        var id = "click_" + tag;
           88  +        var selector = "." + tag;
           89  +        document.getElementById(id).addEventListener("click", toggler(selector));
           90  +        if (TAGS[tag]) {
           91  +            document.getElementById(id).checked = true;
           92  +            toggleClass(selector);
           93  +        }
           94  +    }
           95  +});
           96  +</script>
    81     97   <p>
    82     98   
    83     99   <div class="index">
    84         -<table border="1" cellpadding="2" cellspacing="0" class="sortable"
    85         - id="tipTable">
          100  +<table border="1" cellpadding="2" cellspacing="0" class="sortable" id="tipTable">
    86    101   <thead><tr>
    87    102   <th>#</th>
    88    103   <th>Type</th>
    89    104   <th>Tcl Version</th>
    90    105   <th>Status</th>
    91    106   <th>Title</th>
    92    107   </tr></thead><tbody>

Changes to scripts/mkhtmlindex.tcl.

    27     27   </div></form>
    28     28   <p>
    29     29   
    30     30   <div><div>
    31     31   Filter Toggles:
    32     32   </div>
    33     33   <div>
           34  +<input type="checkbox" id="click_projectdraft">Drafts</button>
           35  +<input type="checkbox" id="click_projectfinal">Finals</button>
           36  +<input type="checkbox" id="click_project">Projects</button>
           37  +(<input type="checkbox" id="click_project84">8.4</button>
           38  + <input type="checkbox" id="click_project85">8.5</button>
           39  + <input type="checkbox" id="click_project86">8.6</button>
           40  + <input type="checkbox" id="click_project87">8.7</button>
           41  + <input type="checkbox" id="click_project90">9.0</button>)
           42  +<input type="checkbox" id="click_informational">Informationals</button>
           43  +<input type="checkbox" id="click_process">Processes</button>
           44  +<br>
           45  +<input type="checkbox" id="click_rejected">Rejected</button>
           46  +<input type="checkbox" id="click_withdrawn">Withdrawn</button>
           47  +<input type="checkbox" id="click_obsoleted">Obsoleted</button>
           48  +<input type="checkbox" id="click_deferred">Deferred</button>
           49  +<input type="checkbox" id="click_jest">Jokes</button>
           50  +</div></div>
    34     51   <style title="filtering">
    35         -.rejected {
    36         -    display: none;
    37         -}
    38         -.withdrawn {
    39         -    display: none;
    40         -}
    41         -.obsoleted {
    42         -    display: none;
    43         -}
    44         -.deferred {
    45         -    display: none;
    46         -}
    47         -.jest {
    48         -    display: none;
    49         -}
           52  +/*
           53  + * DO NOT MANUALLY PUT ANY STYLES IN HERE!
           54  + *
           55  + * This is manipulated by JS and it makes a lot of assumptions about the
           56  + * structure of this stylesheet. Use a different stylesheet instead!
           57  + */
    50     58   </style>
    51     59   <script>
    52     60   var sheet = (function(){
    53     61       for (var i=0; i<document.styleSheets.length; i++) {
    54         -	var s = document.styleSheets[i];
    55         -	if (s.title == "filtering") {
    56         -	    return s;
    57         -	}
           62  +        var s = document.styleSheets[i];
           63  +        if (s.title == "filtering") {
           64  +            return s;
           65  +        }
    58     66       }
    59     67   })();
    60     68   function toggleClass(cls) {
    61     69       r = sheet.cssRules;
    62     70       if (r) {
    63         -	var i = r.length;
    64         -	while (i--) {
    65         -	    if (r[i].selectorText && r[i].selectorText.toLowerCase() === cls) {
    66         -		sheet.deleteRule(i);
    67         -		return;
    68         -	    }
    69         -	}
           71  +        var i = r.length;
           72  +        while (i--) {
           73  +            if (r[i].selectorText && r[i].selectorText.toLowerCase() === cls) {
           74  +		console.log("removing hide rule for " + cls);
           75  +                sheet.deleteRule(i);
           76  +                return;
           77  +            }
           78  +        }
    70     79       }
           80  +    console.log("adding hide rule for " + cls);
    71     81       sheet.insertRule(cls + " {display:none;}", 0);
    72     82   }
    73         -</script>
    74         -<input type="checkbox" onclick="toggleClass('.projectdraft')">Drafts</button>
    75         -<input type="checkbox" onclick="toggleClass('.projectfinal')">Finals</button>
    76         -<input type="checkbox" onclick="toggleClass('.project')">Projects</button>
    77         -(<input type="checkbox" onclick="toggleClass('.project84')">8.4</button>
    78         - <input type="checkbox" onclick="toggleClass('.project85')">8.5</button>
    79         - <input type="checkbox" onclick="toggleClass('.project86')">8.6</button>
    80         - <input type="checkbox" onclick="toggleClass('.project87')">8.7</button>
    81         - <input type="checkbox" onclick="toggleClass('.project90')">9.0</button>)
    82         -<input type="checkbox" onclick="toggleClass('.informational')">Informationals</button>
    83         -<input type="checkbox" onclick="toggleClass('.process')">Processes</button>
    84         -<br>
    85         -<input type="checkbox" onclick="toggleClass('.rejected')" checked>Rejected</button>
    86         -<input type="checkbox" onclick="toggleClass('.widthdrawn')" checked>Withdrawn</button>
    87         -<input type="checkbox" onclick="toggleClass('.obsoleted')" checked>Obsoleted</button>
    88         -<input type="checkbox" onclick="toggleClass('.deferred')" checked>Deferred</button>
    89         -<input type="checkbox" onclick="toggleClass('.jest')" checked>Jokes</button>
    90         -</div></div>
           83  +document.addEventListener("DOMContentLoaded", function() {
           84  +    var TAGS = {
           85  +        "informational": 0, "process": 0,
           86  +        "projectdraft": 0, "projectfinal": 0, "project": 0,
           87  +        "project84": 0, "project85": 0, "project86": 0, "project87": 0,
           88  +        "project90": 0,
           89  +        "rejected": 1, "withdrawn": 1, "obsoleted": 1, "deferred": 1, "jest": 1
           90  +    };
           91  +    function toggler(selector) {
           92  +	return function() {
           93  +	    toggleClass(selector);
           94  +	}
           95  +    }
           96  +    for (var tag of Object.keys(TAGS)) {
           97  +        var id = "click_" + tag;
           98  +        var selector = "." + tag;
           99  +        document.getElementById(id).addEventListener("click", toggler(selector));
          100  +        if (TAGS[tag]) {
          101  +            document.getElementById(id).checked = true;
          102  +            toggleClass(selector);
          103  +        }
          104  +    }
          105  +});
          106  +</script>
    91    107   <p>
    92    108   
    93    109   <div class="index">
    94         -<table border="1" cellpadding="2" cellspacing="0" class="sortable"
    95         - id="tipTable">
          110  +<table border="1" cellpadding="2" cellspacing="0" class="sortable" id="tipTable">
    96    111   <thead><tr>
    97    112   <th>#</th>
    98    113   <th>Type</th>
    99    114   <th>Tcl Version</th>
   100    115   <th>Status</th>
   101    116   <th>Title</th>
   102    117   </tr></thead><tbody>