From a1f308e4a7524f6ee50343d48ead7bb115ffd3be Mon Sep 17 00:00:00 2001 From: Andy Royle Date: Mon, 26 Oct 2015 13:23:19 +0000 Subject: [PATCH 1/3] always call the callback, even on error to avoid blocking the render loop --- components/oc-client/src/oc-client.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/oc-client/src/oc-client.js b/components/oc-client/src/oc-client.js index 3bfa9cd8a..481c3ff5e 100644 --- a/components/oc-client/src/oc-client.js +++ b/components/oc-client/src/oc-client.js @@ -237,7 +237,8 @@ var oc = oc || {}; oc.renderByHref($component.attr('href'), function(err, data){ if(err || !data || !data.html){ - return logger.error(err); + logger.error(err); + return callback(); } processHtml($component, data, callback); From b2f674435383d5642ed90482b3504ba2014de7c9 Mon Sep 17 00:00:00 2001 From: Andy Royle Date: Mon, 26 Oct 2015 13:30:04 +0000 Subject: [PATCH 2/3] don't treat empty html as an error --- components/oc-client/src/oc-client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/oc-client/src/oc-client.js b/components/oc-client/src/oc-client.js index 481c3ff5e..fa0ae2f57 100644 --- a/components/oc-client/src/oc-client.js +++ b/components/oc-client/src/oc-client.js @@ -236,7 +236,7 @@ var oc = oc || {}; $component.html('
' + MESSAGES_LOADING_COMPONENT + '
'); oc.renderByHref($component.attr('href'), function(err, data){ - if(err || !data || !data.html){ + if(err || !data){ logger.error(err); return callback(); } From 8c50507fadf5f47860cfb74d4cd4e78c94d2b34e Mon Sep 17 00:00:00 2001 From: Andy Royle Date: Mon, 26 Oct 2015 13:31:04 +0000 Subject: [PATCH 3/3] build client --- client/oc-client.min.js | 2 +- components/oc-client/_package/package.json | 28 ++++++++++++++++++- .../oc-client/_package/src/head.load.js | 2 +- .../oc-client/_package/src/oc-client.js | 2 +- .../oc-client/_package/src/oc-client.min.js | 2 +- components/oc-client/src/oc-client.min.js | 2 +- 6 files changed, 32 insertions(+), 6 deletions(-) diff --git a/client/oc-client.min.js b/client/oc-client.min.js index c25b08c1e..84a64865f 100644 --- a/client/oc-client.min.js +++ b/client/oc-client.min.js @@ -1 +1 @@ -!function(e,n){"use strict";function t(){}function r(e,n){if(e){"object"==typeof e&&(e=[].slice.call(e));for(var t=0,r=e.length;r>t;t++)n.call(e,e[t],t)}}function o(e,t){var r=Object.prototype.toString.call(t).slice(8,-1);return t!==n&&null!==t&&r===e}function a(e){return o("Function",e)}function c(e){return o("Array",e)}function i(e){var n=e.split("/"),t=n[n.length-1],r=t.indexOf("?");return-1!==r?t.substring(0,r):t}function u(e){e=e||t,e._done||(e(),e._done=1)}function d(e,n,r,o){var a="object"==typeof e?e:{test:e,success:n?c(n)?n:[n]:!1,failure:r?c(r)?r:[r]:!1,callback:o||t},i=!!a.test;return i&&a.success?(a.success.push(a.callback),A.load.apply(null,a.success)):!i&&a.failure?(a.failure.push(a.callback),A.load.apply(null,a.failure)):o(),A}function l(e){var n={};if("object"==typeof e)for(var t in e)e[t]&&(n={name:t,url:e[t]});else n={name:i(e),url:e};var r=C[n.name];return r&&r.url===n.url?r:(C[n.name]=n,n)}function s(e){e=e||C;for(var n in e)if(e.hasOwnProperty(n)&&e[n].state!==U)return!1;return!0}function f(e){e.state=k,r(e.onpreload,function(e){e.call()})}function m(e,t){e.state===n&&(e.state=S,e.onpreload=[],g({url:e.url,type:"cache"},function(){f(e)}))}function p(){var e=arguments,n=e[e.length-1],t=[].slice.call(e,1),o=t[0];return a(n)||(n=null),c(e[0])?(e[0].push(n),A.load.apply(null,e[0]),A):(o?(r(t,function(e){!a(e)&&e&&m(l(e))}),y(l(e[0]),a(o)?o:function(){A.load.apply(null,t)})):y(l(e[0])),A)}function v(){var e=arguments,n=e[e.length-1],t={};return a(n)||(n=null),c(e[0])?(e[0].push(n),A.load.apply(null,e[0]),A):(r(e,function(e,r){e!==n&&(e=l(e),t[e.name]=e)}),r(e,function(e,r){e!==n&&(e=l(e),y(e,function(){s(t)&&u(n)}))}),A)}function y(e,n){return n=n||t,e.state===U?void n():e.state===I?void A.ready(e.name,n):e.state===S?void e.onpreload.push(function(){y(e,n)}):(e.state=I,void g(e,function(){e.state=U,n(),r(w[e.name],function(e){u(e)}),L&&s()&&r(w.ALL,function(e){u(e)})}))}function h(e){e=e||"";var n=e.split("?")[0].split(".");return n[n.length-1].toLowerCase()}function g(n,r){function o(n){n=n||e.event,i.onload=i.onreadystatechange=i.onerror=null,r()}function a(t){t=t||e.event,("load"===t.type||/loaded|complete/.test(i.readyState)&&(!q.documentMode||q.documentMode<9))&&(e.clearTimeout(n.errorTimeout),e.clearTimeout(n.cssTimeout),i.onload=i.onreadystatechange=i.onerror=null,r())}function c(){if(n.state!==U&&n.cssRetries<=20){for(var t=0,r=q.styleSheets.length;r>t;t++)if(q.styleSheets[t].href===i.href)return void a({type:"load"});n.cssRetries++,n.cssTimeout=e.setTimeout(c,250)}}r=r||t;var i,u=h(n.url);"css"===u?(i=q.createElement("link"),i.type="text/"+(n.type||"css"),i.rel="stylesheet",i.href=n.url,n.cssRetries=0,n.cssTimeout=e.setTimeout(c,500)):(i=q.createElement("script"),i.type="text/"+(n.type||"javascript"),i.src=n.url),i.onload=i.onreadystatechange=a,i.onerror=o,i.async=!1,i.defer=!1,n.errorTimeout=e.setTimeout(function(){o({type:"timeout"})},7e3);var d=q.head||q.getElementsByTagName("head")[0];d.insertBefore(i,d.lastChild)}function j(){for(var e=q.getElementsByTagName("script"),n=0,t=e.length;t>n;n++){var r=e[n].getAttribute("data-headjs-load");if(r)return void A.load(r)}}function T(e,n){if(e===q)return L?u(n):x.push(n),A;if(a(e)&&(n=e,e="ALL"),c(e)){var t={};return r(e,function(e){t[e]=C[e],A.ready(e,function(){s(t)&&u(n)})}),A}if("string"!=typeof e||!a(n))return A;var o=C[e];if(o&&o.state===U||"ALL"===e&&s()&&L)return u(n),A;var i=w[e];return i?i.push(n):i=w[e]=[n],A}function b(){return q.body?void(L||(L=!0,j(),r(x,function(e){u(e)}))):(e.clearTimeout(A.readyTimeout),void(A.readyTimeout=e.setTimeout(b,50)))}function E(){q.addEventListener?(q.removeEventListener("DOMContentLoaded",E,!1),b()):"complete"===q.readyState&&(q.detachEvent("onreadystatechange",E),b())}var L,q=e.document,x=[],w={},C={},M="async"in q.createElement("script")||"MozAppearance"in q.documentElement.style||e.opera,O=e.head_conf&&e.head_conf.head||"head",A=e[O]=e[O]||function(){A.ready.apply(null,arguments)},S=1,k=2,I=3,U=4;if("complete"===q.readyState)b();else if(q.addEventListener)q.addEventListener("DOMContentLoaded",E,!1),e.addEventListener("load",b,!1);else{q.attachEvent("onreadystatechange",E),e.attachEvent("onload",b);var B=!1;try{B=!e.frameElement&&q.documentElement}catch(_){}B&&B.doScroll&&!function D(){if(!L){try{B.doScroll("left")}catch(n){return e.clearTimeout(A.readyTimeout),void(A.readyTimeout=e.setTimeout(D,50))}b()}}()}A.load=A.js=M?v:p,A.test=d,A.ready=T,A.ready(q,function(){s()&&r(w.ALL,function(e){u(e)}),A.feature&&A.feature("domloaded",!0)})}(window);var oc=oc||{};!function(e,n,t){oc.conf=oc.conf||{},oc.cmd=oc.cmd||[];var r,o="https://cdnjs.cloudflare.com/ajax/libs/",a=o+"jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js",c=o+"handlebars.js/3.0.1/handlebars.runtime.js",i=o+"jade/1.9.2/runtime.min.js",u=o+"jquery/1.11.2/jquery.min.js",d=oc.conf.retryInterval||5e3,l=oc.conf.pollingInterval||500,s=oc.conf.tag||"oc-component",f="Href parameter missing",m="Error getting compiled view: {0}",p="Error rendering component: {0}, error: {1}",v="Failed to retrieve the component. Retrying in {0} seconds...".replace("{0}",d/1e3),y='Error loading component: view engine "{0}" not supported',h="Loading...",g="Component '{0}' correctly rendered",j="Unrendered component found. Trying to retrieve it...",T=oc.conf.debug||!1,b=function(){},E=t.navigator.userAgent,L=!!E.match(/MSIE 8/),q=!!E.match(/MSIE 9/),x=!1,w=!1,C={error:function(e){return console.log(e)},info:function(e){return T?console.log(e):!1}};oc.require=function(n,r,o){"function"==typeof r&&(o=r,r=n,n=void 0),"string"==typeof n&&(n=[n]);var a=function(){var e=t;if("undefined"==typeof n)return!0;for(var r=0;r':"<"+s+' href="'+t+'">"},oc.ready=function(e){if(x)return e();if(w)oc.cmd.push(e);else{w=!0;var n=function(e){!L&&!q||r.IE_POLYFILL_LOADED?e():oc.require(a,e)},t=function(){x=!0,w=!1,e();for(var n=0;n'+h+""),oc.renderByHref(e.attr("href"),function(t,r){return!t&&r&&r.html?void M(e,r,n):C.error(t)}))})},oc.renderByHref=function(e,n){oc.ready(function(){return""===e?n(p.replace("{1}",f)):void r.ajax({url:e,headers:{Accept:"application/vnd.oc.prerendered+json"},contentType:"text/plain",crossDomain:!0,async:!0,success:function(e){if("pre-rendered"===e.renderMode)oc.render(e.template,e.data,function(t,r){return t?n(p.replace("{0}",e.href).replace("{1}",t)):(C.info(g.replace("{0}",e.template.src)),void n(null,{html:r,key:e.template.key,version:e.version}))});else if("rendered"===e.renderMode){if(C.info(g.replace("{0}",e.href)),0===e.html.indexOf("<"+s)){var t=e.html.slice(e.html.indexOf(">")+1),r=t.slice(0,t.lastIndexOf("<"));e.html=r}n(null,{html:e.html,version:e.version})}},error:function(){C.error(v),setTimeout(function(){oc.renderByHref(e,n)},d)}})})},oc.renderUnloadedComponents=function(){oc.ready(function(){var e=L?"div[data-oc-component=true]":s,n=r(e+"[data-rendered!=true]"),t=function(e,n){oc.renderNestedComponent(r(e[n]),function(){n++,n0&&t(n,0)})},oc.load=function(e,n,t){oc.ready(function(){if("function"!=typeof t&&(t=b),r(e)){r(e).html("<"+s+' href="'+n+'" />');var o=r(s,e);oc.renderNestedComponent(o,function(){t(o)})}})},oc.ready(oc.renderUnloadedComponents)}(head,document,window),oc.clientVersion="0.18.2"; \ No newline at end of file +!function(e,n){"use strict";function t(){}function r(e,n){if(e){"object"==typeof e&&(e=[].slice.call(e));for(var t=0,r=e.length;r>t;t++)n.call(e,e[t],t)}}function o(e,t){var r=Object.prototype.toString.call(t).slice(8,-1);return t!==n&&null!==t&&r===e}function a(e){return o("Function",e)}function c(e){return o("Array",e)}function i(e){var n=e.split("/"),t=n[n.length-1],r=t.indexOf("?");return-1!==r?t.substring(0,r):t}function u(e){e=e||t,e._done||(e(),e._done=1)}function d(e,n,r,o){var a="object"==typeof e?e:{test:e,success:n?c(n)?n:[n]:!1,failure:r?c(r)?r:[r]:!1,callback:o||t},i=!!a.test;return i&&a.success?(a.success.push(a.callback),A.load.apply(null,a.success)):!i&&a.failure?(a.failure.push(a.callback),A.load.apply(null,a.failure)):o(),A}function l(e){var n={};if("object"==typeof e)for(var t in e)e[t]&&(n={name:t,url:e[t]});else n={name:i(e),url:e};var r=C[n.name];return r&&r.url===n.url?r:(C[n.name]=n,n)}function s(e){e=e||C;for(var n in e)if(e.hasOwnProperty(n)&&e[n].state!==U)return!1;return!0}function f(e){e.state=k,r(e.onpreload,function(e){e.call()})}function m(e){e.state===n&&(e.state=S,e.onpreload=[],g({url:e.url,type:"cache"},function(){f(e)}))}function p(){var e=arguments,n=e[e.length-1],t=[].slice.call(e,1),o=t[0];return a(n)||(n=null),c(e[0])?(e[0].push(n),A.load.apply(null,e[0]),A):(o?(r(t,function(e){!a(e)&&e&&m(l(e))}),y(l(e[0]),a(o)?o:function(){A.load.apply(null,t)})):y(l(e[0])),A)}function v(){var e=arguments,n=e[e.length-1],t={};return a(n)||(n=null),c(e[0])?(e[0].push(n),A.load.apply(null,e[0]),A):(r(e,function(e){e!==n&&(e=l(e),t[e.name]=e)}),r(e,function(e){e!==n&&(e=l(e),y(e,function(){s(t)&&u(n)}))}),A)}function y(e,n){return n=n||t,e.state===U?void n():e.state===I?void A.ready(e.name,n):e.state===S?void e.onpreload.push(function(){y(e,n)}):(e.state=I,void g(e,function(){e.state=U,n(),r(w[e.name],function(e){u(e)}),L&&s()&&r(w.ALL,function(e){u(e)})}))}function h(e){e=e||"";var n=e.split("?")[0].split(".");return n[n.length-1].toLowerCase()}function g(n,r){function o(n){n=n||e.event,i.onload=i.onreadystatechange=i.onerror=null,r()}function a(t){t=t||e.event,("load"===t.type||/loaded|complete/.test(i.readyState)&&(!q.documentMode||q.documentMode<9))&&(e.clearTimeout(n.errorTimeout),e.clearTimeout(n.cssTimeout),i.onload=i.onreadystatechange=i.onerror=null,r())}function c(){if(n.state!==U&&n.cssRetries<=20){for(var t=0,r=q.styleSheets.length;r>t;t++)if(q.styleSheets[t].href===i.href)return void a({type:"load"});n.cssRetries++,n.cssTimeout=e.setTimeout(c,250)}}r=r||t;var i,u=h(n.url);"css"===u?(i=q.createElement("link"),i.type="text/"+(n.type||"css"),i.rel="stylesheet",i.href=n.url,n.cssRetries=0,n.cssTimeout=e.setTimeout(c,500)):(i=q.createElement("script"),i.type="text/"+(n.type||"javascript"),i.src=n.url),i.onload=i.onreadystatechange=a,i.onerror=o,i.async=!1,i.defer=!1,n.errorTimeout=e.setTimeout(function(){o({type:"timeout"})},7e3);var d=q.head||q.getElementsByTagName("head")[0];d.insertBefore(i,d.lastChild)}function j(){for(var e=q.getElementsByTagName("script"),n=0,t=e.length;t>n;n++){var r=e[n].getAttribute("data-headjs-load");if(r)return void A.load(r)}}function T(e,n){if(e===q)return L?u(n):x.push(n),A;if(a(e)&&(n=e,e="ALL"),c(e)){var t={};return r(e,function(e){t[e]=C[e],A.ready(e,function(){s(t)&&u(n)})}),A}if("string"!=typeof e||!a(n))return A;var o=C[e];if(o&&o.state===U||"ALL"===e&&s()&&L)return u(n),A;var i=w[e];return i?i.push(n):i=w[e]=[n],A}function b(){return q.body?void(L||(L=!0,j(),r(x,function(e){u(e)}))):(e.clearTimeout(A.readyTimeout),void(A.readyTimeout=e.setTimeout(b,50)))}function E(){q.addEventListener?(q.removeEventListener("DOMContentLoaded",E,!1),b()):"complete"===q.readyState&&(q.detachEvent("onreadystatechange",E),b())}var L,q=e.document,x=[],w={},C={},M="async"in q.createElement("script")||"MozAppearance"in q.documentElement.style||e.opera,O=e.head_conf&&e.head_conf.head||"head",A=e[O]=e[O]||function(){A.ready.apply(null,arguments)},S=1,k=2,I=3,U=4;if("complete"===q.readyState)b();else if(q.addEventListener)q.addEventListener("DOMContentLoaded",E,!1),e.addEventListener("load",b,!1);else{q.attachEvent("onreadystatechange",E),e.attachEvent("onload",b);var B=!1;try{B=!e.frameElement&&q.documentElement}catch(_){}B&&B.doScroll&&!function D(){if(!L){try{B.doScroll("left")}catch(n){return e.clearTimeout(A.readyTimeout),void(A.readyTimeout=e.setTimeout(D,50))}b()}}()}A.load=A.js=M?v:p,A.test=d,A.ready=T,A.ready(q,function(){s()&&r(w.ALL,function(e){u(e)}),A.feature&&A.feature("domloaded",!0)})}(window);var oc=oc||{};!function(e,n,t){oc.conf=oc.conf||{},oc.cmd=oc.cmd||[];var r,o="https://cdnjs.cloudflare.com/ajax/libs/",a=o+"jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js",c=o+"handlebars.js/3.0.1/handlebars.runtime.js",i=o+"jade/1.9.2/runtime.min.js",u=o+"jquery/1.11.2/jquery.min.js",d=oc.conf.retryInterval||5e3,l=oc.conf.pollingInterval||500,s=oc.conf.tag||"oc-component",f="Href parameter missing",m="Error getting compiled view: {0}",p="Error rendering component: {0}, error: {1}",v="Failed to retrieve the component. Retrying in {0} seconds...".replace("{0}",d/1e3),y='Error loading component: view engine "{0}" not supported',h="Loading...",g="Component '{0}' correctly rendered",j="Unrendered component found. Trying to retrieve it...",T=oc.conf.debug||!1,b=function(){},E=t.navigator.userAgent,L=!!E.match(/MSIE 8/),q=!!E.match(/MSIE 9/),x=!1,w=!1,C={error:function(e){return console.log(e)},info:function(e){return T?console.log(e):!1}};oc.require=function(n,r,o){"function"==typeof r&&(o=r,r=n,n=void 0),"string"==typeof n&&(n=[n]);var a=function(){var e=t;if("undefined"==typeof n)return!0;for(var r=0;r':"<"+s+' href="'+t+'">"},oc.ready=function(e){if(x)return e();if(w)oc.cmd.push(e);else{w=!0;var n=function(e){!L&&!q||r.IE_POLYFILL_LOADED?e():oc.require(a,e)},t=function(){x=!0,w=!1,e();for(var n=0;n'+h+""),oc.renderByHref(e.attr("href"),function(t,r){return t||!r?(C.error(t),n()):void M(e,r,n)}))})},oc.renderByHref=function(e,n){oc.ready(function(){return""===e?n(p.replace("{1}",f)):void r.ajax({url:e,headers:{Accept:"application/vnd.oc.prerendered+json"},contentType:"text/plain",crossDomain:!0,async:!0,success:function(e){if("pre-rendered"===e.renderMode)oc.render(e.template,e.data,function(t,r){return t?n(p.replace("{0}",e.href).replace("{1}",t)):(C.info(g.replace("{0}",e.template.src)),void n(null,{html:r,key:e.template.key,version:e.version}))});else if("rendered"===e.renderMode){if(C.info(g.replace("{0}",e.href)),0===e.html.indexOf("<"+s)){var t=e.html.slice(e.html.indexOf(">")+1),r=t.slice(0,t.lastIndexOf("<"));e.html=r}n(null,{html:e.html,version:e.version})}},error:function(){C.error(v),setTimeout(function(){oc.renderByHref(e,n)},d)}})})},oc.renderUnloadedComponents=function(){oc.ready(function(){var e=L?"div[data-oc-component=true]":s,n=r(e+"[data-rendered!=true]"),t=function(e,n){oc.renderNestedComponent(r(e[n]),function(){n++,n0&&t(n,0)})},oc.load=function(e,n,t){oc.ready(function(){if("function"!=typeof t&&(t=b),r(e)){r(e).html("<"+s+' href="'+n+'" />');var o=r(s,e);oc.renderNestedComponent(o,function(){t(o)})}})},oc.ready(oc.renderUnloadedComponents)}(head,document,window),oc.clientVersion="0.18.2"; \ No newline at end of file diff --git a/components/oc-client/_package/package.json b/components/oc-client/_package/package.json index 509712705..d1e04bc79 100644 --- a/components/oc-client/_package/package.json +++ b/components/oc-client/_package/package.json @@ -1 +1,27 @@ -{"name":"oc-client","description":"The OpenComponents client-side javascript client","version":"0.18.2","repository":"https://github.com/opentable/oc/tree/master/components/oc-client","oc":{"parameters":{},"files":{"template":{"type":"handlebars","hashKey":"bb774de6a2b7280c2b66103bd36d7e708a1b7541","src":"template.js"},"static":["src"],"dataProvider":{"type":"node.js","hashKey":"ffb0e43eaf72f55fa13dc1e7262019c14c3dfc81","src":"server.js"}},"version":"0.18.2","packaged":true,"date":1445862575636}} +{ + "name": "oc-client", + "description": "The OpenComponents client-side javascript client", + "version": "0.18.2", + "repository": "https://github.com/opentable/oc/tree/master/components/oc-client", + "oc": { + "parameters": {}, + "files": { + "template": { + "type": "handlebars", + "hashKey": "bb774de6a2b7280c2b66103bd36d7e708a1b7541", + "src": "template.js" + }, + "static": [ + "src" + ], + "dataProvider": { + "type": "node.js", + "hashKey": "ffb0e43eaf72f55fa13dc1e7262019c14c3dfc81", + "src": "server.js" + } + }, + "version": "0.18.2", + "packaged": true, + "date": 1445866253228 + } +} diff --git a/components/oc-client/_package/src/head.load.js b/components/oc-client/_package/src/head.load.js index dce278b9a..3f73427e2 100644 --- a/components/oc-client/_package/src/head.load.js +++ b/components/oc-client/_package/src/head.load.js @@ -1 +1 @@ -!function(e,t){"use strict";function n(){}function r(e,t){if(e){"object"==typeof e&&(e=[].slice.call(e));for(var n=0,r=e.length;r>n;n++)t.call(e,e[n],n)}}function a(e,n){var r=Object.prototype.toString.call(n).slice(8,-1);return n!==t&&null!==n&&r===e}function o(e){return a("Function",e)}function u(e){return a("Array",e)}function i(e){var t=e.split("/"),n=t[t.length-1],r=n.indexOf("?");return-1!==r?n.substring(0,r):n}function c(e){e=e||n,e._done||(e(),e._done=1)}function l(e,t,r,a){var o="object"==typeof e?e:{test:e,success:t?u(t)?t:[t]:!1,failure:r?u(r)?r:[r]:!1,callback:a||n},i=!!o.test;return i&&o.success?(o.success.push(o.callback),C.load.apply(null,o.success)):!i&&o.failure?(o.failure.push(o.callback),C.load.apply(null,o.failure)):a(),C}function s(e){var t={};if("object"==typeof e)for(var n in e)e[n]&&(t={name:n,url:e[n]});else t={name:i(e),url:e};var r=O[t.name];return r&&r.url===t.url?r:(O[t.name]=t,t)}function d(e){e=e||O;for(var t in e)if(e.hasOwnProperty(t)&&e[t].state!==R)return!1;return!0}function f(e){e.state=x,r(e.onpreload,function(e){e.call()})}function m(e,n){e.state===t&&(e.state=_,e.onpreload=[],g({url:e.url,type:"cache"},function(){f(e)}))}function p(){var e=arguments,t=e[e.length-1],n=[].slice.call(e,1),a=n[0];return o(t)||(t=null),u(e[0])?(e[0].push(t),C.load.apply(null,e[0]),C):(a?(r(n,function(e){!o(e)&&e&&m(s(e))}),v(s(e[0]),o(a)?a:function(){C.load.apply(null,n)})):v(s(e[0])),C)}function y(){var e=arguments,t=e[e.length-1],n={};return o(t)||(t=null),u(e[0])?(e[0].push(t),C.load.apply(null,e[0]),C):(r(e,function(e,r){e!==t&&(e=s(e),n[e.name]=e)}),r(e,function(e,r){e!==t&&(e=s(e),v(e,function(){d(n)&&c(t)}))}),C)}function v(e,t){return t=t||n,e.state===R?void t():e.state===B?void C.ready(e.name,t):e.state===_?void e.onpreload.push(function(){v(e,t)}):(e.state=B,void g(e,function(){e.state=R,t(),r(M[e.name],function(e){c(e)}),S&&d()&&r(M.ALL,function(e){c(e)})}))}function h(e){e=e||"";var t=e.split("?")[0].split(".");return t[t.length-1].toLowerCase()}function g(t,r){function a(t){t=t||e.event,i.onload=i.onreadystatechange=i.onerror=null,r()}function o(n){n=n||e.event,("load"===n.type||/loaded|complete/.test(i.readyState)&&(!j.documentMode||j.documentMode<9))&&(e.clearTimeout(t.errorTimeout),e.clearTimeout(t.cssTimeout),i.onload=i.onreadystatechange=i.onerror=null,r())}function u(){if(t.state!==R&&t.cssRetries<=20){for(var n=0,r=j.styleSheets.length;r>n;n++)if(j.styleSheets[n].href===i.href)return void o({type:"load"});t.cssRetries++,t.cssTimeout=e.setTimeout(u,250)}}r=r||n;var i,c=h(t.url);"css"===c?(i=j.createElement("link"),i.type="text/"+(t.type||"css"),i.rel="stylesheet",i.href=t.url,t.cssRetries=0,t.cssTimeout=e.setTimeout(u,500)):(i=j.createElement("script"),i.type="text/"+(t.type||"javascript"),i.src=t.url),i.onload=i.onreadystatechange=o,i.onerror=a,i.async=!1,i.defer=!1,t.errorTimeout=e.setTimeout(function(){a({type:"timeout"})},7e3);var l=j.head||j.getElementsByTagName("head")[0];l.insertBefore(i,l.lastChild)}function T(){for(var e=j.getElementsByTagName("script"),t=0,n=e.length;n>t;t++){var r=e[t].getAttribute("data-headjs-load");if(r)return void C.load(r)}}function E(e,t){if(e===j)return S?c(t):A.push(t),C;if(o(e)&&(t=e,e="ALL"),u(e)){var n={};return r(e,function(e){n[e]=O[e],C.ready(e,function(){d(n)&&c(t)})}),C}if("string"!=typeof e||!o(t))return C;var a=O[e];if(a&&a.state===R||"ALL"===e&&d()&&S)return c(t),C;var i=M[e];return i?i.push(t):i=M[e]=[t],C}function L(){return j.body?void(S||(S=!0,T(),r(A,function(e){c(e)}))):(e.clearTimeout(C.readyTimeout),void(C.readyTimeout=e.setTimeout(L,50)))}function b(){j.addEventListener?(j.removeEventListener("DOMContentLoaded",b,!1),L()):"complete"===j.readyState&&(j.detachEvent("onreadystatechange",b),L())}var S,j=e.document,A=[],M={},O={},k="async"in j.createElement("script")||"MozAppearance"in j.documentElement.style||e.opera,w=e.head_conf&&e.head_conf.head||"head",C=e[w]=e[w]||function(){C.ready.apply(null,arguments)},_=1,x=2,B=3,R=4;if("complete"===j.readyState)L();else if(j.addEventListener)j.addEventListener("DOMContentLoaded",b,!1),e.addEventListener("load",L,!1);else{j.attachEvent("onreadystatechange",b),e.attachEvent("onload",L);var D=!1;try{D=!e.frameElement&&j.documentElement}catch(N){}D&&D.doScroll&&!function z(){if(!S){try{D.doScroll("left")}catch(t){return e.clearTimeout(C.readyTimeout),void(C.readyTimeout=e.setTimeout(z,50))}L()}}()}C.load=C.js=k?y:p,C.test=l,C.ready=E,C.ready(j,function(){d()&&r(M.ALL,function(e){c(e)}),C.feature&&C.feature("domloaded",!0)})}(window); \ No newline at end of file +!function(e,t){"use strict";function n(){}function r(e,t){if(e){"object"==typeof e&&(e=[].slice.call(e));for(var n=0,r=e.length;r>n;n++)t.call(e,e[n],n)}}function a(e,n){var r=Object.prototype.toString.call(n).slice(8,-1);return n!==t&&null!==n&&r===e}function o(e){return a("Function",e)}function u(e){return a("Array",e)}function i(e){var t=e.split("/"),n=t[t.length-1],r=n.indexOf("?");return-1!==r?n.substring(0,r):n}function c(e){e=e||n,e._done||(e(),e._done=1)}function l(e,t,r,a){var o="object"==typeof e?e:{test:e,success:t?u(t)?t:[t]:!1,failure:r?u(r)?r:[r]:!1,callback:a||n},i=!!o.test;return i&&o.success?(o.success.push(o.callback),C.load.apply(null,o.success)):!i&&o.failure?(o.failure.push(o.callback),C.load.apply(null,o.failure)):a(),C}function s(e){var t={};if("object"==typeof e)for(var n in e)e[n]&&(t={name:n,url:e[n]});else t={name:i(e),url:e};var r=O[t.name];return r&&r.url===t.url?r:(O[t.name]=t,t)}function d(e){e=e||O;for(var t in e)if(e.hasOwnProperty(t)&&e[t].state!==R)return!1;return!0}function f(e){e.state=x,r(e.onpreload,function(e){e.call()})}function m(e){e.state===t&&(e.state=_,e.onpreload=[],g({url:e.url,type:"cache"},function(){f(e)}))}function p(){var e=arguments,t=e[e.length-1],n=[].slice.call(e,1),a=n[0];return o(t)||(t=null),u(e[0])?(e[0].push(t),C.load.apply(null,e[0]),C):(a?(r(n,function(e){!o(e)&&e&&m(s(e))}),v(s(e[0]),o(a)?a:function(){C.load.apply(null,n)})):v(s(e[0])),C)}function y(){var e=arguments,t=e[e.length-1],n={};return o(t)||(t=null),u(e[0])?(e[0].push(t),C.load.apply(null,e[0]),C):(r(e,function(e){e!==t&&(e=s(e),n[e.name]=e)}),r(e,function(e){e!==t&&(e=s(e),v(e,function(){d(n)&&c(t)}))}),C)}function v(e,t){return t=t||n,e.state===R?void t():e.state===B?void C.ready(e.name,t):e.state===_?void e.onpreload.push(function(){v(e,t)}):(e.state=B,void g(e,function(){e.state=R,t(),r(M[e.name],function(e){c(e)}),S&&d()&&r(M.ALL,function(e){c(e)})}))}function h(e){e=e||"";var t=e.split("?")[0].split(".");return t[t.length-1].toLowerCase()}function g(t,r){function a(t){t=t||e.event,i.onload=i.onreadystatechange=i.onerror=null,r()}function o(n){n=n||e.event,("load"===n.type||/loaded|complete/.test(i.readyState)&&(!j.documentMode||j.documentMode<9))&&(e.clearTimeout(t.errorTimeout),e.clearTimeout(t.cssTimeout),i.onload=i.onreadystatechange=i.onerror=null,r())}function u(){if(t.state!==R&&t.cssRetries<=20){for(var n=0,r=j.styleSheets.length;r>n;n++)if(j.styleSheets[n].href===i.href)return void o({type:"load"});t.cssRetries++,t.cssTimeout=e.setTimeout(u,250)}}r=r||n;var i,c=h(t.url);"css"===c?(i=j.createElement("link"),i.type="text/"+(t.type||"css"),i.rel="stylesheet",i.href=t.url,t.cssRetries=0,t.cssTimeout=e.setTimeout(u,500)):(i=j.createElement("script"),i.type="text/"+(t.type||"javascript"),i.src=t.url),i.onload=i.onreadystatechange=o,i.onerror=a,i.async=!1,i.defer=!1,t.errorTimeout=e.setTimeout(function(){a({type:"timeout"})},7e3);var l=j.head||j.getElementsByTagName("head")[0];l.insertBefore(i,l.lastChild)}function T(){for(var e=j.getElementsByTagName("script"),t=0,n=e.length;n>t;t++){var r=e[t].getAttribute("data-headjs-load");if(r)return void C.load(r)}}function E(e,t){if(e===j)return S?c(t):A.push(t),C;if(o(e)&&(t=e,e="ALL"),u(e)){var n={};return r(e,function(e){n[e]=O[e],C.ready(e,function(){d(n)&&c(t)})}),C}if("string"!=typeof e||!o(t))return C;var a=O[e];if(a&&a.state===R||"ALL"===e&&d()&&S)return c(t),C;var i=M[e];return i?i.push(t):i=M[e]=[t],C}function L(){return j.body?void(S||(S=!0,T(),r(A,function(e){c(e)}))):(e.clearTimeout(C.readyTimeout),void(C.readyTimeout=e.setTimeout(L,50)))}function b(){j.addEventListener?(j.removeEventListener("DOMContentLoaded",b,!1),L()):"complete"===j.readyState&&(j.detachEvent("onreadystatechange",b),L())}var S,j=e.document,A=[],M={},O={},k="async"in j.createElement("script")||"MozAppearance"in j.documentElement.style||e.opera,w=e.head_conf&&e.head_conf.head||"head",C=e[w]=e[w]||function(){C.ready.apply(null,arguments)},_=1,x=2,B=3,R=4;if("complete"===j.readyState)L();else if(j.addEventListener)j.addEventListener("DOMContentLoaded",b,!1),e.addEventListener("load",L,!1);else{j.attachEvent("onreadystatechange",b),e.attachEvent("onload",L);var D=!1;try{D=!e.frameElement&&j.documentElement}catch(N){}D&&D.doScroll&&!function z(){if(!S){try{D.doScroll("left")}catch(t){return e.clearTimeout(C.readyTimeout),void(C.readyTimeout=e.setTimeout(z,50))}L()}}()}C.load=C.js=k?y:p,C.test=l,C.ready=E,C.ready(j,function(){d()&&r(M.ALL,function(e){c(e)}),C.feature&&C.feature("domloaded",!0)})}(window); \ No newline at end of file diff --git a/components/oc-client/_package/src/oc-client.js b/components/oc-client/_package/src/oc-client.js index 7bf1038e2..7fa051c91 100644 --- a/components/oc-client/_package/src/oc-client.js +++ b/components/oc-client/_package/src/oc-client.js @@ -1 +1 @@ -"use strict";var oc=oc||{};!function(e,r,n){oc.conf=oc.conf||{},oc.cmd=oc.cmd||[];var o,t="https://cdnjs.cloudflare.com/ajax/libs/",a=t+"jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js",c=t+"handlebars.js/3.0.1/handlebars.runtime.js",i=t+"jade/1.9.2/runtime.min.js",d=t+"jquery/1.11.2/jquery.min.js",u=oc.conf.retryInterval||5e3,f=oc.conf.pollingInterval||500,l=oc.conf.tag||"oc-component",s="Href parameter missing",m="Error getting compiled view: {0}",p="Error rendering component: {0}, error: {1}",v="Failed to retrieve the component. Retrying in {0} seconds...".replace("{0}",u/1e3),h='Error loading component: view engine "{0}" not supported',y="Loading...",g="Component '{0}' correctly rendered",j="Unrendered component found. Trying to retrieve it...",q=oc.conf.debug||!1,b=function(){},x=n.navigator.userAgent,w=!!x.match(/MSIE 8/),C=!!x.match(/MSIE 9/),E=!1,I=!1,U={error:function(e){return console.log(e)},info:function(e){return q?console.log(e):!1}};oc.require=function(r,o,t){"function"==typeof o&&(t=o,o=r,r=void 0),"string"==typeof r&&(r=[r]);var a=function(){var e=n;if("undefined"==typeof r)return!0;for(var o=0;o':"<"+l+' href="'+n+'">"},oc.ready=function(e){if(E)return e();if(I)oc.cmd.push(e);else{I=!0;var r=function(e){!w&&!C||o.IE_POLYFILL_LOADED?e():oc.require(a,e)},n=function(){E=!0,I=!1,e();for(var r=0;r'+y+""),oc.renderByHref(e.attr("href"),function(n,o){return!n&&o&&o.html?void M(e,o,r):U.error(n)}))})},oc.renderByHref=function(e,r){oc.ready(function(){return""===e?r(p.replace("{1}",s)):void o.ajax({url:e,headers:{Accept:"application/vnd.oc.prerendered+json"},contentType:"text/plain",crossDomain:!0,async:!0,success:function(e){if("pre-rendered"===e.renderMode)oc.render(e.template,e.data,function(n,o){return n?r(p.replace("{0}",e.href).replace("{1}",n)):(U.info(g.replace("{0}",e.template.src)),void r(null,{html:o,key:e.template.key,version:e.version}))});else if("rendered"===e.renderMode){if(U.info(g.replace("{0}",e.href)),0===e.html.indexOf("<"+l)){var n=e.html.slice(e.html.indexOf(">")+1),o=n.slice(0,n.lastIndexOf("<"));e.html=o}r(null,{html:e.html,version:e.version})}},error:function(){U.error(v),setTimeout(function(){oc.renderByHref(e,r)},u)}})})},oc.renderUnloadedComponents=function(){oc.ready(function(){var e=w?"div[data-oc-component=true]":l,r=o(e+"[data-rendered!=true]"),n=function(e,r){oc.renderNestedComponent(o(e[r]),function(){r++,r0&&n(r,0)})},oc.load=function(e,r,n){oc.ready(function(){if("function"!=typeof n&&(n=b),o(e)){o(e).html("<"+l+' href="'+r+'" />');var t=o(l,e);oc.renderNestedComponent(t,function(){n(t)})}})},oc.ready(oc.renderUnloadedComponents)}(head,document,window); \ No newline at end of file +"use strict";var oc=oc||{};!function(e,r,n){oc.conf=oc.conf||{},oc.cmd=oc.cmd||[];var o,t="https://cdnjs.cloudflare.com/ajax/libs/",a=t+"jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js",c=t+"handlebars.js/3.0.1/handlebars.runtime.js",i=t+"jade/1.9.2/runtime.min.js",d=t+"jquery/1.11.2/jquery.min.js",u=oc.conf.retryInterval||5e3,f=oc.conf.pollingInterval||500,l=oc.conf.tag||"oc-component",s="Href parameter missing",m="Error getting compiled view: {0}",p="Error rendering component: {0}, error: {1}",v="Failed to retrieve the component. Retrying in {0} seconds...".replace("{0}",u/1e3),h='Error loading component: view engine "{0}" not supported',y="Loading...",g="Component '{0}' correctly rendered",j="Unrendered component found. Trying to retrieve it...",q=oc.conf.debug||!1,b=function(){},x=n.navigator.userAgent,w=!!x.match(/MSIE 8/),C=!!x.match(/MSIE 9/),E=!1,I=!1,U={error:function(e){return console.log(e)},info:function(e){return q?console.log(e):!1}};oc.require=function(r,o,t){"function"==typeof o&&(t=o,o=r,r=void 0),"string"==typeof r&&(r=[r]);var a=function(){var e=n;if("undefined"==typeof r)return!0;for(var o=0;o':"<"+l+' href="'+n+'">"},oc.ready=function(e){if(E)return e();if(I)oc.cmd.push(e);else{I=!0;var r=function(e){!w&&!C||o.IE_POLYFILL_LOADED?e():oc.require(a,e)},n=function(){E=!0,I=!1,e();for(var r=0;r'+y+""),oc.renderByHref(e.attr("href"),function(n,o){return n||!o?(U.error(n),r()):void M(e,o,r)}))})},oc.renderByHref=function(e,r){oc.ready(function(){return""===e?r(p.replace("{1}",s)):void o.ajax({url:e,headers:{Accept:"application/vnd.oc.prerendered+json"},contentType:"text/plain",crossDomain:!0,async:!0,success:function(e){if("pre-rendered"===e.renderMode)oc.render(e.template,e.data,function(n,o){return n?r(p.replace("{0}",e.href).replace("{1}",n)):(U.info(g.replace("{0}",e.template.src)),void r(null,{html:o,key:e.template.key,version:e.version}))});else if("rendered"===e.renderMode){if(U.info(g.replace("{0}",e.href)),0===e.html.indexOf("<"+l)){var n=e.html.slice(e.html.indexOf(">")+1),o=n.slice(0,n.lastIndexOf("<"));e.html=o}r(null,{html:e.html,version:e.version})}},error:function(){U.error(v),setTimeout(function(){oc.renderByHref(e,r)},u)}})})},oc.renderUnloadedComponents=function(){oc.ready(function(){var e=w?"div[data-oc-component=true]":l,r=o(e+"[data-rendered!=true]"),n=function(e,r){oc.renderNestedComponent(o(e[r]),function(){r++,r0&&n(r,0)})},oc.load=function(e,r,n){oc.ready(function(){if("function"!=typeof n&&(n=b),o(e)){o(e).html("<"+l+' href="'+r+'" />');var t=o(l,e);oc.renderNestedComponent(t,function(){n(t)})}})},oc.ready(oc.renderUnloadedComponents)}(head,document,window); \ No newline at end of file diff --git a/components/oc-client/_package/src/oc-client.min.js b/components/oc-client/_package/src/oc-client.min.js index c25b08c1e..84a64865f 100644 --- a/components/oc-client/_package/src/oc-client.min.js +++ b/components/oc-client/_package/src/oc-client.min.js @@ -1 +1 @@ -!function(e,n){"use strict";function t(){}function r(e,n){if(e){"object"==typeof e&&(e=[].slice.call(e));for(var t=0,r=e.length;r>t;t++)n.call(e,e[t],t)}}function o(e,t){var r=Object.prototype.toString.call(t).slice(8,-1);return t!==n&&null!==t&&r===e}function a(e){return o("Function",e)}function c(e){return o("Array",e)}function i(e){var n=e.split("/"),t=n[n.length-1],r=t.indexOf("?");return-1!==r?t.substring(0,r):t}function u(e){e=e||t,e._done||(e(),e._done=1)}function d(e,n,r,o){var a="object"==typeof e?e:{test:e,success:n?c(n)?n:[n]:!1,failure:r?c(r)?r:[r]:!1,callback:o||t},i=!!a.test;return i&&a.success?(a.success.push(a.callback),A.load.apply(null,a.success)):!i&&a.failure?(a.failure.push(a.callback),A.load.apply(null,a.failure)):o(),A}function l(e){var n={};if("object"==typeof e)for(var t in e)e[t]&&(n={name:t,url:e[t]});else n={name:i(e),url:e};var r=C[n.name];return r&&r.url===n.url?r:(C[n.name]=n,n)}function s(e){e=e||C;for(var n in e)if(e.hasOwnProperty(n)&&e[n].state!==U)return!1;return!0}function f(e){e.state=k,r(e.onpreload,function(e){e.call()})}function m(e,t){e.state===n&&(e.state=S,e.onpreload=[],g({url:e.url,type:"cache"},function(){f(e)}))}function p(){var e=arguments,n=e[e.length-1],t=[].slice.call(e,1),o=t[0];return a(n)||(n=null),c(e[0])?(e[0].push(n),A.load.apply(null,e[0]),A):(o?(r(t,function(e){!a(e)&&e&&m(l(e))}),y(l(e[0]),a(o)?o:function(){A.load.apply(null,t)})):y(l(e[0])),A)}function v(){var e=arguments,n=e[e.length-1],t={};return a(n)||(n=null),c(e[0])?(e[0].push(n),A.load.apply(null,e[0]),A):(r(e,function(e,r){e!==n&&(e=l(e),t[e.name]=e)}),r(e,function(e,r){e!==n&&(e=l(e),y(e,function(){s(t)&&u(n)}))}),A)}function y(e,n){return n=n||t,e.state===U?void n():e.state===I?void A.ready(e.name,n):e.state===S?void e.onpreload.push(function(){y(e,n)}):(e.state=I,void g(e,function(){e.state=U,n(),r(w[e.name],function(e){u(e)}),L&&s()&&r(w.ALL,function(e){u(e)})}))}function h(e){e=e||"";var n=e.split("?")[0].split(".");return n[n.length-1].toLowerCase()}function g(n,r){function o(n){n=n||e.event,i.onload=i.onreadystatechange=i.onerror=null,r()}function a(t){t=t||e.event,("load"===t.type||/loaded|complete/.test(i.readyState)&&(!q.documentMode||q.documentMode<9))&&(e.clearTimeout(n.errorTimeout),e.clearTimeout(n.cssTimeout),i.onload=i.onreadystatechange=i.onerror=null,r())}function c(){if(n.state!==U&&n.cssRetries<=20){for(var t=0,r=q.styleSheets.length;r>t;t++)if(q.styleSheets[t].href===i.href)return void a({type:"load"});n.cssRetries++,n.cssTimeout=e.setTimeout(c,250)}}r=r||t;var i,u=h(n.url);"css"===u?(i=q.createElement("link"),i.type="text/"+(n.type||"css"),i.rel="stylesheet",i.href=n.url,n.cssRetries=0,n.cssTimeout=e.setTimeout(c,500)):(i=q.createElement("script"),i.type="text/"+(n.type||"javascript"),i.src=n.url),i.onload=i.onreadystatechange=a,i.onerror=o,i.async=!1,i.defer=!1,n.errorTimeout=e.setTimeout(function(){o({type:"timeout"})},7e3);var d=q.head||q.getElementsByTagName("head")[0];d.insertBefore(i,d.lastChild)}function j(){for(var e=q.getElementsByTagName("script"),n=0,t=e.length;t>n;n++){var r=e[n].getAttribute("data-headjs-load");if(r)return void A.load(r)}}function T(e,n){if(e===q)return L?u(n):x.push(n),A;if(a(e)&&(n=e,e="ALL"),c(e)){var t={};return r(e,function(e){t[e]=C[e],A.ready(e,function(){s(t)&&u(n)})}),A}if("string"!=typeof e||!a(n))return A;var o=C[e];if(o&&o.state===U||"ALL"===e&&s()&&L)return u(n),A;var i=w[e];return i?i.push(n):i=w[e]=[n],A}function b(){return q.body?void(L||(L=!0,j(),r(x,function(e){u(e)}))):(e.clearTimeout(A.readyTimeout),void(A.readyTimeout=e.setTimeout(b,50)))}function E(){q.addEventListener?(q.removeEventListener("DOMContentLoaded",E,!1),b()):"complete"===q.readyState&&(q.detachEvent("onreadystatechange",E),b())}var L,q=e.document,x=[],w={},C={},M="async"in q.createElement("script")||"MozAppearance"in q.documentElement.style||e.opera,O=e.head_conf&&e.head_conf.head||"head",A=e[O]=e[O]||function(){A.ready.apply(null,arguments)},S=1,k=2,I=3,U=4;if("complete"===q.readyState)b();else if(q.addEventListener)q.addEventListener("DOMContentLoaded",E,!1),e.addEventListener("load",b,!1);else{q.attachEvent("onreadystatechange",E),e.attachEvent("onload",b);var B=!1;try{B=!e.frameElement&&q.documentElement}catch(_){}B&&B.doScroll&&!function D(){if(!L){try{B.doScroll("left")}catch(n){return e.clearTimeout(A.readyTimeout),void(A.readyTimeout=e.setTimeout(D,50))}b()}}()}A.load=A.js=M?v:p,A.test=d,A.ready=T,A.ready(q,function(){s()&&r(w.ALL,function(e){u(e)}),A.feature&&A.feature("domloaded",!0)})}(window);var oc=oc||{};!function(e,n,t){oc.conf=oc.conf||{},oc.cmd=oc.cmd||[];var r,o="https://cdnjs.cloudflare.com/ajax/libs/",a=o+"jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js",c=o+"handlebars.js/3.0.1/handlebars.runtime.js",i=o+"jade/1.9.2/runtime.min.js",u=o+"jquery/1.11.2/jquery.min.js",d=oc.conf.retryInterval||5e3,l=oc.conf.pollingInterval||500,s=oc.conf.tag||"oc-component",f="Href parameter missing",m="Error getting compiled view: {0}",p="Error rendering component: {0}, error: {1}",v="Failed to retrieve the component. Retrying in {0} seconds...".replace("{0}",d/1e3),y='Error loading component: view engine "{0}" not supported',h="Loading...",g="Component '{0}' correctly rendered",j="Unrendered component found. Trying to retrieve it...",T=oc.conf.debug||!1,b=function(){},E=t.navigator.userAgent,L=!!E.match(/MSIE 8/),q=!!E.match(/MSIE 9/),x=!1,w=!1,C={error:function(e){return console.log(e)},info:function(e){return T?console.log(e):!1}};oc.require=function(n,r,o){"function"==typeof r&&(o=r,r=n,n=void 0),"string"==typeof n&&(n=[n]);var a=function(){var e=t;if("undefined"==typeof n)return!0;for(var r=0;r':"<"+s+' href="'+t+'">"},oc.ready=function(e){if(x)return e();if(w)oc.cmd.push(e);else{w=!0;var n=function(e){!L&&!q||r.IE_POLYFILL_LOADED?e():oc.require(a,e)},t=function(){x=!0,w=!1,e();for(var n=0;n'+h+""),oc.renderByHref(e.attr("href"),function(t,r){return!t&&r&&r.html?void M(e,r,n):C.error(t)}))})},oc.renderByHref=function(e,n){oc.ready(function(){return""===e?n(p.replace("{1}",f)):void r.ajax({url:e,headers:{Accept:"application/vnd.oc.prerendered+json"},contentType:"text/plain",crossDomain:!0,async:!0,success:function(e){if("pre-rendered"===e.renderMode)oc.render(e.template,e.data,function(t,r){return t?n(p.replace("{0}",e.href).replace("{1}",t)):(C.info(g.replace("{0}",e.template.src)),void n(null,{html:r,key:e.template.key,version:e.version}))});else if("rendered"===e.renderMode){if(C.info(g.replace("{0}",e.href)),0===e.html.indexOf("<"+s)){var t=e.html.slice(e.html.indexOf(">")+1),r=t.slice(0,t.lastIndexOf("<"));e.html=r}n(null,{html:e.html,version:e.version})}},error:function(){C.error(v),setTimeout(function(){oc.renderByHref(e,n)},d)}})})},oc.renderUnloadedComponents=function(){oc.ready(function(){var e=L?"div[data-oc-component=true]":s,n=r(e+"[data-rendered!=true]"),t=function(e,n){oc.renderNestedComponent(r(e[n]),function(){n++,n0&&t(n,0)})},oc.load=function(e,n,t){oc.ready(function(){if("function"!=typeof t&&(t=b),r(e)){r(e).html("<"+s+' href="'+n+'" />');var o=r(s,e);oc.renderNestedComponent(o,function(){t(o)})}})},oc.ready(oc.renderUnloadedComponents)}(head,document,window),oc.clientVersion="0.18.2"; \ No newline at end of file +!function(e,n){"use strict";function t(){}function r(e,n){if(e){"object"==typeof e&&(e=[].slice.call(e));for(var t=0,r=e.length;r>t;t++)n.call(e,e[t],t)}}function o(e,t){var r=Object.prototype.toString.call(t).slice(8,-1);return t!==n&&null!==t&&r===e}function a(e){return o("Function",e)}function c(e){return o("Array",e)}function i(e){var n=e.split("/"),t=n[n.length-1],r=t.indexOf("?");return-1!==r?t.substring(0,r):t}function u(e){e=e||t,e._done||(e(),e._done=1)}function d(e,n,r,o){var a="object"==typeof e?e:{test:e,success:n?c(n)?n:[n]:!1,failure:r?c(r)?r:[r]:!1,callback:o||t},i=!!a.test;return i&&a.success?(a.success.push(a.callback),A.load.apply(null,a.success)):!i&&a.failure?(a.failure.push(a.callback),A.load.apply(null,a.failure)):o(),A}function l(e){var n={};if("object"==typeof e)for(var t in e)e[t]&&(n={name:t,url:e[t]});else n={name:i(e),url:e};var r=C[n.name];return r&&r.url===n.url?r:(C[n.name]=n,n)}function s(e){e=e||C;for(var n in e)if(e.hasOwnProperty(n)&&e[n].state!==U)return!1;return!0}function f(e){e.state=k,r(e.onpreload,function(e){e.call()})}function m(e){e.state===n&&(e.state=S,e.onpreload=[],g({url:e.url,type:"cache"},function(){f(e)}))}function p(){var e=arguments,n=e[e.length-1],t=[].slice.call(e,1),o=t[0];return a(n)||(n=null),c(e[0])?(e[0].push(n),A.load.apply(null,e[0]),A):(o?(r(t,function(e){!a(e)&&e&&m(l(e))}),y(l(e[0]),a(o)?o:function(){A.load.apply(null,t)})):y(l(e[0])),A)}function v(){var e=arguments,n=e[e.length-1],t={};return a(n)||(n=null),c(e[0])?(e[0].push(n),A.load.apply(null,e[0]),A):(r(e,function(e){e!==n&&(e=l(e),t[e.name]=e)}),r(e,function(e){e!==n&&(e=l(e),y(e,function(){s(t)&&u(n)}))}),A)}function y(e,n){return n=n||t,e.state===U?void n():e.state===I?void A.ready(e.name,n):e.state===S?void e.onpreload.push(function(){y(e,n)}):(e.state=I,void g(e,function(){e.state=U,n(),r(w[e.name],function(e){u(e)}),L&&s()&&r(w.ALL,function(e){u(e)})}))}function h(e){e=e||"";var n=e.split("?")[0].split(".");return n[n.length-1].toLowerCase()}function g(n,r){function o(n){n=n||e.event,i.onload=i.onreadystatechange=i.onerror=null,r()}function a(t){t=t||e.event,("load"===t.type||/loaded|complete/.test(i.readyState)&&(!q.documentMode||q.documentMode<9))&&(e.clearTimeout(n.errorTimeout),e.clearTimeout(n.cssTimeout),i.onload=i.onreadystatechange=i.onerror=null,r())}function c(){if(n.state!==U&&n.cssRetries<=20){for(var t=0,r=q.styleSheets.length;r>t;t++)if(q.styleSheets[t].href===i.href)return void a({type:"load"});n.cssRetries++,n.cssTimeout=e.setTimeout(c,250)}}r=r||t;var i,u=h(n.url);"css"===u?(i=q.createElement("link"),i.type="text/"+(n.type||"css"),i.rel="stylesheet",i.href=n.url,n.cssRetries=0,n.cssTimeout=e.setTimeout(c,500)):(i=q.createElement("script"),i.type="text/"+(n.type||"javascript"),i.src=n.url),i.onload=i.onreadystatechange=a,i.onerror=o,i.async=!1,i.defer=!1,n.errorTimeout=e.setTimeout(function(){o({type:"timeout"})},7e3);var d=q.head||q.getElementsByTagName("head")[0];d.insertBefore(i,d.lastChild)}function j(){for(var e=q.getElementsByTagName("script"),n=0,t=e.length;t>n;n++){var r=e[n].getAttribute("data-headjs-load");if(r)return void A.load(r)}}function T(e,n){if(e===q)return L?u(n):x.push(n),A;if(a(e)&&(n=e,e="ALL"),c(e)){var t={};return r(e,function(e){t[e]=C[e],A.ready(e,function(){s(t)&&u(n)})}),A}if("string"!=typeof e||!a(n))return A;var o=C[e];if(o&&o.state===U||"ALL"===e&&s()&&L)return u(n),A;var i=w[e];return i?i.push(n):i=w[e]=[n],A}function b(){return q.body?void(L||(L=!0,j(),r(x,function(e){u(e)}))):(e.clearTimeout(A.readyTimeout),void(A.readyTimeout=e.setTimeout(b,50)))}function E(){q.addEventListener?(q.removeEventListener("DOMContentLoaded",E,!1),b()):"complete"===q.readyState&&(q.detachEvent("onreadystatechange",E),b())}var L,q=e.document,x=[],w={},C={},M="async"in q.createElement("script")||"MozAppearance"in q.documentElement.style||e.opera,O=e.head_conf&&e.head_conf.head||"head",A=e[O]=e[O]||function(){A.ready.apply(null,arguments)},S=1,k=2,I=3,U=4;if("complete"===q.readyState)b();else if(q.addEventListener)q.addEventListener("DOMContentLoaded",E,!1),e.addEventListener("load",b,!1);else{q.attachEvent("onreadystatechange",E),e.attachEvent("onload",b);var B=!1;try{B=!e.frameElement&&q.documentElement}catch(_){}B&&B.doScroll&&!function D(){if(!L){try{B.doScroll("left")}catch(n){return e.clearTimeout(A.readyTimeout),void(A.readyTimeout=e.setTimeout(D,50))}b()}}()}A.load=A.js=M?v:p,A.test=d,A.ready=T,A.ready(q,function(){s()&&r(w.ALL,function(e){u(e)}),A.feature&&A.feature("domloaded",!0)})}(window);var oc=oc||{};!function(e,n,t){oc.conf=oc.conf||{},oc.cmd=oc.cmd||[];var r,o="https://cdnjs.cloudflare.com/ajax/libs/",a=o+"jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js",c=o+"handlebars.js/3.0.1/handlebars.runtime.js",i=o+"jade/1.9.2/runtime.min.js",u=o+"jquery/1.11.2/jquery.min.js",d=oc.conf.retryInterval||5e3,l=oc.conf.pollingInterval||500,s=oc.conf.tag||"oc-component",f="Href parameter missing",m="Error getting compiled view: {0}",p="Error rendering component: {0}, error: {1}",v="Failed to retrieve the component. Retrying in {0} seconds...".replace("{0}",d/1e3),y='Error loading component: view engine "{0}" not supported',h="Loading...",g="Component '{0}' correctly rendered",j="Unrendered component found. Trying to retrieve it...",T=oc.conf.debug||!1,b=function(){},E=t.navigator.userAgent,L=!!E.match(/MSIE 8/),q=!!E.match(/MSIE 9/),x=!1,w=!1,C={error:function(e){return console.log(e)},info:function(e){return T?console.log(e):!1}};oc.require=function(n,r,o){"function"==typeof r&&(o=r,r=n,n=void 0),"string"==typeof n&&(n=[n]);var a=function(){var e=t;if("undefined"==typeof n)return!0;for(var r=0;r':"<"+s+' href="'+t+'">"},oc.ready=function(e){if(x)return e();if(w)oc.cmd.push(e);else{w=!0;var n=function(e){!L&&!q||r.IE_POLYFILL_LOADED?e():oc.require(a,e)},t=function(){x=!0,w=!1,e();for(var n=0;n'+h+""),oc.renderByHref(e.attr("href"),function(t,r){return t||!r?(C.error(t),n()):void M(e,r,n)}))})},oc.renderByHref=function(e,n){oc.ready(function(){return""===e?n(p.replace("{1}",f)):void r.ajax({url:e,headers:{Accept:"application/vnd.oc.prerendered+json"},contentType:"text/plain",crossDomain:!0,async:!0,success:function(e){if("pre-rendered"===e.renderMode)oc.render(e.template,e.data,function(t,r){return t?n(p.replace("{0}",e.href).replace("{1}",t)):(C.info(g.replace("{0}",e.template.src)),void n(null,{html:r,key:e.template.key,version:e.version}))});else if("rendered"===e.renderMode){if(C.info(g.replace("{0}",e.href)),0===e.html.indexOf("<"+s)){var t=e.html.slice(e.html.indexOf(">")+1),r=t.slice(0,t.lastIndexOf("<"));e.html=r}n(null,{html:e.html,version:e.version})}},error:function(){C.error(v),setTimeout(function(){oc.renderByHref(e,n)},d)}})})},oc.renderUnloadedComponents=function(){oc.ready(function(){var e=L?"div[data-oc-component=true]":s,n=r(e+"[data-rendered!=true]"),t=function(e,n){oc.renderNestedComponent(r(e[n]),function(){n++,n0&&t(n,0)})},oc.load=function(e,n,t){oc.ready(function(){if("function"!=typeof t&&(t=b),r(e)){r(e).html("<"+s+' href="'+n+'" />');var o=r(s,e);oc.renderNestedComponent(o,function(){t(o)})}})},oc.ready(oc.renderUnloadedComponents)}(head,document,window),oc.clientVersion="0.18.2"; \ No newline at end of file diff --git a/components/oc-client/src/oc-client.min.js b/components/oc-client/src/oc-client.min.js index c25b08c1e..84a64865f 100644 --- a/components/oc-client/src/oc-client.min.js +++ b/components/oc-client/src/oc-client.min.js @@ -1 +1 @@ -!function(e,n){"use strict";function t(){}function r(e,n){if(e){"object"==typeof e&&(e=[].slice.call(e));for(var t=0,r=e.length;r>t;t++)n.call(e,e[t],t)}}function o(e,t){var r=Object.prototype.toString.call(t).slice(8,-1);return t!==n&&null!==t&&r===e}function a(e){return o("Function",e)}function c(e){return o("Array",e)}function i(e){var n=e.split("/"),t=n[n.length-1],r=t.indexOf("?");return-1!==r?t.substring(0,r):t}function u(e){e=e||t,e._done||(e(),e._done=1)}function d(e,n,r,o){var a="object"==typeof e?e:{test:e,success:n?c(n)?n:[n]:!1,failure:r?c(r)?r:[r]:!1,callback:o||t},i=!!a.test;return i&&a.success?(a.success.push(a.callback),A.load.apply(null,a.success)):!i&&a.failure?(a.failure.push(a.callback),A.load.apply(null,a.failure)):o(),A}function l(e){var n={};if("object"==typeof e)for(var t in e)e[t]&&(n={name:t,url:e[t]});else n={name:i(e),url:e};var r=C[n.name];return r&&r.url===n.url?r:(C[n.name]=n,n)}function s(e){e=e||C;for(var n in e)if(e.hasOwnProperty(n)&&e[n].state!==U)return!1;return!0}function f(e){e.state=k,r(e.onpreload,function(e){e.call()})}function m(e,t){e.state===n&&(e.state=S,e.onpreload=[],g({url:e.url,type:"cache"},function(){f(e)}))}function p(){var e=arguments,n=e[e.length-1],t=[].slice.call(e,1),o=t[0];return a(n)||(n=null),c(e[0])?(e[0].push(n),A.load.apply(null,e[0]),A):(o?(r(t,function(e){!a(e)&&e&&m(l(e))}),y(l(e[0]),a(o)?o:function(){A.load.apply(null,t)})):y(l(e[0])),A)}function v(){var e=arguments,n=e[e.length-1],t={};return a(n)||(n=null),c(e[0])?(e[0].push(n),A.load.apply(null,e[0]),A):(r(e,function(e,r){e!==n&&(e=l(e),t[e.name]=e)}),r(e,function(e,r){e!==n&&(e=l(e),y(e,function(){s(t)&&u(n)}))}),A)}function y(e,n){return n=n||t,e.state===U?void n():e.state===I?void A.ready(e.name,n):e.state===S?void e.onpreload.push(function(){y(e,n)}):(e.state=I,void g(e,function(){e.state=U,n(),r(w[e.name],function(e){u(e)}),L&&s()&&r(w.ALL,function(e){u(e)})}))}function h(e){e=e||"";var n=e.split("?")[0].split(".");return n[n.length-1].toLowerCase()}function g(n,r){function o(n){n=n||e.event,i.onload=i.onreadystatechange=i.onerror=null,r()}function a(t){t=t||e.event,("load"===t.type||/loaded|complete/.test(i.readyState)&&(!q.documentMode||q.documentMode<9))&&(e.clearTimeout(n.errorTimeout),e.clearTimeout(n.cssTimeout),i.onload=i.onreadystatechange=i.onerror=null,r())}function c(){if(n.state!==U&&n.cssRetries<=20){for(var t=0,r=q.styleSheets.length;r>t;t++)if(q.styleSheets[t].href===i.href)return void a({type:"load"});n.cssRetries++,n.cssTimeout=e.setTimeout(c,250)}}r=r||t;var i,u=h(n.url);"css"===u?(i=q.createElement("link"),i.type="text/"+(n.type||"css"),i.rel="stylesheet",i.href=n.url,n.cssRetries=0,n.cssTimeout=e.setTimeout(c,500)):(i=q.createElement("script"),i.type="text/"+(n.type||"javascript"),i.src=n.url),i.onload=i.onreadystatechange=a,i.onerror=o,i.async=!1,i.defer=!1,n.errorTimeout=e.setTimeout(function(){o({type:"timeout"})},7e3);var d=q.head||q.getElementsByTagName("head")[0];d.insertBefore(i,d.lastChild)}function j(){for(var e=q.getElementsByTagName("script"),n=0,t=e.length;t>n;n++){var r=e[n].getAttribute("data-headjs-load");if(r)return void A.load(r)}}function T(e,n){if(e===q)return L?u(n):x.push(n),A;if(a(e)&&(n=e,e="ALL"),c(e)){var t={};return r(e,function(e){t[e]=C[e],A.ready(e,function(){s(t)&&u(n)})}),A}if("string"!=typeof e||!a(n))return A;var o=C[e];if(o&&o.state===U||"ALL"===e&&s()&&L)return u(n),A;var i=w[e];return i?i.push(n):i=w[e]=[n],A}function b(){return q.body?void(L||(L=!0,j(),r(x,function(e){u(e)}))):(e.clearTimeout(A.readyTimeout),void(A.readyTimeout=e.setTimeout(b,50)))}function E(){q.addEventListener?(q.removeEventListener("DOMContentLoaded",E,!1),b()):"complete"===q.readyState&&(q.detachEvent("onreadystatechange",E),b())}var L,q=e.document,x=[],w={},C={},M="async"in q.createElement("script")||"MozAppearance"in q.documentElement.style||e.opera,O=e.head_conf&&e.head_conf.head||"head",A=e[O]=e[O]||function(){A.ready.apply(null,arguments)},S=1,k=2,I=3,U=4;if("complete"===q.readyState)b();else if(q.addEventListener)q.addEventListener("DOMContentLoaded",E,!1),e.addEventListener("load",b,!1);else{q.attachEvent("onreadystatechange",E),e.attachEvent("onload",b);var B=!1;try{B=!e.frameElement&&q.documentElement}catch(_){}B&&B.doScroll&&!function D(){if(!L){try{B.doScroll("left")}catch(n){return e.clearTimeout(A.readyTimeout),void(A.readyTimeout=e.setTimeout(D,50))}b()}}()}A.load=A.js=M?v:p,A.test=d,A.ready=T,A.ready(q,function(){s()&&r(w.ALL,function(e){u(e)}),A.feature&&A.feature("domloaded",!0)})}(window);var oc=oc||{};!function(e,n,t){oc.conf=oc.conf||{},oc.cmd=oc.cmd||[];var r,o="https://cdnjs.cloudflare.com/ajax/libs/",a=o+"jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js",c=o+"handlebars.js/3.0.1/handlebars.runtime.js",i=o+"jade/1.9.2/runtime.min.js",u=o+"jquery/1.11.2/jquery.min.js",d=oc.conf.retryInterval||5e3,l=oc.conf.pollingInterval||500,s=oc.conf.tag||"oc-component",f="Href parameter missing",m="Error getting compiled view: {0}",p="Error rendering component: {0}, error: {1}",v="Failed to retrieve the component. Retrying in {0} seconds...".replace("{0}",d/1e3),y='Error loading component: view engine "{0}" not supported',h="Loading...",g="Component '{0}' correctly rendered",j="Unrendered component found. Trying to retrieve it...",T=oc.conf.debug||!1,b=function(){},E=t.navigator.userAgent,L=!!E.match(/MSIE 8/),q=!!E.match(/MSIE 9/),x=!1,w=!1,C={error:function(e){return console.log(e)},info:function(e){return T?console.log(e):!1}};oc.require=function(n,r,o){"function"==typeof r&&(o=r,r=n,n=void 0),"string"==typeof n&&(n=[n]);var a=function(){var e=t;if("undefined"==typeof n)return!0;for(var r=0;r':"<"+s+' href="'+t+'">"},oc.ready=function(e){if(x)return e();if(w)oc.cmd.push(e);else{w=!0;var n=function(e){!L&&!q||r.IE_POLYFILL_LOADED?e():oc.require(a,e)},t=function(){x=!0,w=!1,e();for(var n=0;n'+h+""),oc.renderByHref(e.attr("href"),function(t,r){return!t&&r&&r.html?void M(e,r,n):C.error(t)}))})},oc.renderByHref=function(e,n){oc.ready(function(){return""===e?n(p.replace("{1}",f)):void r.ajax({url:e,headers:{Accept:"application/vnd.oc.prerendered+json"},contentType:"text/plain",crossDomain:!0,async:!0,success:function(e){if("pre-rendered"===e.renderMode)oc.render(e.template,e.data,function(t,r){return t?n(p.replace("{0}",e.href).replace("{1}",t)):(C.info(g.replace("{0}",e.template.src)),void n(null,{html:r,key:e.template.key,version:e.version}))});else if("rendered"===e.renderMode){if(C.info(g.replace("{0}",e.href)),0===e.html.indexOf("<"+s)){var t=e.html.slice(e.html.indexOf(">")+1),r=t.slice(0,t.lastIndexOf("<"));e.html=r}n(null,{html:e.html,version:e.version})}},error:function(){C.error(v),setTimeout(function(){oc.renderByHref(e,n)},d)}})})},oc.renderUnloadedComponents=function(){oc.ready(function(){var e=L?"div[data-oc-component=true]":s,n=r(e+"[data-rendered!=true]"),t=function(e,n){oc.renderNestedComponent(r(e[n]),function(){n++,n0&&t(n,0)})},oc.load=function(e,n,t){oc.ready(function(){if("function"!=typeof t&&(t=b),r(e)){r(e).html("<"+s+' href="'+n+'" />');var o=r(s,e);oc.renderNestedComponent(o,function(){t(o)})}})},oc.ready(oc.renderUnloadedComponents)}(head,document,window),oc.clientVersion="0.18.2"; \ No newline at end of file +!function(e,n){"use strict";function t(){}function r(e,n){if(e){"object"==typeof e&&(e=[].slice.call(e));for(var t=0,r=e.length;r>t;t++)n.call(e,e[t],t)}}function o(e,t){var r=Object.prototype.toString.call(t).slice(8,-1);return t!==n&&null!==t&&r===e}function a(e){return o("Function",e)}function c(e){return o("Array",e)}function i(e){var n=e.split("/"),t=n[n.length-1],r=t.indexOf("?");return-1!==r?t.substring(0,r):t}function u(e){e=e||t,e._done||(e(),e._done=1)}function d(e,n,r,o){var a="object"==typeof e?e:{test:e,success:n?c(n)?n:[n]:!1,failure:r?c(r)?r:[r]:!1,callback:o||t},i=!!a.test;return i&&a.success?(a.success.push(a.callback),A.load.apply(null,a.success)):!i&&a.failure?(a.failure.push(a.callback),A.load.apply(null,a.failure)):o(),A}function l(e){var n={};if("object"==typeof e)for(var t in e)e[t]&&(n={name:t,url:e[t]});else n={name:i(e),url:e};var r=C[n.name];return r&&r.url===n.url?r:(C[n.name]=n,n)}function s(e){e=e||C;for(var n in e)if(e.hasOwnProperty(n)&&e[n].state!==U)return!1;return!0}function f(e){e.state=k,r(e.onpreload,function(e){e.call()})}function m(e){e.state===n&&(e.state=S,e.onpreload=[],g({url:e.url,type:"cache"},function(){f(e)}))}function p(){var e=arguments,n=e[e.length-1],t=[].slice.call(e,1),o=t[0];return a(n)||(n=null),c(e[0])?(e[0].push(n),A.load.apply(null,e[0]),A):(o?(r(t,function(e){!a(e)&&e&&m(l(e))}),y(l(e[0]),a(o)?o:function(){A.load.apply(null,t)})):y(l(e[0])),A)}function v(){var e=arguments,n=e[e.length-1],t={};return a(n)||(n=null),c(e[0])?(e[0].push(n),A.load.apply(null,e[0]),A):(r(e,function(e){e!==n&&(e=l(e),t[e.name]=e)}),r(e,function(e){e!==n&&(e=l(e),y(e,function(){s(t)&&u(n)}))}),A)}function y(e,n){return n=n||t,e.state===U?void n():e.state===I?void A.ready(e.name,n):e.state===S?void e.onpreload.push(function(){y(e,n)}):(e.state=I,void g(e,function(){e.state=U,n(),r(w[e.name],function(e){u(e)}),L&&s()&&r(w.ALL,function(e){u(e)})}))}function h(e){e=e||"";var n=e.split("?")[0].split(".");return n[n.length-1].toLowerCase()}function g(n,r){function o(n){n=n||e.event,i.onload=i.onreadystatechange=i.onerror=null,r()}function a(t){t=t||e.event,("load"===t.type||/loaded|complete/.test(i.readyState)&&(!q.documentMode||q.documentMode<9))&&(e.clearTimeout(n.errorTimeout),e.clearTimeout(n.cssTimeout),i.onload=i.onreadystatechange=i.onerror=null,r())}function c(){if(n.state!==U&&n.cssRetries<=20){for(var t=0,r=q.styleSheets.length;r>t;t++)if(q.styleSheets[t].href===i.href)return void a({type:"load"});n.cssRetries++,n.cssTimeout=e.setTimeout(c,250)}}r=r||t;var i,u=h(n.url);"css"===u?(i=q.createElement("link"),i.type="text/"+(n.type||"css"),i.rel="stylesheet",i.href=n.url,n.cssRetries=0,n.cssTimeout=e.setTimeout(c,500)):(i=q.createElement("script"),i.type="text/"+(n.type||"javascript"),i.src=n.url),i.onload=i.onreadystatechange=a,i.onerror=o,i.async=!1,i.defer=!1,n.errorTimeout=e.setTimeout(function(){o({type:"timeout"})},7e3);var d=q.head||q.getElementsByTagName("head")[0];d.insertBefore(i,d.lastChild)}function j(){for(var e=q.getElementsByTagName("script"),n=0,t=e.length;t>n;n++){var r=e[n].getAttribute("data-headjs-load");if(r)return void A.load(r)}}function T(e,n){if(e===q)return L?u(n):x.push(n),A;if(a(e)&&(n=e,e="ALL"),c(e)){var t={};return r(e,function(e){t[e]=C[e],A.ready(e,function(){s(t)&&u(n)})}),A}if("string"!=typeof e||!a(n))return A;var o=C[e];if(o&&o.state===U||"ALL"===e&&s()&&L)return u(n),A;var i=w[e];return i?i.push(n):i=w[e]=[n],A}function b(){return q.body?void(L||(L=!0,j(),r(x,function(e){u(e)}))):(e.clearTimeout(A.readyTimeout),void(A.readyTimeout=e.setTimeout(b,50)))}function E(){q.addEventListener?(q.removeEventListener("DOMContentLoaded",E,!1),b()):"complete"===q.readyState&&(q.detachEvent("onreadystatechange",E),b())}var L,q=e.document,x=[],w={},C={},M="async"in q.createElement("script")||"MozAppearance"in q.documentElement.style||e.opera,O=e.head_conf&&e.head_conf.head||"head",A=e[O]=e[O]||function(){A.ready.apply(null,arguments)},S=1,k=2,I=3,U=4;if("complete"===q.readyState)b();else if(q.addEventListener)q.addEventListener("DOMContentLoaded",E,!1),e.addEventListener("load",b,!1);else{q.attachEvent("onreadystatechange",E),e.attachEvent("onload",b);var B=!1;try{B=!e.frameElement&&q.documentElement}catch(_){}B&&B.doScroll&&!function D(){if(!L){try{B.doScroll("left")}catch(n){return e.clearTimeout(A.readyTimeout),void(A.readyTimeout=e.setTimeout(D,50))}b()}}()}A.load=A.js=M?v:p,A.test=d,A.ready=T,A.ready(q,function(){s()&&r(w.ALL,function(e){u(e)}),A.feature&&A.feature("domloaded",!0)})}(window);var oc=oc||{};!function(e,n,t){oc.conf=oc.conf||{},oc.cmd=oc.cmd||[];var r,o="https://cdnjs.cloudflare.com/ajax/libs/",a=o+"jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js",c=o+"handlebars.js/3.0.1/handlebars.runtime.js",i=o+"jade/1.9.2/runtime.min.js",u=o+"jquery/1.11.2/jquery.min.js",d=oc.conf.retryInterval||5e3,l=oc.conf.pollingInterval||500,s=oc.conf.tag||"oc-component",f="Href parameter missing",m="Error getting compiled view: {0}",p="Error rendering component: {0}, error: {1}",v="Failed to retrieve the component. Retrying in {0} seconds...".replace("{0}",d/1e3),y='Error loading component: view engine "{0}" not supported',h="Loading...",g="Component '{0}' correctly rendered",j="Unrendered component found. Trying to retrieve it...",T=oc.conf.debug||!1,b=function(){},E=t.navigator.userAgent,L=!!E.match(/MSIE 8/),q=!!E.match(/MSIE 9/),x=!1,w=!1,C={error:function(e){return console.log(e)},info:function(e){return T?console.log(e):!1}};oc.require=function(n,r,o){"function"==typeof r&&(o=r,r=n,n=void 0),"string"==typeof n&&(n=[n]);var a=function(){var e=t;if("undefined"==typeof n)return!0;for(var r=0;r':"<"+s+' href="'+t+'">"},oc.ready=function(e){if(x)return e();if(w)oc.cmd.push(e);else{w=!0;var n=function(e){!L&&!q||r.IE_POLYFILL_LOADED?e():oc.require(a,e)},t=function(){x=!0,w=!1,e();for(var n=0;n'+h+""),oc.renderByHref(e.attr("href"),function(t,r){return t||!r?(C.error(t),n()):void M(e,r,n)}))})},oc.renderByHref=function(e,n){oc.ready(function(){return""===e?n(p.replace("{1}",f)):void r.ajax({url:e,headers:{Accept:"application/vnd.oc.prerendered+json"},contentType:"text/plain",crossDomain:!0,async:!0,success:function(e){if("pre-rendered"===e.renderMode)oc.render(e.template,e.data,function(t,r){return t?n(p.replace("{0}",e.href).replace("{1}",t)):(C.info(g.replace("{0}",e.template.src)),void n(null,{html:r,key:e.template.key,version:e.version}))});else if("rendered"===e.renderMode){if(C.info(g.replace("{0}",e.href)),0===e.html.indexOf("<"+s)){var t=e.html.slice(e.html.indexOf(">")+1),r=t.slice(0,t.lastIndexOf("<"));e.html=r}n(null,{html:e.html,version:e.version})}},error:function(){C.error(v),setTimeout(function(){oc.renderByHref(e,n)},d)}})})},oc.renderUnloadedComponents=function(){oc.ready(function(){var e=L?"div[data-oc-component=true]":s,n=r(e+"[data-rendered!=true]"),t=function(e,n){oc.renderNestedComponent(r(e[n]),function(){n++,n0&&t(n,0)})},oc.load=function(e,n,t){oc.ready(function(){if("function"!=typeof t&&(t=b),r(e)){r(e).html("<"+s+' href="'+n+'" />');var o=r(s,e);oc.renderNestedComponent(o,function(){t(o)})}})},oc.ready(oc.renderUnloadedComponents)}(head,document,window),oc.clientVersion="0.18.2"; \ No newline at end of file