Skip to content

Commit 8c4f098

Browse files
authored
Merge branch 'main' into issues/0197-emdash
2 parents 555d53a + ce8ba3a commit 8c4f098

File tree

1 file changed

+68
-18
lines changed

1 file changed

+68
-18
lines changed

smpte.js

Lines changed: 68 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ function insertFrontMatter(docMetadata) {
195195
case smpte.ST_PUBTYPE:
196196
case smpte.RP_PUBTYPE:
197197
case smpte.EG_PUBTYPE:
198+
case smpte.ER_PUBTYPE:
199+
case smpte.RDD_PUBTYPE:
198200
if (docMetadata.pubPart !== null)
199201
actualPubNumber += `-<span itemprop="doc-part" id="doc-part">${docMetadata.pubPart}</span>`;
200202
if (docMetadata.pubStage === smpte.PUB_STAGE_PUB) {
@@ -623,7 +625,7 @@ function insertConformance(docMetadata) {
623625
if (!(docMetadata.pubType == smpte.RP_PUBTYPE || docMetadata.pubType == smpte.ST_PUBTYPE || docMetadata.pubType == smpte.AG_PUBTYPE)) {
624626
if (sec !== null)
625627
logger_.error(`An ${docMetadata.pubType} document must not contain a conformance section`);
626-
if (docMetadata.pubType != smpte.EG_PUBTYPE)
628+
if (!(docMetadata.pubType == smpte.EG_PUBTYPE || docMetadata.pubType == smpte.ER_PUBTYPE))
627629
return;
628630
}
629631

@@ -700,6 +702,14 @@ function insertConformance(docMetadata) {
700702
interoperability information.</p>
701703
`;
702704

705+
} else if (docMetadata.pubType === smpte.ER_PUBTYPE) {
706+
707+
sec.innerHTML = `
708+
<h2>Conformance</h2>
709+
<p>This Engineering Report is meant to provide information to the
710+
industry. It does not impose requirements.</p>
711+
`;
712+
703713
} else {
704714
sec.innerHTML = `
705715
<h2>Conformance</h2>
@@ -720,7 +730,7 @@ function insertConformance(docMetadata) {
720730

721731
const SMPTE_FOREWORD_ID = "sec-foreword";
722732

723-
const SMPTE_AG_FOREWORD_BOILERPLATE = `<h2>Foreword</h2>
733+
const SMPTE_GEN_FOREWORD_BOILERPLATE = `<h2>Foreword</h2>
724734
<p>The Society of Motion Picture and Television Engineers (SMPTE) is an
725735
internationally-recognized standards developing organization. Headquartered
726736
and incorporated in the United States of America, SMPTE has members in over
@@ -730,26 +740,43 @@ by SMPTE’s Technology Committees. Participation in these Committees is open
730740
to all with a bona fide interest in their work. SMPTE cooperates closely
731741
with other standards-developing organizations, including ISO, IEC and ITU.
732742
SMPTE Engineering Documents are drafted in accordance with the rules given
733-
in its Standards Operations Manual. For more information, please visit
743+
in its Standards Operations Manual.</p>
744+
745+
<p>For more information, please visit
734746
<a href="https://www.smpte.org">www.smpte.org</a>.</p>
747+
`
748+
749+
const SMPTE_AG_FOREWORD_BOILERPLATE = `${SMPTE_GEN_FOREWORD_BOILERPLATE}
735750
736751
<p>This Standards Administrative Guideline forms an adjunct to the use and
737752
interpretation of the SMPTE Standards Operations Manual. In the event of a
738753
conflict, the Operations Manual shall prevail.</p>
739754
`
755+
const SMPTE_RDD_FOREWORD_BOILERPLATE = `<h2>Foreword</h2>
756+
<p>This document is a Registered Disclosure Document prepared by the sponsor(s) identified
757+
below. It has been examined by the appropriate SMPTE Technology Committee and is believed to
758+
contain adequate information to satisfy the objectives defined in the Scope, and to be
759+
technically consistent.</p>
760+
<p>This document is NOT a Standard, Recommended Practice or Engineering Guideline and does NOT
761+
imply a finding or representation of the Society.</p>
762+
<p>Every attempt has been made to ensure that the information contained in this document is
763+
accurate. Errors in this document should be reported to the SMPTE Registered Disclosure
764+
Document proponent(s) identified below with a copy to
765+
<a href="mailto:[email protected]">[email protected]</a>.</p>
766+
767+
<p>All other inquiries in respect of this document, including inquiries as to intellectual
768+
property requirements, should be addressed to the SMPTE Registered Disclosure Document
769+
proponent(s) identified below.</p>
740770
741-
const SMPTE_DOC_FOREWORD_BOILERPLATE = `<h2>Foreword</h2>
742-
<p>The Society of Motion Picture and Television Engineers (SMPTE) is an
743-
internationally-recognized standards developing organization. Headquartered
744-
and incorporated in the United States of America, SMPTE has members in over
745-
80 countries on six continents. SMPTE’s Engineering Documents, including
746-
Standards, Recommended Practices, and Engineering Guidelines, are prepared
747-
by SMPTE’s Technology Committees. Participation in these Committees is open
748-
to all with a bona fide interest in their work. SMPTE cooperates closely
749-
with other standards-developing organizations, including ISO, IEC and ITU.
750-
SMPTE Engineering Documents are drafted in accordance with the rules given
751-
in its Standards Operations Manual.</p> For more information, please visit
752-
<a href="https://www.smpte.org">www.smpte.org</a>.</p>
771+
{{authorProse}}
772+
773+
`
774+
const SMPTE_ER_FOREWORD_BOILERPLATE = `${SMPTE_GEN_FOREWORD_BOILERPLATE}
775+
776+
{{authorProse}}
777+
`
778+
779+
const SMPTE_DOC_FOREWORD_BOILERPLATE = `${SMPTE_GEN_FOREWORD_BOILERPLATE}
753780
754781
<p>At the time of publication no notice had been received by SMPTE claiming patent
755782
rights essential to the implementation of this Engineering Document.
@@ -778,6 +805,22 @@ function insertForeword(docMetadata) {
778805
return;
779806
}
780807

808+
if (docMetadata.pubType == smpte.RDD_PUBTYPE) {
809+
if (sec === null)
810+
logger_.error("RDD must contain a Foreword section.");
811+
812+
}
813+
814+
const SMPTE_PROPONENT_ID = document.getElementById("element-proponent");
815+
816+
if (SMPTE_PROPONENT_ID === null && docMetadata.pubType === smpte.RDD_PUBTYPE) {
817+
logger_.error("Missing required proponents.");
818+
return;
819+
} if (SMPTE_PROPONENT_ID !== null && docMetadata.pubType !== smpte.RDD_PUBTYPE) {
820+
logger_.error("Proponents only allowed for RDD documents.");
821+
return;
822+
}
823+
781824
if (sec === null && docMetadata.pubType != smpte.OM_PUBTYPE) {
782825
sec = document.createElement("section");
783826
sec.id = SMPTE_FOREWORD_ID;
@@ -788,20 +831,27 @@ function insertForeword(docMetadata) {
788831

789832
let authorProse = sec.innerHTML;
790833

791-
if (smpte.ENGDOC_PUBTYPES.has(docMetadata.pubType)) {
834+
if (smpte.ENGDOC_PUBTYPES.has(docMetadata.pubType) && docMetadata.pubType != smpte.RDD_PUBTYPE) {
792835
authorProse = `<p>This document was prepared by Technology Committee ${docMetadata.pubTC}.</p>` + authorProse;
793836
}
794837

795838
if (docMetadata.pubType == smpte.AG_PUBTYPE) {
796839
if (authorProse.trim().length > 0)
797840
logger_.error("AGs cannot contain author-specified Foreword prose.")
798841
sec.innerHTML = fillTemplate(SMPTE_AG_FOREWORD_BOILERPLATE, {copyrightYear: (new Date()).getFullYear()});
842+
} else if (docMetadata.pubType == smpte.RDD_PUBTYPE) {
843+
sec.innerHTML = fillTemplate(SMPTE_RDD_FOREWORD_BOILERPLATE, {authorProse: authorProse, copyrightYear: (new Date()).getFullYear()});
844+
} else if (docMetadata.pubType == smpte.ER_PUBTYPE) {
845+
sec.innerHTML = fillTemplate(SMPTE_ER_FOREWORD_BOILERPLATE, {authorProse: authorProse, copyrightYear: (new Date()).getFullYear()});
799846
} else {
800847
sec.innerHTML = fillTemplate(SMPTE_DOC_FOREWORD_BOILERPLATE, {authorProse: authorProse, copyrightYear: (new Date()).getFullYear()});
801848
}
802849

803850
}
804851

852+
853+
854+
805855
function addHeadingLinks(docMetadata) {
806856
const headings = document.querySelectorAll("h2, h3, h4, h5, h6");
807857

@@ -1286,7 +1336,7 @@ function resolveLinks(docMetadata) {
12861336
const CONFORMANCE_RE = /\s*(shall)|(should)|(may)\s/i;
12871337

12881338
function checkConformanceNotation(docMetadata) {
1289-
if (docMetadata.pubType !== smpte.EG_PUBTYPE)
1339+
if (!(docMetadata.pubType == smpte.EG_PUBTYPE || docMetadata.pubType == smpte.ER_PUBTYPE))
12901340
return;
12911341

12921342
for (let section of document.querySelectorAll("section:not(:has(section))")) {
@@ -1299,7 +1349,7 @@ function checkConformanceNotation(docMetadata) {
12991349
const r = CONFORMANCE_RE.exec(section.innerText);
13001350

13011351
if (r !== null)
1302-
logger_.error(`An EG must not contain the conformance notation ${r[1]}`, section);
1352+
logger_.error(`An ${docMetadata.pubType} must not contain the conformance notation ${r[1]}`, section);
13031353

13041354
};
13051355
}

0 commit comments

Comments
 (0)