diff --git a/inform7/Internal/Templates/Parchment/(manifest).txt b/inform7/Internal/Templates/Parchment/(manifest).txt index ed71466a9..770a9e609 100644 --- a/inform7/Internal/Templates/Parchment/(manifest).txt +++ b/inform7/Internal/Templates/Parchment/(manifest).txt @@ -9,7 +9,7 @@ ! of the play page: [INTERPRETERVERSION] -Parchment for Inform 7 (2022.4) +Parchment for Inform 7 (2022.5) [] [INTERPRETERURL] diff --git a/inform7/Internal/Templates/Parchment/main.js b/inform7/Internal/Templates/Parchment/main.js index 868e13bd3..daea43415 100644 --- a/inform7/Internal/Templates/Parchment/main.js +++ b/inform7/Internal/Templates/Parchment/main.js @@ -1,5 +1,5 @@ (()=>{var de=class extends DataView{constructor(a,o,l){a instanceof Uint8Array?super(a.buffer,a.byteOffset,a.byteLength):super(a,o,l)}getFourCC(a){return String.fromCharCode(this.getUint8(a),this.getUint8(a+1),this.getUint8(a+2),this.getUint8(a+3))}getUint8Subarray(a,o){return new Uint8Array(this.buffer,this.byteOffset+(a||0),o)}setFourCC(a,o){this.setUint8(a,o.charCodeAt(0)),this.setUint8(a+1,o.charCodeAt(1)),this.setUint8(a+2,o.charCodeAt(2)),this.setUint8(a+3,o.charCodeAt(3))}setUint8Array(a,o){this.getUint8Subarray(a,o.length).set(o)}},at=class{constructor(){this.type="";this.chunks=[]}parse(a){let o=new de(a);if(o.getFourCC(0)!=="FORM")throw new Error("Not an IFF file");this.type=o.getFourCC(8);let l=12,_=o.getUint32(4)+8;for(;l<_;){let m=o.getUint32(l+4);if(m<0||m+l>_)throw new Error("IFF chunk out of range");this.chunks.push({data:o.getUint8Subarray(l+8,m),offset:l,type:o.getFourCC(l)}),l+=8+m,l%2&&l++}}write(){let a=12;for(let _ of this.chunks)a+=8+_.data.length,a%2&&a++;let o=new de(new ArrayBuffer(a));o.setFourCC(0,"FORM"),o.setUint32(4,a-8),o.setFourCC(8,this.type);let l=12;for(let _ of this.chunks)o.setFourCC(l,_.type),o.setUint32(l+4,_.data.length),o.setUint8Array(l+8,_.data),l+=8+_.data.length,l%2&&l++;return o.getUint8Subarray()}};var Yt={Data:"data",Exec:"exec",Pict:"pict","Snd ":"sound"},Kt="????",Vt=new TextDecoder,Qe=class{constructor(a){this.classname="Blorb";this.chunks={};this.is_inited=!1;this.metadata={};a&&this.init(a)}init(a,o){if(!this.is_inited){if(a instanceof Uint8Array){let l=new at;if(l.parse(a),l.type!=="IFRS")throw new Error("Not a Blorb file");if(l.chunks[0].type!=="RIdx")throw new Error("Malformed blorb: chunk 1 is not RIdx");for(let _ of l.chunks)switch(_.type){case"Dbug":{this.debugdata=_.data;break}case"Fspc":{let m=new de(_.data);this.coverimagenum=m.getUint32(0);break}case"IFmd":{let m=Vt.decode(_.data),x=$("").html(m).find("bibliographic").children();for(let k of x)this.metadata[k.tagName.toLowerCase()]=k.textContent;break}case"RDes":{let m=new de(_.data),b=4;for(;bJ.offset===v)[0];if(!C)throw new Error(`No Blorb chunk at offset ${v}`);let q={blorbtype:C.type,content:C.data,usage:Yt[x]};x==="Pict"&&(C.type==="JPEG"?q.type="jpeg":C.type==="PNG "?q.type="png":q.type=Kt),x==="Data"&&(q.binary=C.type==="BINA"||C.type==="FORM"),this.chunks[`${q.usage}:${k}`]=q}break}}}else if(o?.format==="infomap")for(let l in a){if(!Number.isInteger(+l))continue;let _=Object.assign({},a[l]);delete _.image,_.height&&_.width&&(_.imagesize={height:_.height,width:_.width},delete _.height,delete _.width),_.type=_.url.endsWith(".png")?"png":"jpeg",_.usage="pict",this.chunks[`pict:${l}`]=_}else if(!(Array.isArray(a)&&a.length===0))throw new Error("Unsupported Blorb.init data format");this.is_inited=!0}}getlibrary(){return null}get_chunk(a,o){return this.chunks[`${a}:${o}`]||null}get_cover_pict(){return this.coverimagenum??null}get_data_chunk(a){let o=this.chunks[`data:${a}`];return o?.content?{binary:o.binary,data:o.content}:null}get_debug_info(){return this.debugdata}get_exec_data(a){let o=this.chunks["exec:0"];return!o?.content||a&&o.blorbtype!==a?null:o.content}get_image_info(a){let o=this.chunks[`pict:${a}`];if(!o)return null;!o.imagesize&&o.content&&(o.type==="jpeg"?o.imagesize=zn(o.content):o.type==="png"&&(o.imagesize=Ln(o.content)));let l=Object.assign({image:a},o);return l.imagesize&&(l.height=l.imagesize.height,l.width=l.imagesize.width),l}get_image_url(a){let o=this.chunks[`pict:${a}`];return o?o.url?o.url:o.type!==Kt&&o.content?(o.url=URL.createObjectURL(new Blob([o.content],{type:`image/${o.type}`})),o.url):null:null}get_metadata(a){return this.metadata[a]}inited(){return this.is_inited}};function zn(p){let a=new de(p),o=0;for(;o=208&&l<=217)continue;let _=a.getUint16(o);if(l>=192&&l<=207&&l!==200)return _<7?void 0:{height:a.getUint16(o+3),width:a.getUint16(o+5)};o+=_}}function Ln(p){let a=new de(p);if(a.getFourCC(0)!=="\x89PNG")return;let o=8;for(;o",{id:p+"_screen"}),D.append(I));var K=$("#"+p+"_frame");K.length||(K=$("
",{id:p+"_frame"}),D.append(K));var j=$("#"+p);j.length&&j.remove(),j=$("
",{id:p});var z,F,M;z=$("
"),z.on("submit",l?he:me),j.append(z),M=$("
",{class:"DiaButtonsFloat"}),F=$("