-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathnextstep.html
328 lines (302 loc) · 12.7 KB
/
nextstep.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
---
title: Organize a Technical Report Transition (2023 Process)
toc: false
---
<h2 id="sotd">About This Document</h2>
<p>This resource assists in finding the internal W3C Technical Report publication processes.</p>
<h2 id="snext">Next Steps</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'>
<div id='spec'>
<p><strong>We found the following information:</strong></p>
<ul>
<li>Title: <span id='spec_title'></span></li>
<li>Shortname: <span id='spec_shortname'></span></li>
<li>Date: <span id='spec_date'></span></li>
<li>Shortlink: <span id='spec_shortlink'></span></li>
<li>URL: <span id='spec_uri'></span></li>
<li>Status: <span id='spec_status'></span></li>
<li>Published by: <span id='spec_deliverers'></span></li>
</ul>
</div>
<p><strong>Your possible next steps are:</strong></p>
<ul id='step_list'>
</ul>
</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>
<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 => {
let shortname = spec.shortname;
return spec["latest-version"].then(latest => {
latest.shortname = shortname;
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:") || true) {
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/2003/01/republishing/'>In-place modification of W3C Technical Reports</a></li>";
function listItem(text, query) {
return "<li><a href='" + BASE + '?' + query + "'>" + text + "</a></li>";
}
function nextSteps(spec) {
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" || spec.status === "First Public 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 as a Discontinued Draft", "profile=DISC");
} 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 Discontinued Draft", "profile=DISC");
} 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 Discontinued Draft", "profile=DISC");
} 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 Discontinued Draft", "profile=DISC");
} 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 === "Draft Registry") {
list.innerHTML = listItem("Update the Draft Registry", "profile=DRAFT-REGISTRY")
+ listItem("Advance to Candidate Registry", "profile=CRY&cr=new")
+ listItem("Publish as a Note (which you may mark as retired)", "profile=WG-NOTE");
} else if (spec.status === "Candidate Registry") {
list.innerHTML = listItem("Update the Candidate Registry Draft", "profile=CRY&cr=draft")
+ listItem("Update as a Candidate Registry Snapshot", "profile=CRY&cr=snapshot")
+ listItem("Advance to Registry", "profile=RY&rec=new")
+ listItem("Return to Draft Registry", "profile=DRAFT-REGISTRY&returning=true")
+ listItem("Publish as a Note (which you may mark as retired)", "profile=WG-NOTE");
} else if (spec.status === "Candidate Registry Draft" || spec.status === "Candidate Registry Snapshot") {
list.innerHTML = listItem("Update the Candidate Registry Draft", "profile=CRY&cr=draft")
+ listItem("Update as a Candidate Registry Snapshot", "profile=CRY&cr=snapshot")
+ listItem("Advance to Registry", "profile=RY&rec=new")
+ listItem("Return to Draft Registry", "profile=DRAFT-REGISTRY&returning=true")
+ listItem("Publish as a Note (which you may mark as retired)", "profile=WG-NOTE");
} else if (spec.status === "Proposed Registry") {
list.innerHTML = listItem("Advance to Registry", "profile=RY&rec=new")
+ listItem("Return to Draft Registry", "profile=DRAFT-REGISTRY&returning=true")
+ listItem("Publish as a Note (which you may mark as retired)", "profile=WG-NOTE");
} else if (spec.status === "Registry") {
list.innerHTML = INPLACE + listItem("Update the Registry", "profile=RY&rec=update")
+ listItem("Propose to obsolete or supersede the Registry", "profile=PRY-OBSL");
} else if (spec.status === "Draft Note") {
list.innerHTML = listItem("Update the Draft Note", "profile=DRAFT-NOTE")
+ listItem("Publish as a Note (which you may mark as retired)", "profile=WG-NOTE");
} else if (spec.status === "Group Note" || spec.status === "Note") {
list.innerHTML = INPLACE
+ listItem("Return to Draft Note", "profile=DRAFT-NOTE")
+ listItem("Advance to W3C Statement", "profile=STMT")
+ listItem("Update the 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 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");
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>