8000 Updated script to work on IE9+. Fixed bug database reference for Excl… · w3c/csswg-drafts@a7f071a · GitHub
Skip to content

Commit a7f071a

Browse files
committed
Updated script to work on IE9+. Fixed bug database reference for Exclusions
1 parent 4141169 commit a7f071a

3 files changed

Lines changed: 33 additions & 9 deletions

File tree

css3-exclusions/Exclusions.src.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1828,7 +1828,7 @@ <h2 class="no-num" id="property-index">Property index</h2>
18281828
<script type="text/javascript" src="../shared/scripts/BugzillaTrackerUtil.js"></script>
18291829
<script type="text/javascript" src="../shared/scripts/BugzillaTracker.js"></script>
18301830
<script type="text/javascript">
1831-
checkSpecificationIssues('CSS', 'Regions');
1831+
checkSpecificationIssues('CSS', 'Exclusions');
18321832
</script>
18331833

18341834
<h2 class="no-num" id="change-log">Change Log</h2>

css3-exclusions/Overview.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2787,7 +2787,7 @@ <h2 class=no-num id=property-index>Property index</h2>
27872787
checkSpecificationIssues(&lsquo;</script>
27882788

27892789
<p><code class=property>CSS</code>&rsquo;, &lsquo;<code
2790-
class=property>Regions</code>&rsquo;);
2790+
class=property>Exclusions</code>&rsquo;);
27912791

27922792
<h2 class=no-num id=change-log>Change Log</h2>
27932793

shared/scripts/BugzillaTracker.js

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
(function () {
2-
2+
3+
// helper methods for filling gaps less capable browsers
34
var util = 8000 {
45
getOuterHTML: function(el){
56

@@ -16,9 +17,32 @@
1617
temp = null
1718

1819
return outerHTML
20+
},
21+
22+
getDataAttr: function(el, attr){
23+
return (el.dataset) ? el.dataset[attr] : el.getAttribute("data-" + attr)
24+
},
25+
26+
toggleClass: function(el, className){
27+
if (el.classList){
28+
el.classList.toggle(className)
29+
}
30+
else{
31+
var classList = el.className.split(" "),
32+
index = classList.indexOf(className)
33+
34+
if (index > -1){
35+
classList.splice(index, 1)
36+
}
37+
else{
38+
classList.push(className)
39+
}
40+
41+
el.className = classList.join(" ")
42+
}
1943
}
2044
}
21-
45+
2246
function IssueDashboard(){
2347
var _dashboard = document.createElement("div"),
2448
_offlineIssues = {},
@@ -41,7 +65,7 @@
4165

4266
function toggleDashboard(e){
4367
e.preventDefault()
44-
_dashboard.classList.toggle("open")
68+
util.toggleClass(_dashboard, "open")
4569
}
4670

4771
function getNewIssues(){
@@ -123,8 +147,8 @@
123147
toggle.addEventListener("click", function(parent){
124148

125149
return function(e){
126-
e.preventDefault()
127-
parent.classList.toggle("showMarkup")
150+
e.preventDefault()
151+
util.toggleClass(parent, "showMarkup")
128152
}
129153

130154
}(issueItem))
@@ -205,11 +229,11 @@
205229
// pluck out the bug data from the DOM object
206230
issues.forEach(function (issue) {
207231

208-
var bugId = issue.dataset["bug_id"];
232+
var bugId = util.getDataAttr(issue, "bug_id")
209233

210234
if (bugId){
211235
list[bugId] = {
212-
"bug_status": issue.dataset["bug_status"],
236+
"bug_status": util.getDataAttr(issue, "bug_status"),
213237
"short_desc": issue.querySelector(".short-desc").textContent.replace(/\n?\s+/g, " ")
214238
}
215239
}

0 commit comments

Comments
 (0)