Skip to content

Commit fa36452

Browse files
authored
Merge branch 'main' into feature/support-er-rdd
2 parents 4276f14 + 75fdae9 commit fa36452

File tree

6 files changed

+67
-6
lines changed

6 files changed

+67
-6
lines changed

js/common.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,10 @@ export function validateHead(head, logger) {
188188
if(metadata.pubDateTime === null)
189189
fatal(logger, "pubDateTime must be present if the document is in pub state.");
190190

191-
if (metadata.pubNumber === null)
192-
logger.error("pubNumber must be specified if the document is in pub state.");
191+
if (metadata.pubNumber === null) {
192+
if (metadata.pubType !== OM_PUBTYPE)
193+
logger.error("pubNumber must be specified if the document is in pub state.");
194+
}
193195
}
194196

195197
/* specific to OM */

scripts/build.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ async function makePDF(docPath, pdfPath) {
509509
window.PagedConfig = window.PagedConfig || {};
510510
window.PagedConfig.auto = false;
511511
});
512-
await page.addScriptTag({ url: 'https://unpkg.com/pagedjs/dist/paged.polyfill.js' });
512+
await page.addScriptTag({ url: 'https://cdn.jsdelivr.net/npm/pagedjs@0.4.3/dist/paged.polyfill.js' });
513513

514514
let renderingDone;
515515
let rendered = new Promise(function (resolve, reject) {

smpte.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,20 @@ without the prior written permission of the Society of Motion Picture and Televi
129129
<hr />
130130
{{draftWarning}}`
131131

132+
const SMPTE_PUB_AG_FRONT_MATTER_BOILERPLATE = `<div id="doc-designator" itemscope="itemscope" itemtype="http://purl.org/dc/elements/1.1/">
133+
<span itemprop="publisher">SMPTE</span>&nbsp;<span id="doc-type">{{pubType}}</span>&nbsp;{{actualPubNumber}}</div>
134+
<img id="smpte-logo" src="{{smpteLogoURL}}" alt="SMPTE logo" />
135+
<div id="long-doc-type">{{longDocType}}</div>
136+
<h1>{{fullTitle}}</h1>
137+
<div id="doc-status">{{publicationState}}: {{actualPubDateTime}}</div>
138+
<p><span id="copyright-text">Copyright © <span id="doc-copyright-year">{{copyrightYear}}</span>,
139+
Society of Motion Picture and Television Engineers</span>.
140+
All rights reserved. No part of this material may be reproduced, by any means whatsoever,
141+
without the prior written permission of the Society of Motion Picture and Television Engineers.</p>
142+
<hr />`
143+
132144
const SMPTE_PUB_OM_FRONT_MATTER_BOILERPLATE = `<div id="doc-designator" itemscope="itemscope" itemtype="http://purl.org/dc/elements/1.1/">
133-
<span itemprop="publisher">SMPTE</span>&nbsp;<span id="doc-type">{{pubType}}</span>&nbsp;{actualPubNumber}}</div>
145+
<span itemprop="publisher">SMPTE</span>&nbsp;<span id="doc-type">{{pubType}}</span>&nbsp;{{actualPubNumber}}</div>
134146
<img id="smpte-logo" src="{{smpteLogoURL}}" alt="SMPTE logo" />
135147
<div id="long-doc-type">{{longDocType}}</div>
136148
<h1>{{fullTitle}}</h1>
@@ -224,6 +236,8 @@ function insertFrontMatter(docMetadata) {
224236

225237
if (docMetadata.pubState === smpte.PUB_STATE_PUB && docMetadata.pubType === smpte.OM_PUBTYPE)
226238
boilerplate = SMPTE_PUB_OM_FRONT_MATTER_BOILERPLATE;
239+
else if (docMetadata.pubState === smpte.PUB_STATE_PUB && docMetadata.pubType === smpte.AG_PUBTYPE)
240+
boilerplate = SMPTE_PUB_AG_FRONT_MATTER_BOILERPLATE;
227241
else
228242
boilerplate = SMPTE_FRONT_MATTER_BOILERPLATE;
229243

@@ -1420,7 +1434,7 @@ async function render() {
14201434
/* debug print version */
14211435
if (docMetadata.media === "print") {
14221436
let pagedJS = document.createElement("script");
1423-
pagedJS.setAttribute("src", "https://unpkg.com/pagedjs/dist/paged.polyfill.js");
1437+
pagedJS.setAttribute("src", "https://cdn.jsdelivr.net/npm/pagedjs@0.4.3/dist/paged.polyfill.js");
14241438
pagedJS.id = "paged-js-script";
14251439
document.head.appendChild(pagedJS);
14261440
}

test/resources/html/validation/om-valid.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<script src="../../../../smpte.js"></script>
88
<meta itemprop="test" content="valid" />
99
<meta itemprop="pubType" content="OM" />
10-
<meta itemprop="pubNumber" content="5" />
1110
<meta itemprop="pubState" content="draft" />
1211
<meta itemprop="effectiveDateTime" content="2015-04-04" />
1312
<title>OM</title>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!doctype html>
2+
<html>
3+
<head itemscope="itemscope" itemtype="http://smpte.org/standards/documents">
4+
<meta charset="utf-8" />
5+
<meta http-equiv="x-ua-compatible" content="ie=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<script type="module" src="../../../../smpte.js"></script>
8+
<meta itemprop="test" content="invalid" />
9+
<meta itemprop="pubType" content="ST" />
10+
<meta itemprop="pubStage" content="PUB" />
11+
<meta itemprop="pubDateTime" content="2010-09-04" />
12+
<meta itemprop="effectiveDateTime" content="2010-09-04" />
13+
<meta itemprop="pubState" content="pub" />
14+
<meta itemprop="pubTC" content="35PM" />
15+
16+
<title>Title of the document</title>
17+
</head>
18+
<body>
19+
<section id="sec-scope">
20+
<p>This is the scope of the document.</p>
21+
</section>
22+
</body>
23+
</html>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!doctype html>
2+
<html>
3+
<head itemscope="itemscope" itemtype="http://smpte.org/standards/documents">
4+
<meta charset="utf-8" />
5+
<meta http-equiv="x-ua-compatible" content="ie=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<script type="module" src="../../../../smpte.js"></script>
8+
<meta itemprop="test" content="valid" />
9+
<meta itemprop="pubType" content="OM" />
10+
<meta itemprop="pubStage" content="PUB" />
11+
<meta itemprop="pubDateTime" content="2010-09-04" />
12+
<meta itemprop="effectiveDateTime" content="2010-09-04" />
13+
<meta itemprop="pubState" content="pub" />
14+
<meta itemprop="pubTC" content="ST" />
15+
16+
<title>Title of the document</title>
17+
</head>
18+
<body>
19+
<section id="sec-scope">
20+
<p>This is the scope of the document.</p>
21+
</section>
22+
</body>
23+
</html>

0 commit comments

Comments
 (0)