More scripting fixes

This commit is contained in:
Jeff Parsons 2017-02-06 17:46:42 -08:00 committed by Jeff Parsons
commit c8f32d84f5
10 changed files with 10 additions and 10 deletions

View file

@ -878,7 +878,7 @@ function cC(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=
function dC(a,b,c,d){function e(a){if(void 0===h){var b=g&&pb(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=oa(a))}function f(a){e("Error: "+a);k&&(--$B||Xa(!0));k=!1}var g,h,k=!0;$B++;gb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],x=document.createElement("style");x.type="text/css";x.styleSheet?x.styleSheet.cssText=m:x.appendChild(document.createTextNode(m));p.appendChild(x)}c||
(c="/versions/pcx86/1.34.0/components.xsl");m=function(d,h){h?aC(c,null,null,!1,e,function(d,k){k?(eb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(k=h.transformNode(k))?(g.outerHTML=k,--$B||Xa(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(k),(k=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(k,g),--$B||Xa(!0)):f("invalid machine element: "+
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?aC(b,a,d,!0,e,m):bC(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(u){f(u.message)}return k}function eC(a,b,c,d){Xa(!1);return dC(a,b,c,d)}window.embedPC=eC;window.embedPCx86=eC;window.findMachineComponent=function(a,b){return lb(b,a+".machine")};
window.processMachineScript=function(a,b,c){b=!1;if("string"==typeof c){b=!0;for(var d=c.length,e=[],f=[],g="",h=null,k=0;k<d;k++){var m=c[k];if('"'==m||"'"==m)h&&m!=h?g+=m:(h?h=null:h=m,g&&(f.push(g),g=""));else{if(!h){if("\r"==m||"\n"==m)m=";";if(" "==m||"\t"==m||";"==m){g&&(f.push(g),g="");";"==m&&f.length&&(e.push(f),f=[]);continue}}g+=m}}f.length&&e.push(f);qb(a+".machine",e,0)||(b=!1)}return b};window.enableEvents=Xa;window.sendEvent=Za;
window.processMachineScript=function(a,b,c){b=!1;if("string"==typeof c){b=!0;for(var d=c.length,e=[],f=[],g="",h=null,k=0;k<d;k++){var m=c[k];if('"'==m||"'"==m)h&&m!=h?g+=m:(h?h=null:h=m,g&&(f.push(g),g=""));else{if(!h){if("\r"==m||"\n"==m)m=";";if(" "==m||"\t"==m||";"==m){g&&(f.push(g),g="");";"==m&&f.length&&(e.push(f),f=[]);continue}}g+=m}}g&&f.push(g);f.length&&e.push(f);qb(a+".machine",e,0)||(b=!1)}return b};window.enableEvents=Xa;window.sendEvent=Za;
function fC(a,b,c,d){if(!c&&b){d.push(b);a=gb[d[0]];b=null;for(var e in a)if(na(e,"components.xsl")){b=e.replace(".xsl",".css");break}b?Ca(b,null,!0,function(a,b){gC(b,d)}):gC(null,d)}else Wa("Error ("+c+") requesting "+a)}
function gC(a,b){var c,d,e,f=b[0],g=b[1];c=b[4];c=c.match(/^(\s*\(function\(\)\{)([\s\S]*)(}\)\(\);\s*)$/);var h=gb[f],k={},m;for(m in h){var p=h[m],x=ma(m);if("xml"==x){for(x=/[ \t]*<disk [^>]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=x.exec(h[m]);){var u=d[2];u&&(h[u]||(p=p.replace(d[0],"")))}d=m=la(m)}else"xsl"==x&&(e=m=la(m));k[m]=p}a&&(k[m="css"]=a);b[2]&&(k[m="parms"]=b[2]);b[3]&&(k[m="state"]=b[3]);d&&e?(a=JSON.stringify(k),g+=".js",c=c[1]+"var resources="+a+";"+c[2]+c[3],c=c.replace(/\u00A9/g,
"&#xA9;"),a=Ma(c,"javascript",!1,g),a=a+(', copy it to your web server as "'+g+'", and then add the following to your web page:\n\n')+('<div id="'+f+'"></div>\n')+"...\n",a=a+('<script type="text/javascript" src="'+g+'">\x3c/script>\n')+('<script type="text/javascript">embedPC("'+f+'","'+d+'","'+e+'");\x3c/script>\n\n')+"The machine should appear where the <div> is located.",Wa(a)):Wa("Missing XML/XSL resources")}

View file

@ -687,7 +687,7 @@ function cv(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=
function dv(a,b,c,d){function e(a){if(void 0===h){var b=g&&Wa(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=ka(a))}function f(a){e("Error: "+a);l&&(--$u||Ia(!0));l=!1}var g,h,l=!0;$u++;Oa[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var q=document.head||document.getElementsByTagName("head")[0],y=document.createElement("style");y.type="text/css";y.styleSheet?y.styleSheet.cssText=m:y.appendChild(document.createTextNode(m));q.appendChild(y)}c||
(c="/versions/pcx86/1.34.0/components.xsl");m=function(d,h){h?av(c,null,null,!1,e,function(d,l){l?(Na(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--$u||Ia(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--$u||Ia(!0)):f("invalid machine element: "+
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?av(b,a,d,!0,e,m):bv(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(w){f(w.message)}return l}function ev(a,b,c,d){Ia(!1);return dv(a,b,c,d)}window.embedPC=ev;window.embedPCx86=ev;window.findMachineComponent=function(a,b){return Sa(b,a+".machine")};
window.processMachineScript=function(a,b,c){b=!1;if("string"==typeof c){b=!0;for(var d=c.length,e=[],f=[],g="",h=null,l=0;l<d;l++){var m=c[l];if('"'==m||"'"==m)h&&m!=h?g+=m:(h?h=null:h=m,g&&(f.push(g),g=""));else{if(!h){if("\r"==m||"\n"==m)m=";";if(" "==m||"\t"==m||";"==m){g&&(f.push(g),g="");";"==m&&f.length&&(e.push(f),f=[]);continue}}g+=m}}f.length&&e.push(f);Xa(a+".machine",e,0)||(b=!1)}return b};window.enableEvents=Ia;window.sendEvent=Ka;
window.processMachineScript=function(a,b,c){b=!1;if("string"==typeof c){b=!0;for(var d=c.length,e=[],f=[],g="",h=null,l=0;l<d;l++){var m=c[l];if('"'==m||"'"==m)h&&m!=h?g+=m:(h?h=null:h=m,g&&(f.push(g),g=""));else{if(!h){if("\r"==m||"\n"==m)m=";";if(" "==m||"\t"==m||";"==m){g&&(f.push(g),g="");";"==m&&f.length&&(e.push(f),f=[]);continue}}g+=m}}g&&f.push(g);f.length&&e.push(f);Xa(a+".machine",e,0)||(b=!1)}return b};window.enableEvents=Ia;window.sendEvent=Ka;
function fv(a,b,c,d){if(!c&&b){d.push(b);a=Oa[d[0]];b=null;for(var e in a)if(ja(e,"components.xsl")){b=e.replace(".xsl",".css");break}b?ta(b,null,!0,function(a,b){gv(b,d)}):gv(null,d)}else r("Error ("+c+") requesting "+a)}
function gv(a,b){var c,d,e,f=b[0],g=b[1];c=b[4];c=c.match(/^(\s*\(function\(\)\{)([\s\S]*)(}\)\(\);\s*)$/);var h=Oa[f],l={},m;for(m in h){var q=h[m],y=ia(m);if("xml"==y){for(y=/[ \t]*<disk [^>]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=y.exec(h[m]);){var w=d[2];w&&(h[w]||(q=q.replace(d[0],"")))}d=m=ha(m)}else"xsl"==y&&(e=m=ha(m));l[m]=q}a&&(l[m="css"]=a);b[2]&&(l[m="parms"]=b[2]);b[3]&&(l[m="state"]=b[3]);d&&e?(a=JSON.stringify(l),g+=".js",c=c[1]+"var resources="+a+";"+c[2]+c[3],c=c.replace(/\u00A9/g,
"&#xA9;"),a=Ca(c,"javascript",!1,g),a=a+(', copy it to your web server as "'+g+'", and then add the following to your web page:\n\n')+('<div id="'+f+'"></div>\n')+"...\n",a=a+('<script type="text/javascript" src="'+g+'">\x3c/script>\n')+('<script type="text/javascript">embedPC("'+f+'","'+d+'","'+e+'");\x3c/script>\n\n')+"The machine should appear where the <div> is located.",r(a)):r("Missing XML/XSL resources")}