-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathwide-review-request.html
355 lines (324 loc) · 15.6 KB
/
wide-review-request.html
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
---
title: Request a wide review
toc: false
---
<!-- Go to the bottom of this document for help in editing it -->
<h2 id="sotd">About This Document</h2>
<p>This resource assists in request the wide review of a document.</p>
<h2 id="subtitle">****MOCKUP - DO NOT USE*****</h2>
<div class="field">
<label for="shortname" id="shortnameLabel">
<span class="field-label">Shortname</span>
</label>
<div class="field-hint" id="hint-shortname">You may use a TR shortname to find out your next step</div>
<input type="text" id="shortname" name="shortname" aria-describedby="hint-shortname" class="input-width-40"
minlength="3" maxlength="40" pattern="[-a-zA-Z0-9]{3,40}" list="w3ctr">
<datalist id="w3ctr"></datalist>
</div>
<div aria-live="assertive" aria-atomic="true" id="next">
<p>Pick your possible next major transition from:</p>
<fieldset>
<ul id="step_list"></ul>
</fieldset>
<div id="spec">
<p>We suggest:</p>
<pre id="issue_body">
Subject: <span id='spec_shortname'></span> <span id='spec_date'></span>
- Name of spec to be reviewed: <span id='spec_title2'></span>
- Deadline for comments: <input type='date'>
- URL of spec:
<span id='spec_uri'></span>
<span id='spec_shortlink'></span>
<span id='spec_editor-draft'></span>
- What and when is your next expected transition?
Current Status: <span id='spec_status'></span>
Next status: <span id='spec_nextstatus'>?</span>
Expected next status: <input type='date'>
- What has changed since any previous review?
<span id='spec_commits_link'>@@github/commits@@</span>
- Please point to the results of your own self-reviews:
<a href='https://w3c.github.io/i18n-drafts/techniques/shortchecklist'>Internationalization</a>: <input placeholder='<link>' id='i18n' type='url' maxlength='255' size='50'>
<a href="https://w3c.github.io/apa/fast/checklist.html">Accessibility</a>: <input placeholder='<link>' id='a11y' type='url' maxlength='255' size='50'>
<a href="https://w3ctag.github.io/security-questionnaire/">Security and Privacy</a>: <input placeholder='<link>' id='sec_priv' type='url' maxlength='255' size='50'>
- Where and how to file issues arising?
<span id='spec_issues_link'>@@github/issues@@</span>
- Pointer to any explainer for the spec?
<input placeholder='<link>' id='explainer' type='url' maxlength='255' size='50'>
- Horizontal comments tracker:
<span id='spec_hr_link'>?</span>
- Published by:
<span id='spec_deliverers'></span>
</pre>
<button>Raise on GitHub</button>
</div>
</div>
<h2 id="resources">Other resources</h2>
<ul>
<li><a href=".">Organize a Technical Report Transition</a></li>
<li><a href="https://w3c.github.io/spec-releases/milestones/">Milestones planning</a></li>
<li><a href="https://w3c.github.io/spec-releases/timeline.svg">174 days to W3C Recommendation</a></li>
<li><a href="https://www.w3.org/policies/process/#Reports">Recommendation Track Process</a></li>
</ul>
<style>
#step_list {
list-style: none;
}
</style>
<script type="module">
import { fetchW3C } from "https://w3c.github.io/gargantua/fetch-utils.js";
function getLatestSpec(shortname) {
return fetchW3C("https://api.w3.org/specifications/" + shortname).then((spec) => {
return spec["latest-version"].then((latest) => {
latest.shortname = spec.shortname;
latest.title2 = spec.title;
if (spec._links.series) {
latest.hr_link = "https://www.w3.org/PM/horizontal/review.html?shortname=" + spec._links.series.href.match(new RegExp("https://api.w3.org/specification-series/(.*)"))[1];
spec._links.series.href;
latest.series_version = spec["series-version"];
}
const ed = spec["editor-draft"];
if (ed) {
const m = ed.match(new RegExp("^https://([-_a-zA-Z0-9]+).github.io/([-_a-zA-Z0-9]+)/"));
if (m) {
latest.issues_link = `https://github.com/${m[1]}/${m[2]}/issues`;
latest.commits_link = `https://github.com/${m[1]}/${m[2]}/commits`;
}
}
return latest;
});
});
}
function findSpecOptions(shortname) {
return fetchW3C("https://api.w3.org/specifications-by-shortname/" + shortname).then((data) => {
return data.length > 0 ? data.map((s) => s.shortname) : [];
});
}
// For debugging
var trace = function () {};
if (window.location.href.includes("file:")) {
trace = function trace(msg) {
console.log(msg);
};
}
// each one of those config parameters are matching the ones in the option/input elements
var config = {};
// State and browser history handling
// browser history status push
function onpushstate() {
var query = "";
// this query setup is more cumbersome but it favors clean/reduced url query
if (config.shortname !== undefined) {
query = "?shortname=" + config.shortname;
}
window.history.pushState(config, config.shortname, query);
trace("pushed " + window.location.href);
}
// browser back and forward buttons
window.onpopstate = function (e) {
config = e.state;
adjustForms();
trace("popped " + window.location.href);
};
function findShortname(s) {
let w3ctr = document.getElementById("w3ctr");
if (s.length > 2) {
while (w3ctr.firstChild) {
w3ctr.removeChild(w3ctr.firstChild);
}
findSpecOptions(s).then((options) => {
// dynamic autocompletion
options.forEach((option) => {
let elt = document.createElement("option");
elt.value = option;
w3ctr.appendChild(elt);
});
// display a spec if we find one
getLatestSpec(s)
.then((spec) => {
return spec.deliverers.then((deliverers) => {
spec.isGroupClosed = deliverers.reduce((a, c) => a && c["is_closed"], true);
return spec;
});
})
.then((spec) => {
config.shortname = s;
updateSpec(spec);
onpushstate();
trace(spec);
})
.catch((err) => {
// console.error(err);
updateSpec();
});
});
}
}
let BASE = "https://www.w3.org/guide/transitions?";
let INPLACE = "<li><a href='https://www.w3.org/guide/standards-track/republishing/'>In-place modification of W3C Technical Reports</a></li>";
function listItem(text, query) {
let id = "option" + Math.round(Math.random() * 10000);
return `<li>`
+ `<div class='radio-item'>`
+ `<input type='radio' name='option' id='${id}'>`
+ `<label for="${id}">${text}</a>`
+ `</div>`
+ `</li>`;
}
function nextSteps(spec) {
let base = "https://www.w3.org/guide/transitions?";
let next = document.getElementById("next");
let list = document.getElementById("step_list");
if (spec.isGroupClosed) {
if (spec.status === "Recommendation") {
list.innerHTML =
INPLACE +
listItem("Publish an Amended Recommendation with only editorial changes", "profile=REC&rec=editorial") +
listItem("Publish a Candidate Recommendation with substantive changes (but no new features)", "profile=CR&cr=rec-amended") +
listItem("Propose to obsolete or supersede the Recommendation", "profile=PR-OBSL");
} else if (spec.status === "Group Note") {
list.innerHTML = INPLACE + listItem("contact [email protected]", "profile=WG-NOTE");
} else if (spec.status === "Retired") {
list.innerHTML = listItem("Propose to restore the Recommendation", "");
} else {
list.innerHTML = listItem("Publish as Working Group Note (oops, this should have been done already)", "profile=WG-NOTE");
}
} else if (spec.status === "Working Draft") {
// !isGroupClosed(spec)
let WD = "";
if (!spec["_links"]["predecessor-version"]) {
function formatNumber(n) {
return n < 10 ? "0" + n : n;
}
let today = new Date();
let sToday = today.getUTCFullYear() + "-" + formatNumber(today.getUTCMonth()) + "-" + formatNumber(today.getUTCDate());
if (sToday === spec.date) WD = INPLACE; // same day only
}
list.innerHTML =
WD + listItem("Update the Working Draft", "profile=WD") + listItem("Advance to Candidate Recommendation", "profile=CR&cr=new") + listItem("Publish to Working Group Note (which you may mark as retired)", "profile=WG-NOTE");
} else if (spec.status === "Candidate Recommendation") {
list.innerHTML =
listItem("Update the Candidate Recommendation Draft", "profile=CR&cr=draft") +
listItem("Update as a Candidate Recommendation Snapshot", "profile=CR&cr=snapshot") +
listItem("Advance to Proposed Recommendation", "profile=PR") +
listItem("Return to Working Draft", "profile=WD&returning=true") +
listItem("Publish as a Working Group Note (which you may mark as retired)", "profile=WG-NOTE");
} else if (spec.status === "Candidate Recommendation Draft" || spec.status === "Candidate Recommendation Snapshot") {
list.innerHTML =
listItem("Update the Candidate Recommendation Draft", "profile=CR&cr=draft") +
listItem("Update as a Candidate Recommendation Snapshot", "profile=CR&cr=snapshot") +
listItem("Advance to Proposed Recommendation", "profile=PR") +
listItem("Return to Working Draft", "profile=WD&returning=true") +
listItem("Publish as a Working Group Note (which you may mark as retired)", "profile=WG-NOTE");
} else if (spec.status === "Proposed Recommendation") {
list.innerHTML =
listItem("Advance to Recommendation", "profile=REC&rec=new") +
listItem("Return to Working Draft", "profile=WD&returning=true") +
listItem("Publish as a Working Group Note (which you may mark as retired)", "profile=WG-NOTE");
} else if (spec.status === "Recommendation") {
list.innerHTML =
INPLACE +
listItem("Update the Recommendation with only editorial changes", "profile=REC&rec=editorial") +
listItem("Publish as a Recommendation with candidate corrections (substantive changes)", "profile=REC&cr=candidate-corrections") +
listItem("Publish as a Recommendation with candidate additions (new features)", "profile=REC&cr=candidate-additions") +
listItem("Incorporate candidate corrections (substantive changes)", "profile=REC&cr=substantive") +
listItem("Incorporate candidate additions (new features)", "profile=REC&cr=features") +
listItem("Publish as a First Public Working Draft with new features (if your current Recommendation doesn't allow those)", "profile=FPWD") +
listItem("Propose to rescind the Recommendation", "profile=PR-RSCND") +
listItem("Propose to obsolete or supersede the Recommendation", "profile=PR-OBSL");
} else if (spec.status === "Group Note") {
list.innerHTML = INPLACE + listItem("Update the Working Group Note (which you may mark as retired)", "profile=WG-NOTE");
} else if (spec.status === "Retired") {
list.innerHTML = listItem("Propose to restore the Recommendation", "");
} else {
list.innerHTML = listItem("... Not sure yet. See the transition requirements", "");
}
next.style.display = "block";
}
function defaultStep() {
let base = "https://www.w3.org/guide/transitions?";
let next = document.getElementById("next");
let list = document.getElementById("step_list");
list.innerHTML = listItem("Publish as a First Public Working Draft", "profile=FPWD") + listItem("Publish as a Working Group Note", "profile=WG-NOTE");
next.style.display = "block";
}
function updateSpec(spec) {
let div = document.getElementById("spec");
console.log(spec);
if (spec === undefined) {
div.style.display = "none";
document.getElementById("next").style.display = "none";
defaultStep();
} else {
for (let key in spec) {
let elt = document.getElementById("spec_" + key);
if (elt !== null) {
let obj = spec[key];
if (key === "deliverers") {
elt.innerHTML = "";
spec.deliverers.then((groups) => {
for (let index = 0; index < groups.length; index++) {
let group = groups[index];
let a = document.createElement("a");
a.href = group._links.homepage.href;
a.textContent = group.name;
elt.appendChild(a);
if (group["is_closed"]) {
elt.appendChild(document.createTextNode(" (closed) "));
}
elt.appendChild(document.createTextNode(", "));
}
});
} else if (obj instanceof Promise) {
console.log("[Promise] " + key);
} else if (obj.indexOf("https://") !== -1 || obj.indexOf("http://") !== -1) {
elt.innerHTML = "<a href='" + obj + "'>" + obj + "</a>";
} else {
elt.textContent = obj;
}
}
}
div.style.display = "block";
nextSteps(spec);
}
}
function adjustForms() {
// adjust the HTML forms according to the config
trace("adjustForms for " + JSON.stringify(config));
for (let key in config) {
let input = null;
if (key === "shortname") {
input = document.getElementById("shortname");
input.value = config.shortname;
}
}
}
// initialization
document.getElementById("spec").style.display = "none";
document.getElementById("next").style.display = "none";
for (const [key, value] of new URL(location).searchParams) {
let input;
if (key === "shortname") {
input = document.getElementById("shortname");
}
if (input !== undefined) {
config[key] = value;
}
}
if (config.shortname !== undefined) {
findShortname(config.shortname);
}
adjustForms();
function shortname(e) {
let s = e.target.value;
if (s.length > 2) {
findShortname(s);
}
}
var nodes = document.querySelectorAll("input");
for (let i = 0; i < nodes.length; i++) {
if (nodes[i].type === "text") {
nodes[i].oninput = shortname;
}
}
trace("restored " + window.location.href);
</script>