j1m_scroll 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.md +21 -0
- data/README.md +41 -0
- data/_data/modules/default/j1_scroll-0.0.1/j1_back2top.yml +131 -0
- data/_data/modules/default/j1_scroll-0.0.1/j1_smooth_scroll.yml +162 -0
- data/_data/resources/default/j1_scroll-0.0.1/resource.yml +43 -0
- data/assets/themes/j1/iframe_resizer/.npmignore +9 -0
- data/assets/themes/j1/iframe_resizer/.travis.yml +6 -0
- data/assets/themes/j1/iframe_resizer/CONTRIBUTING.md +86 -0
- data/assets/themes/j1/iframe_resizer/Iframe-resizer by davidjbradshaw.url +2 -0
- data/assets/themes/j1/iframe_resizer/LICENSE +21 -0
- data/assets/themes/j1/iframe_resizer/README.md +608 -0
- data/assets/themes/j1/iframe_resizer/bower.json +45 -0
- data/assets/themes/j1/iframe_resizer/example/frame.absolute.html +88 -0
- data/assets/themes/j1/iframe_resizer/example/frame.content.html +58 -0
- data/assets/themes/j1/iframe_resizer/example/frame.hover.html +51 -0
- data/assets/themes/j1/iframe_resizer/example/frame.nested.html +72 -0
- data/assets/themes/j1/iframe_resizer/example/frame.textarea.html +46 -0
- data/assets/themes/j1/iframe_resizer/example/frame.tolerance.html +79 -0
- data/assets/themes/j1/iframe_resizer/example/index.html +70 -0
- data/assets/themes/j1/iframe_resizer/example/two.html +71 -0
- data/assets/themes/j1/iframe_resizer/gruntfile.js +215 -0
- data/assets/themes/j1/iframe_resizer/iframeResizer.jquery.json +41 -0
- data/assets/themes/j1/iframe_resizer/index.js +4 -0
- data/assets/themes/j1/iframe_resizer/js/_client.js +1131 -0
- data/assets/themes/j1/iframe_resizer/js/_server.js +1126 -0
- data/assets/themes/j1/iframe_resizer/js/ie8.polyfils.js +85 -0
- data/assets/themes/j1/iframe_resizer/js/ie8.polyfils.map +1 -0
- data/assets/themes/j1/iframe_resizer/js/ie8.polyfils.min.js +4 -0
- data/assets/themes/j1/iframe_resizer/js/iframeResizer.contentWindow.js +1104 -0
- data/assets/themes/j1/iframe_resizer/js/iframeResizer.contentWindow.map +1 -0
- data/assets/themes/j1/iframe_resizer/js/iframeResizer.contentWindow.min.js +10 -0
- data/assets/themes/j1/iframe_resizer/js/iframeResizer.js +1007 -0
- data/assets/themes/j1/iframe_resizer/js/iframeResizer.js.modified +1004 -0
- data/assets/themes/j1/iframe_resizer/js/iframeResizer.map +1 -0
- data/assets/themes/j1/iframe_resizer/js/iframeResizer.min.js +9 -0
- data/assets/themes/j1/iframe_resizer/js/index.js +2 -0
- data/assets/themes/j1/iframe_resizer/karma.conf.js +92 -0
- data/assets/themes/j1/iframe_resizer/package.json +111 -0
- data/assets/themes/j1/iframe_resizer/spec/_initSpec.js +63 -0
- data/assets/themes/j1/iframe_resizer/spec/anchorSpec.js +62 -0
- data/assets/themes/j1/iframe_resizer/spec/childSpec.js +403 -0
- data/assets/themes/j1/iframe_resizer/spec/closeSpecSpec.js +44 -0
- data/assets/themes/j1/iframe_resizer/spec/getPageInfoSpec.js +32 -0
- data/assets/themes/j1/iframe_resizer/spec/initCssSpec.js +28 -0
- data/assets/themes/j1/iframe_resizer/spec/initDomSpec.js +27 -0
- data/assets/themes/j1/iframe_resizer/spec/initDoubleCallSpec.js +33 -0
- data/assets/themes/j1/iframe_resizer/spec/initErrorSpec.js +57 -0
- data/assets/themes/j1/iframe_resizer/spec/initJQuerySpec.js +29 -0
- data/assets/themes/j1/iframe_resizer/spec/initUndefinedDomSpec.js +25 -0
- data/assets/themes/j1/iframe_resizer/spec/javascripts/fixtures/iframe.html +2 -0
- data/assets/themes/j1/iframe_resizer/spec/javascripts/fixtures/iframe600.html +4 -0
- data/assets/themes/j1/iframe_resizer/spec/javascripts/fixtures/iframe600WithId.html +4 -0
- data/assets/themes/j1/iframe_resizer/spec/lib/common.js +59 -0
- data/assets/themes/j1/iframe_resizer/spec/parentSpec.js +88 -0
- data/assets/themes/j1/iframe_resizer/spec/resources/djb.jpg +0 -0
- data/assets/themes/j1/iframe_resizer/spec/resources/frame.content.html +176 -0
- data/assets/themes/j1/iframe_resizer/spec/resources/frame.lateload.html +33 -0
- data/assets/themes/j1/iframe_resizer/spec/resources/frame.nested.html +40 -0
- data/assets/themes/j1/iframe_resizer/spec/scrollSpec.js +53 -0
- data/assets/themes/j1/iframe_resizer/spec/sendMessageSpec.js +58 -0
- data/assets/themes/j1/iframe_resizer/spec/support/jasmine.json +9 -0
- data/assets/themes/j1/iframe_resizer/src/ie8.polyfils.js +64 -0
- data/assets/themes/j1/iframe_resizer/src/iframeResizer.contentWindow.js +1123 -0
- data/assets/themes/j1/iframe_resizer/src/iframeResizer.js +1002 -0
- data/assets/themes/j1/iframe_resizer/test-main.js +33 -0
- data/assets/themes/j1/iframe_resizer/test/_init.html +44 -0
- data/assets/themes/j1/iframe_resizer/test/_init_once.html +45 -0
- data/assets/themes/j1/iframe_resizer/test/_init_once_async.html +72 -0
- data/assets/themes/j1/iframe_resizer/test/background.html +47 -0
- data/assets/themes/j1/iframe_resizer/test/changePage.html +50 -0
- data/assets/themes/j1/iframe_resizer/test/close.html +44 -0
- data/assets/themes/j1/iframe_resizer/test/getId.html +44 -0
- data/assets/themes/j1/iframe_resizer/test/interval.html +56 -0
- data/assets/themes/j1/iframe_resizer/test/jqueryNoConflict.html +47 -0
- data/assets/themes/j1/iframe_resizer/test/lateImageLoad.html +90 -0
- data/assets/themes/j1/iframe_resizer/test/margin.html +73 -0
- data/assets/themes/j1/iframe_resizer/test/mutationObserver.html +63 -0
- data/assets/themes/j1/iframe_resizer/test/nested.html +46 -0
- data/assets/themes/j1/iframe_resizer/test/resize.contentWidth.html +51 -0
- data/assets/themes/j1/iframe_resizer/test/resize.width.html +63 -0
- data/assets/themes/j1/iframe_resizer/test/resources/djb.jpg +0 -0
- data/assets/themes/j1/iframe_resizer/test/resources/frame.content.html +191 -0
- data/assets/themes/j1/iframe_resizer/test/resources/frame.lateload.html +33 -0
- data/assets/themes/j1/iframe_resizer/test/resources/frame.nested.html +40 -0
- data/assets/themes/j1/iframe_resizer/test/resources/jquery.js +6 -0
- data/assets/themes/j1/iframe_resizer/test/resources/qunit.css +244 -0
- data/assets/themes/j1/iframe_resizer/test/resources/qunit.js +2212 -0
- data/assets/themes/j1/iframe_resizer/test/resources/require.js +2103 -0
- data/assets/themes/j1/iframe_resizer/test/resources/testLib.js +9 -0
- data/assets/themes/j1/iframe_resizer/test/scrolling.html +65 -0
- data/assets/themes/j1/iframe_resizer/test/sendMessage.html +61 -0
- data/assets/themes/j1/iframe_resizer/test/setHeightCalculationMethod.html +51 -0
- data/assets/themes/j1/iframe_resizer/test/size.html +64 -0
- data/assets/themes/j1/iframe_resizer/test/v1.html +189 -0
- data/assets/themes/j1/j1/js/adapters/iframe_resizer.js +105 -0
- data/exe/console +14 -0
- data/exe/setup +8 -0
- data/lib/j1m_scroll.rb +5 -0
- data/lib/j1m_scroll/version.rb +3 -0
- metadata +190 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["iframeResizer.js"],"names":["window","addEventListener","obj","evt","func","attachEvent","removeEventListener","el","detachEvent","setupRequestAnimationFrame","x","vendors","length","requestAnimationFrame","log","getMyID","iframeId","retStr","top","self","parentIFrame","getId","formatLogHeader","msgId","isLogEnabled","settings","logEnabled","msg","output","info","warn","type","enabled","console","iFrameListener","event","resizeIFrame","resize","setSize","messageData","setPagePosition","ensureInRange","syncResize","processMsg","data","substr","msgIdLen","split","iframe","id","height","width","Dimension","max","Number","min","dimension","toLowerCase","size","isMessageFromIFrame","checkAllowedOrigin","checkList","i","retCode","checkOrigin","origin","checkSingle","remoteHost","constructor","Array","Error","isMessageForUs","isMessageFromMetaParent","true","false","undefined","getMsgBody","offset","indexOf","msgHeaderLen","forwardMsgFromIFrame","msgBody","callback","message","JSON","parse","getPageInfo","bodyPosition","document","body","getBoundingClientRect","iFramePosition","stringify","iframeHeight","iframeWidth","clientHeight","Math","documentElement","innerHeight","clientWidth","innerWidth","offsetTop","parseInt","offsetLeft","left","scrollTop","pageYOffset","scrollLeft","pageXOffset","sendPageInfoToIframe","debouncedTrigger","trigger","debouce","startPageInfoMonitor","setListener","sendPageInfo","stop","forEach","start","stopPageInfo","stopPageInfoMonitor","checkIFrameExists","retBool","getElementPosition","target","getPagePosition","floor","pagePosition","y","scrollRequestFromChild","addOffset","reposition","newPosition","scrollTo","calcOffset","scrollParent","unsetPagePosition","findTarget","location","jumpToTarget","jumpPosition","hash","jumpToParent","moveToAnchor","hashData","decodeURIComponent","getElementById","getElementsByName","funcName","val","chkCallback","actionMsg","firstRun","closeIFrame","resetIFrame","hasSettings","iFrameReadyMsgReceived","createOutgoingMsg","logId","retVal","TypeError","parentNode","removeChild","reset","setDimension","style","chkZero","hiddenCheckEnabled","fixHiddenIFrames","processDimension","sizeHeight","sizeWidth","doNotSync","calleeMsg","postMessageToIFrame","targetOrigin","contentWindow","postMessage","iFrameNotFound","chkAndSend","bodyMarginV1","interval","enablePublicMethods","autoResize","bodyMargin","heightCalculationMethod","bodyBackground","bodyPadding","tolerance","inPageLinks","resizeFrom","widthCalculationMethod","setupIFrame","options","setLimits","addStyle","Infinity","chkMinMax","newId","defaults","count","ensureHasId","src","setScrolling","scrolling","overflow","setupBodyMarginValues","checkReset","resetRequertMethod","resetRequiredMethods","setupIFrameObject","Function","prototype","bind","iFrameResizer","close","anchor","sendMessage","init","iFrameLoaded","checkOptions","copyOptions","option","hasOwnProperty","getTargetOrigin","processOptions","slice","join","beenHere","fn","time","timer","setTimeout","checkIFrames","checkIFrame","settingId","chkDimension","isVisible","offsetParent","mutationObserved","mutations","createMutationObserver","querySelector","config","attributes","attributeOldValue","characterData","characterDataOldValue","childList","subtree","observer","MutationObserver","observe","WebKitMutationObserver","resizeIFrames","sendTriggerMsg","tabVisible","visibilityState","eventName","isIFrameResizeEnabled","setupEventListeners","factory","element","chkType","tagName","toUpperCase","iFrames","push","warnDeprecatedOptions","call","querySelectorAll","createJQueryPublicMethod","$","iFrameResize","index","this","filter","each","end","msgHeader","scroll","bodyScroll","documentElementScroll","maxHeight","maxWidth","minHeight","minWidth","closedCallback","initCallback","messageCallback","resizedCallback","scrollCallback","jQuery","define","amd","module","exports"],"mappings":";;;;;;;CAWC,SAAUA,GACV,YA+CA,SAASC,GAAiBC,EAAIC,EAAIC,GAE7B,oBAAsBJ,GACzBE,EAAID,iBAAiBE,EAAIC,GAAM,GACrB,eAAiBJ,IAC3BE,EAAIG,YAAY,KAAKF,EAAIC,GAI3B,QAASE,GAAoBC,EAAGJ,EAAIC,GAE/B,uBAAyBJ,GAC5BO,EAAGD,oBAAoBH,EAAIC,GAAM,GACvB,eAAiBJ,IAC3BO,EAAGC,YAAY,KAAKL,EAAIC,GAI1B,QAASK,KACR,GAECC,GADAC,GAAW,MAAO,SAAU,IAAK,KAIlC,KAAKD,EAAI,EAAGA,EAAIC,EAAQC,SAAWC,EAAuBH,GAAK,EAC9DG,EAAwBb,EAAOW,EAAQD,GAAK,wBAGxC,IACJI,EAAI,QAAQ,uCAId,QAASC,GAAQC,GAChB,GAAIC,GAAS,cAAcD,CAU3B,OARIhB,GAAOkB,MAAQlB,EAAOmB,OAExBF,EADGjB,EAAOoB,cAAgBpB,EAAOoB,aAAaC,MACrCrB,EAAOoB,aAAaC,QAAQ,KAAKL,EAEjC,qBAAqBA,GAIzBC,EAGR,QAASK,GAAgBN,GACxB,MAAOO,GAAQ,IAAMR,EAAQC,GAAY,IAG1C,QAASQ,GAAaR,GACrB,MAAOS,GAAST,GAAYS,EAAST,GAAUF,IAAMY,EAGtD,QAASZ,GAAIE,EAASW,GACrBC,EAAO,MAAMZ,EAASW,EAAIH,EAAaR,IAGxC,QAASa,GAAKb,EAASW,GACtBC,EAAO,OAAOZ,EAASW,EAAIH,EAAaR,IAGzC,QAASc,GAAKd,EAASW,GACtBC,EAAO,OAAOZ,EAASW,GAAI,GAG5B,QAASC,GAAOG,EAAKf,EAASW,EAAIK,IAC7B,IAAS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AA4BxF,EAAAA,EAC5ByF,UAA4B,EAC5BC,SAA4B,EAC5BhG,WAA4B,SAC5Bc,WAA4B,EAC5BlC,YAA4B,EAC5BC,WAA4B,EAC5BiB,UAA4B,EAC5BG,uBAA4B,SAC5BgG,eAA4B,aAC5BC,aAA4B,aAC5BC,gBAA4B,WAAWnQ,EAAK,yCAC5CoQ,gBAA4B,aAC5BC,eAA4B,WAAW,OAAO,GA46B5CnS,GAAOoS,QAAUrB,EAAyBqB,QAExB,kBAAXC,SAAyBA,OAAOC,IAC1CD,UAAUhC,GACkB,gBAAXkC,SAAiD,gBAAnBA,QAAOC,QACtDD,OAAOC,QAAUnC,IAEjBrQ,EAAOiR,aAAejR,EAAOiR,cAAgBZ,KAG5CrQ","file":"iframeResizer.min.js","sourcesContent":["/*\n * File: iframeResizer.js\n * Desc: Force iframes to size to content.\n * Requires: iframeResizer.contentWindow.js to be loaded into the target frame.\n * Doc: https://github.com/davidjbradshaw/iframe-resizer\n * Author: David J. Bradshaw - dave@bradshaw.net\n * Contributor: Jure Mav - jure.mav@gmail.com\n * Contributor: Reed Dadoune - reed@dadoune.com\n */\n\n\n;(function(window) {\n\t'use strict';\n\n\tvar\n\t\tcount = 0,\n\t\tlogEnabled = false,\n\t\thiddenCheckEnabled = false,\n\t\tmsgHeader = 'message',\n\t\tmsgHeaderLen = msgHeader.length,\n\t\tmsgId = '[iFrameSizer]', //Must match iframe msg ID\n\t\tmsgIdLen = msgId.length,\n\t\tpagePosition = null,\n\t\trequestAnimationFrame = window.requestAnimationFrame,\n\t\tresetRequiredMethods = {max:1,scroll:1,bodyScroll:1,documentElementScroll:1},\n\t\tsettings = {},\n\t\ttimer = null,\n\t\tlogId = 'Host Page',\n\n\t\tdefaults = {\n\t\t\tautoResize : true,\n\t\t\tbodyBackground : null,\n\t\t\tbodyMargin : null,\n\t\t\tbodyMarginV1 : 8,\n\t\t\tbodyPadding : null,\n\t\t\tcheckOrigin : true,\n\t\t\tinPageLinks : false,\n\t\t\tenablePublicMethods : true,\n\t\t\theightCalculationMethod : 'bodyOffset',\n\t\t\tid : 'iFrameResizer',\n\t\t\tinterval : 32,\n\t\t\tlog : false,\n\t\t\tmaxHeight : Infinity,\n\t\t\tmaxWidth : Infinity,\n\t\t\tminHeight : 0,\n\t\t\tminWidth : 0,\n\t\t\tresizeFrom : 'parent',\n\t\t\tscrolling : false,\n\t\t\tsizeHeight : true,\n\t\t\tsizeWidth : false,\n\t\t\ttolerance : 0,\n\t\t\twidthCalculationMethod : 'scroll',\n\t\t\tclosedCallback : function(){},\n\t\t\tinitCallback : function(){},\n\t\t\tmessageCallback : function(){warn('MessageCallback function not defined');},\n\t\t\tresizedCallback : function(){},\n\t\t\tscrollCallback : function(){return true;}\n\t\t};\n\n\tfunction addEventListener(obj,evt,func){\n\t\t/* istanbul ignore else */ // Not testable in PhantonJS\n\t\tif ('addEventListener' in window){\n\t\t\tobj.addEventListener(evt,func, false);\n\t\t} else if ('attachEvent' in window){//IE\n\t\t\tobj.attachEvent('on'+evt,func);\n\t\t}\n\t}\n\n\tfunction removeEventListener(el,evt,func){\n\t\t/* istanbul ignore else */ // Not testable in phantonJS\n\t\tif ('removeEventListener' in window){\n\t\t\tel.removeEventListener(evt,func, false);\n\t\t} else if ('detachEvent' in window){ //IE\n\t\t\tel.detachEvent('on'+evt,func);\n\t\t}\n\t}\n\n\tfunction setupRequestAnimationFrame(){\n\t\tvar\n\t\t\tvendors = ['moz', 'webkit', 'o', 'ms'],\n\t\t\tx;\n\n\t\t// Remove vendor prefixing if prefixed and break early if not\n\t\tfor (x = 0; x < vendors.length && !requestAnimationFrame; x += 1) {\n\t\t\trequestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];\n\t\t}\n\n\t\tif (!(requestAnimationFrame)){\n\t\t\tlog('setup','RequestAnimationFrame not supported');\n\t\t}\n\t}\n\n\tfunction getMyID(iframeId){\n\t\tvar retStr = 'Host page: '+iframeId;\n\n\t\tif (window.top !== window.self){\n\t\t\tif (window.parentIFrame && window.parentIFrame.getId){\n\t\t\t\tretStr = window.parentIFrame.getId()+': '+iframeId;\n\t\t\t} else {\n\t\t\t\tretStr = 'Nested host page: '+iframeId;\n\t\t\t}\n\t\t}\n\n\t\treturn retStr;\n\t}\n\n\tfunction formatLogHeader(iframeId){\n\t\treturn msgId + '[' + getMyID(iframeId) + ']';\n\t}\n\n\tfunction isLogEnabled(iframeId){\n\t\treturn settings[iframeId] ? settings[iframeId].log : logEnabled;\n\t}\n\n\tfunction log(iframeId,msg){\n\t\toutput('log',iframeId,msg,isLogEnabled(iframeId));\n\t}\n\n\tfunction info(iframeId,msg){\n\t\toutput('info',iframeId,msg,isLogEnabled(iframeId));\n\t}\n\n\tfunction warn(iframeId,msg){\n\t\toutput('warn',iframeId,msg,true);\n\t}\n\n\tfunction output(type,iframeId,msg,enabled){\n\t\tif (true === enabled && 'object' === typeof window.console){\n\t\t\tconsole[type](formatLogHeader(iframeId),msg);\n\t\t}\n\t}\n\n\tfunction iFrameListener(event){\n\t\tfunction resizeIFrame(){\n\t\t\tfunction resize(){\n\t\t\t\tsetSize(messageData);\n\t\t\t\tsetPagePosition(iframeId);\n\t\t\t}\n\n\t\t\tensureInRange('Height');\n\t\t\tensureInRange('Width');\n\n\t\t\tsyncResize(resize,messageData,'init');\n\t\t}\n\n\t\tfunction processMsg(){\n\t\t\tvar data = msg.substr(msgIdLen).split(':');\n\n\t\t\treturn {\n\t\t\t\tiframe: settings[data[0]].iframe,\n\t\t\t\tid: data[0],\n\t\t\t\theight: data[1],\n\t\t\t\twidth: data[2],\n\t\t\t\ttype: data[3]\n\t\t\t};\n\t\t}\n\n\t\tfunction ensureInRange(Dimension){\n\t\t\tvar\n\t\t\t\tmax = Number(settings[iframeId]['max' + Dimension]),\n\t\t\t\tmin = Number(settings[iframeId]['min' + Dimension]),\n\t\t\t\tdimension = Dimension.toLowerCase(),\n\t\t\t\tsize = Number(messageData[dimension]);\n\n\t\t\tlog(iframeId,'Checking ' + dimension + ' is in range ' + min + '-' + max);\n\n\t\t\tif (size<min) {\n\t\t\t\tsize=min;\n\t\t\t\tlog(iframeId,'Set ' + dimension + ' to min value');\n\t\t\t}\n\n\t\t\tif (size>max) {\n\t\t\t\tsize=max;\n\t\t\t\tlog(iframeId,'Set ' + dimension + ' to max value');\n\t\t\t}\n\n\t\t\tmessageData[dimension] = '' + size;\n\t\t}\n\n\n\t\tfunction isMessageFromIFrame(){\n\t\t\tfunction checkAllowedOrigin(){\n\t\t\t\tfunction checkList(){\n\t\t\t\t\tvar\n\t\t\t\t\t\ti = 0,\n\t\t\t\t\t\tretCode = false;\n\n\t\t\t\t\tlog(iframeId,'Checking connection is from allowed list of origins: ' + checkOrigin);\n\n\t\t\t\t\tfor (; i < checkOrigin.length; i++) {\n\t\t\t\t\t\tif (checkOrigin[i] === origin) {\n\t\t\t\t\t\t\tretCode = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn retCode;\n\t\t\t\t}\n\n\t\t\t\tfunction checkSingle(){\n\t\t\t\t\tvar remoteHost = settings[iframeId].remoteHost;\n\t\t\t\t\tlog(iframeId,'Checking connection is from: '+remoteHost);\n\t\t\t\t\treturn origin === remoteHost;\n\t\t\t\t}\n\n\t\t\t\treturn checkOrigin.constructor === Array ? checkList() : checkSingle();\n\t\t\t}\n\n\t\t\tvar\n\t\t\t\torigin = event.origin,\n\t\t\t\tcheckOrigin = settings[iframeId].checkOrigin;\n\n\t\t\tif (checkOrigin && (''+origin !== 'null') && !checkAllowedOrigin()) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'Unexpected message received from: ' + origin +\n\t\t\t\t\t' for ' + messageData.iframe.id +\n\t\t\t\t\t'. Message was: ' + event.data +\n\t\t\t\t\t'. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tfunction isMessageForUs(){\n\t\t\treturn msgId === (('' + msg).substr(0,msgIdLen)) && (msg.substr(msgIdLen).split(':')[0] in settings); //''+Protects against non-string msg\n\t\t}\n\n\t\tfunction isMessageFromMetaParent(){\n\t\t\t//Test if this message is from a parent above us. This is an ugly test, however, updating\n\t\t\t//the message format would break backwards compatibity.\n\t\t\tvar retCode = messageData.type in {'true':1,'false':1,'undefined':1};\n\n\t\t\tif (retCode){\n\t\t\t\tlog(iframeId,'Ignoring init message from meta parent page');\n\t\t\t}\n\n\t\t\treturn retCode;\n\t\t}\n\n\t\tfunction getMsgBody(offset){\n\t\t\treturn msg.substr(msg.indexOf(':')+msgHeaderLen+offset);\n\t\t}\n\n\t\tfunction forwardMsgFromIFrame(msgBody){\n\t\t\tlog(iframeId,'MessageCallback passed: {iframe: '+ messageData.iframe.id + ', message: ' + msgBody + '}');\n\t\t\tcallback('messageCallback',{\n\t\t\t\tiframe: messageData.iframe,\n\t\t\t\tmessage: JSON.parse(msgBody)\n\t\t\t});\n\t\t\tlog(iframeId,'--');\n\t\t}\n\n\t\tfunction getPageInfo(){\n\t\t\tvar\n\t\t\t\tbodyPosition = document.body.getBoundingClientRect(),\n\t\t\t\tiFramePosition = messageData.iframe.getBoundingClientRect();\n\n\t\t\treturn JSON.stringify({\n\t\t\t\tiframeHeight: iFramePosition.height,\n\t\t\t\tiframeWidth: iFramePosition.width,\n\t\t\t\tclientHeight: Math.max(document.documentElement.clientHeight, window.innerHeight || 0),\n\t\t\t\tclientWidth: Math.max(document.documentElement.clientWidth, window.innerWidth || 0),\n\t\t\t\toffsetTop: parseInt(iFramePosition.top - bodyPosition.top, 10),\n\t\t\t\toffsetLeft: parseInt(iFramePosition.left - bodyPosition.left, 10),\n\t\t\t\tscrollTop: window.pageYOffset,\n\t\t\t\tscrollLeft: window.pageXOffset\n\t\t\t});\n\t\t}\n\n\t\tfunction sendPageInfoToIframe(iframe,iframeId){\n\t\t\tfunction debouncedTrigger(){\n\t\t\t\ttrigger(\n\t\t\t\t\t'Send Page Info',\n\t\t\t\t\t'pageInfo:' + getPageInfo(),\n\t\t\t\t\tiframe,\n\t\t\t\t\tiframeId\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tdebouce(debouncedTrigger,32);\n\t\t}\n\n\n\t\tfunction startPageInfoMonitor(){\n\t\t\tfunction setListener(type,func){\n\t\t\t\tfunction sendPageInfo(){\n\t\t\t\t\tif (settings[id]){\n\t\t\t\t\t\tsendPageInfoToIframe(settings[id].iframe,id);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstop();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t['scroll','resize'].forEach(function(evt){\n\t\t\t\t\tlog(id, type + evt + ' listener for sendPageInfo');\n\t\t\t\t\tfunc(window,evt,sendPageInfo);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tfunction stop(){\n\t\t\t\tsetListener('Remove ', removeEventListener);\n\t\t\t}\n\n\t\t\tfunction start(){\n\t\t\t\tsetListener('Add ', addEventListener);\n\t\t\t}\n\n\t\t\tvar id = iframeId; //Create locally scoped copy of iFrame ID\n\n\t\t\tstart();\n\n\t\t\tsettings[id].stopPageInfo = stop;\n\t\t}\n\n\t\tfunction stopPageInfoMonitor(){\n\t\t\tif (settings[iframeId] && settings[iframeId].stopPageInfo){\n\t\t\t\tsettings[iframeId].stopPageInfo();\n\t\t\t\tdelete settings[iframeId].stopPageInfo;\n\t\t\t}\n\t\t}\n\n\t\tfunction checkIFrameExists(){\n\t\t\tvar retBool = true;\n\n\t\t\tif (null === messageData.iframe) {\n\t\t\t\twarn(iframeId,'IFrame ('+messageData.id+') not found');\n\t\t\t\tretBool = false;\n\t\t\t}\n\t\t\treturn retBool;\n\t\t}\n\n\t\tfunction getElementPosition(target){\n\t\t\tvar iFramePosition = target.getBoundingClientRect();\n\n\t\t\tgetPagePosition(iframeId);\n\n\t\t\treturn {\n\t\t\t\tx: Math.floor( Number(iFramePosition.left) + Number(pagePosition.x) ),\n\t\t\t\ty: Math.floor( Number(iFramePosition.top) + Number(pagePosition.y) )\n\t\t\t};\n\t\t}\n\n\t\tfunction scrollRequestFromChild(addOffset){\n\t\t\t/* istanbul ignore next */ //Not testable in Karma\n\t\t\tfunction reposition(){\n\t\t\t\tpagePosition = newPosition;\n\t\t\t\tscrollTo();\n\t\t\t\tlog(iframeId,'--');\n\t\t\t}\n\n\t\t\tfunction calcOffset(){\n\t\t\t\treturn {\n\t\t\t\t\tx: Number(messageData.width) + offset.x,\n\t\t\t\t\ty: Number(messageData.height) + offset.y\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tfunction scrollParent(){\n\t\t\t\tif (window.parentIFrame){\n\t\t\t\t\twindow.parentIFrame['scrollTo'+(addOffset?'Offset':'')](newPosition.x,newPosition.y);\n\t\t\t\t} else {\n\t\t\t\t\twarn(iframeId,'Unable to scroll to requested position, window.parentIFrame not found');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar\n\t\t\t\toffset = addOffset ? getElementPosition(messageData.iframe) : {x:0,y:0},\n\t\t\t\tnewPosition = calcOffset();\n\n\t\t\tlog(iframeId,'Reposition requested from iFrame (offset x:'+offset.x+' y:'+offset.y+')');\n\n\t\t\tif(window.top !== window.self){\n\t\t\t\tscrollParent();\n\t\t\t} else {\n\t\t\t\treposition();\n\t\t\t}\n\t\t}\n\n\t\tfunction scrollTo(){\n\t\t\tif (false !== callback('scrollCallback',pagePosition)){\n\t\t\t\tsetPagePosition(iframeId);\n\t\t\t} else {\n\t\t\t\tunsetPagePosition();\n\t\t\t}\n\t\t}\n\n\t\tfunction findTarget(location){\n\t\t\tfunction jumpToTarget(){\n\t\t\t\tvar jumpPosition = getElementPosition(target);\n\n\t\t\t\tlog(iframeId,'Moving to in page link (#'+hash+') at x: '+jumpPosition.x+' y: '+jumpPosition.y);\n\t\t\t\tpagePosition = {\n\t\t\t\t\tx: jumpPosition.x,\n\t\t\t\t\ty: jumpPosition.y\n\t\t\t\t};\n\n\t\t\t\tscrollTo();\n\t\t\t\tlog(iframeId,'--');\n\t\t\t}\n\n\t\t\tfunction jumpToParent(){\n\t\t\t\tif (window.parentIFrame){\n\t\t\t\t\twindow.parentIFrame.moveToAnchor(hash);\n\t\t\t\t} else {\n\t\t\t\t\tlog(iframeId,'In page link #'+hash+' not found and window.parentIFrame not found');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar\n\t\t\t\thash = location.split('#')[1] || '',\n\t\t\t\thashData = decodeURIComponent(hash),\n\t\t\t\ttarget = document.getElementById(hashData) || document.getElementsByName(hashData)[0];\n\n\t\t\tif (target){\n\t\t\t\tjumpToTarget();\n\t\t\t} else if(window.top!==window.self){\n\t\t\t\tjumpToParent();\n\t\t\t} else {\n\t\t\t\tlog(iframeId,'In page link #'+hash+' not found');\n\t\t\t}\n\t\t}\n\n\t\tfunction callback(funcName,val){\n\t\t\treturn chkCallback(iframeId,funcName,val);\n\t\t}\n\n\t\tfunction actionMsg(){\n\n\t\t\tif(settings[iframeId].firstRun) firstRun();\n\n\t\t\tswitch(messageData.type){\n\t\t\tcase 'close':\n\t\t\t\tcloseIFrame(messageData.iframe);\n\t\t\t\tbreak;\n\t\t\tcase 'message':\n\t\t\t\tforwardMsgFromIFrame(getMsgBody(6));\n\t\t\t\tbreak;\n\t\t\tcase 'scrollTo':\n\t\t\t\tscrollRequestFromChild(false);\n\t\t\t\tbreak;\n\t\t\tcase 'scrollToOffset':\n\t\t\t\tscrollRequestFromChild(true);\n\t\t\t\tbreak;\n\t\t\tcase 'pageInfo':\n\t\t\t\tsendPageInfoToIframe(settings[iframeId].iframe,iframeId);\n\t\t\t\tstartPageInfoMonitor();\n\t\t\t\tbreak;\n\t\t\tcase 'pageInfoStop':\n\t\t\t\tstopPageInfoMonitor();\n\t\t\t\tbreak;\n\t\t\tcase 'inPageLink':\n\t\t\t\tfindTarget(getMsgBody(9));\n\t\t\t\tbreak;\n\t\t\tcase 'reset':\n\t\t\t\tresetIFrame(messageData);\n\t\t\t\tbreak;\n\t\t\tcase 'init':\n\t\t\t\tresizeIFrame();\n\t\t\t\tcallback('initCallback',messageData.iframe);\n\t\t\t\tcallback('resizedCallback',messageData);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tresizeIFrame();\n\t\t\t\tcallback('resizedCallback',messageData);\n\t\t\t}\n\t\t}\n\n\t\tfunction hasSettings(iframeId){\n\t\t\tvar retBool = true;\n\n\t\t\tif (!settings[iframeId]){\n\t\t\t\tretBool = false;\n\t\t\t\twarn(messageData.type + ' No settings for ' + iframeId + '. Message was: ' + msg);\n\t\t\t}\n\n\t\t\treturn retBool;\n\t\t}\n\n\t\tfunction iFrameReadyMsgReceived(){\n\t\t\tfor (var iframeId in settings){\n\t\t\t\ttrigger('iFrame requested init',createOutgoingMsg(iframeId),document.getElementById(iframeId),iframeId);\n\t\t\t}\n\t\t}\n\n\t\tfunction firstRun() {\n\t\t\tsettings[iframeId].firstRun = false;\n\t\t}\n\n\t\tvar\n\t\t\tmsg = event.data,\n\t\t\tmessageData = {},\n\t\t\tiframeId = null;\n\n\t\tif('[iFrameResizerChild]Ready' === msg){\n\t\t\tiFrameReadyMsgReceived();\n\t\t} else if (isMessageForUs()){\n\t\t\tmessageData = processMsg();\n\t\t\tiframeId = logId = messageData.id;\n\n\t\t\tif (!isMessageFromMetaParent() && hasSettings(iframeId)){\n\t\t\t\tlog(iframeId,'Received: '+msg);\n\n\t\t\t\tif ( checkIFrameExists() && isMessageFromIFrame() ){\n\t\t\t\t\tactionMsg();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tinfo(iframeId,'Ignored: '+msg);\n\t\t}\n\n\t}\n\n\n\tfunction chkCallback(iframeId,funcName,val){\n\t\tvar\n\t\t\tfunc = null,\n\t\t\tretVal = null;\n\n\t\tif(settings[iframeId]){\n\t\t\tfunc = settings[iframeId][funcName];\n\n\t\t\tif( 'function' === typeof func){\n\t\t\t\tretVal = func(val);\n\t\t\t} else {\n\t\t\t\tthrow new TypeError(funcName+' on iFrame['+iframeId+'] is not a function');\n\t\t\t}\n\t\t}\n\n\t\treturn retVal;\n\t}\n\n\tfunction closeIFrame(iframe){\n\t\tvar iframeId = iframe.id;\n\n\t\tlog(iframeId,'Removing iFrame: '+iframeId);\n\t\tif (iframe.parentNode) { iframe.parentNode.removeChild(iframe); }\n\t\tchkCallback(iframeId,'closedCallback',iframeId);\n\t\tlog(iframeId,'--');\n\t\tdelete settings[iframeId];\n\t}\n\n\tfunction getPagePosition(iframeId){\n\t\tif(null === pagePosition){\n\t\t\tpagePosition = {\n\t\t\t\tx: (window.pageXOffset !== undefined) ? window.pageXOffset : document.documentElement.scrollLeft,\n\t\t\t\ty: (window.pageYOffset !== undefined) ? window.pageYOffset : document.documentElement.scrollTop\n\t\t\t};\n\t\t\tlog(iframeId,'Get page position: '+pagePosition.x+','+pagePosition.y);\n\t\t}\n\t}\n\n\tfunction setPagePosition(iframeId){\n\t\tif(null !== pagePosition){\n\t\t\twindow.scrollTo(pagePosition.x,pagePosition.y);\n\t\t\tlog(iframeId,'Set page position: '+pagePosition.x+','+pagePosition.y);\n\t\t\tunsetPagePosition();\n\t\t}\n\t}\n\n\tfunction unsetPagePosition(){\n\t\tpagePosition = null;\n\t}\n\n\tfunction resetIFrame(messageData){\n\t\tfunction reset(){\n\t\t\tsetSize(messageData);\n\t\t\ttrigger('reset','reset',messageData.iframe,messageData.id);\n\t\t}\n\n\t\tlog(messageData.id,'Size reset requested by '+('init'===messageData.type?'host page':'iFrame'));\n\t\tgetPagePosition(messageData.id);\n\t\tsyncResize(reset,messageData,'reset');\n\t}\n\n\tfunction setSize(messageData){\n\t\tfunction setDimension(dimension){\n\t\t\tmessageData.iframe.style[dimension] = messageData[dimension] + 'px';\n\t\t\tlog(\n\t\t\t\tmessageData.id,\n\t\t\t\t'IFrame (' + iframeId +\n\t\t\t\t') ' + dimension +\n\t\t\t\t' set to ' + messageData[dimension] + 'px'\n\t\t\t);\n\t\t}\n\n\t\tfunction chkZero(dimension){\n\t\t\t//FireFox sets dimension of hidden iFrames to zero.\n\t\t\t//So if we detect that set up an event to check for\n\t\t\t//when iFrame becomes visible.\n\n\t\t\t/* istanbul ignore next */ //Not testable in PhantomJS\n\t\t\tif (!hiddenCheckEnabled && '0' === messageData[dimension]){\n\t\t\t\thiddenCheckEnabled = true;\n\t\t\t\tlog(iframeId,'Hidden iFrame detected, creating visibility listener');\n\t\t\t\tfixHiddenIFrames();\n\t\t\t}\n\t\t}\n\n\t\tfunction processDimension(dimension){\n\t\t\tsetDimension(dimension);\n\t\t\tchkZero(dimension);\n\t\t}\n\n\t\tvar iframeId = messageData.iframe.id;\n\n\t\tif(settings[iframeId]){\n\t\t\tif( settings[iframeId].sizeHeight) { processDimension('height'); }\n\t\t\tif( settings[iframeId].sizeWidth ) { processDimension('width'); }\n\t\t}\n\t}\n\n\tfunction syncResize(func,messageData,doNotSync){\n\t\t/* istanbul ignore if */ //Not testable in PhantomJS\n\t\tif(doNotSync!==messageData.type && requestAnimationFrame){\n\t\t\tlog(messageData.id,'Requesting animation frame');\n\t\t\trequestAnimationFrame(func);\n\t\t} else {\n\t\t\tfunc();\n\t\t}\n\t}\n\n\tfunction trigger(calleeMsg,msg,iframe,id){\n\t\tfunction postMessageToIFrame(){\n\t\t\tvar target = settings[id].targetOrigin;\n\t\t\tlog(id,'[' + calleeMsg + '] Sending msg to iframe['+id+'] ('+msg+') targetOrigin: '+target);\n\t\t\tiframe.contentWindow.postMessage( msgId + msg, target );\n\t\t}\n\n\t\tfunction iFrameNotFound(){\n\t\t\twarn(id,'[' + calleeMsg + '] IFrame('+id+') not found');\n\t\t}\n\n\t\tfunction chkAndSend(){\n\t\t\tif(iframe && 'contentWindow' in iframe && (null !== iframe.contentWindow)){ //Null test for PhantomJS\n\t\t\t\tpostMessageToIFrame();\n\t\t\t} else {\n\t\t\t\tiFrameNotFound();\n\t\t\t}\n\t\t}\n\n\t\tid = id || iframe.id;\n\n\t\tif(settings[id]) {\n\t\t\tchkAndSend();\n\t\t}\n\n\t}\n\n\tfunction createOutgoingMsg(iframeId){\n\t\treturn iframeId +\n\t\t\t':' + settings[iframeId].bodyMarginV1 +\n\t\t\t':' + settings[iframeId].sizeWidth +\n\t\t\t':' + settings[iframeId].log +\n\t\t\t':' + settings[iframeId].interval +\n\t\t\t':' + settings[iframeId].enablePublicMethods +\n\t\t\t':' + settings[iframeId].autoResize +\n\t\t\t':' + settings[iframeId].bodyMargin +\n\t\t\t':' + settings[iframeId].heightCalculationMethod +\n\t\t\t':' + settings[iframeId].bodyBackground +\n\t\t\t':' + settings[iframeId].bodyPadding +\n\t\t\t':' + settings[iframeId].tolerance +\n\t\t\t':' + settings[iframeId].inPageLinks +\n\t\t\t':' + settings[iframeId].resizeFrom +\n\t\t\t':' + settings[iframeId].widthCalculationMethod;\n\t}\n\n\tfunction setupIFrame(iframe,options){\n\t\tfunction setLimits(){\n\t\t\tfunction addStyle(style){\n\t\t\t\tif ((Infinity !== settings[iframeId][style]) && (0 !== settings[iframeId][style])){\n\t\t\t\t\tiframe.style[style] = settings[iframeId][style] + 'px';\n\t\t\t\t\tlog(iframeId,'Set '+style+' = '+settings[iframeId][style]+'px');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction chkMinMax(dimension){\n\t\t\t\tif (settings[iframeId]['min'+dimension]>settings[iframeId]['max'+dimension]){\n\t\t\t\t\tthrow new Error('Value for min'+dimension+' can not be greater than max'+dimension);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tchkMinMax('Height');\n\t\t\tchkMinMax('Width');\n\n\t\t\taddStyle('maxHeight');\n\t\t\taddStyle('minHeight');\n\t\t\taddStyle('maxWidth');\n\t\t\taddStyle('minWidth');\n\t\t}\n\n\t\tfunction newId(){\n\t\t\tvar id = ((options && options.id) || defaults.id + count++);\n\t\t\tif (null !== document.getElementById(id)){\n\t\t\t\tid = id + count++;\n\t\t\t}\n\t\t\treturn id;\n\t\t}\n\n\t\tfunction ensureHasId(iframeId){\n\t\t\tlogId=iframeId;\n\t\t\tif (''===iframeId){\n\t\t\t\tiframe.id = iframeId = newId();\n\t\t\t\tlogEnabled = (options || {}).log;\n\t\t\t\tlogId=iframeId;\n\t\t\t\tlog(iframeId,'Added missing iframe ID: '+ iframeId +' (' + iframe.src + ')');\n\t\t\t}\n\n\n\t\t\treturn iframeId;\n\t\t}\n\n\t\tfunction setScrolling(){\n\t\t\tlog(iframeId,'IFrame scrolling ' + (settings[iframeId].scrolling ? 'enabled' : 'disabled') + ' for ' + iframeId);\n\t\t\tiframe.style.overflow = false === settings[iframeId].scrolling ? 'hidden' : 'auto';\n\t\t\tiframe.scrolling = false === settings[iframeId].scrolling ? 'no' : 'yes';\n\t\t}\n\n\t\t//The V1 iFrame script expects an int, where as in V2 expects a CSS\n\t\t//string value such as '1px 3em', so if we have an int for V2, set V1=V2\n\t\t//and then convert V2 to a string PX value.\n\t\tfunction setupBodyMarginValues(){\n\t\t\tif (('number'===typeof(settings[iframeId].bodyMargin)) || ('0'===settings[iframeId].bodyMargin)){\n\t\t\t\tsettings[iframeId].bodyMarginV1 = settings[iframeId].bodyMargin;\n\t\t\t\tsettings[iframeId].bodyMargin = '' + settings[iframeId].bodyMargin + 'px';\n\t\t\t}\n\t\t}\n\n\t\tfunction checkReset(){\n\t\t\t// Reduce scope of firstRun to function, because IE8's JS execution\n\t\t\t// context stack is borked and this value gets externally\n\t\t\t// changed midway through running this function!!!\n\t\t\tvar\n\t\t\t\tfirstRun = settings[iframeId].firstRun,\n\t\t\t\tresetRequertMethod = settings[iframeId].heightCalculationMethod in resetRequiredMethods;\n\n\t\t\tif (!firstRun && resetRequertMethod){\n\t\t\t\tresetIFrame({iframe:iframe, height:0, width:0, type:'init'});\n\t\t\t}\n\t\t}\n\n\t\tfunction setupIFrameObject(){\n\t\t\tif(Function.prototype.bind){ //Ignore unpolyfilled IE8.\n\t\t\t\tsettings[iframeId].iframe.iFrameResizer = {\n\n\t\t\t\t\tclose : closeIFrame.bind(null,settings[iframeId].iframe),\n\n\t\t\t\t\tresize : trigger.bind(null,'Window resize', 'resize', settings[iframeId].iframe),\n\n\t\t\t\t\tmoveToAnchor : function(anchor){\n\t\t\t\t\t\ttrigger('Move to anchor','moveToAnchor:'+anchor, settings[iframeId].iframe,iframeId);\n\t\t\t\t\t},\n\n\t\t\t\t\tsendMessage : function(message){\n\t\t\t\t\t\tmessage = JSON.stringify(message);\n\t\t\t\t\t\ttrigger('Send Message','message:'+message, settings[iframeId].iframe,iframeId);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\t//We have to call trigger twice, as we can not be sure if all\n\t\t//iframes have completed loading when this code runs. The\n\t\t//event listener also catches the page changing in the iFrame.\n\t\tfunction init(msg){\n\t\t\tfunction iFrameLoaded(){\n\t\t\t\ttrigger('iFrame.onload',msg,iframe);\n\t\t\t\tcheckReset();\n\t\t\t}\n\n\t\t\taddEventListener(iframe,'load',iFrameLoaded);\n\t\t\ttrigger('init',msg,iframe);\n\t\t}\n\n\t\tfunction checkOptions(options){\n\t\t\tif ('object' !== typeof options){\n\t\t\t\tthrow new TypeError('Options is not an object');\n\t\t\t}\n\t\t}\n\n\t\tfunction copyOptions(options){\n\t\t\tfor (var option in defaults) {\n\t\t\t\tif (defaults.hasOwnProperty(option)){\n\t\t\t\t\tsettings[iframeId][option] = options.hasOwnProperty(option) ? options[option] : defaults[option];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction getTargetOrigin (remoteHost){\n\t\t\treturn ('' === remoteHost || 'file://' === remoteHost) ? '*' : remoteHost;\n\t\t}\n\n\t\tfunction processOptions(options){\n\t\t\toptions = options || {};\n\t\t\tsettings[iframeId] = {\n\t\t\t\tfirstRun\t: true,\n\t\t\t\tiframe\t\t: iframe,\n\t\t\t\tremoteHost\t: iframe.src.split('/').slice(0,3).join('/')\n\t\t\t};\n\n\t\t\tcheckOptions(options);\n\t\t\tcopyOptions(options);\n\n\t\t\tsettings[iframeId].targetOrigin = true === settings[iframeId].checkOrigin ? getTargetOrigin(settings[iframeId].remoteHost) : '*';\n\t\t}\n\n\t\tfunction beenHere(){\n\t\t\treturn (iframeId in settings && 'iFrameResizer' in iframe);\n\t\t}\n\n\t\tvar iframeId = ensureHasId(iframe.id);\n\n\t\tif (!beenHere()){\n\t\t\tprocessOptions(options);\n\t\t\tsetScrolling();\n\t\t\tsetLimits();\n\t\t\tsetupBodyMarginValues();\n\t\t\tinit(createOutgoingMsg(iframeId));\n\t\t\tsetupIFrameObject();\n\t\t} else {\n\t\t\twarn(iframeId,'Ignored iFrame, already setup.');\n\t\t}\n\t}\n\n\tfunction debouce(fn,time){\n\t\tif (null === timer){\n\t\t\ttimer = setTimeout(function(){\n\t\t\t\ttimer = null;\n\t\t\t\tfn();\n\t\t\t}, time);\n\t\t}\n\t}\n\n\t/* istanbul ignore next */ //Not testable in PhantomJS\n\tfunction fixHiddenIFrames(){\n\t\tfunction checkIFrames(){\n\t\t\tfunction checkIFrame(settingId){\n\t\t\t\tfunction chkDimension(dimension){\n\t\t\t\t\treturn '0px' === settings[settingId].iframe.style[dimension];\n\t\t\t\t}\n\n\t\t\t\tfunction isVisible(el) {\n\t\t\t\t\treturn (null !== el.offsetParent);\n\t\t\t\t}\n\n\t\t\t\tif (isVisible(settings[settingId].iframe) && (chkDimension('height') || chkDimension('width'))){\n\t\t\t\t\ttrigger('Visibility change', 'resize', settings[settingId].iframe,settingId);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (var settingId in settings){\n\t\t\t\tcheckIFrame(settingId);\n\t\t\t}\n\t\t}\n\n\t\tfunction mutationObserved(mutations){\n\t\t\tlog('window','Mutation observed: ' + mutations[0].target + ' ' + mutations[0].type);\n\t\t\tdebouce(checkIFrames,16);\n\t\t}\n\n\t\tfunction createMutationObserver(){\n\t\t\tvar\n\t\t\t\ttarget = document.querySelector('body'),\n\n\t\t\t\tconfig = {\n\t\t\t\t\tattributes : true,\n\t\t\t\t\tattributeOldValue : false,\n\t\t\t\t\tcharacterData : true,\n\t\t\t\t\tcharacterDataOldValue : false,\n\t\t\t\t\tchildList : true,\n\t\t\t\t\tsubtree : true\n\t\t\t\t},\n\n\t\t\t\tobserver = new MutationObserver(mutationObserved);\n\n\t\t\tobserver.observe(target, config);\n\t\t}\n\n\t\tvar MutationObserver = window.MutationObserver || window.WebKitMutationObserver;\n\n\t\tif (MutationObserver) createMutationObserver();\n\t}\n\n\n\tfunction resizeIFrames(event){\n\t\tfunction resize(){\n\t\t\tsendTriggerMsg('Window '+event,'resize');\n\t\t}\n\n\t\tlog('window','Trigger event: '+event);\n\t\tdebouce(resize,16);\n\t}\n\n\t/* istanbul ignore next */ //Not testable in PhantomJS\n\tfunction tabVisible() {\n\t\tfunction resize(){\n\t\t\tsendTriggerMsg('Tab Visable','resize');\n\t\t}\n\n\t\tif('hidden' !== document.visibilityState) {\n\t\t\tlog('document','Trigger event: Visiblity change');\n\t\t\tdebouce(resize,16);\n\t\t}\n\t}\n\n\tfunction sendTriggerMsg(eventName,event){\n\t\tfunction isIFrameResizeEnabled(iframeId) {\n\t\t\treturn\t'parent' === settings[iframeId].resizeFrom &&\n\t\t\t\t\tsettings[iframeId].autoResize &&\n\t\t\t\t\t!settings[iframeId].firstRun;\n\t\t}\n\n\t\tfor (var iframeId in settings){\n\t\t\tif(isIFrameResizeEnabled(iframeId)){\n\t\t\t\ttrigger(eventName,event,document.getElementById(iframeId),iframeId);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction setupEventListeners(){\n\t\taddEventListener(window,'message',iFrameListener);\n\n\t\taddEventListener(window,'resize', function(){resizeIFrames('resize');});\n\n\t\taddEventListener(document,'visibilitychange',tabVisible);\n\t\taddEventListener(document,'-webkit-visibilitychange',tabVisible); //Andriod 4.4\n\t\taddEventListener(window,'focusin',function(){resizeIFrames('focus');}); //IE8-9\n\t\taddEventListener(window,'focus',function(){resizeIFrames('focus');});\n\t}\n\n\n\tfunction factory(){\n\t\tfunction init(options,element){\n\t\t\tfunction chkType(){\n\t\t\t\tif(!element.tagName) {\n\t\t\t\t\tthrow new TypeError('Object is not a valid DOM element');\n\t\t\t\t} else if ('IFRAME' !== element.tagName.toUpperCase()) {\n\t\t\t\t\tthrow new TypeError('Expected <IFRAME> tag, found <'+element.tagName+'>');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(element) {\n\t\t\t\tchkType();\n\t\t\t\tsetupIFrame(element, options);\n\t\t\t\tiFrames.push(element);\n\t\t\t}\n\t\t}\n\n\t\tfunction warnDeprecatedOptions(options) {\n\t\t\tif (options && options.enablePublicMethods) {\n\t\t\t\twarn('enablePublicMethods option has been removed, public methods are now always available in the iFrame');\n\t\t\t}\n\t\t}\n\n\t\tvar iFrames;\n\n\t\tsetupRequestAnimationFrame();\n\t\tsetupEventListeners();\n\n\t\treturn function iFrameResizeF(options,target){\n\t\t\tiFrames = []; //Only return iFrames past in on this call\n\n\t\t\twarnDeprecatedOptions(options);\n\n\t\t\tswitch (typeof(target)){\n\t\t\tcase 'undefined':\n\t\t\tcase 'string':\n\t\t\t\tArray.prototype.forEach.call(\n\t\t\t\t\tdocument.querySelectorAll( target || 'iframe' ),\n\t\t\t\t\tinit.bind(undefined, options)\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'object':\n\t\t\t\tinit(options,target);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new TypeError('Unexpected data type ('+typeof(target)+')');\n\t\t\t}\n\n\t\t\treturn iFrames;\n\t\t};\n\t}\n\n\tfunction createJQueryPublicMethod($){\n\t\tif (!$.fn) {\n\t\t\tinfo('','Unable to bind to jQuery, it is not fully loaded.');\n\t\t} else if (!$.fn.iFrameResize){\n\t\t\t$.fn.iFrameResize = function $iFrameResizeF(options) {\n\t\t\t\tfunction init(index, element) {\n\t\t\t\t\tsetupIFrame(element, options);\n\t\t\t\t}\n\n\t\t\t\treturn this.filter('iframe').each(init).end();\n\t\t\t};\n\t\t}\n\t}\n\n\tif (window.jQuery) { createJQueryPublicMethod(jQuery); }\n\n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine([],factory);\n\t} else if (typeof module === 'object' && typeof module.exports === 'object') { //Node for browserfy\n\t\tmodule.exports = factory();\n\t} else {\n\t\twindow.iFrameResize = window.iFrameResize || factory();\n\t}\n\n})(window || {});\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*! iFrame Resizer (iframeSizer.min.js ) - v3.5.7 - 2016-12-16
|
|
2
|
+
* Desc: Force cross domain iframes to size to content.
|
|
3
|
+
* Requires: iframeResizer.contentWindow.min.js to be loaded into the target frame.
|
|
4
|
+
* Copyright: (c) 2016 David J. Bradshaw - dave@bradshaw.net
|
|
5
|
+
* License: MIT
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
!function(a){"use strict";function b(b,c,d){"addEventListener"in a?b.addEventListener(c,d,!1):"attachEvent"in a&&b.attachEvent("on"+c,d)}function c(b,c,d){"removeEventListener"in a?b.removeEventListener(c,d,!1):"detachEvent"in a&&b.detachEvent("on"+c,d)}function d(){var b,c=["moz","webkit","o","ms"];for(b=0;b<c.length&&!N;b+=1)N=a[c[b]+"RequestAnimationFrame"];N||h("setup","RequestAnimationFrame not supported")}function e(b){var c="Host page: "+b;return a.top!==a.self&&(c=a.parentIFrame&&a.parentIFrame.getId?a.parentIFrame.getId()+": "+b:"Nested host page: "+b),c}function f(a){return K+"["+e(a)+"]"}function g(a){return P[a]?P[a].log:G}function h(a,b){k("log",a,b,g(a))}function i(a,b){k("info",a,b,g(a))}function j(a,b){k("warn",a,b,!0)}function k(b,c,d,e){!0===e&&"object"==typeof a.console&&console[b](f(c),d)}function l(d){function e(){function a(){s(V),p(W)}g("Height"),g("Width"),t(a,V,"init")}function f(){var a=U.substr(L).split(":");return{iframe:P[a[0]].iframe,id:a[0],height:a[1],width:a[2],type:a[3]}}function g(a){var b=Number(P[W]["max"+a]),c=Number(P[W]["min"+a]),d=a.toLowerCase(),e=Number(V[d]);h(W,"Checking "+d+" is in range "+c+"-"+b),c>e&&(e=c,h(W,"Set "+d+" to min value")),e>b&&(e=b,h(W,"Set "+d+" to max value")),V[d]=""+e}function k(){function a(){function a(){var a=0,d=!1;for(h(W,"Checking connection is from allowed list of origins: "+c);a<c.length;a++)if(c[a]===b){d=!0;break}return d}function d(){var a=P[W].remoteHost;return h(W,"Checking connection is from: "+a),b===a}return c.constructor===Array?a():d()}var b=d.origin,c=P[W].checkOrigin;if(c&&""+b!="null"&&!a())throw new Error("Unexpected message received from: "+b+" for "+V.iframe.id+". Message was: "+d.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}function l(){return K===(""+U).substr(0,L)&&U.substr(L).split(":")[0]in P}function w(){var a=V.type in{"true":1,"false":1,undefined:1};return a&&h(W,"Ignoring init message from meta parent page"),a}function y(a){return U.substr(U.indexOf(":")+J+a)}function z(a){h(W,"MessageCallback passed: {iframe: "+V.iframe.id+", message: "+a+"}"),N("messageCallback",{iframe:V.iframe,message:JSON.parse(a)}),h(W,"--")}function A(){var b=document.body.getBoundingClientRect(),c=V.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:c.height,iframeWidth:c.width,clientHeight:Math.max(document.documentElement.clientHeight,a.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,a.innerWidth||0),offsetTop:parseInt(c.top-b.top,10),offsetLeft:parseInt(c.left-b.left,10),scrollTop:a.pageYOffset,scrollLeft:a.pageXOffset})}function B(a,b){function c(){u("Send Page Info","pageInfo:"+A(),a,b)}x(c,32)}function C(){function d(b,c){function d(){P[g]?B(P[g].iframe,g):e()}["scroll","resize"].forEach(function(e){h(g,b+e+" listener for sendPageInfo"),c(a,e,d)})}function e(){d("Remove ",c)}function f(){d("Add ",b)}var g=W;f(),P[g].stopPageInfo=e}function D(){P[W]&&P[W].stopPageInfo&&(P[W].stopPageInfo(),delete P[W].stopPageInfo)}function E(){var a=!0;return null===V.iframe&&(j(W,"IFrame ("+V.id+") not found"),a=!1),a}function F(a){var b=a.getBoundingClientRect();return o(W),{x:Math.floor(Number(b.left)+Number(M.x)),y:Math.floor(Number(b.top)+Number(M.y))}}function G(b){function c(){M=g,H(),h(W,"--")}function d(){return{x:Number(V.width)+f.x,y:Number(V.height)+f.y}}function e(){a.parentIFrame?a.parentIFrame["scrollTo"+(b?"Offset":"")](g.x,g.y):j(W,"Unable to scroll to requested position, window.parentIFrame not found")}var f=b?F(V.iframe):{x:0,y:0},g=d();h(W,"Reposition requested from iFrame (offset x:"+f.x+" y:"+f.y+")"),a.top!==a.self?e():c()}function H(){!1!==N("scrollCallback",M)?p(W):q()}function I(b){function c(){var a=F(g);h(W,"Moving to in page link (#"+e+") at x: "+a.x+" y: "+a.y),M={x:a.x,y:a.y},H(),h(W,"--")}function d(){a.parentIFrame?a.parentIFrame.moveToAnchor(e):h(W,"In page link #"+e+" not found and window.parentIFrame not found")}var e=b.split("#")[1]||"",f=decodeURIComponent(e),g=document.getElementById(f)||document.getElementsByName(f)[0];g?c():a.top!==a.self?d():h(W,"In page link #"+e+" not found")}function N(a,b){return m(W,a,b)}function O(){switch(P[W].firstRun&&T(),V.type){case"close":n(V.iframe);break;case"message":z(y(6));break;case"scrollTo":G(!1);break;case"scrollToOffset":G(!0);break;case"pageInfo":B(P[W].iframe,W),C();break;case"pageInfoStop":D();break;case"inPageLink":I(y(9));break;case"reset":r(V);break;case"init":e(),N("initCallback",V.iframe),N("resizedCallback",V);break;default:e(),N("resizedCallback",V)}}function Q(a){var b=!0;return P[a]||(b=!1,j(V.type+" No settings for "+a+". Message was: "+U)),b}function S(){for(var a in P)u("iFrame requested init",v(a),document.getElementById(a),a)}function T(){P[W].firstRun=!1}var U=d.data,V={},W=null;"[iFrameResizerChild]Ready"===U?S():l()?(V=f(),W=R=V.id,!w()&&Q(W)&&(h(W,"Received: "+U),E()&&k()&&O())):i(W,"Ignored: "+U)}function m(a,b,c){var d=null,e=null;if(P[a]){if(d=P[a][b],"function"!=typeof d)throw new TypeError(b+" on iFrame["+a+"] is not a function");e=d(c)}return e}function n(a){var b=a.id;h(b,"Removing iFrame: "+b),a.parentNode&&a.parentNode.removeChild(a),m(b,"closedCallback",b),h(b,"--"),delete P[b]}function o(b){null===M&&(M={x:void 0!==a.pageXOffset?a.pageXOffset:document.documentElement.scrollLeft,y:void 0!==a.pageYOffset?a.pageYOffset:document.documentElement.scrollTop},h(b,"Get page position: "+M.x+","+M.y))}function p(b){null!==M&&(a.scrollTo(M.x,M.y),h(b,"Set page position: "+M.x+","+M.y),q())}function q(){M=null}function r(a){function b(){s(a),u("reset","reset",a.iframe,a.id)}h(a.id,"Size reset requested by "+("init"===a.type?"host page":"iFrame")),o(a.id),t(b,a,"reset")}function s(a){function b(b){a.iframe.style[b]=a[b]+"px",h(a.id,"IFrame ("+e+") "+b+" set to "+a[b]+"px")}function c(b){H||"0"!==a[b]||(H=!0,h(e,"Hidden iFrame detected, creating visibility listener"),y())}function d(a){b(a),c(a)}var e=a.iframe.id;P[e]&&(P[e].sizeHeight&&d("height"),P[e].sizeWidth&&d("width"))}function t(a,b,c){c!==b.type&&N?(h(b.id,"Requesting animation frame"),N(a)):a()}function u(a,b,c,d){function e(){var e=P[d].targetOrigin;h(d,"["+a+"] Sending msg to iframe["+d+"] ("+b+") targetOrigin: "+e),c.contentWindow.postMessage(K+b,e)}function f(){j(d,"["+a+"] IFrame("+d+") not found")}function g(){c&&"contentWindow"in c&&null!==c.contentWindow?e():f()}d=d||c.id,P[d]&&g()}function v(a){return a+":"+P[a].bodyMarginV1+":"+P[a].sizeWidth+":"+P[a].log+":"+P[a].interval+":"+P[a].enablePublicMethods+":"+P[a].autoResize+":"+P[a].bodyMargin+":"+P[a].heightCalculationMethod+":"+P[a].bodyBackground+":"+P[a].bodyPadding+":"+P[a].tolerance+":"+P[a].inPageLinks+":"+P[a].resizeFrom+":"+P[a].widthCalculationMethod}function w(a,c){function d(){function b(b){1/0!==P[w][b]&&0!==P[w][b]&&(a.style[b]=P[w][b]+"px",h(w,"Set "+b+" = "+P[w][b]+"px"))}function c(a){if(P[w]["min"+a]>P[w]["max"+a])throw new Error("Value for min"+a+" can not be greater than max"+a)}c("Height"),c("Width"),b("maxHeight"),b("minHeight"),b("maxWidth"),b("minWidth")}function e(){var a=c&&c.id||S.id+F++;return null!==document.getElementById(a)&&(a+=F++),a}function f(b){return R=b,""===b&&(a.id=b=e(),G=(c||{}).log,R=b,h(b,"Added missing iframe ID: "+b+" ("+a.src+")")),b}function g(){h(w,"IFrame scrolling "+(P[w].scrolling?"enabled":"disabled")+" for "+w),a.style.overflow=!1===P[w].scrolling?"hidden":"auto",a.scrolling=!1===P[w].scrolling?"no":"yes"}function i(){("number"==typeof P[w].bodyMargin||"0"===P[w].bodyMargin)&&(P[w].bodyMarginV1=P[w].bodyMargin,P[w].bodyMargin=""+P[w].bodyMargin+"px")}function k(){var b=P[w].firstRun,c=P[w].heightCalculationMethod in O;!b&&c&&r({iframe:a,height:0,width:0,type:"init"})}function l(){Function.prototype.bind&&(P[w].iframe.iFrameResizer={close:n.bind(null,P[w].iframe),resize:u.bind(null,"Window resize","resize",P[w].iframe),moveToAnchor:function(a){u("Move to anchor","moveToAnchor:"+a,P[w].iframe,w)},sendMessage:function(a){a=JSON.stringify(a),u("Send Message","message:"+a,P[w].iframe,w)}})}function m(c){function d(){u("iFrame.onload",c,a),k()}b(a,"load",d),u("init",c,a)}function o(a){if("object"!=typeof a)throw new TypeError("Options is not an object")}function p(a){for(var b in S)S.hasOwnProperty(b)&&(P[w][b]=a.hasOwnProperty(b)?a[b]:S[b])}function q(a){return""===a||"file://"===a?"*":a}function s(b){b=b||{},P[w]={firstRun:!0,iframe:a,remoteHost:a.src.split("/").slice(0,3).join("/")},o(b),p(b),P[w].targetOrigin=!0===P[w].checkOrigin?q(P[w].remoteHost):"*"}function t(){return w in P&&"iFrameResizer"in a}var w=f(a.id);t()?j(w,"Ignored iFrame, already setup."):(s(c),g(),d(),i(),m(v(w)),l())}function x(a,b){null===Q&&(Q=setTimeout(function(){Q=null,a()},b))}function y(){function b(){function a(a){function b(b){return"0px"===P[a].iframe.style[b]}function c(a){return null!==a.offsetParent}c(P[a].iframe)&&(b("height")||b("width"))&&u("Visibility change","resize",P[a].iframe,a)}for(var b in P)a(b)}function c(a){h("window","Mutation observed: "+a[0].target+" "+a[0].type),x(b,16)}function d(){var a=document.querySelector("body"),b={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0},d=new e(c);d.observe(a,b)}var e=a.MutationObserver||a.WebKitMutationObserver;e&&d()}function z(a){function b(){B("Window "+a,"resize")}h("window","Trigger event: "+a),x(b,16)}function A(){function a(){B("Tab Visable","resize")}"hidden"!==document.visibilityState&&(h("document","Trigger event: Visiblity change"),x(a,16))}function B(a,b){function c(a){return"parent"===P[a].resizeFrom&&P[a].autoResize&&!P[a].firstRun}for(var d in P)c(d)&&u(a,b,document.getElementById(d),d)}function C(){b(a,"message",l),b(a,"resize",function(){z("resize")}),b(document,"visibilitychange",A),b(document,"-webkit-visibilitychange",A),b(a,"focusin",function(){z("focus")}),b(a,"focus",function(){z("focus")})}function D(){function a(a,b){function d(){if(!b.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==b.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+b.tagName+">")}b&&(d(),w(b,a),c.push(b))}function b(a){a&&a.enablePublicMethods&&j("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}var c;return d(),C(),function(d,e){switch(c=[],b(d),typeof e){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(e||"iframe"),a.bind(void 0,d));break;case"object":a(d,e);break;default:throw new TypeError("Unexpected data type ("+typeof e+")")}return c}}function E(a){a.fn?a.fn.iFrameResize||(a.fn.iFrameResize=function(a){function b(b,c){w(c,a)}return this.filter("iframe").each(b).end()}):i("","Unable to bind to jQuery, it is not fully loaded.")}var F=0,G=!1,H=!1,I="message",J=I.length,K="[iFrameSizer]",L=K.length,M=null,N=a.requestAnimationFrame,O={max:1,scroll:1,bodyScroll:1,documentElementScroll:1},P={},Q=null,R="Host Page",S={autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,widthCalculationMethod:"scroll",closedCallback:function(){},initCallback:function(){},messageCallback:function(){j("MessageCallback function not defined")},resizedCallback:function(){},scrollCallback:function(){return!0}};a.jQuery&&E(jQuery),"function"==typeof define&&define.amd?define([],D):"object"==typeof module&&"object"==typeof module.exports?module.exports=D():a.iFrameResize=a.iFrameResize||D()}(window||{});
|
|
9
|
+
//# sourceMappingURL=iframeResizer.map
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// Karma configuration
|
|
2
|
+
// Generated on Tue Aug 25 2015 12:11:48 GMT+0100 (BST)
|
|
3
|
+
|
|
4
|
+
module.exports = function(config) {
|
|
5
|
+
config.set({
|
|
6
|
+
|
|
7
|
+
// base path that will be used to resolve all patterns (eg. files, exclude)
|
|
8
|
+
basePath: '',
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
// frameworks to use
|
|
12
|
+
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
|
13
|
+
frameworks: ['jasmine-jquery', 'jasmine', 'requirejs'],
|
|
14
|
+
|
|
15
|
+
// Karma will require() these plugins
|
|
16
|
+
/*
|
|
17
|
+
plugins: [
|
|
18
|
+
'logcapture',
|
|
19
|
+
'karma-verbose-summary-reporter',
|
|
20
|
+
'karma-jasmine',
|
|
21
|
+
'karma-chrome-launcher'
|
|
22
|
+
],
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
// list of files / patterns to load in the browser
|
|
26
|
+
files: [
|
|
27
|
+
'test-main.js',
|
|
28
|
+
'spec/lib/*.js',
|
|
29
|
+
'js/ie8.polyfils.min.js',
|
|
30
|
+
{pattern: 'js/*.js', included: false},
|
|
31
|
+
{pattern: 'src/*.js', included: false},
|
|
32
|
+
{pattern: 'example/*.html', included: false},
|
|
33
|
+
{pattern: 'spec/*Spec.js', included: false},
|
|
34
|
+
{pattern: 'spec/resources/*', included: false},
|
|
35
|
+
{pattern: 'spec/javascripts/fixtures/*.html', included: false}
|
|
36
|
+
],
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
// list of files to exclude
|
|
40
|
+
exclude: [
|
|
41
|
+
],
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
// preprocess matching files before serving them to the browser
|
|
45
|
+
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
|
46
|
+
preprocessors: {
|
|
47
|
+
'src/*.js': ['coverage']
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
coverageReporter: {
|
|
51
|
+
type : 'html',
|
|
52
|
+
dir : 'coverage/'
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
client: {
|
|
56
|
+
captureConsole: true
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
// test results reporter to use
|
|
61
|
+
// possible values: 'dots', 'progress'
|
|
62
|
+
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
|
63
|
+
reporters: ['logcapture', 'progress', 'verbose-summary', 'coverage'],
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
// web server port
|
|
67
|
+
port: 9876,
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
// enable / disable colors in the output (reporters and logs)
|
|
71
|
+
colors: true,
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
// level of logging
|
|
75
|
+
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
|
76
|
+
logLevel: config.LOG_INFO,
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
// enable / disable watching file and executing tests whenever any file changes
|
|
80
|
+
autoWatch: true,
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
// start these browsers
|
|
84
|
+
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
|
|
85
|
+
browsers: [ ], //'Chrome', 'Firefox', 'Safari', 'PhantomJS'
|
|
86
|
+
|
|
87
|
+
// Continuous Integration mode
|
|
88
|
+
// if true, Karma captures browsers, runs the tests and exits
|
|
89
|
+
singleRun: true
|
|
90
|
+
|
|
91
|
+
})
|
|
92
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "iframe-resizer",
|
|
3
|
+
"version": "3.5.5",
|
|
4
|
+
"homepage": "https://github.com/davidjbradshaw/iframe-resizer",
|
|
5
|
+
"authors": [
|
|
6
|
+
"David J. Bradshaw <dave@bradshaw.net>"
|
|
7
|
+
],
|
|
8
|
+
"maintainers": [
|
|
9
|
+
{
|
|
10
|
+
"name": "davidjbradshaw",
|
|
11
|
+
"email": "dave@bradshaw.net"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"description": "Keep same and cross domain iFrames sized to their content with support for window/content resizing, and multiple iFrames.",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/davidjbradshaw/iframe-resizer.git"
|
|
18
|
+
},
|
|
19
|
+
"github": "https://github.com/davidjbradshaw/iframe-resizer",
|
|
20
|
+
"dependencies": {},
|
|
21
|
+
"categories": [
|
|
22
|
+
"UI",
|
|
23
|
+
"Utilities"
|
|
24
|
+
],
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"grunt": "0.4.x",
|
|
27
|
+
"grunt-bump": "0.0.x",
|
|
28
|
+
"grunt-contrib-clean": "^0.6.0",
|
|
29
|
+
"grunt-contrib-compress": "0.5.x",
|
|
30
|
+
"grunt-contrib-copy": "^0.8.1",
|
|
31
|
+
"grunt-contrib-jshint": "~0.6.3",
|
|
32
|
+
"grunt-contrib-qunit": "0.3.0",
|
|
33
|
+
"grunt-contrib-uglify": "0.9.x",
|
|
34
|
+
"grunt-contrib-watch": "~0.5.2",
|
|
35
|
+
"grunt-jsonlint": "1.0.x",
|
|
36
|
+
"grunt-karma": "^0.12.0",
|
|
37
|
+
"grunt-karma-coveralls": "^2.5.4",
|
|
38
|
+
"grunt-shell": "0.6.x",
|
|
39
|
+
"jasmine": "^2.3.2",
|
|
40
|
+
"jasmine-core": "^2.3.4",
|
|
41
|
+
"jasmine-jquery": "^2.1.0",
|
|
42
|
+
"jit-grunt": "0.3.x",
|
|
43
|
+
"jquery": "^2.1.4",
|
|
44
|
+
"karma": "^0.13.9",
|
|
45
|
+
"karma-chrome-launcher": "^0.2.0",
|
|
46
|
+
"karma-coverage": "^0.5.1",
|
|
47
|
+
"karma-firefox-launcher": "^0.1.6",
|
|
48
|
+
"karma-jasmine": "^0.3.6",
|
|
49
|
+
"karma-jasmine-jquery": "^0.1.1",
|
|
50
|
+
"karma-logcapture-reporter": "0.0.1",
|
|
51
|
+
"karma-phantomjs-launcher": "^0.2.1",
|
|
52
|
+
"karma-requirejs": "^0.2.2",
|
|
53
|
+
"karma-safari-launcher": "^0.1.1",
|
|
54
|
+
"karma-verbose-summary-reporter": "0.0.1",
|
|
55
|
+
"load-grunt-tasks": "~0.1.0",
|
|
56
|
+
"phantomjs": "^1.9.18",
|
|
57
|
+
"requirejs": "^2.1.20",
|
|
58
|
+
"time-grunt": "0.x.x"
|
|
59
|
+
},
|
|
60
|
+
"main": "index.js",
|
|
61
|
+
"scripts": {
|
|
62
|
+
"build": "npm install && grunt",
|
|
63
|
+
"test": "grunt travis"
|
|
64
|
+
},
|
|
65
|
+
"engines": {
|
|
66
|
+
"node": ">=0.8.0"
|
|
67
|
+
},
|
|
68
|
+
"license": "MIT",
|
|
69
|
+
"keywords": [
|
|
70
|
+
"CrossDomain",
|
|
71
|
+
"Cross-Domain",
|
|
72
|
+
"iFrame",
|
|
73
|
+
"Resizing",
|
|
74
|
+
"Resizer",
|
|
75
|
+
"postMessage",
|
|
76
|
+
"autoheight",
|
|
77
|
+
"auto-height",
|
|
78
|
+
"iframe-auto-height",
|
|
79
|
+
"height-iframe",
|
|
80
|
+
"heightiframe",
|
|
81
|
+
"width",
|
|
82
|
+
"mutationObserver",
|
|
83
|
+
"RWD",
|
|
84
|
+
"responsiveiframes",
|
|
85
|
+
"responsive-iframes",
|
|
86
|
+
"jquery-plugin"
|
|
87
|
+
],
|
|
88
|
+
"gitHead": "ab00b21d88a29df810a1b2216f3e501f9f16c97a",
|
|
89
|
+
"bugs": {
|
|
90
|
+
"url": "https://github.com/davidjbradshaw/iframe-resizer/issues"
|
|
91
|
+
},
|
|
92
|
+
"_id": "iframe-resizer@3.5.5",
|
|
93
|
+
"_shasum": "944d570c665c7f61c2a482801a90e51e50a3a42f",
|
|
94
|
+
"_from": "iframe-resizer@*",
|
|
95
|
+
"_npmVersion": "3.5.3",
|
|
96
|
+
"_nodeVersion": "5.5.0",
|
|
97
|
+
"_npmUser": {
|
|
98
|
+
"name": "davidjbradshaw",
|
|
99
|
+
"email": "dave@bradshaw.net"
|
|
100
|
+
},
|
|
101
|
+
"dist": {
|
|
102
|
+
"shasum": "944d570c665c7f61c2a482801a90e51e50a3a42f",
|
|
103
|
+
"tarball": "https://registry.npmjs.org/iframe-resizer/-/iframe-resizer-3.5.5.tgz"
|
|
104
|
+
},
|
|
105
|
+
"_npmOperationalInternal": {
|
|
106
|
+
"host": "packages-16-east.internal.npmjs.com",
|
|
107
|
+
"tmp": "tmp/iframe-resizer-3.5.5.tgz_1466086228617_0.9651394316460937"
|
|
108
|
+
},
|
|
109
|
+
"directories": {},
|
|
110
|
+
"_resolved": "https://registry.npmjs.org/iframe-resizer/-/iframe-resizer-3.5.5.tgz"
|
|
111
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
|
|
2
|
+
define(['iframeResizer'], function(iFrameResize) {
|
|
3
|
+
|
|
4
|
+
describe('iFrame init', function() {
|
|
5
|
+
var iframe;
|
|
6
|
+
var id = 'initTest';
|
|
7
|
+
|
|
8
|
+
beforeEach(function(done){
|
|
9
|
+
loadIFrame('iframe600.html');
|
|
10
|
+
|
|
11
|
+
iframe = iFrameResize({
|
|
12
|
+
log:LOG,
|
|
13
|
+
id:id+'-',
|
|
14
|
+
autoResize:false,
|
|
15
|
+
bodyMargin:1,
|
|
16
|
+
checkOrigin:false,
|
|
17
|
+
inPageLinks:true,
|
|
18
|
+
interval:0,
|
|
19
|
+
maxHeight:100,
|
|
20
|
+
minHeight:10,
|
|
21
|
+
maxWidth:100,
|
|
22
|
+
minWidth:10,
|
|
23
|
+
scrolling:true,
|
|
24
|
+
sizeHeight:false,
|
|
25
|
+
sizeWidth:true,
|
|
26
|
+
tolerance:1,
|
|
27
|
+
initCallback:function(){
|
|
28
|
+
setTimeout(done,1);
|
|
29
|
+
}
|
|
30
|
+
})[0];
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
afterEach(function(){
|
|
34
|
+
//tearDown(iframe);
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
it('should add an ID', function() {
|
|
38
|
+
expect(iframe.id.split('-')[0]).toBe(id);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
describe('methods', function() {
|
|
42
|
+
it('should create iFrameResizer object', function() {
|
|
43
|
+
expect(iframe.iFrameResizer).toBeDefined();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('should create a close method', function() {
|
|
47
|
+
expect(iframe.iFrameResizer.close).toBeDefined();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('should create a resize method', function() {
|
|
51
|
+
expect(iframe.iFrameResizer.resize).toBeDefined();
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('should create a moveToAnchor method', function() {
|
|
55
|
+
expect(iframe.iFrameResizer.moveToAnchor).toBeDefined();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('should create a sendMessage method', function() {
|
|
59
|
+
expect(iframe.iFrameResizer.sendMessage).toBeDefined();
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
define(['iframeResizer'], function(iFrameResize) {
|
|
2
|
+
|
|
3
|
+
describe('jump to anchor', function() {
|
|
4
|
+
var iframe;
|
|
5
|
+
var log=LOG;
|
|
6
|
+
var testId = 'anchor';
|
|
7
|
+
|
|
8
|
+
beforeEach(function(){
|
|
9
|
+
loadIFrame('iframe600.html');
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
afterEach(function(){
|
|
13
|
+
tearDown(iframe);
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
it('requested from host page', function(done) {
|
|
17
|
+
var iframe1 = iFrameResize({
|
|
18
|
+
log:log,
|
|
19
|
+
id:'anchor1',
|
|
20
|
+
})[0];
|
|
21
|
+
|
|
22
|
+
spyOnIFramePostMessage(iframe1);
|
|
23
|
+
setTimeout(function(){
|
|
24
|
+
iframe1.iFrameResizer.moveToAnchor('testAnchor');
|
|
25
|
+
expect(iframe1.contentWindow.postMessage).toHaveBeenCalledWith('[iFrameSizer]moveToAnchor:testAnchor', getTarget(iframe1));
|
|
26
|
+
tearDown(iframe1);
|
|
27
|
+
done();
|
|
28
|
+
},100);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('mock incoming message', function(done) {
|
|
32
|
+
iframe2 = iFrameResize({
|
|
33
|
+
log:log,
|
|
34
|
+
id:'anchor2',
|
|
35
|
+
scrollCallback:function(position){
|
|
36
|
+
expect(position.x).toBe(8);
|
|
37
|
+
expect(position.y).toBeGreaterThan(8);
|
|
38
|
+
done();
|
|
39
|
+
}
|
|
40
|
+
})[0];
|
|
41
|
+
|
|
42
|
+
mockMsgFromIFrame(iframe2,'inPageLink:#anchorParentTest');
|
|
43
|
+
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('mock incoming message to parent', function(done) {
|
|
47
|
+
iframe3 = iFrameResize({
|
|
48
|
+
log:log,
|
|
49
|
+
id:'anchor3',
|
|
50
|
+
})[0];
|
|
51
|
+
|
|
52
|
+
window.parentIFrame = {
|
|
53
|
+
moveToAnchor: function(){
|
|
54
|
+
done();
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
mockMsgFromIFrame(iframe3,'inPageLink:#anchorParentTest2');
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
});
|
|
62
|
+
});
|
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
define(['iframeResizerContent','jquery'], function(mockMsgListener,$) {
|
|
2
|
+
|
|
3
|
+
function createMsg(msg){
|
|
4
|
+
return {
|
|
5
|
+
data:'[iFrameSizer]'+msg,
|
|
6
|
+
source:{
|
|
7
|
+
postMessage: function(msg){
|
|
8
|
+
if(log){
|
|
9
|
+
console.log('PostMessage: '+msg);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
window.iFrameResizer = {
|
|
17
|
+
messageCallback: function(msg){msgCalled = msg;},
|
|
18
|
+
readyCallback: function(){this.readyCalled = true;},
|
|
19
|
+
targetOrigin: '*'
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
$(window.document.body).append('<a href="#foo" id="bar"></a>');
|
|
23
|
+
|
|
24
|
+
//test early message is ignored
|
|
25
|
+
mockMsgListener(createMsg('resize'));
|
|
26
|
+
|
|
27
|
+
var
|
|
28
|
+
id = 'parentIFrameTests',
|
|
29
|
+
log = true,
|
|
30
|
+
childMsg = '8:true:'+log+':9999:true:false:-8px:max:wheat:null:0:true:child:scroll'
|
|
31
|
+
msgObject = createMsg(id+':'+childMsg),
|
|
32
|
+
win = mockMsgListener(msgObject);
|
|
33
|
+
|
|
34
|
+
//test reset is ignored during init
|
|
35
|
+
mockMsgListener(createMsg('reset'));
|
|
36
|
+
|
|
37
|
+
window.msgCalled = null;
|
|
38
|
+
//window.readyCalled = null;
|
|
39
|
+
|
|
40
|
+
beforeEach(function(){
|
|
41
|
+
spyOn(msgObject.source,'postMessage');
|
|
42
|
+
spyOn(window.iFrameResizer,'messageCallback');
|
|
43
|
+
spyOn(window.iFrameResizer,'readyCallback');
|
|
44
|
+
spyOn(console,'log');
|
|
45
|
+
spyOn(console,'warn');
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
afterAll(function(){
|
|
49
|
+
win.parentIFrame.close();
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
describe('ParentIFrame methods: ', function() {
|
|
54
|
+
|
|
55
|
+
it('autoResize',function(){
|
|
56
|
+
win.parentIFrame.autoResize(true);
|
|
57
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Add event listener: Animation Start');
|
|
58
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Add event listener: Animation Iteration');
|
|
59
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Add event listener: Animation End');
|
|
60
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Add event listener: Orientation Change');
|
|
61
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Add event listener: Input');
|
|
62
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Add event listener: Print');
|
|
63
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Add event listener: Transition End');
|
|
64
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Add event listener: Mouse Up');
|
|
65
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Add event listener: Mouse Down');
|
|
66
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Add event listener: IFrame Resized');
|
|
67
|
+
win.parentIFrame.autoResize(false);
|
|
68
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Remove event listener: Animation Start');
|
|
69
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Remove event listener: Animation Iteration');
|
|
70
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Remove event listener: Animation End');
|
|
71
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Remove event listener: Orientation Change');
|
|
72
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Remove event listener: Input');
|
|
73
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Remove event listener: Print');
|
|
74
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Remove event listener: Transition End');
|
|
75
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Remove event listener: Mouse Up');
|
|
76
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Remove event listener: Mouse Down');
|
|
77
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Remove event listener: IFrame Resized');
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('Get ID of iFrame is same as iFrame', function() {
|
|
81
|
+
expect(win.parentIFrame.getId()).toBe(id);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('move to anchor', function() {
|
|
85
|
+
win.parentIFrame.moveToAnchor('foo');
|
|
86
|
+
expect(msgObject.source.postMessage).toHaveBeenCalledWith('[iFrameSizer]parentIFrameTests:0:0:inPageLink:#foo', '*');
|
|
87
|
+
win.parentIFrame.moveToAnchor('bar');
|
|
88
|
+
expect(msgObject.source.postMessage.calls.argsFor(1)[0]).toContain(':scrollToOffset');
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it('reset', function() {
|
|
92
|
+
win.parentIFrame.reset();
|
|
93
|
+
expect(msgObject.source.postMessage.calls.argsFor(0)[0]).toContain(':reset');
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it('getPageInfo', function(done) {
|
|
97
|
+
win.parentIFrame.getPageInfo(function(pageInfo){
|
|
98
|
+
expect(pageInfo.iframeHeight).toBe(500);
|
|
99
|
+
expect(pageInfo.iframeWidth).toBe(300);
|
|
100
|
+
expect(pageInfo.clientHeight).toBe(645);
|
|
101
|
+
expect(pageInfo.clientWidth).toBe(1295);
|
|
102
|
+
expect(pageInfo.offsetLeft).toBe(20);
|
|
103
|
+
expect(pageInfo.offsetTop).toBe(85);
|
|
104
|
+
expect(pageInfo.scrollTop).toBe(0);
|
|
105
|
+
expect(pageInfo.scrollLeft).toBe(0);
|
|
106
|
+
done();
|
|
107
|
+
});
|
|
108
|
+
expect(msgObject.source.postMessage).toHaveBeenCalledWith('[iFrameSizer]parentIFrameTests:0:0:pageInfo', '*');
|
|
109
|
+
mockMsgListener(createMsg('pageInfo:{"iframeHeight":500,"iframeWidth":300,"clientHeight":645,"clientWidth":1295,"offsetLeft":20,"offsetTop":85,"scrollLeft":0,"scrollTop":0}'));
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it('getPageInfoStop', function() {
|
|
113
|
+
win.parentIFrame.getPageInfo();
|
|
114
|
+
expect(msgObject.source.postMessage).toHaveBeenCalledWith('[iFrameSizer]parentIFrameTests:0:0:pageInfoStop', '*');
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
it('scrollTo', function() {
|
|
118
|
+
win.parentIFrame.scrollTo(10,10);
|
|
119
|
+
expect(msgObject.source.postMessage).toHaveBeenCalledWith('[iFrameSizer]parentIFrameTests:10:10:scrollTo', '*');
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it('scrollToOffset', function() {
|
|
123
|
+
win.parentIFrame.scrollToOffset(10,10);
|
|
124
|
+
expect(msgObject.source.postMessage).toHaveBeenCalledWith('[iFrameSizer]parentIFrameTests:10:10:scrollToOffset', '*');
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it('sendMessage (string)', function() {
|
|
128
|
+
win.parentIFrame.sendMessage('foo:bar');
|
|
129
|
+
expect(msgObject.source.postMessage).toHaveBeenCalledWith('[iFrameSizer]parentIFrameTests:0:0:message:"foo:bar"', '*');
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it('sendMessage (object)', function() {
|
|
133
|
+
win.parentIFrame.sendMessage({foo:'bar'},'http://foo.bar:1337');
|
|
134
|
+
expect(msgObject.source.postMessage).toHaveBeenCalledWith('[iFrameSizer]parentIFrameTests:0:0:message:{"foo":"bar"}', 'http://foo.bar:1337');
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it('setTargetOrigin', function() {
|
|
138
|
+
var targetOrigin = 'http://foo.bar:1337'
|
|
139
|
+
win.parentIFrame.setTargetOrigin(targetOrigin);
|
|
140
|
+
win.parentIFrame.size(10,10);
|
|
141
|
+
win.parentIFrame.setTargetOrigin('*');
|
|
142
|
+
expect(msgObject.source.postMessage).toHaveBeenCalledWith('[iFrameSizer]parentIFrameTests:10:10:size', targetOrigin);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
describe('inbound message: ', function() {
|
|
148
|
+
|
|
149
|
+
it('readyCallack', function() {
|
|
150
|
+
expect(window.readyCalled).toEqual(true);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it('message (String)', function() {
|
|
154
|
+
var msg = 'foo';
|
|
155
|
+
mockMsgListener(createMsg('message:'+JSON.stringify(msg)));
|
|
156
|
+
expect(msgCalled).toBe(msg);
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it('message (Object)', function() {
|
|
160
|
+
var msg = {foo:'bar'};
|
|
161
|
+
mockMsgListener(createMsg('message:'+JSON.stringify(msg)));
|
|
162
|
+
expect(msgCalled.foo).toBe('bar');
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
it('reset', function(done) {
|
|
166
|
+
setTimeout(function(){ //Wait for init lock to clear
|
|
167
|
+
mockMsgListener(createMsg('reset'));
|
|
168
|
+
expect(msgObject.source.postMessage.calls.argsFor(0)[0]).toContain(':reset');
|
|
169
|
+
done();
|
|
170
|
+
},200);
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
it('resize(max)', function() {
|
|
174
|
+
win.parentIFrame.setHeightCalculationMethod('max');
|
|
175
|
+
mockMsgListener(createMsg('resize'));
|
|
176
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Trigger event: Parent window requested size check');
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
it('resize(lowestElement)', function() {
|
|
180
|
+
win.parentIFrame.setHeightCalculationMethod('lowestElement');
|
|
181
|
+
mockMsgListener(createMsg('resize'));
|
|
182
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Trigger event: Parent window requested size check');
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
it('resize(rightMostElement)', function() {
|
|
186
|
+
win.parentIFrame.setWidthCalculationMethod('rightMostElement');
|
|
187
|
+
mockMsgListener(createMsg('resize'));
|
|
188
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Trigger event: Parent window requested size check');
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
it('move to anchor', function() {
|
|
192
|
+
mockMsgListener(createMsg('moveToAnchor:foo'));
|
|
193
|
+
expect(msgObject.source.postMessage).toHaveBeenCalledWith('[iFrameSizer]parentIFrameTests:0:0:inPageLink:#foo', '*');
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
it('unexpected message', function() {
|
|
197
|
+
mockMsgListener(createMsg('foo'));
|
|
198
|
+
expect(console.warn).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] Unexpected message ([iFrameSizer]foo)');
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
describe('performance: ', function() {
|
|
205
|
+
|
|
206
|
+
it('trottles',function(done){
|
|
207
|
+
win.parentIFrame.size(10,10);
|
|
208
|
+
win.parentIFrame.size(20,10);
|
|
209
|
+
win.parentIFrame.size(30,10);
|
|
210
|
+
win.parentIFrame.size(40,10);
|
|
211
|
+
win.parentIFrame.size(50,10);
|
|
212
|
+
win.parentIFrame.size(60,10);
|
|
213
|
+
setTimeout(function(){
|
|
214
|
+
//expect(msgObject.source.postMessage).toHaveBeenCalledWith('[iFrameSizer]parentIFrameTests:10:10:size', '*');
|
|
215
|
+
expect(msgObject.source.postMessage).not.toHaveBeenCalledWith('[iFrameSizer]parentIFrameTests:20:10:size', '*');
|
|
216
|
+
expect(msgObject.source.postMessage).not.toHaveBeenCalledWith('[iFrameSizer]parentIFrameTests:30:10:size', '*');
|
|
217
|
+
expect(msgObject.source.postMessage).not.toHaveBeenCalledWith('[iFrameSizer]parentIFrameTests:40:10:size', '*');
|
|
218
|
+
expect(msgObject.source.postMessage).not.toHaveBeenCalledWith('[iFrameSizer]parentIFrameTests:50:10:size', '*');
|
|
219
|
+
expect(msgObject.source.postMessage).toHaveBeenCalledWith('[iFrameSizer]parentIFrameTests:60:10:size', '*');
|
|
220
|
+
done();
|
|
221
|
+
},17);
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
describe('height calculation methods: ', function() {
|
|
228
|
+
|
|
229
|
+
it('invalid',function() {
|
|
230
|
+
win.parentIFrame.setHeightCalculationMethod('foo');
|
|
231
|
+
expect(console.warn).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] foo is not a valid option for heightCalculationMethod.');
|
|
232
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] height calculation method set to "bodyOffset"');
|
|
233
|
+
win.parentIFrame.size();
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
it('bodyOffset',function(done) {
|
|
237
|
+
setTimeout(function(){
|
|
238
|
+
win.parentIFrame.setHeightCalculationMethod('bodyOffset');
|
|
239
|
+
win.parentIFrame.size();
|
|
240
|
+
done();
|
|
241
|
+
},10);
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
it('offset',function(done) {
|
|
245
|
+
setTimeout(function(){
|
|
246
|
+
win.parentIFrame.setHeightCalculationMethod('offset');
|
|
247
|
+
win.parentIFrame.size();
|
|
248
|
+
done();
|
|
249
|
+
},20);
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
it('bodyScroll',function(done) {
|
|
253
|
+
setTimeout(function(){
|
|
254
|
+
win.parentIFrame.setHeightCalculationMethod('bodyScroll');
|
|
255
|
+
win.parentIFrame.size();
|
|
256
|
+
done();
|
|
257
|
+
},30);
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
it('documentElementOffset',function(done) {
|
|
261
|
+
setTimeout(function(){
|
|
262
|
+
win.parentIFrame.setHeightCalculationMethod('documentElementOffset');
|
|
263
|
+
win.parentIFrame.size();
|
|
264
|
+
done();
|
|
265
|
+
},40);
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
it('documentElementScroll',function(done) {
|
|
269
|
+
setTimeout(function(){
|
|
270
|
+
win.parentIFrame.setHeightCalculationMethod('documentElementScroll');
|
|
271
|
+
win.parentIFrame.size();
|
|
272
|
+
done();
|
|
273
|
+
},50);
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
it('max',function(done) {
|
|
277
|
+
setTimeout(function(){
|
|
278
|
+
win.parentIFrame.setHeightCalculationMethod('max');
|
|
279
|
+
win.parentIFrame.size();
|
|
280
|
+
done();
|
|
281
|
+
},60);
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
it('min',function(done) {
|
|
285
|
+
setTimeout(function(){
|
|
286
|
+
win.parentIFrame.setHeightCalculationMethod('min');
|
|
287
|
+
win.parentIFrame.size();
|
|
288
|
+
done();
|
|
289
|
+
},70);
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
it('grow',function(done) {
|
|
293
|
+
setTimeout(function(){
|
|
294
|
+
win.parentIFrame.setHeightCalculationMethod('grow');
|
|
295
|
+
win.parentIFrame.size();
|
|
296
|
+
done();
|
|
297
|
+
},80);
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
it('lowestElement',function(done) {
|
|
301
|
+
setTimeout(function(){
|
|
302
|
+
win.parentIFrame.setHeightCalculationMethod('lowestElement');
|
|
303
|
+
win.parentIFrame.size();
|
|
304
|
+
done();
|
|
305
|
+
},90);
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
it('taggedElement',function(done) {
|
|
309
|
+
setTimeout(function(){
|
|
310
|
+
win.parentIFrame.setHeightCalculationMethod('taggedElement');
|
|
311
|
+
win.parentIFrame.size();
|
|
312
|
+
done();
|
|
313
|
+
},100);
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
describe('width calculation methods: ', function() {
|
|
320
|
+
|
|
321
|
+
it('invalid',function() {
|
|
322
|
+
win.parentIFrame.setWidthCalculationMethod('foo');
|
|
323
|
+
expect(console.warn).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] foo is not a valid option for widthCalculationMethod.');
|
|
324
|
+
expect(console.log).toHaveBeenCalledWith('[iFrameSizer][parentIFrameTests] width calculation method set to "scroll"');
|
|
325
|
+
win.parentIFrame.size();
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
it('bodyOffset',function(done) {
|
|
329
|
+
setTimeout(function(){
|
|
330
|
+
win.parentIFrame.setWidthCalculationMethod('bodyOffset');
|
|
331
|
+
win.parentIFrame.size();
|
|
332
|
+
done();
|
|
333
|
+
},110);
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
it('bodyScroll',function(done) {
|
|
337
|
+
setTimeout(function(){
|
|
338
|
+
win.parentIFrame.setWidthCalculationMethod('bodyScroll');
|
|
339
|
+
win.parentIFrame.size();
|
|
340
|
+
done();
|
|
341
|
+
},120);
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
it('documentElementOffset',function(done) {
|
|
345
|
+
setTimeout(function(){
|
|
346
|
+
win.parentIFrame.setWidthCalculationMethod('documentElementOffset');
|
|
347
|
+
win.parentIFrame.size();
|
|
348
|
+
done();
|
|
349
|
+
},130);
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
it('documentElementScroll:',function(done) {
|
|
353
|
+
setTimeout(function(){
|
|
354
|
+
win.parentIFrame.setWidthCalculationMethod('documentElementScroll:');
|
|
355
|
+
win.parentIFrame.size();
|
|
356
|
+
done();
|
|
357
|
+
},140);
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
it('scroll',function(done) {
|
|
361
|
+
setTimeout(function(){
|
|
362
|
+
win.parentIFrame.setWidthCalculationMethod('scroll');
|
|
363
|
+
win.parentIFrame.size();
|
|
364
|
+
done();
|
|
365
|
+
},150);
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
it('max',function(done) {
|
|
369
|
+
setTimeout(function(){
|
|
370
|
+
win.parentIFrame.setWidthCalculationMethod('max');
|
|
371
|
+
win.parentIFrame.size();
|
|
372
|
+
done();
|
|
373
|
+
},160);
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
it('min',function(done) {
|
|
377
|
+
setTimeout(function(){
|
|
378
|
+
win.parentIFrame.setWidthCalculationMethod('min');
|
|
379
|
+
win.parentIFrame.size();
|
|
380
|
+
done();
|
|
381
|
+
},170);
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
it('leftMostElement',function(done) {
|
|
385
|
+
setTimeout(function(){
|
|
386
|
+
win.parentIFrame.setWidthCalculationMethod('leftMostElement');
|
|
387
|
+
win.parentIFrame.size();
|
|
388
|
+
done();
|
|
389
|
+
},180);
|
|
390
|
+
});
|
|
391
|
+
|
|
392
|
+
it('taggedElement',function(done) {
|
|
393
|
+
setTimeout(function(){
|
|
394
|
+
win.parentIFrame.setWidthCalculationMethod('taggedElement');
|
|
395
|
+
win.parentIFrame.size();
|
|
396
|
+
done();
|
|
397
|
+
},190);
|
|
398
|
+
});
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
});
|
|
403
|
+
|