diff --git a/dist/css/app.css b/dist/css/app.css index 4dec8a0..ce635d6 100644 --- a/dist/css/app.css +++ b/dist/css/app.css @@ -1 +1 @@ -.meta-MetaWindow{position:fixed}.meta-MetaWindow .meta-error,.meta-MetaWindow .meta-spinner,.meta-MetaWindow .meta-spinner_embed{align-items:center;display:none;justify-content:center;text-align:center;z-index:2}.meta-MetaWindow .meta-spinner,.meta-MetaWindow .meta-spinner_embed{bottom:0;color:#fff;font-size:2rem;font-weight:700;left:0;position:absolute;right:0;text-transform:uppercase;top:0}.meta-MetaWindow .meta-error{color:#f44336;font-size:1.5em;font-weight:700}.meta-MetaWindow .meta-spinner_embed{display:flex}.meta-MetaWindow-overlay{align-items:center;background:rgba(0,0,0,.8);bottom:0;display:none;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:98}.meta-MetaWindow-overlay__loading .meta-spinner,.meta-MetaWindow-overlay__open{display:flex}.meta-MetaWindow-overlay__error .meta-content{justify-content:center}.meta-MetaWindow-overlay__error .meta-error{display:flex}.meta-MetaWindow .meta-nav{background:none;border:0;color:#fff;font-size:2rem;text-shadow:#000 0 0 .25em;z-index:2}.meta-MetaWindow .meta-nav:focus,.meta-MetaWindow .meta-nav:hover{color:#fff}.meta-MetaWindow .meta-nav:hover{background:none;color:#eceff1;text-decoration:none;text-shadow:none}.meta-MetaWindow .meta-nav-arrow{align-items:center;bottom:0;display:flex;font-size:2.5rem;justify-content:center;padding:.25rem .5rem;position:absolute;top:auto;z-index:2}.meta-MetaWindow .meta-nav-arrow:focus .fa,.meta-MetaWindow .meta-nav-arrow:focus .fab,.meta-MetaWindow .meta-nav-arrow:focus .far,.meta-MetaWindow .meta-nav-arrow:focus .fas,.meta-MetaWindow .meta-nav-arrow:hover .fa,.meta-MetaWindow .meta-nav-arrow:hover .fab,.meta-MetaWindow .meta-nav-arrow:hover .far,.meta-MetaWindow .meta-nav-arrow:hover .fas{transform:scale(1.5)}@media(min-width:992px){.meta-MetaWindow .meta-nav-arrow{bottom:0;top:0}}.meta-MetaWindow .meta-nav-arrow__next{right:0}.meta-MetaWindow .meta-nav-arrow__prev{left:0}@media(min-width:992px){.meta-MetaWindow .meta-nav-arrow__next{right:-3rem}.meta-MetaWindow .meta-nav-arrow__prev{left:-3rem}}.meta-MetaWindow .meta-close{position:absolute;right:0;top:-3rem;width:1.25em}.meta-MetaWindow .meta-close:hover .fa,.meta-MetaWindow .meta-close:hover .fab,.meta-MetaWindow .meta-close:hover .far,.meta-MetaWindow .meta-close:hover .fas{transform:rotate(-180deg)}@media(min-width:992px){.meta-MetaWindow .meta-close{right:-3rem;top:-3rem}}.meta-MetaWindow .meta-content{display:flex;flex-direction:column;height:80%;position:relative;width:100%;z-index:1}@media(min-width:992px){.meta-MetaWindow .meta-content{height:90%;height:calc(90% - 3rem);width:90%;width:calc(90% - 3rem)}}.meta-MetaWindow .meta-wrap{display:flex;height:100%;margin:0 auto;max-height:100%;max-width:100%;overflow:auto;width:100%;word-break:break-word}.meta-MetaWindow .meta-wrap img{max-height:100%;max-width:100%;object-fit:cover}.meta-MetaWindow__text .meta-content{background:#fff;color:#000;padding:1rem 0 1rem 1rem}.meta-MetaWindow__text .meta-wrap{padding-right:1rem}.meta-MetaWindow__image .meta-wrap,.meta-MetaWindow__image .typography,.meta-MetaWindow__video .meta-wrap,.meta-MetaWindow__video .typography{align-items:center;justify-content:center;min-height:100%;overflow:hidden}.meta-MetaWindow__image .meta-wrap img,.meta-MetaWindow__image .typography img,.meta-MetaWindow__video .meta-wrap img,.meta-MetaWindow__video .typography img{margin:0}.meta-MetaWindow__embed:before,.meta-MetaWindow__video:before{content:"";display:block;padding-top:56.25%;position:relative;width:100%}.meta-MetaWindow__embed a[rel="nofollow noreferrer noopener"],.meta-MetaWindow__video a[rel="nofollow noreferrer noopener"]{color:#fff;font-size:1.2rem;font-weight:700}.meta-MetaWindow__embed a[rel="nofollow noreferrer noopener"]:before,.meta-MetaWindow__video a[rel="nofollow noreferrer noopener"]:before{content:"Unable to load. Please follow the provided link: ";display:block}.meta-MetaWindow__embed iframe,.meta-MetaWindow__video iframe{height:100%;left:0;position:absolute;top:0;width:100%}.visually-hidden,.visually-hidden-focusable:not(:focus):not(:focus-within){clip:rect(0,0,0,0)!important;border:0!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important} \ No newline at end of file +.meta-MetaWindow{position:fixed}.meta-MetaWindow .meta-error,.meta-MetaWindow .meta-spinner,.meta-MetaWindow .meta-spinner--embed{align-items:center;display:none;justify-content:center;text-align:center;z-index:2}.meta-MetaWindow .meta-spinner,.meta-MetaWindow .meta-spinner--embed{bottom:0;color:#fff;font-size:2rem;font-weight:700;left:0;position:absolute;right:0;text-transform:uppercase;top:0}.meta-MetaWindow .meta-error{color:#f44336;font-size:1.5em;font-weight:700}.meta-MetaWindow .meta-spinner--embed{display:flex}.meta-MetaWindow-overlay{align-items:center;background:rgba(0,0,0,.8);bottom:0;display:none;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:98}.meta-MetaWindow-overlay--loading .meta-spinner,.meta-MetaWindow-overlay--open{display:flex}.meta-MetaWindow-overlay--error .meta-content{justify-content:center}.meta-MetaWindow-overlay--error .meta-error{display:flex}.meta-MetaWindow .meta-nav{background:none;border:0;color:#fff;font-size:2rem;text-shadow:#000 0 0 .25em;z-index:2}.meta-MetaWindow .meta-nav:focus,.meta-MetaWindow .meta-nav:hover{color:#fff}.meta-MetaWindow .meta-nav:hover{background:none;color:#eceff1;text-decoration:none;text-shadow:none}.meta-MetaWindow .meta-nav-arrow{align-items:center;bottom:0;display:flex;font-size:2.5rem;justify-content:center;padding:.25rem .5rem;position:absolute;top:auto;z-index:2}.meta-MetaWindow .meta-nav-arrow:focus .fa,.meta-MetaWindow .meta-nav-arrow:focus .fab,.meta-MetaWindow .meta-nav-arrow:focus .far,.meta-MetaWindow .meta-nav-arrow:focus .fas,.meta-MetaWindow .meta-nav-arrow:hover .fa,.meta-MetaWindow .meta-nav-arrow:hover .fab,.meta-MetaWindow .meta-nav-arrow:hover .far,.meta-MetaWindow .meta-nav-arrow:hover .fas{transform:scale(1.5)}@media(min-width:992px){.meta-MetaWindow .meta-nav-arrow{bottom:0;top:0}}.meta-MetaWindow .meta-nav-arrow__next{right:0}.meta-MetaWindow .meta-nav-arrow__prev{left:0}@media(min-width:992px){.meta-MetaWindow .meta-nav-arrow__next{right:-3rem}.meta-MetaWindow .meta-nav-arrow__prev{left:-3rem}}.meta-MetaWindow .meta-close{position:absolute;right:0;top:-3rem;width:1.25em}.meta-MetaWindow .meta-close:hover .fa,.meta-MetaWindow .meta-close:hover .fab,.meta-MetaWindow .meta-close:hover .far,.meta-MetaWindow .meta-close:hover .fas{transform:rotate(-180deg)}@media(min-width:992px){.meta-MetaWindow .meta-close{right:-3rem;top:-3rem}}.meta-MetaWindow .meta-content{display:flex;flex-direction:column;height:80%;position:relative;width:100%;z-index:1}@media(min-width:992px){.meta-MetaWindow .meta-content{height:90%;height:calc(90% - 3rem);width:90%;width:calc(90% - 3rem)}}.meta-MetaWindow .meta-wrap{display:flex;height:100%;margin:0 auto;max-height:100%;max-width:100%;overflow:auto;width:100%;word-break:break-word}.meta-MetaWindow .meta-wrap img{max-height:100%;max-width:100%;object-fit:cover}.meta-MetaWindow--text .meta-content{background:#fff;color:#000;padding:1rem 0 1rem 1rem}.meta-MetaWindow--text .meta-wrap{padding-right:1rem}.meta-MetaWindow--image .meta-wrap,.meta-MetaWindow--image .typography,.meta-MetaWindow--video .meta-wrap,.meta-MetaWindow--video .typography{align-items:center;justify-content:center;min-height:100%;overflow:hidden}.meta-MetaWindow--image .meta-wrap img,.meta-MetaWindow--image .typography img,.meta-MetaWindow--video .meta-wrap img,.meta-MetaWindow--video .typography img{margin:0}.meta-MetaWindow--embed:before,.meta-MetaWindow--video:before{content:"";display:block;padding-top:56.25%;position:relative;width:100%}.meta-MetaWindow--embed a[rel="nofollow noreferrer noopener"],.meta-MetaWindow--video a[rel="nofollow noreferrer noopener"]{color:#fff;font-size:1.2rem;font-weight:700}.meta-MetaWindow--embed a[rel="nofollow noreferrer noopener"]:before,.meta-MetaWindow--video a[rel="nofollow noreferrer noopener"]:before{content:"Unable to load. Please follow the provided link: ";display:block}.meta-MetaWindow--embed iframe,.meta-MetaWindow--video iframe{height:100%;left:0;position:absolute;top:0;width:100%}.visually-hidden,.visually-hidden-focusable:not(:focus):not(:focus-within){clip:rect(0,0,0,0)!important;border:0!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important} \ No newline at end of file diff --git a/dist/index.html b/dist/index.html index 2d3ce36..7b8d83a 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1,3 +1,3 @@ Meta-lightbox Demo

Meta-lightbox Demo

NODE_ENV: production
\ No newline at end of file + }

Meta-lightbox Demo

NODE_ENV: production
\ No newline at end of file diff --git a/dist/js/app.js b/dist/js/app.js index 1f356b2..b11455f 100644 --- a/dist/js/app.js +++ b/dist/js/app.js @@ -1 +1 @@ -!function(){var e={722:function(e,t,n){e.exports=n(895)},196:function(e,t,n){"use strict";var r=n(695),o=n(30),a=n(305),i=n(999),s=n(492),c=n(867),u=n(751),f=n(174);e.exports=function xhrAdapter(e){return new Promise((function dispatchXhrRequest(t,n){var l=e.data,d=e.headers;r.isFormData(l)&&delete d["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var m=e.auth.username||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";d.Authorization="Basic "+btoa(m+":"+h)}var g=s(e.baseURL,e.url);if(p.open(e.method.toUpperCase(),i(g,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function handleLoad(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in p?c(p.getAllResponseHeaders()):null,a={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:e,request:p};o(t,n,a),p=null}},p.onabort=function handleAbort(){p&&(n(f("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function handleError(){n(f("Network Error",e,null,p)),p=null},p.ontimeout=function handleTimeout(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(f(t,e,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var y=(e.withCredentials||u(g))&&e.xsrfCookieName?a.read(e.xsrfCookieName):void 0;y&&(d[e.xsrfHeaderName]=y)}if("setRequestHeader"in p&&r.forEach(d,(function setRequestHeader(e,t){"undefined"===typeof l&&"content-type"===t.toLowerCase()?delete d[t]:p.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),e.responseType)try{p.responseType=e.responseType}catch(v){if("json"!==e.responseType)throw v}"function"===typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function onCanceled(e){p&&(p.abort(),n(e),p=null)})),l||(l=null),p.send(l)}))}},895:function(e,t,n){"use strict";var r=n(695),o=n(129),a=n(653),i=n(309);function createInstance(e){var t=new a(e),n=o(a.prototype.request,t);return r.extend(n,a.prototype,t),r.extend(n,t),n}var s=createInstance(n(933));s.Axios=a,s.create=function create(e){return createInstance(i(s.defaults,e))},s.Cancel=n(638),s.CancelToken=n(114),s.isCancel=n(539),s.all=function all(e){return Promise.all(e)},s.spread=n(522),s.isAxiosError=n(431),e.exports=s,e.exports.default=s},638:function(e){"use strict";function Cancel(e){this.message=e}Cancel.prototype.toString=function toString(){return"Cancel"+(this.message?": "+this.message:"")},Cancel.prototype.__CANCEL__=!0,e.exports=Cancel},114:function(e,t,n){"use strict";var r=n(638);function CancelToken(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function promiseExecutor(e){t=e}));var n=this;e((function cancel(e){n.reason||(n.reason=new r(e),t(n.reason))}))}CancelToken.prototype.throwIfRequested=function throwIfRequested(){if(this.reason)throw this.reason},CancelToken.source=function source(){var e;return{token:new CancelToken((function executor(t){e=t})),cancel:e}},e.exports=CancelToken},539:function(e){"use strict";e.exports=function isCancel(e){return!(!e||!e.__CANCEL__)}},653:function(e,t,n){"use strict";var r=n(695),o=n(999),a=n(328),i=n(570),s=n(309);function Axios(e){this.defaults=e,this.interceptors={request:new a,response:new a}}Axios.prototype.request=function request(e){"string"===typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=s(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[i,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function unshiftRequestInterceptors(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function pushResponseInterceptors(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},Axios.prototype.getUri=function getUri(e){return e=s(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function forEachMethodNoData(e){Axios.prototype[e]=function(t,n){return this.request(s(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function forEachMethodWithData(e){Axios.prototype[e]=function(t,n,r){return this.request(s(r||{},{method:e,url:t,data:n}))}})),e.exports=Axios},328:function(e,t,n){"use strict";var r=n(695);function InterceptorManager(){this.handlers=[]}InterceptorManager.prototype.use=function use(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},InterceptorManager.prototype.eject=function eject(e){this.handlers[e]&&(this.handlers[e]=null)},InterceptorManager.prototype.forEach=function forEach(e){r.forEach(this.handlers,(function forEachHandler(t){null!==t&&e(t)}))},e.exports=InterceptorManager},492:function(e,t,n){"use strict";var r=n(794),o=n(296);e.exports=function buildFullPath(e,t){return e&&!r(t)?o(e,t):t}},174:function(e,t,n){"use strict";var r=n(2);e.exports=function createError(e,t,n,o,a){var i=new Error(e);return r(i,t,n,o,a)}},570:function(e,t,n){"use strict";var r=n(695),o=n(554),a=n(539),i=n(933);function throwIfCancellationRequested(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function dispatchRequest(e){return throwIfCancellationRequested(e),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function cleanHeaderConfig(t){delete e.headers[t]})),(e.adapter||i.adapter)(e).then((function onAdapterResolution(t){return throwIfCancellationRequested(e),t.data=o(t.data,t.headers,e.transformResponse),t}),(function onAdapterRejection(t){return a(t)||(throwIfCancellationRequested(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},2:function(e){"use strict";e.exports=function enhanceError(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},309:function(e,t,n){"use strict";var r=n(695);e.exports=function mergeConfig(e,t){t=t||{};var n={},o=["url","method","data"],a=["headers","auth","proxy","params"],i=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],s=["validateStatus"];function getMergedValue(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function mergeDeepProperties(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(n[o]=getMergedValue(void 0,e[o])):n[o]=getMergedValue(e[o],t[o])}r.forEach(o,(function valueFromConfig2(e){r.isUndefined(t[e])||(n[e]=getMergedValue(void 0,t[e]))})),r.forEach(a,mergeDeepProperties),r.forEach(i,(function defaultToConfig2(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(n[o]=getMergedValue(void 0,e[o])):n[o]=getMergedValue(void 0,t[o])})),r.forEach(s,(function merge(r){r in t?n[r]=getMergedValue(e[r],t[r]):r in e&&(n[r]=getMergedValue(void 0,e[r]))}));var c=o.concat(a).concat(i).concat(s),u=Object.keys(e).concat(Object.keys(t)).filter((function filterAxiosKeys(e){return-1===c.indexOf(e)}));return r.forEach(u,mergeDeepProperties),n}},30:function(e,t,n){"use strict";var r=n(174);e.exports=function settle(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},554:function(e,t,n){"use strict";var r=n(695);e.exports=function transformData(e,t,n){return r.forEach(n,(function transform(n){e=n(e,t)})),e}},933:function(e,t,n){"use strict";var r=n(695),o=n(965),a={"Content-Type":"application/x-www-form-urlencoded"};function setContentTypeIfUnset(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var i={adapter:function getDefaultAdapter(){var e;return("undefined"!==typeof XMLHttpRequest||"undefined"!==typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(e=n(196)),e}(),transformRequest:[function transformRequest(e,t){return o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(setContentTypeIfUnset(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)?(setContentTypeIfUnset(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function transformResponse(e){if("string"===typeof e)try{e=JSON.parse(e)}catch(t){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function validateStatus(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function forEachMethodNoData(e){i.headers[e]={}})),r.forEach(["post","put","patch"],(function forEachMethodWithData(e){i.headers[e]=r.merge(a)})),e.exports=i},129:function(e){"use strict";e.exports=function bind(e,t){return function wrap(){for(var n=new Array(arguments.length),r=0;r=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([n]):i[t]?i[t]+", "+n:n}})),i):i}},522:function(e){"use strict";e.exports=function spread(e){return function wrap(t){return e.apply(null,t)}}},695:function(e,t,n){"use strict";function _typeof(e){return(_typeof="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function _typeof(e){return typeof e}:function _typeof(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r=n(129),o=Object.prototype.toString;function isArray(e){return"[object Array]"===o.call(e)}function isUndefined(e){return"undefined"===typeof e}function isObject(e){return null!==e&&"object"===_typeof(e)}function isPlainObject(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function isFunction(e){return"[object Function]"===o.call(e)}function forEach(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==_typeof(e)&&(e=[e]),isArray(e))for(var n=0,r=e.length;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{shown:!1},o=arguments.length>1?arguments[1]:void 0;_classCallCheck(this,MetaWindow),_defineProperty(this,"state",{content:"",type:["empty"],shown:!1,loading:!1,error:!1,embed:!1,collections:[],current:null,target:null}),_defineProperty(this,"show",(function(){var t=e;console.log("".concat(t.name,": show")),t.setState({shown:!0}),n.dispatchEvent(new Event("{ui.name}.show"))})),_defineProperty(this,"hide",(function(){var t=e;console.log("".concat(t.name,": hide")),t.setState({shown:!1}),n.dispatchEvent(new Event("{ui.name}.hide"))})),_defineProperty(this,"next",(function(){var t=e,r=t.state.current.getAttribute("data-gallery"),o=t._currIndex();o0?o--:o=t.state.collections[r].length-1,t.state.collections[r][o].click(),console.log("".concat(t.name,": prev")),n.dispatchEvent(new Event("{ui.name}.prev"))})),_defineProperty(this,"reset",(function(){e.setState({content:"",type:["empty"],shown:!1,loading:!1,error:!1,embed:!1})})),_defineProperty(this,"load",(function(t){var r=e,o=r.axios;r.reset(),r.setState({loading:!0}),r.show(),o.get(t,{responseType:"arraybuffer"}).then((function(e){console.log("".concat(r.name,": response content-type: ").concat(e.headers["content-type"]));switch(e.headers["content-type"]){case"image/jpeg":case"image/png":case"image/svg+xml":case"image/bmp":case"image/gif":case"image/tiff":case"image/webp":case"image/jpg":case"image/svg":r.setContent(''),"meta-".concat(r.name,"__image"));break;case"application/json":case"application/ld+json":case"application/json; charset=UTF-8":r.setContent("".concat((!1).Content),["meta-".concat(r.name,"__text"),"meta-".concat(r.name,"__html"),"meta-".concat(r.name,"__json")]);break;case"text/html":case"application/xhtml+xml":case"text/plain":case"text/html; charset=UTF-8":case"application/xhtml+xml; charset=UTF-8":case"text/plain; charset=UTF-8":r.setContent(r._abToString(e.data),["meta-".concat(r.name,"__text"),"meta-".concat(r.name,"__html"),"meta-".concat(r.name,"__pajax")]);break;default:console.warn("".concat(r.name,": Unknown response content-type!"))}n.dispatchEvent(new Event("{ui.name}.loaded"))})).catch((function(e){console.error(e);var t="";if(e.response)switch(e.response.status){case 404:t="Not Found.";break;case 500:t="Server issue, please try again latter.";break;default:t="Something went wrong."}else e.request?t="No response received":console.warn("Error",e.message);r.setState({error:t}),n.dispatchEvent(new Event("{ui.name}.error"))})).then((function(){r.setState({loading:!1})}))})),_defineProperty(this,"_currIndex",(function(){var t=e,n=t.state.current,r=n.getAttribute("data-gallery");return t.state.collections[r].indexOf(n)})),_defineProperty(this,"embed",(function(t){var n=e;console.log("".concat(n.name,": embed")),n.reset(),n.setState({embed:t,loading:!1,type:["meta-".concat(n.name,"__embed"),"meta-".concat(n.name,"__video")]}),n.show()})),_defineProperty(this,"setCaption",(function(t){var n=e;console.log("".concat(n.name,": setCaption")),n.state.caption=t})),_defineProperty(this,"getCaption",(function(){return e.state.caption})),_defineProperty(this,"_abToString",(function(e){return String.fromCharCode.apply(null,new Uint8Array(e))})),_defineProperty(this,"_imageEncode",(function(e){new Uint8Array(e);return btoa([].reduce.call(new Uint8Array(e),(function(e,t){return e+String.fromCharCode(t)}),""))})),_defineProperty(this,"setContent",(function(t,n){var r=e;console.log("".concat(r.name,": setContent"));var o=n||["meta-".concat(r.name,"__html"),"meta-".concat(r.name,"__text")];Array.isArray(o)||(o=n.split(" ")),r.setState({content:t,type:o})})),_defineProperty(this,"getHtml",(function(){var t=e;if(t.state.embed){var n=__webpack_require__(46)(t.state.embed);t.state.content='')}return t.state.content}));var a=this;switch(a.name=a.constructor.name,console.log("".concat(a.name,": init")),a.axios=r,a.setState(t),o){case"show":case"hide":a.hide()}n.dispatchEvent(new Event("{ui.name}.init"))}return function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}(MetaWindow,[{key:"init",value:function init(){var e=this;console.log("MetaWindow: [links] init"),document.querySelectorAll('[data-toggle="lightbox"],[data-gallery="${gallery}"]').forEach((function(t){var n=t.getAttribute("data-gallery");n&&(e.state.collections[n]=[],document.querySelectorAll('[data-toggle="lightbox"][data-gallery="'.concat(n,'"]')).forEach((function(t){e.state.collections[n].push(t)}))),t.addEventListener("click",(function(t){t.preventDefault(),console.log("MetaWindow: [link] click");var n=t.currentTarget,r=n.getAttribute("href")||n.getAttribute("data-href"),o=n.getAttribute("data-embed");e.state.current=n,o?e.embed(r):e.load(r);var a=n.getAttribute("data-title");a&&e.setCaption(a)}))}))}},{key:"setState",value:function setState(e){var t=this;t.state=Object.assign({},t.state,e),t.render()}},{key:"render",value:function render(){var e,t=this,n=t.name,r=t.state.current;t.state.target.innerHTML="";var o=document.createElement("div");o.classList.add("meta-".concat(n)),(e=o.classList).add.apply(e,_toConsumableArray(t.state.type)),t.state.target.append(o);var a=document.createElement("div");a.classList.add("meta-".concat(n,"-overlay")),t.state.shown&&a.classList.add("meta-".concat(n,"-overlay__open")),t.state.loading&&a.classList.add("meta-".concat(n,"-overlay__loading")),t.state.error&&a.classList.add("meta-".concat(n,"-overlay__error")),o.append(a);var i=document.createElement("div");i.classList.add("meta-content"),a.append(i);var s=document.createElement("button");if(s.classList.add("meta-nav","meta-close","a"),s.innerHTML=' Close',s.addEventListener("click",(function(e){e.preventDefault(),t.hide()})),i.append(s),r){var c=r.getAttribute("data-gallery");if(c&&t.state.collections[c].length>1){var u=document.createElement("nav");u.classList.add("meta-navs");var f=document.createElement("button");f.classList.add("meta-nav","meta-nav-arrow","meta-nav-arrow__prev","a"),f.innerHTML=' Previous',f.addEventListener("click",(function(e){e.preventDefault(),t.prev()})),u.append(f);var l=document.createElement("button");l.classList.add("meta-nav","meta-nav-arrow","meta-nav-arrow__next","a"),l.innerHTML=' Next',l.addEventListener("click",(function(e){e.preventDefault(),t.next()})),u.append(l),i.append(u)}}var d=document.createElement("section");if(d.classList.add("meta-wrap","typography"),d.innerHTML=t.getHtml(),i.append(d),t.state.error){var p=document.createElement("div");p.classList.add("meta-error"),p.innerHTML=t.state.error,i.append(p)}else if(t.state.caption){var m=document.createElement("div");m.classList.add("meta-caption"),m.innerHTML=t.getCaption(),i.append(m)}return t}}]),MetaWindow}(),a=document.getElementById("MetaLightboxApp");a||console.log("MetaWindow: missing container #MetaLightboxApp");var i=new o({target:a}),s=function init(){i.init()};window.addEventListener("".concat(t),s),window.addEventListener("".concat(e),s),window.addEventListener("MetaWindow.initLinks",s),window.MetaWindow=i}()}(); \ No newline at end of file +!function(){var e={722:function(e,t,n){e.exports=n(895)},196:function(e,t,n){"use strict";var r=n(695),o=n(30),a=n(305),i=n(999),s=n(492),c=n(867),u=n(751),f=n(174);e.exports=function xhrAdapter(e){return new Promise((function dispatchXhrRequest(t,n){var l=e.data,d=e.headers;r.isFormData(l)&&delete d["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var m=e.auth.username||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";d.Authorization="Basic "+btoa(m+":"+h)}var g=s(e.baseURL,e.url);if(p.open(e.method.toUpperCase(),i(g,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function handleLoad(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in p?c(p.getAllResponseHeaders()):null,a={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:e,request:p};o(t,n,a),p=null}},p.onabort=function handleAbort(){p&&(n(f("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function handleError(){n(f("Network Error",e,null,p)),p=null},p.ontimeout=function handleTimeout(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(f(t,e,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var y=(e.withCredentials||u(g))&&e.xsrfCookieName?a.read(e.xsrfCookieName):void 0;y&&(d[e.xsrfHeaderName]=y)}if("setRequestHeader"in p&&r.forEach(d,(function setRequestHeader(e,t){"undefined"===typeof l&&"content-type"===t.toLowerCase()?delete d[t]:p.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),e.responseType)try{p.responseType=e.responseType}catch(v){if("json"!==e.responseType)throw v}"function"===typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function onCanceled(e){p&&(p.abort(),n(e),p=null)})),l||(l=null),p.send(l)}))}},895:function(e,t,n){"use strict";var r=n(695),o=n(129),a=n(653),i=n(309);function createInstance(e){var t=new a(e),n=o(a.prototype.request,t);return r.extend(n,a.prototype,t),r.extend(n,t),n}var s=createInstance(n(933));s.Axios=a,s.create=function create(e){return createInstance(i(s.defaults,e))},s.Cancel=n(638),s.CancelToken=n(114),s.isCancel=n(539),s.all=function all(e){return Promise.all(e)},s.spread=n(522),s.isAxiosError=n(431),e.exports=s,e.exports.default=s},638:function(e){"use strict";function Cancel(e){this.message=e}Cancel.prototype.toString=function toString(){return"Cancel"+(this.message?": "+this.message:"")},Cancel.prototype.__CANCEL__=!0,e.exports=Cancel},114:function(e,t,n){"use strict";var r=n(638);function CancelToken(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function promiseExecutor(e){t=e}));var n=this;e((function cancel(e){n.reason||(n.reason=new r(e),t(n.reason))}))}CancelToken.prototype.throwIfRequested=function throwIfRequested(){if(this.reason)throw this.reason},CancelToken.source=function source(){var e;return{token:new CancelToken((function executor(t){e=t})),cancel:e}},e.exports=CancelToken},539:function(e){"use strict";e.exports=function isCancel(e){return!(!e||!e.__CANCEL__)}},653:function(e,t,n){"use strict";var r=n(695),o=n(999),a=n(328),i=n(570),s=n(309);function Axios(e){this.defaults=e,this.interceptors={request:new a,response:new a}}Axios.prototype.request=function request(e){"string"===typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=s(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[i,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function unshiftRequestInterceptors(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function pushResponseInterceptors(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},Axios.prototype.getUri=function getUri(e){return e=s(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function forEachMethodNoData(e){Axios.prototype[e]=function(t,n){return this.request(s(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function forEachMethodWithData(e){Axios.prototype[e]=function(t,n,r){return this.request(s(r||{},{method:e,url:t,data:n}))}})),e.exports=Axios},328:function(e,t,n){"use strict";var r=n(695);function InterceptorManager(){this.handlers=[]}InterceptorManager.prototype.use=function use(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},InterceptorManager.prototype.eject=function eject(e){this.handlers[e]&&(this.handlers[e]=null)},InterceptorManager.prototype.forEach=function forEach(e){r.forEach(this.handlers,(function forEachHandler(t){null!==t&&e(t)}))},e.exports=InterceptorManager},492:function(e,t,n){"use strict";var r=n(794),o=n(296);e.exports=function buildFullPath(e,t){return e&&!r(t)?o(e,t):t}},174:function(e,t,n){"use strict";var r=n(2);e.exports=function createError(e,t,n,o,a){var i=new Error(e);return r(i,t,n,o,a)}},570:function(e,t,n){"use strict";var r=n(695),o=n(554),a=n(539),i=n(933);function throwIfCancellationRequested(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function dispatchRequest(e){return throwIfCancellationRequested(e),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function cleanHeaderConfig(t){delete e.headers[t]})),(e.adapter||i.adapter)(e).then((function onAdapterResolution(t){return throwIfCancellationRequested(e),t.data=o(t.data,t.headers,e.transformResponse),t}),(function onAdapterRejection(t){return a(t)||(throwIfCancellationRequested(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},2:function(e){"use strict";e.exports=function enhanceError(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},309:function(e,t,n){"use strict";var r=n(695);e.exports=function mergeConfig(e,t){t=t||{};var n={},o=["url","method","data"],a=["headers","auth","proxy","params"],i=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],s=["validateStatus"];function getMergedValue(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function mergeDeepProperties(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(n[o]=getMergedValue(void 0,e[o])):n[o]=getMergedValue(e[o],t[o])}r.forEach(o,(function valueFromConfig2(e){r.isUndefined(t[e])||(n[e]=getMergedValue(void 0,t[e]))})),r.forEach(a,mergeDeepProperties),r.forEach(i,(function defaultToConfig2(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(n[o]=getMergedValue(void 0,e[o])):n[o]=getMergedValue(void 0,t[o])})),r.forEach(s,(function merge(r){r in t?n[r]=getMergedValue(e[r],t[r]):r in e&&(n[r]=getMergedValue(void 0,e[r]))}));var c=o.concat(a).concat(i).concat(s),u=Object.keys(e).concat(Object.keys(t)).filter((function filterAxiosKeys(e){return-1===c.indexOf(e)}));return r.forEach(u,mergeDeepProperties),n}},30:function(e,t,n){"use strict";var r=n(174);e.exports=function settle(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},554:function(e,t,n){"use strict";var r=n(695);e.exports=function transformData(e,t,n){return r.forEach(n,(function transform(n){e=n(e,t)})),e}},933:function(e,t,n){"use strict";var r=n(695),o=n(965),a={"Content-Type":"application/x-www-form-urlencoded"};function setContentTypeIfUnset(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var i={adapter:function getDefaultAdapter(){var e;return("undefined"!==typeof XMLHttpRequest||"undefined"!==typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(e=n(196)),e}(),transformRequest:[function transformRequest(e,t){return o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(setContentTypeIfUnset(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)?(setContentTypeIfUnset(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function transformResponse(e){if("string"===typeof e)try{e=JSON.parse(e)}catch(t){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function validateStatus(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function forEachMethodNoData(e){i.headers[e]={}})),r.forEach(["post","put","patch"],(function forEachMethodWithData(e){i.headers[e]=r.merge(a)})),e.exports=i},129:function(e){"use strict";e.exports=function bind(e,t){return function wrap(){for(var n=new Array(arguments.length),r=0;r=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([n]):i[t]?i[t]+", "+n:n}})),i):i}},522:function(e){"use strict";e.exports=function spread(e){return function wrap(t){return e.apply(null,t)}}},695:function(e,t,n){"use strict";function _typeof(e){return(_typeof="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function _typeof(e){return typeof e}:function _typeof(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r=n(129),o=Object.prototype.toString;function isArray(e){return"[object Array]"===o.call(e)}function isUndefined(e){return"undefined"===typeof e}function isObject(e){return null!==e&&"object"===_typeof(e)}function isPlainObject(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function isFunction(e){return"[object Function]"===o.call(e)}function forEach(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==_typeof(e)&&(e=[e]),isArray(e))for(var n=0,r=e.length;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{shown:!1},o=arguments.length>1?arguments[1]:void 0;_classCallCheck(this,MetaWindow),_defineProperty(this,"state",{content:"",type:["empty"],shown:!1,loading:!1,error:!1,embed:!1,collections:[],current:null,target:null}),_defineProperty(this,"show",(function(){var t=e;console.log("".concat(t.name,": show")),t.setState({shown:!0}),n.dispatchEvent(new Event("{ui.name}.show"))})),_defineProperty(this,"hide",(function(){var t=e;console.log("".concat(t.name,": hide")),t.setState({shown:!1}),n.dispatchEvent(new Event("{ui.name}.hide"))})),_defineProperty(this,"next",(function(){var t=e,r=t.state.current.getAttribute("data-gallery"),o=t._currIndex();o0?o--:o=t.state.collections[r].length-1,t.state.collections[r][o].click(),console.log("".concat(t.name,": prev")),n.dispatchEvent(new Event("{ui.name}.prev"))})),_defineProperty(this,"reset",(function(){e.setState({content:"",type:["empty"],shown:!1,loading:!1,error:!1,embed:!1})})),_defineProperty(this,"load",(function(t){var r=e,o=r.axios;r.reset(),r.setState({loading:!0}),r.show(),o.get(t,{responseType:"arraybuffer"}).then((function(e){console.log("".concat(r.name,": response content-type: ").concat(e.headers["content-type"]));switch(e.headers["content-type"]){case"image/jpeg":case"image/png":case"image/svg+xml":case"image/bmp":case"image/gif":case"image/tiff":case"image/webp":case"image/jpg":case"image/svg":r.setContent(''),"meta-".concat(r.name,"--image"));break;case"application/json":case"application/ld+json":case"application/json; charset=UTF-8":r.setContent("".concat((!1).Content),["meta-".concat(r.name,"--text"),"meta-".concat(r.name,"--html"),"meta-".concat(r.name,"--json")]);break;case"text/html":case"application/xhtml+xml":case"text/plain":case"text/html; charset=UTF-8":case"application/xhtml+xml; charset=UTF-8":case"text/plain; charset=UTF-8":r.setContent(r._abToString(e.data),["meta-".concat(r.name,"--text"),"meta-".concat(r.name,"--html"),"meta-".concat(r.name,"--pajax")]);break;default:console.warn("".concat(r.name,": Unknown response content-type!"))}n.dispatchEvent(new Event("{ui.name}.loaded"))})).catch((function(e){console.error(e);var t="";if(e.response)switch(e.response.status){case 404:t="Not Found.";break;case 500:t="Server issue, please try again latter.";break;default:t="Something went wrong."}else e.request?t="No response received":console.warn("Error",e.message);r.setState({error:t}),n.dispatchEvent(new Event("{ui.name}.error"))})).then((function(){r.setState({loading:!1})}))})),_defineProperty(this,"_currIndex",(function(){var t=e,n=t.state.current,r=n.getAttribute("data-gallery");return t.state.collections[r].indexOf(n)})),_defineProperty(this,"embed",(function(t){var n=e;console.log("".concat(n.name,": embed")),n.reset(),n.setState({embed:t,loading:!1,type:["meta-".concat(n.name,"--embed"),"meta-".concat(n.name,"--video")]}),n.show()})),_defineProperty(this,"setCaption",(function(t){var n=e;console.log("".concat(n.name,": setCaption")),n.state.caption=t})),_defineProperty(this,"getCaption",(function(){return e.state.caption})),_defineProperty(this,"_abToString",(function(e){return String.fromCharCode.apply(null,new Uint8Array(e))})),_defineProperty(this,"_imageEncode",(function(e){new Uint8Array(e);return btoa([].reduce.call(new Uint8Array(e),(function(e,t){return e+String.fromCharCode(t)}),""))})),_defineProperty(this,"setContent",(function(t,n){var r=e;console.log("".concat(r.name,": setContent"));var o=n||["meta-".concat(r.name,"--html"),"meta-".concat(r.name,"--text")];Array.isArray(o)||(o=n.split(" ")),r.setState({content:t,type:o})})),_defineProperty(this,"getHtml",(function(){var t=e;if(t.state.embed){var n=__webpack_require__(46)(t.state.embed);t.state.content='')}return t.state.content}));var a=this;switch(a.name=a.constructor.name,console.log("".concat(a.name,": init")),a.axios=r,a.setState(t),o){case"show":case"hide":a.hide()}n.dispatchEvent(new Event("{ui.name}.init"))}return function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}(MetaWindow,[{key:"init",value:function init(){var e=this;console.log("MetaWindow: [links] init"),document.querySelectorAll('[data-toggle="lightbox"],[data-gallery="${gallery}"]').forEach((function(t){var n=t.getAttribute("data-gallery");n&&(e.state.collections[n]=[],document.querySelectorAll('[data-toggle="lightbox"][data-gallery="'.concat(n,'"]')).forEach((function(t){e.state.collections[n].push(t)}))),t.addEventListener("click",(function(t){t.preventDefault(),console.log("MetaWindow: [link] click");var n=t.currentTarget,r=n.getAttribute("href")||n.getAttribute("data-href"),o=n.getAttribute("data-embed");e.state.current=n,o?e.embed(r):e.load(r);var a=n.getAttribute("data-title");a&&e.setCaption(a)}))}))}},{key:"setState",value:function setState(e){var t=this;t.state=Object.assign({},t.state,e),t.render()}},{key:"render",value:function render(){var e,t=this,n=t.name,r=t.state.current;t.state.target.innerHTML="";var o=document.createElement("div");o.classList.add("meta-".concat(n)),(e=o.classList).add.apply(e,_toConsumableArray(t.state.type)),t.state.target.append(o);var a=document.createElement("div");a.classList.add("meta-".concat(n,"-overlay")),t.state.shown&&a.classList.add("meta-".concat(n,"-overlay--open")),t.state.loading&&a.classList.add("meta-".concat(n,"-overlay--loading")),t.state.error&&a.classList.add("meta-".concat(n,"-overlay--error")),o.append(a);var i=document.createElement("div");i.classList.add("meta-content"),a.append(i);var s=document.createElement("button");if(s.classList.add("meta-nav","meta-close","a"),s.innerHTML=' Close',s.addEventListener("click",(function(e){e.preventDefault(),t.hide()})),i.append(s),r){var c=r.getAttribute("data-gallery");if(c&&t.state.collections[c].length>1){var u=document.createElement("nav");u.classList.add("meta-navs");var f=document.createElement("button");f.classList.add("meta-nav","meta-nav-arrow","meta-nav-arrow__prev","a"),f.innerHTML=' Previous',f.addEventListener("click",(function(e){e.preventDefault(),t.prev()})),u.append(f);var l=document.createElement("button");l.classList.add("meta-nav","meta-nav-arrow","meta-nav-arrow__next","a"),l.innerHTML=' Next',l.addEventListener("click",(function(e){e.preventDefault(),t.next()})),u.append(l),i.append(u)}}var d=document.createElement("section");if(d.classList.add("meta-wrap","typography"),d.innerHTML=t.getHtml(),i.append(d),t.state.error){var p=document.createElement("div");p.classList.add("meta-error"),p.innerHTML=t.state.error,i.append(p)}else if(t.state.caption){var m=document.createElement("div");m.classList.add("meta-caption"),m.innerHTML=t.getCaption(),i.append(m)}return t}}]),MetaWindow}(),a=document.getElementById("MetaLightboxApp");a||console.log("MetaWindow: missing container #MetaLightboxApp");var i=new o({target:a}),s=function init(){i.init()};window.addEventListener("".concat(t),s),window.addEventListener("".concat(e),s),window.addEventListener("MetaWindow.initLinks",s),window.MetaWindow=i}()}(); \ No newline at end of file diff --git a/dist/report.html b/dist/report.html index ec7235a..743be92 100644 --- a/dist/report.html +++ b/dist/report.html @@ -3,7 +3,7 @@ - @a2nt/meta-lightbox-js [18 Aug 2021 at 19:18] + @a2nt/meta-lightbox-js [18 Aug 2021 at 21:11] diff --git a/package.json b/package.json index 45edcc8..effd500 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@a2nt/meta-lightbox-js", - "version": "4.1.0", + "version": "4.1.1", "description": "Universal lightbox", "author": "Tony Air ", "license": "BSD-2-Clause", @@ -14,20 +14,19 @@ "yarn": ">= 1.22.0" }, "scripts": { - "start": "cross-env NODE_ENV=development webpack-dev-server --config webpack.config.serve.js", + "start": "cross-env NODE_ENV=development webpack-dev-server --config webpack.config.serve.js", "dash": "cross-env NODE_ENV=development webpack-dashboard -- webpack-dev-server --config webpack.config.serve.js", "build": "cross-env NODE_ENV=production webpack --progress --stats-all", - "lint:check": "eslint ./src --config eslint.config.json && sass-lint ./src --config sass-lint.yml -v -q", - "lint:fix": "eslint ./src --config eslint.config.json --fix && sass-lint-auto-fix -c ./sass-lint.yml './src/scss/*'", - "lint:js": "eslint ./src --config eslint.config.json", - "lint:sass": "sass-lint ./src --config sass-lint.yml -v -q", - "prebuild": "yarn lint:fix && rimraf dist", - "prepare": "yarn lint:fix && yarn build", + "lint:fix": "eslint './src/**/*.js' -c eslint.config.json --fix && sass-lint-auto-fix -s -c ./sass-lint.yml './src/**/*.scss'", + "lint:js": "eslint './src/**/*.js' -c eslint.config.json", + "lint:scss": "sass-lint ./src/**/*.scss -c sass-lint.yml -v", + "lint:check": "yarn lint:js && yarn lint:scss", + "prebuild": "yarn lint:fix && yarn lint:check && rimraf dist", + "prepare": "yarn build", "prunecaches": "rimraf ./node_modules/.cache/", "postinstall": "npm run prunecaches", "postuninstall": "npm run prunecaches", - "preinstall": "npx only-allow pnpm", - "update": "npx msw init ./src/_graphql" + "preinstall": "npx only-allow pnpm" }, "directories": { "assets": { diff --git a/sass-lint.yml b/sass-lint.yml index 75c4759..ba4811b 100755 --- a/sass-lint.yml +++ b/sass-lint.yml @@ -18,8 +18,8 @@ rules: nesting-depth: - 1 - max-depth: 3 - no-ids: 1 - no-important: 1 + no-ids: 0 + no-important: 0 no-misspelled-properties: - 1 - extra-properties: @@ -54,7 +54,7 @@ rules: clean-import-paths: - 2 - filename-extension: false - leading-underscore: false + - leading-underscore: true no-debug: 2 no-empty-rulesets: 2 no-invalid-hex: 2 diff --git a/src/html/meta-lightbox.html b/src/html/meta-lightbox.html index eb03b6d..87d3764 100755 --- a/src/html/meta-lightbox.html +++ b/src/html/meta-lightbox.html @@ -1,65 +1,108 @@
-
-

Loading data

-

- Load an Image -
- - Load JSON - -
- - Load Partial AJAX HTML
- - Not Found test - -

-

Embeds

-

- Embed Youtube link -
- Embed Vimeo link -
- Embed SoundCloud link
- Embed Instagram -

-

Other

-

- - Use [data-toggle="lightbox"] attribute to attach lightbox action - and [href] to specify URL. - -

-

- - Use [data-gallery="YOUR_GALLERY_NAME"] to group ligthboxes with - next/prev arrows - -

-

- - Use [data-gallery="YOUR_GALLERY_NAME"] to group ligthboxes with - next/prev arrows - -

-

- Use [data-toggle="lightbox"] + [data-href] attribute to toggle - lightbox on regular elements. - Click me! -

-
-
+
+

Loading data

+

+ Load an Image +
+ Load JSON + +
+ + Load Partial AJAX HTML
+ + Not Found test + +

+

Embeds

+

+ Embed Youtube link +
+ Embed Vimeo link +
+ Embed SoundCloud link
+ Embed Instagram +

+

Other

+

+ + Use [data-toggle="lightbox"] attribute to attach lightbox action and + [href] to specify URL. + +

+

+ + Use [data-gallery="YOUR_GALLERY_NAME"] to group ligthboxes with + next/prev arrows + +

+

+ + Use [data-gallery="YOUR_GALLERY_NAME"] to group ligthboxes with + next/prev arrows + +

+

+ Use [data-toggle="lightbox"] + [data-href] attribute to toggle lightbox on + regular elements. + Click me! +

+
+
diff --git a/src/index.html b/src/index.html index eac0ce5..e6d7b16 100755 --- a/src/index.html +++ b/src/index.html @@ -1,36 +1,40 @@ - - + - + Meta-lightbox Demo - + - +
-

Meta-lightbox Demo

- NODE_ENV: - <%= NODE_ENV %> - <%= - require('html-loader!./html/meta-lightbox.html').default %> -
+

Meta-lightbox Demo

+ NODE_ENV: <%= NODE_ENV %> <%= + require('html-loader!./html/meta-lightbox.html').default %> +
<%= REACT_SCRIPTS %> - - - - + + + diff --git a/src/js/_events.js b/src/js/_events.js index 48405e0..a2bdd6b 100755 --- a/src/js/_events.js +++ b/src/js/_events.js @@ -3,41 +3,41 @@ */ export default { - AJAX: 'ajax-load', - AJAXMAIN: 'ajax-main-load', - MAININIT: 'main-init', - TABHIDDEN: 'tab-hidden', - TABFOCUSED: 'tab-focused', - OFFLINE: 'offline', - ONLINE: 'online', - BACKONLINE: 'back-online', - TOUCHENABLE: 'touch-enabled', - TOUCHDISABLED: 'touch-disabled', - LOADED: 'load', - SWIPELEFT: 'swipeleft panleft', - SWIPERIGHT: 'swiperight panright', - ALLERTAPPEARED: 'alert-appeared', - ALERTREMOVED: 'alert-removed', - LOADEDANDREADY: 'load-ready', - LAZYIMAGEREADY: 'image-lazy-bg-loaded', - LAZYIMAGESREADY: 'images-lazy-loaded', - MAPLOADED: 'map-loaded', - MAPAPILOADED: 'map-api-loaded', - MAPMARKERCLICK: 'map-marker-click', - MAPPOPUPCLOSE: 'map-popup-close', - SCROLL: 'scroll', - RESIZE: 'resize', - CAROUSEL_READY: 'bs.carousel.ready', - SET_TARGET_UPDATE: 'set-target-update', - RESTORE_FIELD: 'restore-field', - FORM_INIT_BASICS: 'form-basics', - FORM_INIT_STEPPED: 'form-init-stepped', - FORM_INIT_VALIDATE: 'form-init-validate', - FORM_INIT_VALIDATE_FIELD: 'form-init-validate-field', - FORM_INIT_STORAGE: 'form-init-storage', - FORM_VALIDATION_FAILED: 'form-validation-failed', - FORM_STEPPED_NEW_STEP: 'form-new-step', - FORM_STEPPED_FIRST_STEP: 'form-first-step', - FORM_STEPPED_LAST_STEP: 'form-last-step', - FORM_FIELDS: 'input,textarea,select', + AJAX: "ajax-load", + AJAXMAIN: "ajax-main-load", + MAININIT: "main-init", + TABHIDDEN: "tab-hidden", + TABFOCUSED: "tab-focused", + OFFLINE: "offline", + ONLINE: "online", + BACKONLINE: "back-online", + TOUCHENABLE: "touch-enabled", + TOUCHDISABLED: "touch-disabled", + LOADED: "load", + SWIPELEFT: "swipeleft panleft", + SWIPERIGHT: "swiperight panright", + ALLERTAPPEARED: "alert-appeared", + ALERTREMOVED: "alert-removed", + LOADEDANDREADY: "load-ready", + LAZYIMAGEREADY: "image-lazy-bg-loaded", + LAZYIMAGESREADY: "images-lazy-loaded", + MAPLOADED: "map-loaded", + MAPAPILOADED: "map-api-loaded", + MAPMARKERCLICK: "map-marker-click", + MAPPOPUPCLOSE: "map-popup-close", + SCROLL: "scroll", + RESIZE: "resize", + CAROUSEL_READY: "bs.carousel.ready", + SET_TARGET_UPDATE: "set-target-update", + RESTORE_FIELD: "restore-field", + FORM_INIT_BASICS: "form-basics", + FORM_INIT_STEPPED: "form-init-stepped", + FORM_INIT_VALIDATE: "form-init-validate", + FORM_INIT_VALIDATE_FIELD: "form-init-validate-field", + FORM_INIT_STORAGE: "form-init-storage", + FORM_VALIDATION_FAILED: "form-validation-failed", + FORM_STEPPED_NEW_STEP: "form-new-step", + FORM_STEPPED_FIRST_STEP: "form-first-step", + FORM_STEPPED_LAST_STEP: "form-last-step", + FORM_FIELDS: "input,textarea,select", }; diff --git a/src/js/app.js b/src/js/app.js index 5531649..b4d79bf 100755 --- a/src/js/app.js +++ b/src/js/app.js @@ -4,15 +4,14 @@ * */ -import Events from './_events'; -import MetaWindow from './window'; +import Events from "./_events"; +import MetaWindow from "./window"; -const container = document.getElementById('MetaLightboxApp'); +const container = document.getElementById("MetaLightboxApp"); if (!container) { console.log(`MetaWindow: missing container #MetaLightboxApp`); } - const ui = new MetaWindow({ target: container, }); diff --git a/src/js/index.js b/src/js/index.js index c6f8c7e..7132e1e 100755 --- a/src/js/index.js +++ b/src/js/index.js @@ -1,2 +1,2 @@ -import styles from '../scss/window.scss'; -import './app.js'; +import styles from "../scss/window.scss"; +import "./app.js"; diff --git a/src/js/test-build.js b/src/js/test-build.js index c786a13..591717c 100755 --- a/src/js/test-build.js +++ b/src/js/test-build.js @@ -4,9 +4,9 @@ * */ -import ui from './app'; -import '../scss/app.scss'; -import '../scss/test-build.scss'; +import ui from "./app"; +import "../scss/app.scss"; +import "../scss/test-build.scss"; /*function importAll(r) { return r.keys().map(r); diff --git a/src/js/window.js b/src/js/window.js index 35c319b..b2962ab 100755 --- a/src/js/window.js +++ b/src/js/window.js @@ -2,36 +2,38 @@ * Lightbox window */ -import Events from './_events'; +import Events from "./_events"; const W = window; -const axios = require('axios'); +const axios = require("axios"); class MetaWindow { - state = { - content: '', - type: ['empty'], - shown: false, - loading: false, - error: false, - embed: false, - collections: [], - current: null, - target: null, - }; + state = { + content: "", + type: ["empty"], + shown: false, + loading: false, + error: false, + embed: false, + collections: [], + current: null, + target: null, + }; - init() { - const ui = this; - console.log(`MetaWindow: [links] init`); + init() { + const ui = this; + console.log(`MetaWindow: [links] init`); - // collect new collections - document.querySelectorAll('[data-toggle="lightbox"],[data-gallery="${gallery}"]').forEach((el) => { - const gallery = el.getAttribute('data-gallery'); + // collect new collections + document + .querySelectorAll('[data-toggle="lightbox"],[data-gallery="${gallery}"]') + .forEach((el) => { + const gallery = el.getAttribute("data-gallery"); if (gallery) { ui.state.collections[gallery] = []; document .querySelectorAll( - `[data-toggle="lightbox"][data-gallery="${gallery}"]`, + `[data-toggle="lightbox"][data-gallery="${gallery}"]` ) .forEach((el) => { ui.state.collections[gallery].push(el); @@ -39,14 +41,13 @@ class MetaWindow { } // click handler - el.addEventListener('click', (e) => { + el.addEventListener("click", (e) => { e.preventDefault(); console.log(`MetaWindow: [link] click`); const el = e.currentTarget; - const link = - el.getAttribute('href') || el.getAttribute('data-href'); - const embed = el.getAttribute('data-embed'); + const link = el.getAttribute("href") || el.getAttribute("data-href"); + const embed = el.getAttribute("data-embed"); ui.state.current = el; if (embed) { @@ -55,392 +56,408 @@ class MetaWindow { ui.load(link); } - const title = el.getAttribute('data-title'); + const title = el.getAttribute("data-title"); if (title) { ui.setCaption(title); } }); }); - } + } - constructor(state = { + constructor( + state = { shown: false, - }, action) { - const ui = this; + }, + action + ) { + const ui = this; - ui.name = ui.constructor.name; - console.log(`${ui.name}: init`); - ui.axios = axios; + ui.name = ui.constructor.name; + console.log(`${ui.name}: init`); + ui.axios = axios; - ui.setState(state); - switch (action) { - case 'show': - ui.hide(); - break; - case 'hide': - ui.hide(); - break; - } - - W.dispatchEvent(new Event(`{ui.name}.init`)); + ui.setState(state); + switch (action) { + case "show": + ui.hide(); + break; + case "hide": + ui.hide(); + break; } - show = () => { - const ui = this; - console.log(`${ui.name}: show`); + W.dispatchEvent(new Event(`{ui.name}.init`)); + } - ui.setState({ - shown: true, - }); - W.dispatchEvent(new Event(`{ui.name}.show`)); - }; + show = () => { + const ui = this; + console.log(`${ui.name}: show`); - hide = () => { - const ui = this; + ui.setState({ + shown: true, + }); + W.dispatchEvent(new Event(`{ui.name}.show`)); + }; - console.log(`${ui.name}: hide`); - ui.setState({ - shown: false, - }); - W.dispatchEvent(new Event(`{ui.name}.hide`)); - }; + hide = () => { + const ui = this; - next = () => { - const ui = this; - const el = ui.state.current; - const gallery = el.getAttribute('data-gallery'); + console.log(`${ui.name}: hide`); + ui.setState({ + shown: false, + }); + W.dispatchEvent(new Event(`{ui.name}.hide`)); + }; - let i = ui._currIndex(); - if (i < ui.state.collections[gallery].length - 1) { - i++; - } else { - i = 0; - } + next = () => { + const ui = this; + const el = ui.state.current; + const gallery = el.getAttribute("data-gallery"); - ui.state.collections[gallery][i].click(); + let i = ui._currIndex(); + if (i < ui.state.collections[gallery].length - 1) { + i++; + } else { + i = 0; + } - console.log(`${ui.name}: next`); - W.dispatchEvent(new Event(`{ui.name}.next`)); - }; + ui.state.collections[gallery][i].click(); - prev = () => { - const ui = this; - const el = ui.state.current; - const gallery = el.getAttribute('data-gallery'); + console.log(`${ui.name}: next`); + W.dispatchEvent(new Event(`{ui.name}.next`)); + }; - let i = ui._currIndex(); - if (i > 0) { - i--; - } else { - i = ui.state.collections[gallery].length - 1; - } + prev = () => { + const ui = this; + const el = ui.state.current; + const gallery = el.getAttribute("data-gallery"); - ui.state.collections[gallery][i].click(); + let i = ui._currIndex(); + if (i > 0) { + i--; + } else { + i = ui.state.collections[gallery].length - 1; + } - console.log(`${ui.name}: prev`); - W.dispatchEvent(new Event(`{ui.name}.prev`)); - }; + ui.state.collections[gallery][i].click(); - reset = () => { - const ui = this; + console.log(`${ui.name}: prev`); + W.dispatchEvent(new Event(`{ui.name}.prev`)); + }; - ui.setState({ - content: '', - type: ['empty'], - shown: false, - loading: false, - error: false, - embed: false, - //collections: [], - //current: null, - //target: null, - }); - }; + reset = () => { + const ui = this; - load = (link) => { - const ui = this; - const axios = ui.axios; + ui.setState({ + content: "", + type: ["empty"], + shown: false, + loading: false, + error: false, + embed: false, + //collections: [], + //current: null, + //target: null, + }); + }; - ui.reset(); - ui.setState({ - loading: true, - }); - ui.show(); + load = (link) => { + const ui = this; + const axios = ui.axios; - axios - .get(link, { - responseType: 'arraybuffer', - }) - .then((resp) => { - // handle success - console.log( - `${ui.name}: response content-type: ${resp.headers['content-type']}`, - ); - const json = false; + ui.reset(); + ui.setState({ + loading: true, + }); + ui.show(); - switch (resp.headers['content-type']) { - case 'image/jpeg': - case 'image/png': - case 'image/svg+xml': - case 'image/bmp': - case 'image/gif': - case 'image/tiff': - case 'image/webp': - // irregular types: - case 'image/jpg': - case 'image/svg': - //json = JSON.parse(ui._abToString(resp.data)); - ui.setContent( - ``, - `meta-${ui.name}__image`, - ); + axios + .get(link, { + responseType: "arraybuffer", + }) + .then((resp) => { + // handle success + console.log( + `${ui.name}: response content-type: ${resp.headers["content-type"]}` + ); + const json = false; + + switch (resp.headers["content-type"]) { + case "image/jpeg": + case "image/png": + case "image/svg+xml": + case "image/bmp": + case "image/gif": + case "image/tiff": + case "image/webp": + // irregular types: + case "image/jpg": + case "image/svg": + //json = JSON.parse(ui._abToString(resp.data)); + ui.setContent( + ``, + `meta-${ui.name}--image` + ); + break; + case "application/json": + case "application/ld+json": + // irregular types: + case "application/json; charset=UTF-8": + ui.setContent(`${json["Content"]}`, [ + `meta-${ui.name}--text`, + `meta-${ui.name}--html`, + `meta-${ui.name}--json`, + ]); + + break; + case "text/html": + case "application/xhtml+xml": + case "text/plain": + // irregular types: + case "text/html; charset=UTF-8": + case "application/xhtml+xml; charset=UTF-8": + case "text/plain; charset=UTF-8": + ui.setContent(ui._abToString(resp.data), [ + `meta-${ui.name}--text`, + `meta-${ui.name}--html`, + `meta-${ui.name}--pajax`, + ]); + break; + default: + console.warn(`${ui.name}: Unknown response content-type!`); + break; + } + + W.dispatchEvent(new Event(`{ui.name}.loaded`)); + }) + .catch((error) => { + console.error(error); + + let msg = ""; + + if (error.response) { + switch (error.response.status) { + case 404: + msg = "Not Found."; break; - case 'application/json': - case 'application/ld+json': - // irregular types: - case 'application/json; charset=UTF-8': - ui.setContent(`${json['Content']}`, [ - `meta-${ui.name}__text`, - `meta-${ui.name}__html`, - `meta-${ui.name}__json`, - ]); - - break; - case 'text/html': - case 'application/xhtml+xml': - case 'text/plain': - // irregular types: - case 'text/html; charset=UTF-8': - case 'application/xhtml+xml; charset=UTF-8': - case 'text/plain; charset=UTF-8': - ui.setContent( - ui._abToString(resp.data),[ - `meta-${ui.name}__text`, - `meta-${ui.name}__html`, - `meta-${ui.name}__pajax`, - ]); + case 500: + msg = "Server issue, please try again latter."; break; default: - console.warn( - `${ui.name}: Unknown response content-type!`, - ); + msg = "Something went wrong."; break; } - - W.dispatchEvent(new Event(`{ui.name}.loaded`)); - }) - .catch((error) => { - console.error(error); - - let msg = ''; - - if (error.response) { - switch (error.response.status) { - case 404: - msg = 'Not Found.'; - break; - case 500: - msg = 'Server issue, please try again latter.'; - break; - default: - msg = 'Something went wrong.'; - break; - } - } else if (error.request) { - msg = 'No response received'; - } else { - console.warn('Error', error.message); - } - - ui.setState({ - error: msg, - }); - - W.dispatchEvent(new Event(`{ui.name}.error`)); - }) - .then(() => { - ui.setState({ - loading: false, - }); - }); - }; - - _currIndex = () => { - const ui = this; - const el = ui.state.current; - const gallery = el.getAttribute('data-gallery'); - - return ui.state.collections[gallery].indexOf(el); - }; - - embed = (link) => { - const ui = this; - console.log(`${ui.name}: embed`); - - ui.reset(); - ui.setState({ - embed: link, - loading: false, - type: [`meta-${ui.name}__embed`, `meta-${ui.name}__video`], - }); - - ui.show(); - }; - - setCaption = (title) => { - const ui = this; - console.log(`${ui.name}: setCaption`); - - ui.state.caption = title; - }; - - getCaption = () => { - const ui = this; - return ui.state.caption; - } - - _abToString = (arrayBuffer) => { - return String.fromCharCode.apply(null, new Uint8Array(arrayBuffer)); - }; - - _imageEncode = (arrayBuffer) => { - const u8 = new Uint8Array(arrayBuffer); - const b64encoded = btoa( - [].reduce.call( - new Uint8Array(arrayBuffer), - (p, c) => { - return p + String.fromCharCode(c); - }, - '', - ), - ); - - return b64encoded; - }; - - setContent = (html, type) => { - const ui = this; - console.log(`${ui.name}: setContent`); - - let typeArr = type ? type : [`meta-${ui.name}__html`, `meta-${ui.name}__text`]; - if (!Array.isArray(typeArr)) { - typeArr = type.split(' '); - } - - ui.setState({ - content: html, - type: typeArr, - }); - }; - - getHtml = () => { - const ui = this; - - if (ui.state.embed) { - const youtubeEmbed = require('youtube-embed'); - const embedLink = youtubeEmbed(ui.state.embed); - ui.state.content = ``; - } - - return ui.state.content; - }; - - setState(state) { - const ui = this; - ui.state = Object.assign({}, ui.state, state); - ui.render(); - } - - render() { - const ui = this; - const name = ui.name; - - const navs = null; - const el = ui.state.current; - - ui.state.target.innerHTML = ''; - const meta = document.createElement('div'); - meta.classList.add(`meta-${name}`); - meta.classList.add(...ui.state.type); - ui.state.target.append(meta); - - const metaOverlay = document.createElement('div'); - metaOverlay.classList.add(`meta-${name}-overlay`); - if (ui.state.shown) { - metaOverlay.classList.add(`meta-${name}-overlay__open`); - } - if (ui.state.loading) { - metaOverlay.classList.add(`meta-${name}-overlay__loading`); - } - if (ui.state.error) { - metaOverlay.classList.add(`meta-${name}-overlay__error`); - } - meta.append(metaOverlay); - - const metaContent = document.createElement('div'); - metaContent.classList.add('meta-content'); - metaOverlay.append(metaContent); - - const btnClose = document.createElement('button'); - btnClose.classList.add('meta-nav', 'meta-close', 'a'); - btnClose.innerHTML = - '' + - ' Close'; - btnClose.addEventListener('click', (e) => { - e.preventDefault(); - ui.hide(); - }); - metaContent.append(btnClose); - - if (el) { - const gallery = el.getAttribute('data-gallery'); - if (gallery && ui.state.collections[gallery].length > 1) { - const navs = document.createElement('nav'); - navs.classList.add('meta-navs'); - - const prevBtn = document.createElement('button'); - prevBtn.classList.add('meta-nav', 'meta-nav-arrow', 'meta-nav-arrow__prev', 'a'); - prevBtn.innerHTML = '' + - ' Previous'; - prevBtn.addEventListener('click', (e) => { - e.preventDefault(); - ui.prev(); - }); - navs.append(prevBtn); - - const nextBtn = document.createElement('button'); - nextBtn.classList.add('meta-nav', 'meta-nav-arrow', 'meta-nav-arrow__next', 'a'); - nextBtn.innerHTML = '' + - ' Next'; - nextBtn.addEventListener('click', (e) => { - e.preventDefault(); - ui.next(); - }); - navs.append(nextBtn); - - metaContent.append(navs); + } else if (error.request) { + msg = "No response received"; + } else { + console.warn("Error", error.message); } - } - const content = document.createElement('section'); - content.classList.add('meta-wrap', 'typography'); - content.innerHTML = ui.getHtml(); - metaContent.append(content); + ui.setState({ + error: msg, + }); - if (ui.state.error) { - const error = document.createElement('div'); - error.classList.add('meta-error'); - error.innerHTML = ui.state.error; - metaContent.append(error); - } else if (ui.state.caption) { - const caption = document.createElement('div'); - caption.classList.add('meta-caption'); - caption.innerHTML = ui.getCaption(); - metaContent.append(caption); - } + W.dispatchEvent(new Event(`{ui.name}.error`)); + }) + .then(() => { + ui.setState({ + loading: false, + }); + }); + }; - return ui; + _currIndex = () => { + const ui = this; + const el = ui.state.current; + const gallery = el.getAttribute("data-gallery"); + + return ui.state.collections[gallery].indexOf(el); + }; + + embed = (link) => { + const ui = this; + console.log(`${ui.name}: embed`); + + ui.reset(); + ui.setState({ + embed: link, + loading: false, + type: [`meta-${ui.name}--embed`, `meta-${ui.name}--video`], + }); + + ui.show(); + }; + + setCaption = (title) => { + const ui = this; + console.log(`${ui.name}: setCaption`); + + ui.state.caption = title; + }; + + getCaption = () => { + const ui = this; + return ui.state.caption; + }; + + _abToString = (arrayBuffer) => { + return String.fromCharCode.apply(null, new Uint8Array(arrayBuffer)); + }; + + _imageEncode = (arrayBuffer) => { + const u8 = new Uint8Array(arrayBuffer); + const b64encoded = btoa( + [].reduce.call( + new Uint8Array(arrayBuffer), + (p, c) => { + return p + String.fromCharCode(c); + }, + "" + ) + ); + + return b64encoded; + }; + + setContent = (html, type) => { + const ui = this; + console.log(`${ui.name}: setContent`); + + let typeArr = type + ? type + : [`meta-${ui.name}--html`, `meta-${ui.name}--text`]; + if (!Array.isArray(typeArr)) { + typeArr = type.split(" "); } + + ui.setState({ + content: html, + type: typeArr, + }); + }; + + getHtml = () => { + const ui = this; + + if (ui.state.embed) { + const youtubeEmbed = require("youtube-embed"); + const embedLink = youtubeEmbed(ui.state.embed); + ui.state.content = ``; + } + + return ui.state.content; + }; + + setState(state) { + const ui = this; + ui.state = Object.assign({}, ui.state, state); + ui.render(); + } + + render() { + const ui = this; + const name = ui.name; + + const navs = null; + const el = ui.state.current; + + ui.state.target.innerHTML = ""; + const meta = document.createElement("div"); + meta.classList.add(`meta-${name}`); + meta.classList.add(...ui.state.type); + ui.state.target.append(meta); + + const metaOverlay = document.createElement("div"); + metaOverlay.classList.add(`meta-${name}-overlay`); + if (ui.state.shown) { + metaOverlay.classList.add(`meta-${name}-overlay--open`); + } + if (ui.state.loading) { + metaOverlay.classList.add(`meta-${name}-overlay--loading`); + } + if (ui.state.error) { + metaOverlay.classList.add(`meta-${name}-overlay--error`); + } + meta.append(metaOverlay); + + const metaContent = document.createElement("div"); + metaContent.classList.add("meta-content"); + metaOverlay.append(metaContent); + + const btnClose = document.createElement("button"); + btnClose.classList.add("meta-nav", "meta-close", "a"); + btnClose.innerHTML = + '' + + ' Close'; + btnClose.addEventListener("click", (e) => { + e.preventDefault(); + ui.hide(); + }); + metaContent.append(btnClose); + + if (el) { + const gallery = el.getAttribute("data-gallery"); + if (gallery && ui.state.collections[gallery].length > 1) { + const navs = document.createElement("nav"); + navs.classList.add("meta-navs"); + + const prevBtn = document.createElement("button"); + prevBtn.classList.add( + "meta-nav", + "meta-nav-arrow", + "meta-nav-arrow__prev", + "a" + ); + prevBtn.innerHTML = + '' + + ' Previous'; + prevBtn.addEventListener("click", (e) => { + e.preventDefault(); + ui.prev(); + }); + navs.append(prevBtn); + + const nextBtn = document.createElement("button"); + nextBtn.classList.add( + "meta-nav", + "meta-nav-arrow", + "meta-nav-arrow__next", + "a" + ); + nextBtn.innerHTML = + '' + + ' Next'; + nextBtn.addEventListener("click", (e) => { + e.preventDefault(); + ui.next(); + }); + navs.append(nextBtn); + + metaContent.append(navs); + } + } + + const content = document.createElement("section"); + content.classList.add("meta-wrap", "typography"); + content.innerHTML = ui.getHtml(); + metaContent.append(content); + + if (ui.state.error) { + const error = document.createElement("div"); + error.classList.add("meta-error"); + error.innerHTML = ui.state.error; + metaContent.append(error); + } else if (ui.state.caption) { + const caption = document.createElement("div"); + caption.classList.add("meta-caption"); + caption.innerHTML = ui.getCaption(); + metaContent.append(caption); + } + + return ui; + } } export default MetaWindow; diff --git a/src/scss/_variables.scss b/src/scss/_variables.scss index b10de34..9a81dd1 100755 --- a/src/scss/_variables.scss +++ b/src/scss/_variables.scss @@ -1,6 +1,6 @@ @use "sass:math"; -@import 'material-design-color/material-color.scss'; +@import "material-design-color/material-color"; $red: $clr-red; $body-bg: $clr-white !default; $body-color: $clr-black !default; @@ -12,8 +12,8 @@ $meta-overlay-bg: transparentize($clr-black, 0.2) !default; $meta-text-wrapper-bg: $body-bg !default; $meta-text-wrapper-color: $body-color !default; -$meta-text-wrapper-padding-width: $grid-gutter-width*0.5 !default; -$meta-text-wrapper-padding-height: $grid-gutter-height*0.5 !default; +$meta-text-wrapper-padding-width: $grid-gutter-width * 0.5 !default; +$meta-text-wrapper-padding-height: $grid-gutter-height * 0.5 !default; $meta-nav-size: 2rem !default; $meta-nav-arrows-size: 2.5rem !default; @@ -38,45 +38,45 @@ $meta-video-width: 16 !default; $meta-video-height: 9 !default; // extra variables and mixings -$grid-breakpoints: (xs: 0, -sm: 576px, -md: 768px, -lg: 992px, -xl: 1200px, -xxl: 1390px, -xxxl: 1590px, +$grid-breakpoints: ( + xs: 0, + sm: 576px, + md: 768px, + lg: 992px, + xl: 1200px, + xxl: 1390px, + xxxl: 1590px, ) !default; -$container-max-widths: (sm: 540px, -md: 720px, -lg: 960px, -xl: 1140px, -xxl: 1330px, -xxxl: 1560px, +$container-max-widths: ( + sm: 540px, + md: 720px, + lg: 960px, + xl: 1140px, + xxl: 1330px, + xxxl: 1560px, ) !default; // hovers @mixin hover-focus() { - - &:hover, - &:focus { - @content; - } + &:hover, + &:focus { + @content; + } } @mixin hover-focus-active() { - - &:hover, - &:focus, - &:active { - @content; - } + &:hover, + &:focus, + &:active { + @content; + } } @mixin spinner_style() { - color: $meta-spinner-color; - font-size: $meta-spinner-size; - font-weight: $meta-spinner-weight; - text-transform: uppercase; + color: $meta-spinner-color; + font-size: $meta-spinner-size; + font-weight: $meta-spinner-weight; + text-transform: uppercase; } // screen reader @@ -86,35 +86,33 @@ xxxl: 1560px, // See: https://hugogiraudel.com/2016/10/13/css-hide-and-seek/ @mixin sr-only() { - border: 0; - clip: rect(0, 0, 0, 0); - height: 1px; - margin: -1px; // Fix for https://github.com/twbs/bootstrap/issues/25686 - overflow: hidden; - padding: 0; - position: absolute; - white-space: nowrap; - width: 1px; + border: 0; + clip: rect(0, 0, 0, 0); + height: 1px; + margin: -1px; // Fix for https://github.com/twbs/bootstrap/issues/25686 + overflow: hidden; + padding: 0; + position: absolute; + white-space: nowrap; + width: 1px; } -@mixin pseudo($display: block, $pos: absolute, $content: '') { - content: $content; - display: $display; - position: $pos; +@mixin pseudo($display: block, $pos: absolute, $content: "") { + content: $content; + display: $display; + position: $pos; } @mixin responsive-ratio($x, $y, $pseudo: false) { - $padding: unquote(math.div($y, $x) * 100 + '%'); + $padding: unquote(math.div($y, $x) * 100 + "%"); - @if $pseudo { - &:before { - @include pseudo($pos: relative); - padding-top: $padding; - width: 100%; - } - } - - @else { - padding-top: $padding; + @if $pseudo { + &:before { + @include pseudo($pos: relative); + padding-top: $padding; + width: 100%; } + } @else { + padding-top: $padding; + } } diff --git a/src/scss/app.scss b/src/scss/app.scss index e8fbdfa..3ea2286 100755 --- a/src/scss/app.scss +++ b/src/scss/app.scss @@ -1 +1 @@ -@import './window'; +@import "./window"; diff --git a/src/scss/test-build.scss b/src/scss/test-build.scss index 2a203d0..b5c5267 100755 --- a/src/scss/test-build.scss +++ b/src/scss/test-build.scss @@ -1,12 +1,12 @@ .visually-hidden, .visually-hidden-focusable:not(:focus):not(:focus-within) { - border: 0 !important; - clip: rect(0, 0, 0, 0) !important; - height: 1px !important; - margin: -1px !important; - overflow: hidden !important; - padding: 0 !important; - position: absolute !important; - white-space: nowrap !important; - width: 1px !important; + border: 0 !important; + clip: rect(0, 0, 0, 0) !important; + height: 1px !important; + margin: -1px !important; + overflow: hidden !important; + padding: 0 !important; + position: absolute !important; + white-space: nowrap !important; + width: 1px !important; } diff --git a/src/scss/window.scss b/src/scss/window.scss index 423e6f9..2f92079 100755 --- a/src/scss/window.scss +++ b/src/scss/window.scss @@ -1,250 +1,246 @@ -@import '_variables'; +@import "variables"; -$module_name: 'meta-MetaWindow'; +$module-name: "meta-MetaWindow"; -.#{$module_name} { +.#{$module-name} { + position: fixed; + + // lightbox inner elements + .meta-spinner--embed, + .meta-spinner, + .meta-error { + align-items: center; + display: none; + justify-content: center; + text-align: center; + z-index: 2; + } + + .meta-spinner--embed, + .meta-spinner { + @include spinner_style(); + + bottom: 0; + left: 0; + position: absolute; + right: 0; + top: 0; + } + + .meta-error { + color: $clr-red; + font-size: 1.5em; + font-weight: bold; + } + + .meta-spinner--embed { + display: flex; + } + + &-overlay { + align-items: center; + background: $meta-overlay-bg; + bottom: 0; + display: none; + justify-content: center; + left: 0; position: fixed; + right: 0; + top: 0; + z-index: 98; - // lightbox inner elements - .meta-spinner_embed, - .meta-spinner, - .meta-error { - align-items: center; - display: none; - justify-content: center; - text-align: center; - z-index: 2; + // meta states + &--open { + display: flex; } - .meta-spinner_embed, - .meta-spinner { - @include spinner_style(); - - bottom: 0; - left: 0; - position: absolute; - right: 0; - top: 0; - } - - .meta-error { - color: $clr-red; - font-size: 1.5em; - font-weight: bold; - } - - .meta-spinner_embed { + &--loading { + .meta-spinner { display: flex; + } } - &-overlay { - align-items: center; - background: $meta-overlay-bg; - bottom: 0; - display: none; + &--error { + .meta-content { justify-content: center; - left: 0; - position: fixed; - right: 0; - top: 0; - z-index: 98; + } - // meta states - &__open { - display: flex; - } - - &__loading { - .meta-spinner { - display: flex; - } - } - - &__error { - .meta-content { - justify-content: center; - } - - .meta-error { - display: flex; - } - } - } - - // navs - .meta-nav { - background: none; - border: 0; - color: $meta-nav-color; - font-size: $meta-nav-size; - text-shadow: $meta-nav-hover-shadow 0 0 0.25em; - z-index: 2; - - @include hover-focus() { - color: $meta-nav-color; - } - - &:hover { - background: $meta-nav-hover-bg; - color: $meta-nav-hover-color; - text-decoration: none; - text-shadow: none; - } - - } - - .meta-nav-arrow { - align-items: center; - bottom: 0; + .meta-error { display: flex; - font-size: $meta-nav-arrows-size; - justify-content: center; - padding: $meta-nav-padding; - position: absolute; - top: auto; - z-index: 2; + } + } + } - @include hover-focus() { + // navs + .meta-nav { + background: none; + border: 0; + color: $meta-nav-color; + font-size: $meta-nav-size; + text-shadow: $meta-nav-hover-shadow 0 0 0.25em; + z-index: 2; - .fa, - .fas, - .far, - .fab { - transform: $meta-nav-hover-transform; - } - } - - @media (min-width: map-get($grid-breakpoints, 'lg')) { - bottom: 0; - top: 0; - } - - &__next { - right: 0; - } - - &__prev { - left: 0; - } - - @media (min-width: map-get($grid-breakpoints, 'lg')) { - &__next { - right: -($meta-nav-arrows-size + 0.5); - } - - &__prev { - left: -($meta-nav-arrows-size + 0.5); - } - } + @include hover-focus() { + color: $meta-nav-color; } - .meta-close { - position: absolute; - right: 0; - top: -3rem; - width: 1.25em; + &:hover { + background: $meta-nav-hover-bg; + color: $meta-nav-hover-color; + text-decoration: none; + text-shadow: none; + } + } - &:hover { + .meta-nav-arrow { + align-items: center; + bottom: 0; + display: flex; + font-size: $meta-nav-arrows-size; + justify-content: center; + padding: $meta-nav-padding; + position: absolute; + top: auto; + z-index: 2; - .fa, - .fas, - .far, - .fab { - transform: $meta-nav-close-hover-transform; - } - } - - @media (min-width: map-get($grid-breakpoints, 'lg')) { - right: -($meta-nav-arrows-size + 0.5); - top: -($meta-nav-arrows-size + 0.5); - } + @include hover-focus() { + .fa, + .fas, + .far, + .fab { + transform: $meta-nav-hover-transform; + } } + @media (min-width: map-get($grid-breakpoints, "lg")) { + bottom: 0; + top: 0; + } + + &__next { + right: 0; + } + + &__prev { + left: 0; + } + + @media (min-width: map-get($grid-breakpoints, "lg")) { + &__next { + right: -($meta-nav-arrows-size + 0.5); + } + + &__prev { + left: -($meta-nav-arrows-size + 0.5); + } + } + } + + .meta-close { + position: absolute; + right: 0; + top: -3rem; + width: 1.25em; + + &:hover { + .fa, + .fas, + .far, + .fab { + transform: $meta-nav-close-hover-transform; + } + } + + @media (min-width: map-get($grid-breakpoints, "lg")) { + right: -($meta-nav-arrows-size + 0.5); + top: -($meta-nav-arrows-size + 0.5); + } + } + + .meta-content { + display: flex; + flex-direction: column; + height: 80%; + position: relative; + width: 100%; + z-index: 1; + + @media (min-width: map-get($grid-breakpoints, "lg")) { + height: 90%; + height: calc(90% - 3rem); + width: 90%; + width: calc(90% - 3rem); + } + } + + .meta-wrap { + display: flex; + height: 100%; + margin: 0 auto; + max-height: 100%; + max-width: 100%; + overflow: auto; + width: 100%; + word-break: break-word; + + img { + max-height: 100%; + max-width: 100%; + object-fit: cover; + } + } + + // Lightbox types + + &--text { .meta-content { - display: flex; - flex-direction: column; - height: 80%; - position: relative; - width: 100%; - z-index: 1; - - @media (min-width: map-get($grid-breakpoints, 'lg')) { - height: 90%; - height: calc(90% - 3rem); - width: 90%; - width: calc(90% - 3rem); - } + background: $meta-text-wrapper-bg; + color: $meta-text-wrapper-color; + padding: $meta-text-wrapper-padding-height $meta-text-wrapper-padding-width; + padding-right: 0; } .meta-wrap { - display: flex; - height: 100%; - margin: 0 auto; - max-height: 100%; - max-width: 100%; - overflow: auto; - width: 100%; - word-break: break-word; + padding-right: $meta-text-wrapper-padding-width; + } + } - img { - max-height: 100%; - max-width: 100%; - object-fit: cover; - } + &--image, + &--video { + .typography, + .meta-wrap { + align-items: center; + justify-content: center; + min-height: 100%; + overflow: hidden; + + img { + margin: 0; + } + } + } + + &--video, + &--embed { + @include responsive-ratio($meta-video-width, $meta-video-height, true); + + a[rel="nofollow noreferrer noopener"] { + color: $meta-embed-loading-failed-color; + font-size: $meta-embed-loading-failed-size; + font-weight: $meta-embed-loading-failed-weight; + + &:before { + content: "Unable to load. Please follow the provided link: "; + display: block; + } } - // Lightbox types - - &__text { - .meta-content { - background: $meta-text-wrapper-bg; - color: $meta-text-wrapper-color; - padding: $meta-text-wrapper-padding-height $meta-text-wrapper-padding-width; - padding-right: 0; - } - - .meta-wrap { - padding-right: $meta-text-wrapper-padding-width; - } - } - - &__image, - &__video { - - .typography, - .meta-wrap { - align-items: center; - justify-content: center; - min-height: 100%; - overflow: hidden; - - img { - margin: 0; - } - } - } - - &__video, - &__embed { - @include responsive-ratio($meta-video-width, $meta-video-height, true); - - a[rel='nofollow noreferrer noopener'] { - color: $meta-embed-loading-failed-color; - font-size: $meta-embed-loading-failed-size; - font-weight: $meta-embed-loading-failed-weight; - - &:before { - content: 'Unable to load. Please follow the provided link: '; - display: block; - } - } - - iframe { - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; - } + iframe { + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; } + } } diff --git a/src/test-pajax.html b/src/test-pajax.html index 89adc09..84b995b 100755 --- a/src/test-pajax.html +++ b/src/test-pajax.html @@ -1,84 +1,84 @@

Test HTML-content with PAJAX response

- Lorem Ipsum is simply dummy text of the printing and typesetting industry. - Lorem Ipsum has been the industry's standard dummy text ever since the - 1500s, when an unknown printer took a galley of type and scrambled it to - make a type specimen book. It has survived not only five centuries, but also - the leap into electronic typesetting, remaining essentially unchanged. It - was popularised in the 1960s with the release of Letraset sheets containing - Lorem Ipsum passages, and more recently with desktop publishing software - like Aldus PageMaker including versions of Lorem Ipsum. + Lorem Ipsum is simply dummy text of the printing and typesetting industry. + Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, + when an unknown printer took a galley of type and scrambled it to make a type + specimen book. It has survived not only five centuries, but also the leap into + electronic typesetting, remaining essentially unchanged. It was popularised in + the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, + and more recently with desktop publishing software like Aldus PageMaker + including versions of Lorem Ipsum.

https://twitter.com/reactjs/status/964689022747475968

- Lorem Ipsum is simply dummy text of the printing and typesetting industry. - Lorem Ipsum has been the industry's standard dummy text ever since the - 1500s, when an unknown printer took a galley of type and scrambled it to - make a type specimen book. It has survived not only five centuries, but also - the leap into electronic typesetting, remaining essentially unchanged. It - was popularised in the 1960s with the release of Letraset sheets containing - Lorem Ipsum passages, and more recently with desktop publishing software - like Aldus PageMaker including versions of Lorem Ipsum. + Lorem Ipsum is simply dummy text of the printing and typesetting industry. + Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, + when an unknown printer took a galley of type and scrambled it to make a type + specimen book. It has survived not only five centuries, but also the leap into + electronic typesetting, remaining essentially unchanged. It was popularised in + the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, + and more recently with desktop publishing software like Aldus PageMaker + including versions of Lorem Ipsum.

- Lorem Ipsum is simply dummy text of the printing and typesetting industry. - Lorem Ipsum has been the industry's standard dummy text ever since the - 1500s, when an unknown printer took a galley of type and scrambled it to - make a type specimen book. It has survived not only five centuries, but also - the leap into electronic typesetting, remaining essentially unchanged. It - was popularised in the 1960s with the release of Letraset sheets containing - Lorem Ipsum passages, and more recently with desktop publishing software - like Aldus PageMaker including versions of Lorem Ipsum. + Lorem Ipsum is simply dummy text of the printing and typesetting industry. + Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, + when an unknown printer took a galley of type and scrambled it to make a type + specimen book. It has survived not only five centuries, but also the leap into + electronic typesetting, remaining essentially unchanged. It was popularised in + the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, + and more recently with desktop publishing software like Aldus PageMaker + including versions of Lorem Ipsum.

- Lorem Ipsum is simply dummy text of the printing and typesetting industry. - Lorem Ipsum has been the industry's standard dummy text ever since the - 1500s, when an unknown printer took a galley of type and scrambled it to - make a type specimen book. It has survived not only five centuries, but also - the leap into electronic typesetting, remaining essentially unchanged. It - was popularised in the 1960s with the release of Letraset sheets containing - Lorem Ipsum passages, and more recently with desktop publishing software - like Aldus PageMaker including versions of Lorem Ipsum. + Lorem Ipsum is simply dummy text of the printing and typesetting industry. + Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, + when an unknown printer took a galley of type and scrambled it to make a type + specimen book. It has survived not only five centuries, but also the leap into + electronic typesetting, remaining essentially unchanged. It was popularised in + the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, + and more recently with desktop publishing software like Aldus PageMaker + including versions of Lorem Ipsum.

- Lorem Ipsum is simply dummy text of the printing and typesetting industry. - Lorem Ipsum has been the industry's standard dummy text ever since the - 1500s, when an unknown printer took a galley of type and scrambled it to - make a type specimen book. It has survived not only five centuries, but also - the leap into electronic typesetting, remaining essentially unchanged. It - was popularised in the 1960s with the release of Letraset sheets containing - Lorem Ipsum passages, and more recently with desktop publishing software - like Aldus PageMaker including versions of Lorem Ipsum. + Lorem Ipsum is simply dummy text of the printing and typesetting industry. + Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, + when an unknown printer took a galley of type and scrambled it to make a type + specimen book. It has survived not only five centuries, but also the leap into + electronic typesetting, remaining essentially unchanged. It was popularised in + the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, + and more recently with desktop publishing software like Aldus PageMaker + including versions of Lorem Ipsum.

- Lorem Ipsum is simply dummy text of the printing and typesetting industry. - Lorem Ipsum has been the industry's standard dummy text ever since the - 1500s, when an unknown printer took a galley of type and scrambled it to - make a type specimen book. It has survived not only five centuries, but also - the leap into electronic typesetting, remaining essentially unchanged. It - was popularised in the 1960s with the release of Letraset sheets containing - Lorem Ipsum passages, and more recently with desktop publishing software - like Aldus PageMaker including versions of Lorem Ipsum. + Lorem Ipsum is simply dummy text of the printing and typesetting industry. + Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, + when an unknown printer took a galley of type and scrambled it to make a type + specimen book. It has survived not only five centuries, but also the leap into + electronic typesetting, remaining essentially unchanged. It was popularised in + the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, + and more recently with desktop publishing software like Aldus PageMaker + including versions of Lorem Ipsum.

- Lorem Ipsum is simply dummy text of the printing and typesetting industry. - Lorem Ipsum has been the industry's standard dummy text ever since the - 1500s, when an unknown printer took a galley of type and scrambled it to - make a type specimen book. It has survived not only five centuries, but also - the leap into electronic typesetting, remaining essentially unchanged. It - was popularised in the 1960s with the release of Letraset sheets containing - Lorem Ipsum passages, and more recently with desktop publishing software - like Aldus PageMaker including versions of Lorem Ipsum. + Lorem Ipsum is simply dummy text of the printing and typesetting industry. + Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, + when an unknown printer took a galley of type and scrambled it to make a type + specimen book. It has survived not only five centuries, but also the leap into + electronic typesetting, remaining essentially unchanged. It was popularised in + the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, + and more recently with desktop publishing software like Aldus PageMaker + including versions of Lorem Ipsum.

- Lorem Ipsum is simply dummy text of the printing and typesetting industry. - Lorem Ipsum has been the industry's standard dummy text ever since the - 1500s, when an unknown printer took a galley of type and scrambled it to - make a type specimen book. It has survived not only five centuries, but also - the leap into electronic typesetting, remaining essentially unchanged. It - was popularised in the 1960s with the release of Letraset sheets containing - Lorem Ipsum passages, and more recently with desktop publishing software - like Aldus PageMaker including versions of Lorem Ipsum. + Lorem Ipsum is simply dummy text of the printing and typesetting industry. + Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, + when an unknown printer took a galley of type and scrambled it to make a type + specimen book. It has survived not only five centuries, but also the leap into + electronic typesetting, remaining essentially unchanged. It was popularised in + the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, + and more recently with desktop publishing software like Aldus PageMaker + including versions of Lorem Ipsum.

diff --git a/src/test.json b/src/test.json index 0803745..29d94ed 100755 --- a/src/test.json +++ b/src/test.json @@ -1,4 +1,4 @@ { - "Title": "Test Title!", - "Content": "Test HTML-content with JSON response" + "Title": "Test Title!", + "Content": "Test HTML-content with JSON response" }