From 95b8964bc0576acd2d21ea5b37e22bbfead105f1 Mon Sep 17 00:00:00 2001 From: Kalmer Apinis Date: Wed, 2 Jul 2014 11:47:29 +0200 Subject: [PATCH] server code --- resources/frame.html | 3 + resources/iframeResizer.contentWindow.min.js | 1 - resources/jquery.iframeResizer.min.js | 1 - resources/node.xsl | 22 +- resources/script.js | 25 + src/fi/iki/elonen/NanoHTTPD.java | 1420 ++++++++++++++++++ src/g2html/Config.java | 3 + src/g2html/GoblintInstance.java | 81 + src/g2html/GoblintServer.java | 180 +++ src/g2html/Loc.java | 12 +- src/g2html/Main.java | 17 + src/g2html/XmlResult.java | 2 +- 12 files changed, 1748 insertions(+), 19 deletions(-) create mode 100644 src/fi/iki/elonen/NanoHTTPD.java create mode 100644 src/g2html/GoblintInstance.java create mode 100644 src/g2html/GoblintServer.java diff --git a/resources/frame.html b/resources/frame.html index 596b6d3..120d0b1 100644 --- a/resources/frame.html +++ b/resources/frame.html @@ -19,6 +19,9 @@ main + + + globals diff --git a/resources/iframeResizer.contentWindow.min.js b/resources/iframeResizer.contentWindow.min.js index 1235fba..a4e3642 100755 --- a/resources/iframeResizer.contentWindow.min.js +++ b/resources/iframeResizer.contentWindow.min.js @@ -7,4 +7,3 @@ */ !function(){function a(a,b){"addEventListener"in window?window.addEventListener(a,b,!1):"attachEvent"in window&&window.attachEvent("on"+a,b)}function b(a){return o+"["+q+"] "+a}function c(a){n&&"console"in window&&console.log(b(a))}function d(a){"console"in window&&console.warn(b(a))}function e(b){function e(){function d(){function a(a){return"true"===a?!0:!1}var c=b.data.substr(p).split(":");q=c[0],h=parseInt(c[1],g),i=void 0!==c[2]?a(c[2]):!1,n=void 0!==c[3]?a(c[3]):!1,l=void 0!==c[4]?parseInt(c[4],g):33,r=void 0!==c[5]?a(c[5]):!1,f=void 0!==c[6]?a(c[6]):!0,s=b.source}function e(){document.body.style.margin=h+"px",c("Body margin set to "+h+"px")}function j(){document.documentElement.style.height="auto",document.body.style.height="auto",c('HTML & body height set to "auto"')}function k(){a("resize",function(){u("resize","Window resized")})}function m(){!0===f?(k(),x()):c("Auto Resize disabled")}c("Initialising iFrame"),d(),e(),j(),v(),m()}function u(a,b,d,e){function f(a){return document.body["offset"+a]+2*h}function g(){c("Trigger event ("+b+") cancelled"),setTimeout(function(){m=a},250)}function k(){c("Trigger event: "+b),m=a}function l(){var b=q+":"+j+":"+t+":"+a;c("Sending msg to host page ("+b+")"),s.postMessage(o+b,"*")}function n(){j=p,t=r,k(),l()}var p=void 0!==d?d:f("Height"),r=void 0!==e?e:f("Width");"size"===m&&"resize"===a?g():(j!==p||i&&t!==r)&&n()}function v(){r&&(c("Enabling public methods"),window.parentIFrame=window.iFrameSizer={trigger:function(a,b){d("trigger() method deprecated. Use size() instead."),window.parentIFrame.size(a,b)},size:function(a,b){var c=""+(a?a:"")+(b?","+b:"");u("size","window.parentIFrame.size("+c+")",a,b)},close:function(){u("close","window.parentIFrame.close()",0,0)}})}function w(){0!==l&&(c("setInterval: "+l+"ms"),setInterval(function(){u("interval","setInterval: "+l)},Math.abs(l)))}function x(){function a(){var a=document.querySelector("body"),d={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0},e=new b(function(a){a.forEach(function(a){u("mutationObserver","mutationObserver: "+a.target+" "+a.type)})});c("Setup MutationObserver"),e.observe(a,d)}var b=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;b?0>l?w():a():(d("MutationObserver not supported in this browser!"),w())}o===b.data.substr(0,p)&&k&&(e(),u("init","Init message from host page"),k=!1)}var f=!0,g=10,h=0,i=!1,j=1,k=!0,l=0,m="",n=!1,o="[iFrameSizer]",p=o.length,q="",r=!1,s=null,t=1;try{a("message",e)}catch(u){d(u)}}(); -//# sourceMappingURL=../src/iframeResizer.contentWindow.map \ No newline at end of file diff --git a/resources/jquery.iframeResizer.min.js b/resources/jquery.iframeResizer.min.js index 752b6a7..e7353bc 100755 --- a/resources/jquery.iframeResizer.min.js +++ b/resources/jquery.iframeResizer.min.js @@ -6,4 +6,3 @@ */ !function(a){function b(){var a,b=["moz","webkit","o","ms"];for(a=0;a - +
@@ -43,9 +43,9 @@ - +
- +
@@ -60,20 +60,20 @@
- +
- +
- + - +
@@ -86,7 +86,7 @@
path:
- +
@@ -94,14 +94,14 @@
path: - +
- + ../frame.html?file=&fun=&node=
@@ -131,7 +131,7 @@