UNPKG

3.83 kBJavaScriptView Raw
1!function e(n,t,r){function i(a,c){if(!t[a]){if(!n[a]){var s="function"==typeof require&&require;if(!c&&s)return s(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=t[a]={exports:{}};n[a][0].call(u.exports,function(e){var t=n[a][1][e];return i(t?t:e)},u,u.exports,e,n,t,r)}return t[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,n,t){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(n,t,r){return t&&e(n.prototype,t),r&&e(n,r),n}}(),a=e("./index"),c=r(a),s=document.currentScript,l=function(){function e(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,e),t.currentScript=s,this._widget=new c.default(n,t)}return o(e,[{key:"render",value:function(){return this._widget.render()}}]),e}(),u={Widget:l};"undefined"!=typeof n&&n.exports&&(n.exports=u),window.ScrollirisReadabilityReflector=u},{"./index":2}],2:[function(e,n,t){"use strict";function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(n,t,r){return t&&e(n.prototype,t),r&&e(n,r),n}}(),o=function(){function e(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,e),this.config=n,this.context=t}return i(e,[{key:"render",value:function(){var e=this.context;this._insertStyle();var n=document.createElement("iframe");n.setAttribute("class","scrolliris-frame");var t=document.createElement("div");t.setAttribute("id","scrolliris_container"),t.appendChild(n),document.body.appendChild(t);var r=e.currentScript||document.currentScript,i=r.getAttribute("src")||"",o=/(-browser)?(\.min)?\.js(\?)?/,a=(e.settings||{}).canvasJS||i.replace(o,"-canvas$2.js$3").toString(),c=(e.settings||{}).canvasCSS||i.replace(o,"-canvas$2.css$3").toString();""===a&&console.error("canvasJS is missing"),""===c&&console.error("canvasCSS is missing");var s='\n<head>\n <meta charset="utf-8">\n <link rel="stylesheet" href="'+c+'">\n</head>\n<body>\n <div id="scrolliris_header">\n <h1>Text Readability Heatmap<span class="label">BETA</span></h1>\n <!-- <button class="btn close">close</button> -->\n </div>\n <div id="scrolliris_canvas_container"></div>\n <div id="scrolliris_footer">\n <p class="txt">Powered by\n <a href="https://scrolliris.com/" target="_blank">Scrolliris</a></p>\n </div>\n <script src="'+a+'"></script>\n</body>\n';s=s.replace(/\n/g,""),n.contentWindow.ScrollirisReadabilityReflector={Context:e},n.contentWindow.document.open(),n.contentWindow.document.write(s),n.contentWindow.document.close()}},{key:"_insertStyle",value:function(){var e="\n#scrolliris_container {\n position: fixed;\n width: 0px;\n height: 0px;\n bottom: 0px;\n left: 0px;\n z-index: 9999999 !important;\n}\n\n#scrolliris_container .scrolliris-frame {\n z-index: 9999999 !important;\n position: fixed !important;\n bottom: 9px;\n left: 9px;\n width: 260px;\n height: 360px;\n border: 1px solid rgba(51, 51, 51, 0.18);\n border-radius: 1px;\n}\n",n=document.createElement("style");n.type="text/css",n.appendChild(document.createTextNode(e));var t=document.getElementsByTagName("head")[0];t.appendChild(n)}}]),e}();t.default=o},{}]},{},[1]);
2//# sourceMappingURL=scrolliris-readability-reflector-browser.min.js.map