- From: Robin Berjon via cvs-syncmail <cvsmail@w3.org>
- Date: Mon, 23 May 2011 13:21:15 +0000
- To: public-dap-commits@w3.org
Update of /sources/public/2009/dap/ReSpec.js/js In directory hutz:/tmp/cvs-serv25437/js Modified Files: respec.js Log Message: added support for TAG findings. The code could use massive refactoring but I'll only do that in v2 Index: respec.js =================================================================== RCS file: /sources/public/2009/dap/ReSpec.js/js/respec.js,v retrieving revision 1.149 retrieving revision 1.150 diff -u -d -r1.149 -r1.150 --- respec.js 2 May 2011 10:09:36 -0000 1.149 +++ respec.js 23 May 2011 13:21:12 -0000 1.150 @@ -90,7 +90,9 @@ REC: "Recommendation", RSCND: "Rescinded Recommendation", unofficial: "Unofficial Draft", - base: "Document" + base: "Document", + "draft-finding": "Draft TAG Finding", + "finding": "TAG Finding" }, status2long: { FPWD: "First Public Working Draft", @@ -515,7 +517,8 @@ cfg.publishDate = this._parseDate(cfg.publishDate); } if (cfg.previousPublishDate) cfg.previousPublishDate = this._parseDate(cfg.previousPublishDate); - if (cfg.previousPublishDate && ! cfg.previousMaturity) error("Previous date is set, but not previousMaturity"); + if (cfg.previousPublishDate && ! cfg.previousMaturity && cfg.specStatus.indexOf("finding") === -1) + error("Previous date is set, but not previousMaturity"); if (cfg.lcEnd) cfg.lcEnd = this._parseDate(cfg.lcEnd); if (cfg.crEnd) cfg.crEnd = this._parseDate(cfg.crEnd); if (cfg.specStatus == "LC" && !cfg.lcEnd) error("If specStatus is set to LC, then lcEnd must be defined"); @@ -584,6 +587,7 @@ if (statStyle == "FPWD" || statStyle == "LC" || statStyle == "WD-NOTE" || statStyle == "LC-NOTE" || statStyle == "FPWD-NOTE") { statStyle = "WD"; } + else if (statStyle === "finding" || statStyle === "draft-finding") statStyle = "base"; // else if ( statStyle == "WD-NOTE" || statStyle == "LC-NOTE" // || statStyle == "FPWD-NOTE") { // statStyle = "WG-NOTE"; @@ -728,8 +732,48 @@ } return header; }, + + makeTAGHeaders: function () { + var base = "http://www.w3.org/2001/tag/doc/", + latestVersion = base + this.shortName, + thisVersion = latestVersion + "-" + this._concatDate(this.publishDate, "-"), + header = "<div class='head'><p>" + + "<a href='http://www.w3.org/'><img width='72' height='48' src='http://www.w3.org/Icons/w3c_home' alt='W3C'/></a>"; + header += "<h1 class='title' id='title'>" + this.title + "</h1>"; + if (this.subtitle) header += "<h2 id='subtitle'>" + this.subtitle + "</h2>"; + header += "<h2>" + this.status2text[this.specStatus] + " " + this._humanDate(this.publishDate) + "</h2><dl>"; + header += "<dt>This version:</dt><dd><a href='" + thisVersion + "'>" + thisVersion + "</a></dd>\n" + + "<dt>Latest published version:</dt><dd><a href='" + latestVersion + "'>" + latestVersion + "</a></dd>"; + if (this.edDraftURI) { + header += "<dt>Latest editor's draft:</dt><dd><a href='" + this.edDraftURI + "'>" + this.edDraftURI + "</a></dd>"; + } + if (this.previousPublishDate) { + var prevVersion = latestVersion + "-" + this._concatDate(this.previousPublishDate, "-"); + header += "<dt>Previous version:</dt><dd><a href='" + prevVersion + "'>" + prevVersion + "</a></dd>"; + } + if(this.editors.length == 0) { + header += "<dt>" + "Editor" + ":</dt>"; + error("There must be at least one editor."); + } + header += this.showPeople("Editor", this.editors); + header += this.showPeople("Author", this.authors); + header += "</dl><p class='copyright'>"; + header += + "<a href='http://www.w3.org/Consortium/Legal/ipr-notice#Copyright'>Copyright</a> © " ; + if (this.copyrightStart && this.copyrightStart != this.publishDate.getFullYear()) header += this.copyrightStart + '-'; + header += this.publishDate.getFullYear(); + header += " <a href='http://www.w3.org/'><acronym title='World Wide Web Consortium'>W3C</acronym></a><sup>®</sup> " + + "(<a href='http://www.csail.mit.edu/'><acronym title='Massachusetts Institute of Technology'>MIT</acronym></a>, " + + "<a href='http://www.ercim.eu/'><acronym title='European Research Consortium for Informatics and Mathematics'>ERCIM</acronym></a>, " + + "<a href='http://www.keio.ac.jp/'>Keio</a>), All Rights Reserved. " + + "W3C <a href='http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer'>liability</a>, " + + "<a href='http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks'>trademark</a> and " + + "<a href='http://www.w3.org/Consortium/Legal/copyright-documents'>document use</a> rules apply." + + "</p><hr/></div>"; + return header; + }, - makeHeaders: function () { + makeNormalHeaders: function () { var mat = (this.status2maturity[this.specStatus]) ? this.status2maturity[this.specStatus] : this.specStatus; var thisVersion = "http://www.w3.org/TR/" + this.publishDate.getFullYear() + "/" + mat + "-" + this.shortName + "-" + this._concatDate(this.publishDate) + "/"; @@ -878,7 +922,14 @@ } header += "</p><hr/></div>"; - + return header; + }, + + makeHeaders: function () { + var header; + if (this.specStatus === "finding" || this.specStatus === "draft-finding") header = this.makeTAGHeaders(); + else header = this.makeNormalHeaders(); + console.log(header); var tmp = sn.element("div"); tmp.innerHTML = header; document.body.insertBefore(tmp.firstChild, document.body.firstChild); @@ -1448,8 +1499,9 @@ return this._lead0(date.getDate()) + " " + this._humanMonths[date.getMonth()] + " " + date.getFullYear(); }, - _concatDate: function (date) { - return "" + date.getFullYear() + this._lead0(date.getMonth() + 1) + this._lead0(date.getDate()); + _concatDate: function (date, sep) { + if (!sep) sep = ""; + return "" + date.getFullYear() + sep + this._lead0(date.getMonth() + 1) + sep + this._lead0(date.getDate()); }, _ISODate: function (date) {
Received on Monday, 23 May 2011 13:21:16 UTC