From b0fae47c54b2844dece09b98fd563c7cc48f2193 Mon Sep 17 00:00:00 2001 From: Seun Ogedengbe Date: Wed, 8 Jul 2015 20:18:32 -0500 Subject: [PATCH] updated spec, reader tool added --- README.md | 7 +- comixngn.js | 23 +++--- comixngn.js.map | 4 +- comixngn.min.js | 20 +++--- index.html | 2 +- script.json | 2 +- testing/spec_COMIXNGN.json | 3 +- testing/specification_v2.json | 3 +- tools/reader.py | 127 +++++++++++++++++++++++++++++++++- tools/writer.html | 63 ++++++++--------- 10 files changed, 185 insertions(+), 69 deletions(-) diff --git a/README.md b/README.md index 42e4cae..79fbdaf 100644 --- a/README.md +++ b/README.md @@ -130,8 +130,9 @@ attribute to preload images but not implemented yet **1.9.1** App pages added **1.9.2** Major bugfixes, including null and undefined property checking +* addendum: bugfixes on direction js, properties are now more clear -### comix-ngn Writer version 1.2.0 (beta) +### comix-ngn Writer version 1.1.0 (beta) **0.5.0**: "Initial Setup, Versioning **0.8.0**: Huge implementations, Object config by dynamic form injection for Page and Chapter, Setting config compartmentalized, design config added @@ -144,9 +145,5 @@ attribute to preload images but not implemented yet **1.1.0**: Setup for refactoring, all JS re-specified and deferred, js enclosed in closure -**1.1.5**: Refactoring begun, all dependicies included and deferred, writer has been beautified for legibility, but there is now writer.min.html which is the compressed version - -**1.2.0**: Added spiner config, spinner needs to be refactor - ### comix-ngn Pyoofreader Version 0.1.0 (beta) **0.1.0**: Implemented version, counts page dif and warns of Mismatch \ No newline at end of file diff --git a/comixngn.js b/comixngn.js index 46fc7ad..4ccfaf6 100644 --- a/comixngn.js +++ b/comixngn.js @@ -79,18 +79,17 @@ cG.REPO.producer = {"def":N}; /////// cG.REPO.stage = {"def":{id:"def",construct:function(name,scriptt,anchor,options){ - var direction=function(d,l){if(void 0===d)return-1;if("string"===typeof d)d={parent:null,offset:0,loading:{lines:16,rate:1E3/30,width:250,height:250,xpos:.5,ypos:.5,back:"#FFF",color:"#373737"},config:{dir:"assets/",pagestartnum:!1,chapterstartnum:!1,imgprebuffer:5,imgpostbuffer:5,startpage:0,back:"#FFF"},pages:[{alt:"",hover:"",title:"",url:[d],release:0,note:"",perm:!1,anim8:!1}],chapters:[]};else if(Array.isArray(d)){for(var m={parent:null,offset:0,loading:{lines:16,rate:1E3/30,width:250,height:250, -xpos:.5,ypos:.5,back:"#FFF",color:"#373737"},config:{dir:"assets/",pagestartnum:!1,chapterstartnum:!1,imgprebuffer:5,imgpostbuffer:5,startpage:0,back:"#FFF"},pages:[],chapters:[]},b=0;ba.y&&(a.y=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight);0>a.x&&(a.x=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);var c={x:void 0!==window.pageXOffset?a.x-window.pageXOffset:a.x-document.documentElement.scrollLeft,y:void 0!==window.pageYOffset? -a.y-window.pageYOffset:a.y-document.documentElement.scrollTop};if(c=={x:0,y:0})return c;var d=function(a,b,c){window.scrollBy(Math.floor(a.x)/b,Math.floor(a.y)/b);c+1<5*b&&window.setTimeout(d,5,a,b,c+1)};window.setTimeout(d,5,c,Math.floor(b/5),0);return c},m=function(){e[this.imaginaryID].loaded=!0},q=function(a,b){y=!0;window.setTimeout(F,k.rate,w);D();e[b].loaded||B.clearRect(0,0,c[1].width,c[1].height);a.imaginaryID=b;a.src=p.dir+e[b].url[0];for(var d=0,f=b-1;f>b-p.imgprebuffer-1&&0<=f;f--)e[f].loaded|| -(u[d].imaginaryID=f,u[d].src=p.dir+e[f].url,d++);d=0;for(f=b+1;fa.y&&(a.y=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight);0>a.x&&(a.x=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);var c={x:void 0!==window.pageXOffset?a.x-window.pageXOffset:a.x-document.documentElement.scrollLeft,y:void 0!== +window.pageYOffset?a.y-window.pageYOffset:a.y-document.documentElement.scrollTop};if(c=={x:0,y:0})return c;var d=function(a,b,c){window.scrollBy(Math.floor(a.x)/b,Math.floor(a.y)/b);c+1<5*b&&window.setTimeout(d,5,a,b,c+1)};window.setTimeout(d,5,c,Math.floor(b/5),0);return c},l=function(){e[this.imaginaryID].loaded=!0},q=function(a,b){x=!0;window.setTimeout(E,n.rate,D);A();e[b].loaded||z.clearRect(0,0,c[1].width,c[1].height);a.imaginaryID=b;a.src=p.dir+e[b].url[0];for(var d=0,f=b-1;f>b-p.imgprebuffer- +1&&0<=f;f--)e[f].loaded||(u[d].imaginaryID=f,u[d].src=p.dir+e[f].url,d++);d=0;for(f=b+1;f=d.status?d.responseText:null} cG.REPO=cG.REPO||{};cG.REPO.agent={def:function(a,c){return c=new XMLHttpRequest,c.open("GET",a),a=[],c.onreadystatechange=c.then=function(d,e,f){if(d&&d.call&&(a=[,d,e]),4==c.readyState&&(f=a[0|c.status/200]))try{f(JSON.parse(c.responseText),c)}catch(g){f(c.responseText,c)}},c.send(),c}};cG.REPO.director={def:Path};cG.REPO.producer={def:N}; -cG.REPO.stage={def:{id:"def",construct:function(a,c,d,e){this.main=new function(a,c){if(void 0===a)return-1;if("string"===typeof a)a={parent:null,offset:0,loading:{lines:16,rate:1E3/30,width:250,height:250,xpos:.5,ypos:.5,back:"#FFF",color:"#373737"},config:{dir:"assets/",pagestartnum:!1,chapterstartnum:!1,imgprebuffer:5,imgpostbuffer:5,startpage:0,back:"#FFF"},pages:[{alt:"",hover:"",title:"",url:[a],release:0,note:"",perm:!1,anim8:!1}],chapters:[]};else if(Array.isArray(a)){for(var d={parent:null, -offset:0,loading:{lines:16,rate:1E3/30,width:250,height:250,xpos:.5,ypos:.5,back:"#FFF",color:"#373737"},config:{dir:"assets/",pagestartnum:!1,chapterstartnum:!1,imgprebuffer:5,imgpostbuffer:5,startpage:0,back:"#FFF"},pages:[],chapters:[]},e=0;ea.y&&(a.y=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight);0>a.x&&(a.x=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);var d={x:void 0!==window.pageXOffset?a.x-window.pageXOffset:a.x-document.documentElement.scrollLeft, -y:void 0!==window.pageYOffset?a.y-window.pageYOffset:a.y-document.documentElement.scrollTop};if(d=={x:0,y:0})return d;var e=function(a,c,d){window.scrollBy(Math.floor(a.x)/c,Math.floor(a.y)/c);d+1<5*c&&window.setTimeout(e,5,a,c,d+1)};window.setTimeout(e,5,d,Math.floor(c/5),0);return d},d=function(){l[this.imaginaryID].loaded=!0},x=function(a,c){r=!0;window.setTimeout(I,t.rate,B);G();l[c].loaded||F.clearRect(0,0,n[1].width,n[1].height);a.imaginaryID=c;a.src=w.dir+l[c].url[0];for(var d=0,e=c-1;e>c- -w.imgprebuffer-1&&0<=e;e--)l[e].loaded||(v[d].imaginaryID=e,v[d].src=w.dir+l[e].url,d++);d=0;for(e=c+1;ea.y&&(a.y=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight);0>a.x&&(a.x=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);var d={x:void 0!==window.pageXOffset?a.x-window.pageXOffset: +a.x-document.documentElement.scrollLeft,y:void 0!==window.pageYOffset?a.y-window.pageYOffset:a.y-document.documentElement.scrollTop};if(d=={x:0,y:0})return d;var e=function(a,c,d){window.scrollBy(Math.floor(a.x)/c,Math.floor(a.y)/c);d+1<5*c&&window.setTimeout(e,5,a,c,d+1)};window.setTimeout(e,5,d,Math.floor(c/5),0);return d},d=function(){l[this.imaginaryID].loaded=!0},x=function(a,c){r=!0;window.setTimeout(H,u.rate,G);E();l[c].loaded||D.clearRect(0,0,n[1].width,n[1].height);a.imaginaryID=c;a.src= +w.dir+l[c].url[0];for(var d=0,e=c-1;e>c-w.imgprebuffer-1&&0<=e;e--)l[e].loaded||(v[d].imaginaryID=e,v[d].src=w.dir+l[e].url,d++);d=0;for(e=c+1;e
Archive
About Me
',f=[],g=function(a,h){var k;if(null===h||void 0===h)if(k=c[a].getAttribute("script"),""==k||"script.json"==k||void 0===k||null===k)k=cG.script;else return f.push(cG.agent(k).then(function(c,d){g(a,c)},function(c,d){console.error(c,d.status); -g(a,"")})),0;else k=""==h?cG.script:h;var l=c[a].getAttribute("id"),p=c[a].getAttribute("use"),r=c[a].getAttribute("config");if(""==l||void 0===l||null===l){for(var l="STG"+a,q=1;document.getElementById(l);)l="STG"+(a+q++);l=l.toString();c[a].setAttribute("id",l)}if(""==p||void 0===p||null===p)p="def";if(""!=r)try{r=JSON.parse(r)}catch(t){console.debug("The following configuration settings are malformed for plugin["+p+"]: ",r,"\nIt has been ignored"),r={}}else r={};c[a].innerHTML=e;cG.HELPERS.renameEles(!1, +g(a,"")})),0;else k=""==h?cG.script:h;var l=c[a].getAttribute("id"),p=c[a].getAttribute("use"),r=c[a].getAttribute("config");if(""==l||void 0===l||null===l){for(var l="STG"+a,q=1;document.getElementById(l);)l="STG"+(a+q++);l=l.toString();c[a].setAttribute("id",l)}if(""==p||void 0===p||null===p)p="def";if(""!=r)try{r=JSON.parse(r)}catch(u){console.debug("The following configuration settings are malformed for plugin["+p+"]: ",r,"\nIt has been ignored"),r={}}else r={};c[a].innerHTML=e;cG.HELPERS.renameEles(!1, c[a],l);q=document.getElementById(l+"_location");void 0===q||null===q?q=c[a]:cG.HELPERS.smartAttrib(c[a],{div:{style:"display: none;"}},1);q.style.display="block";d[p+"_"+a]=new cG.stage.construct(l,k,q,r)};for(a=0;a=d){if(void 0===f.count||0!=f.count){e=Object.keys(f);for(y=0;y--> +{def:0}:cG.REPO.decor.def=0;cG.decor=cG.REPO.decor.def});b.src=mainsrc;document.body.appendChild(b);for(var a=0;a