From 3e3ff00cabcf4c314d89a70c415d6406ff966a72 Mon Sep 17 00:00:00 2001 From: Matteo Figus Date: Thu, 10 Mar 2016 01:27:22 +0000 Subject: [PATCH 1/2] Added license on minified oc-client.min.js --- LICENSE => LICENSE.md | 2 +- client/src/oc-client.min.js | 1 + components/oc-client/LICENSES.md | 112 ++++++++++++++++++ components/oc-client/_package/package.json | 2 +- .../oc-client/_package/src/oc-client.min.js | 1 + components/oc-client/src/oc-client.min.js | 1 + grunt-tasks/support/task-build.js | 14 ++- 7 files changed, 127 insertions(+), 6 deletions(-) rename LICENSE => LICENSE.md (96%) create mode 100644 components/oc-client/LICENSES.md diff --git a/LICENSE b/LICENSE.md similarity index 96% rename from LICENSE rename to LICENSE.md index 17841b3bd..dc5a0e22f 100644 --- a/LICENSE +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2015 OpenTable, Inc. +Copyright (c) 2015-2016 OpenTable, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/client/src/oc-client.min.js b/client/src/oc-client.min.js index 721f7468d..3c7eb6e72 100644 --- a/client/src/oc-client.min.js +++ b/client/src/oc-client.min.js @@ -1,2 +1,3 @@ +/*! OpenComponents client v0.28.0 | (c) 2015-2016 OpenTable, Inc. | https://github.com/opentable/oc/tree/master/components/oc-client/LICENSES.md */ !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),S.load.apply(null,a.success)):!i&&a.failure?(a.failure.push(a.callback),S.load.apply(null,a.failure)):o(),S}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=O[n.name];return r&&r.url===n.url?r:(O[n.name]=n,n)}function s(e){e=e||O;for(var n in e)if(e.hasOwnProperty(n)&&e[n].state!==_)return!1;return!0}function f(e){e.state=A,r(e.onpreload,function(e){e.call()})}function m(e,t){e.state===n&&(e.state=$,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),S.load.apply(null,e[0]),S):(o?(r(t,function(e){!a(e)&&e&&m(l(e))}),y(l(e[0]),a(o)?o:function(){S.load.apply(null,t)})):y(l(e[0])),S)}function v(){var e=arguments,n=e[e.length-1],t={};return a(n)||(n=null),c(e[0])?(e[0].push(n),S.load.apply(null,e[0]),S):(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)}))}),S)}function y(e,n){return n=n||t,e.state===_?void n():e.state===k?void S.ready(e.name,n):e.state===$?void e.onpreload.push(function(){y(e,n)}):(e.state=k,void g(e,function(){e.state=_,n(),r(x[e.name],function(e){u(e)}),L&&s()&&r(x.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)&&(!C.documentMode||C.documentMode<9))&&(e.clearTimeout(n.errorTimeout),e.clearTimeout(n.cssTimeout),i.onload=i.onreadystatechange=i.onerror=null,r())}function c(){if(n.state!==_&&n.cssRetries<=20){for(var t=0,r=C.styleSheets.length;r>t;t++)if(C.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=C.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=C.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=C.head||C.getElementsByTagName("head")[0];d.insertBefore(i,d.lastChild)}function j(){for(var e=C.getElementsByTagName("script"),n=0,t=e.length;t>n;n++){var r=e[n].getAttribute("data-headjs-load");if(r)return void S.load(r)}}function T(e,n){if(e===C)return L?u(n):q.push(n),S;if(a(e)&&(n=e,e="ALL"),c(e)){var t={};return r(e,function(e){t[e]=O[e],S.ready(e,function(){s(t)&&u(n)})}),S}if("string"!=typeof e||!a(n))return S;var o=O[e];if(o&&o.state===_||"ALL"===e&&s()&&L)return u(n),S;var i=x[e];return i?i.push(n):i=x[e]=[n],S}function b(){return C.body?void(L||(L=!0,j(),r(q,function(e){u(e)}))):(e.clearTimeout(S.readyTimeout),void(S.readyTimeout=e.setTimeout(b,50)))}function E(){C.addEventListener?(C.removeEventListener("DOMContentLoaded",E,!1),b()):"complete"===C.readyState&&(C.detachEvent("onreadystatechange",E),b())}var L,C=e.document,q=[],x={},O={},w="async"in C.createElement("script")||"MozAppearance"in C.documentElement.style||e.opera,M=e.head_conf&&e.head_conf.head||"head",S=e[M]=e[M]||function(){S.ready.apply(null,arguments)},$=1,A=2,k=3,_=4;if("complete"===C.readyState)b();else if(C.addEventListener)C.addEventListener("DOMContentLoaded",E,!1),e.addEventListener("load",b,!1);else{C.attachEvent("onreadystatechange",E),e.attachEvent("onload",b);var I=!1;try{I=!e.frameElement&&C.documentElement}catch(U){}I&&I.doScroll&&!function B(){if(!L){try{I.doScroll("left")}catch(n){return e.clearTimeout(S.readyTimeout),void(S.readyTimeout=e.setTimeout(B,50))}b()}}()}S.load=S.js=w?v:p,S.test=d,S.ready=T,S.ready(C,function(){s()&&r(x.ALL,function(e){u(e)}),S.feature&&S.feature("domloaded",!0)})}(window);var oc=oc||{};!function(e,n,t){if(oc.conf=oc.conf||{},oc.cmd=oc.cmd||[],oc.renderedComponents=oc.renderedComponents||{},oc.status=oc.status||!1,oc.status)return oc;oc.status="loading";var r="https://cdnjs.cloudflare.com/ajax/libs/",o=r+"jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js",a=r+"handlebars.js/3.0.1/handlebars.runtime.js",c=r+"jade/1.9.2/runtime.min.js",i=r+"jquery/1.11.2/jquery.min.js",u=oc.conf.retryInterval||5e3,d=oc.conf.retryLimit||30,l=oc.conf.retrySendNumber||!0,s=oc.conf.pollingInterval||500,f=oc.conf.tag||"oc-component",m="baseUrl parameter is required",p="Href parameter missing",v="name parameter is required",y="Failed to load {0} component {1} times. Giving up".replace("{1}",d),h="Error getting compiled view: {0}",g="Error rendering component: {0}, error: {1}",j="Failed to retrieve the component. Retrying in {0} seconds...".replace("{0}",u/1e3),T='Error loading component: view engine "{0}" not supported',b="Loading...",E="Component '{0}' correctly rendered",L="Unrendered component found. Trying to retrieve it...",C=oc.conf.debug||!1,q=function(){},x=t.navigator.userAgent,O=!!x.match(/MSIE 8/),w=!!x.match(/MSIE 9/),M=!1,S=!1,$={},A=function(e){return"boolean"==typeof e},k={error:function(e){return console.log(e)},info:function(e){return C?console.log(e):!1}},_=function(e,n,t){return void 0===$[e]&&($[e]=d),$[e]<=0?t():(setTimeout(function(){n(d-$[e]+1)},u),void $[e]--)},I=function(e,n){if(e&&n){var t=oc.$.param(n);return e.indexOf("?")>-1?e+"&"+t:e+"?"+t}return e};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':"<"+f+' href="'+t+'">"},oc.events={},oc.ready=function(e){if(M)return e();if(S)oc.cmd.push(e);else{S=!0;var n=function(e,n){!O&&!w||e.IE_POLYFILL_LOADED?n():oc.require(o,n)},r=function(){M=!0,S=!1,oc.events=function(){var e=oc.$({});return{fire:function(n,t){return e.trigger(n,t)},on:function(n,t){return e.on(n,t||q)},reset:function(){return e.off()}}}(),e(),oc.events.fire("oc:ready",oc),oc.status="ready";for(var n=0;n'+b+""),oc.renderByHref(e.attr("href"),function(t,r){return t||!r?(k.error(t),n()):void U(e,r,n)}))})},oc.renderByHref=function(e,n,t){var r=t,o=n;"function"==typeof n&&(r=n,o=0),oc.ready(function(){if(""===e)return r(g.replace("{1}",p));var n=e;l&&(n=I(n,{__oc_Retry:o})),oc.$.ajax({url:n,headers:{Accept:"application/vnd.oc.unrendered+json"},contentType:"text/plain",crossDomain:!0,async:!0,success:function(e){if("unrendered"===e.renderMode)oc.render(e.template,e.data,function(n,t){return n?r(g.replace("{0}",e.href).replace("{1}",n)):(k.info(E.replace("{0}",e.template.src)),void r(null,{html:t,key:e.template.key,version:e.version,name:e.name}))});else if("rendered"===e.renderMode){if(k.info(E.replace("{0}",e.href)),0===e.html.indexOf("<"+f)){var n=e.html.slice(e.html.indexOf(">")+1),t=n.slice(0,n.lastIndexOf("<"));e.html=t}r(null,{html:e.html,version:e.version,name:e.name})}},error:function(){k.error(j),_(e,function(n){oc.renderByHref(e,n,r)},function(){r(y.replace("{0}",e))})}})})},oc.renderUnloadedComponents=function(){oc.ready(function(){var e=O?"div[data-oc-component=true]":f,n=oc.$(e+"[data-rendered!=true]"),t=n.length,r=function(e){t--,t||oc.renderUnloadedComponents()};if(t>0)for(var o=0;o');var r=oc.$(f,e);oc.renderNestedComponent(r,function(){t(r)})}})},oc.ready(oc.renderUnloadedComponents)}(head,document,window),oc.clientVersion="0.28.0"; //# sourceMappingURL=oc-client.min.map \ No newline at end of file diff --git a/components/oc-client/LICENSES.md b/components/oc-client/LICENSES.md new file mode 100644 index 000000000..efade63ea --- /dev/null +++ b/components/oc-client/LICENSES.md @@ -0,0 +1,112 @@ +oc-client.js +============ + +Copyright (c) 2015-2016 OpenTable, Inc. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==================== + +OC wouldn't exist without some fantastic Open-Source libraries: + +* jQuery +* head.js +* Jade runtime +* Handlebars runtime +* jQuery-ajaxTransport-XDomainRequest + +==================== + +/*! jQuery v1.11.2 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ + +==================== + +///#source 1 1 /src/1.0.0/load.js +/*! head.load - v1.0.3 */ +/* + * HeadJS The only script in your + * Author Tero Piirainen (tipiirai) + * Maintainer Robert Hoffmann (itechnology) + * License MIT / http://bit.ly/mit-license + * WebSite http://headjs.com + */ + +==================== + +(The MIT License) + +Copyright (c) 2009-2014 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==================== + +/*! + + handlebars v3.0.1 + +Copyright (C) 2011-2014 by Yehuda Katz + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +@license +*/ + +==================== + +/*! + * jQuery-ajaxTransport-XDomainRequest - v1.0.3 - 2014-06-06 + * https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest + * Copyright (c) 2014 Jason Moon (@JSONMOON) + * Licensed MIT (/blob/master/LICENSE.txt) + */ diff --git a/components/oc-client/_package/package.json b/components/oc-client/_package/package.json index e36818ed1..3e6461d4b 100644 --- a/components/oc-client/_package/package.json +++ b/components/oc-client/_package/package.json @@ -1 +1 @@ -{"name":"oc-client","description":"The OpenComponents client-side javascript client","version":"0.28.0","repository":"https://github.com/opentable/oc/tree/master/components/oc-client","author":"Matteo Figus ","oc":{"container":false,"renderInfo":false,"minify":false,"parameters":{},"files":{"template":{"type":"handlebars","hashKey":"bb774de6a2b7280c2b66103bd36d7e708a1b7541","src":"template.js"},"static":["src"],"dataProvider":{"type":"node.js","hashKey":"ffb0e43eaf72f55fa13dc1e7262019c14c3dfc81","src":"server.js"}},"version":"0.28.0","packaged":true,"date":1457462372778}} +{"name":"oc-client","description":"The OpenComponents client-side javascript client","version":"0.28.0","repository":"https://github.com/opentable/oc/tree/master/components/oc-client","author":"Matteo Figus ","oc":{"container":false,"renderInfo":false,"minify":false,"parameters":{},"files":{"template":{"type":"handlebars","hashKey":"bb774de6a2b7280c2b66103bd36d7e708a1b7541","src":"template.js"},"static":["src"],"dataProvider":{"type":"node.js","hashKey":"ffb0e43eaf72f55fa13dc1e7262019c14c3dfc81","src":"server.js"}},"version":"0.28.0","packaged":true,"date":1457573038009}} diff --git a/components/oc-client/_package/src/oc-client.min.js b/components/oc-client/_package/src/oc-client.min.js index 721f7468d..3c7eb6e72 100644 --- a/components/oc-client/_package/src/oc-client.min.js +++ b/components/oc-client/_package/src/oc-client.min.js @@ -1,2 +1,3 @@ +/*! OpenComponents client v0.28.0 | (c) 2015-2016 OpenTable, Inc. | https://github.com/opentable/oc/tree/master/components/oc-client/LICENSES.md */ !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),S.load.apply(null,a.success)):!i&&a.failure?(a.failure.push(a.callback),S.load.apply(null,a.failure)):o(),S}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=O[n.name];return r&&r.url===n.url?r:(O[n.name]=n,n)}function s(e){e=e||O;for(var n in e)if(e.hasOwnProperty(n)&&e[n].state!==_)return!1;return!0}function f(e){e.state=A,r(e.onpreload,function(e){e.call()})}function m(e,t){e.state===n&&(e.state=$,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),S.load.apply(null,e[0]),S):(o?(r(t,function(e){!a(e)&&e&&m(l(e))}),y(l(e[0]),a(o)?o:function(){S.load.apply(null,t)})):y(l(e[0])),S)}function v(){var e=arguments,n=e[e.length-1],t={};return a(n)||(n=null),c(e[0])?(e[0].push(n),S.load.apply(null,e[0]),S):(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)}))}),S)}function y(e,n){return n=n||t,e.state===_?void n():e.state===k?void S.ready(e.name,n):e.state===$?void e.onpreload.push(function(){y(e,n)}):(e.state=k,void g(e,function(){e.state=_,n(),r(x[e.name],function(e){u(e)}),L&&s()&&r(x.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)&&(!C.documentMode||C.documentMode<9))&&(e.clearTimeout(n.errorTimeout),e.clearTimeout(n.cssTimeout),i.onload=i.onreadystatechange=i.onerror=null,r())}function c(){if(n.state!==_&&n.cssRetries<=20){for(var t=0,r=C.styleSheets.length;r>t;t++)if(C.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=C.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=C.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=C.head||C.getElementsByTagName("head")[0];d.insertBefore(i,d.lastChild)}function j(){for(var e=C.getElementsByTagName("script"),n=0,t=e.length;t>n;n++){var r=e[n].getAttribute("data-headjs-load");if(r)return void S.load(r)}}function T(e,n){if(e===C)return L?u(n):q.push(n),S;if(a(e)&&(n=e,e="ALL"),c(e)){var t={};return r(e,function(e){t[e]=O[e],S.ready(e,function(){s(t)&&u(n)})}),S}if("string"!=typeof e||!a(n))return S;var o=O[e];if(o&&o.state===_||"ALL"===e&&s()&&L)return u(n),S;var i=x[e];return i?i.push(n):i=x[e]=[n],S}function b(){return C.body?void(L||(L=!0,j(),r(q,function(e){u(e)}))):(e.clearTimeout(S.readyTimeout),void(S.readyTimeout=e.setTimeout(b,50)))}function E(){C.addEventListener?(C.removeEventListener("DOMContentLoaded",E,!1),b()):"complete"===C.readyState&&(C.detachEvent("onreadystatechange",E),b())}var L,C=e.document,q=[],x={},O={},w="async"in C.createElement("script")||"MozAppearance"in C.documentElement.style||e.opera,M=e.head_conf&&e.head_conf.head||"head",S=e[M]=e[M]||function(){S.ready.apply(null,arguments)},$=1,A=2,k=3,_=4;if("complete"===C.readyState)b();else if(C.addEventListener)C.addEventListener("DOMContentLoaded",E,!1),e.addEventListener("load",b,!1);else{C.attachEvent("onreadystatechange",E),e.attachEvent("onload",b);var I=!1;try{I=!e.frameElement&&C.documentElement}catch(U){}I&&I.doScroll&&!function B(){if(!L){try{I.doScroll("left")}catch(n){return e.clearTimeout(S.readyTimeout),void(S.readyTimeout=e.setTimeout(B,50))}b()}}()}S.load=S.js=w?v:p,S.test=d,S.ready=T,S.ready(C,function(){s()&&r(x.ALL,function(e){u(e)}),S.feature&&S.feature("domloaded",!0)})}(window);var oc=oc||{};!function(e,n,t){if(oc.conf=oc.conf||{},oc.cmd=oc.cmd||[],oc.renderedComponents=oc.renderedComponents||{},oc.status=oc.status||!1,oc.status)return oc;oc.status="loading";var r="https://cdnjs.cloudflare.com/ajax/libs/",o=r+"jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js",a=r+"handlebars.js/3.0.1/handlebars.runtime.js",c=r+"jade/1.9.2/runtime.min.js",i=r+"jquery/1.11.2/jquery.min.js",u=oc.conf.retryInterval||5e3,d=oc.conf.retryLimit||30,l=oc.conf.retrySendNumber||!0,s=oc.conf.pollingInterval||500,f=oc.conf.tag||"oc-component",m="baseUrl parameter is required",p="Href parameter missing",v="name parameter is required",y="Failed to load {0} component {1} times. Giving up".replace("{1}",d),h="Error getting compiled view: {0}",g="Error rendering component: {0}, error: {1}",j="Failed to retrieve the component. Retrying in {0} seconds...".replace("{0}",u/1e3),T='Error loading component: view engine "{0}" not supported',b="Loading...",E="Component '{0}' correctly rendered",L="Unrendered component found. Trying to retrieve it...",C=oc.conf.debug||!1,q=function(){},x=t.navigator.userAgent,O=!!x.match(/MSIE 8/),w=!!x.match(/MSIE 9/),M=!1,S=!1,$={},A=function(e){return"boolean"==typeof e},k={error:function(e){return console.log(e)},info:function(e){return C?console.log(e):!1}},_=function(e,n,t){return void 0===$[e]&&($[e]=d),$[e]<=0?t():(setTimeout(function(){n(d-$[e]+1)},u),void $[e]--)},I=function(e,n){if(e&&n){var t=oc.$.param(n);return e.indexOf("?")>-1?e+"&"+t:e+"?"+t}return e};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':"<"+f+' href="'+t+'">"},oc.events={},oc.ready=function(e){if(M)return e();if(S)oc.cmd.push(e);else{S=!0;var n=function(e,n){!O&&!w||e.IE_POLYFILL_LOADED?n():oc.require(o,n)},r=function(){M=!0,S=!1,oc.events=function(){var e=oc.$({});return{fire:function(n,t){return e.trigger(n,t)},on:function(n,t){return e.on(n,t||q)},reset:function(){return e.off()}}}(),e(),oc.events.fire("oc:ready",oc),oc.status="ready";for(var n=0;n'+b+""),oc.renderByHref(e.attr("href"),function(t,r){return t||!r?(k.error(t),n()):void U(e,r,n)}))})},oc.renderByHref=function(e,n,t){var r=t,o=n;"function"==typeof n&&(r=n,o=0),oc.ready(function(){if(""===e)return r(g.replace("{1}",p));var n=e;l&&(n=I(n,{__oc_Retry:o})),oc.$.ajax({url:n,headers:{Accept:"application/vnd.oc.unrendered+json"},contentType:"text/plain",crossDomain:!0,async:!0,success:function(e){if("unrendered"===e.renderMode)oc.render(e.template,e.data,function(n,t){return n?r(g.replace("{0}",e.href).replace("{1}",n)):(k.info(E.replace("{0}",e.template.src)),void r(null,{html:t,key:e.template.key,version:e.version,name:e.name}))});else if("rendered"===e.renderMode){if(k.info(E.replace("{0}",e.href)),0===e.html.indexOf("<"+f)){var n=e.html.slice(e.html.indexOf(">")+1),t=n.slice(0,n.lastIndexOf("<"));e.html=t}r(null,{html:e.html,version:e.version,name:e.name})}},error:function(){k.error(j),_(e,function(n){oc.renderByHref(e,n,r)},function(){r(y.replace("{0}",e))})}})})},oc.renderUnloadedComponents=function(){oc.ready(function(){var e=O?"div[data-oc-component=true]":f,n=oc.$(e+"[data-rendered!=true]"),t=n.length,r=function(e){t--,t||oc.renderUnloadedComponents()};if(t>0)for(var o=0;o');var r=oc.$(f,e);oc.renderNestedComponent(r,function(){t(r)})}})},oc.ready(oc.renderUnloadedComponents)}(head,document,window),oc.clientVersion="0.28.0"; //# sourceMappingURL=oc-client.min.map \ 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 721f7468d..3c7eb6e72 100644 --- a/components/oc-client/src/oc-client.min.js +++ b/components/oc-client/src/oc-client.min.js @@ -1,2 +1,3 @@ +/*! OpenComponents client v0.28.0 | (c) 2015-2016 OpenTable, Inc. | https://github.com/opentable/oc/tree/master/components/oc-client/LICENSES.md */ !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),S.load.apply(null,a.success)):!i&&a.failure?(a.failure.push(a.callback),S.load.apply(null,a.failure)):o(),S}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=O[n.name];return r&&r.url===n.url?r:(O[n.name]=n,n)}function s(e){e=e||O;for(var n in e)if(e.hasOwnProperty(n)&&e[n].state!==_)return!1;return!0}function f(e){e.state=A,r(e.onpreload,function(e){e.call()})}function m(e,t){e.state===n&&(e.state=$,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),S.load.apply(null,e[0]),S):(o?(r(t,function(e){!a(e)&&e&&m(l(e))}),y(l(e[0]),a(o)?o:function(){S.load.apply(null,t)})):y(l(e[0])),S)}function v(){var e=arguments,n=e[e.length-1],t={};return a(n)||(n=null),c(e[0])?(e[0].push(n),S.load.apply(null,e[0]),S):(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)}))}),S)}function y(e,n){return n=n||t,e.state===_?void n():e.state===k?void S.ready(e.name,n):e.state===$?void e.onpreload.push(function(){y(e,n)}):(e.state=k,void g(e,function(){e.state=_,n(),r(x[e.name],function(e){u(e)}),L&&s()&&r(x.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)&&(!C.documentMode||C.documentMode<9))&&(e.clearTimeout(n.errorTimeout),e.clearTimeout(n.cssTimeout),i.onload=i.onreadystatechange=i.onerror=null,r())}function c(){if(n.state!==_&&n.cssRetries<=20){for(var t=0,r=C.styleSheets.length;r>t;t++)if(C.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=C.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=C.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=C.head||C.getElementsByTagName("head")[0];d.insertBefore(i,d.lastChild)}function j(){for(var e=C.getElementsByTagName("script"),n=0,t=e.length;t>n;n++){var r=e[n].getAttribute("data-headjs-load");if(r)return void S.load(r)}}function T(e,n){if(e===C)return L?u(n):q.push(n),S;if(a(e)&&(n=e,e="ALL"),c(e)){var t={};return r(e,function(e){t[e]=O[e],S.ready(e,function(){s(t)&&u(n)})}),S}if("string"!=typeof e||!a(n))return S;var o=O[e];if(o&&o.state===_||"ALL"===e&&s()&&L)return u(n),S;var i=x[e];return i?i.push(n):i=x[e]=[n],S}function b(){return C.body?void(L||(L=!0,j(),r(q,function(e){u(e)}))):(e.clearTimeout(S.readyTimeout),void(S.readyTimeout=e.setTimeout(b,50)))}function E(){C.addEventListener?(C.removeEventListener("DOMContentLoaded",E,!1),b()):"complete"===C.readyState&&(C.detachEvent("onreadystatechange",E),b())}var L,C=e.document,q=[],x={},O={},w="async"in C.createElement("script")||"MozAppearance"in C.documentElement.style||e.opera,M=e.head_conf&&e.head_conf.head||"head",S=e[M]=e[M]||function(){S.ready.apply(null,arguments)},$=1,A=2,k=3,_=4;if("complete"===C.readyState)b();else if(C.addEventListener)C.addEventListener("DOMContentLoaded",E,!1),e.addEventListener("load",b,!1);else{C.attachEvent("onreadystatechange",E),e.attachEvent("onload",b);var I=!1;try{I=!e.frameElement&&C.documentElement}catch(U){}I&&I.doScroll&&!function B(){if(!L){try{I.doScroll("left")}catch(n){return e.clearTimeout(S.readyTimeout),void(S.readyTimeout=e.setTimeout(B,50))}b()}}()}S.load=S.js=w?v:p,S.test=d,S.ready=T,S.ready(C,function(){s()&&r(x.ALL,function(e){u(e)}),S.feature&&S.feature("domloaded",!0)})}(window);var oc=oc||{};!function(e,n,t){if(oc.conf=oc.conf||{},oc.cmd=oc.cmd||[],oc.renderedComponents=oc.renderedComponents||{},oc.status=oc.status||!1,oc.status)return oc;oc.status="loading";var r="https://cdnjs.cloudflare.com/ajax/libs/",o=r+"jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js",a=r+"handlebars.js/3.0.1/handlebars.runtime.js",c=r+"jade/1.9.2/runtime.min.js",i=r+"jquery/1.11.2/jquery.min.js",u=oc.conf.retryInterval||5e3,d=oc.conf.retryLimit||30,l=oc.conf.retrySendNumber||!0,s=oc.conf.pollingInterval||500,f=oc.conf.tag||"oc-component",m="baseUrl parameter is required",p="Href parameter missing",v="name parameter is required",y="Failed to load {0} component {1} times. Giving up".replace("{1}",d),h="Error getting compiled view: {0}",g="Error rendering component: {0}, error: {1}",j="Failed to retrieve the component. Retrying in {0} seconds...".replace("{0}",u/1e3),T='Error loading component: view engine "{0}" not supported',b="Loading...",E="Component '{0}' correctly rendered",L="Unrendered component found. Trying to retrieve it...",C=oc.conf.debug||!1,q=function(){},x=t.navigator.userAgent,O=!!x.match(/MSIE 8/),w=!!x.match(/MSIE 9/),M=!1,S=!1,$={},A=function(e){return"boolean"==typeof e},k={error:function(e){return console.log(e)},info:function(e){return C?console.log(e):!1}},_=function(e,n,t){return void 0===$[e]&&($[e]=d),$[e]<=0?t():(setTimeout(function(){n(d-$[e]+1)},u),void $[e]--)},I=function(e,n){if(e&&n){var t=oc.$.param(n);return e.indexOf("?")>-1?e+"&"+t:e+"?"+t}return e};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':"<"+f+' href="'+t+'">"},oc.events={},oc.ready=function(e){if(M)return e();if(S)oc.cmd.push(e);else{S=!0;var n=function(e,n){!O&&!w||e.IE_POLYFILL_LOADED?n():oc.require(o,n)},r=function(){M=!0,S=!1,oc.events=function(){var e=oc.$({});return{fire:function(n,t){return e.trigger(n,t)},on:function(n,t){return e.on(n,t||q)},reset:function(){return e.off()}}}(),e(),oc.events.fire("oc:ready",oc),oc.status="ready";for(var n=0;n'+b+""),oc.renderByHref(e.attr("href"),function(t,r){return t||!r?(k.error(t),n()):void U(e,r,n)}))})},oc.renderByHref=function(e,n,t){var r=t,o=n;"function"==typeof n&&(r=n,o=0),oc.ready(function(){if(""===e)return r(g.replace("{1}",p));var n=e;l&&(n=I(n,{__oc_Retry:o})),oc.$.ajax({url:n,headers:{Accept:"application/vnd.oc.unrendered+json"},contentType:"text/plain",crossDomain:!0,async:!0,success:function(e){if("unrendered"===e.renderMode)oc.render(e.template,e.data,function(n,t){return n?r(g.replace("{0}",e.href).replace("{1}",n)):(k.info(E.replace("{0}",e.template.src)),void r(null,{html:t,key:e.template.key,version:e.version,name:e.name}))});else if("rendered"===e.renderMode){if(k.info(E.replace("{0}",e.href)),0===e.html.indexOf("<"+f)){var n=e.html.slice(e.html.indexOf(">")+1),t=n.slice(0,n.lastIndexOf("<"));e.html=t}r(null,{html:e.html,version:e.version,name:e.name})}},error:function(){k.error(j),_(e,function(n){oc.renderByHref(e,n,r)},function(){r(y.replace("{0}",e))})}})})},oc.renderUnloadedComponents=function(){oc.ready(function(){var e=O?"div[data-oc-component=true]":f,n=oc.$(e+"[data-rendered!=true]"),t=n.length,r=function(e){t--,t||oc.renderUnloadedComponents()};if(t>0)for(var o=0;o');var r=oc.$(f,e);oc.renderNestedComponent(r,function(){t(r)})}})},oc.ready(oc.renderUnloadedComponents)}(head,document,window),oc.clientVersion="0.28.0"; //# sourceMappingURL=oc-client.min.map \ No newline at end of file diff --git a/grunt-tasks/support/task-build.js b/grunt-tasks/support/task-build.js index 12f54950e..be404910b 100644 --- a/grunt-tasks/support/task-build.js +++ b/grunt-tasks/support/task-build.js @@ -10,13 +10,17 @@ module.exports = function(grunt, taskObject){ return function(){ var done = this.async(), + version = taskObject.pkg.version, clientComponentDir = '../../components/oc-client/', + licenseRow = '/*! OpenComponents client v{0} | (c) 2015-{1} OpenTable, Inc. | {2} */', + licenseLink = 'https://github.com/opentable/oc/tree/master/components/oc-client/LICENSES.md', + license = format(licenseRow, version, new Date().getFullYear(), licenseLink), headLoad = fs.readFileSync(path.join(__dirname, clientComponentDir, 'src/head.load.js')).toString(), ocClient = fs.readFileSync(path.join(__dirname, clientComponentDir, 'src/oc-client.js')).toString(), - bundle = format('{0}\n;\n{1}\n;\noc.clientVersion=\'{2}\';', headLoad, ocClient, taskObject.pkg.version), + bundle = format('{0}\n;\n{1}\n;\noc.clientVersion=\'{2}\';', headLoad, ocClient, version), ocClientPackageInfo = require(clientComponentDir + 'package.json'); - ocClientPackageInfo.version = taskObject.pkg.version; + ocClientPackageInfo.version = version; fs.writeJsonSync(path.join(__dirname, clientComponentDir, 'package.json'), ocClientPackageInfo, {spaces: 2}); var compressed = uglifyJs.minify(bundle, { @@ -24,9 +28,11 @@ module.exports = function(grunt, taskObject){ outSourceMap: 'oc-client.min.map' }); - fs.writeFileSync(path.join(__dirname, clientComponentDir, 'src/oc-client.min.js'), compressed.code); + var compressedCode = format('{0}\n{1}', license, compressed.code); + + fs.writeFileSync(path.join(__dirname, clientComponentDir, 'src/oc-client.min.js'), compressedCode); fs.writeFileSync(path.join(__dirname, clientComponentDir, 'src/oc-client.min.map'), compressed.map); - fs.writeFileSync(path.join(__dirname, '../../client/src/oc-client.min.js'), compressed.code); + fs.writeFileSync(path.join(__dirname, '../../client/src/oc-client.min.js'), compressedCode); var Local = require('../../cli/domain/local'), local = new Local({ logger: { log: grunt.log.writeln }}); From 1b7bf5aa4afb212a7c0eba565042928bec8f432c Mon Sep 17 00:00:00 2001 From: Matteo Figus Date: Thu, 10 Mar 2016 01:31:48 +0000 Subject: [PATCH 2/2] Cleanup --- LICENSE.md => LICENSE | 0 client/src/oc-client.min.js | 2 +- components/oc-client/{LICENSES.md => LICENSES} | 0 components/oc-client/_package/package.json | 2 +- components/oc-client/_package/src/oc-client.min.js | 2 +- components/oc-client/src/oc-client.min.js | 2 +- grunt-tasks/support/task-build.js | 2 +- 7 files changed, 5 insertions(+), 5 deletions(-) rename LICENSE.md => LICENSE (100%) rename components/oc-client/{LICENSES.md => LICENSES} (100%) diff --git a/LICENSE.md b/LICENSE similarity index 100% rename from LICENSE.md rename to LICENSE diff --git a/client/src/oc-client.min.js b/client/src/oc-client.min.js index 3c7eb6e72..e126a272a 100644 --- a/client/src/oc-client.min.js +++ b/client/src/oc-client.min.js @@ -1,3 +1,3 @@ -/*! OpenComponents client v0.28.0 | (c) 2015-2016 OpenTable, Inc. | https://github.com/opentable/oc/tree/master/components/oc-client/LICENSES.md */ +/*! OpenComponents client v0.28.0 | (c) 2015-2016 OpenTable, Inc. | https://github.com/opentable/oc/tree/master/components/oc-client/LICENSES */ !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),S.load.apply(null,a.success)):!i&&a.failure?(a.failure.push(a.callback),S.load.apply(null,a.failure)):o(),S}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=O[n.name];return r&&r.url===n.url?r:(O[n.name]=n,n)}function s(e){e=e||O;for(var n in e)if(e.hasOwnProperty(n)&&e[n].state!==_)return!1;return!0}function f(e){e.state=A,r(e.onpreload,function(e){e.call()})}function m(e,t){e.state===n&&(e.state=$,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),S.load.apply(null,e[0]),S):(o?(r(t,function(e){!a(e)&&e&&m(l(e))}),y(l(e[0]),a(o)?o:function(){S.load.apply(null,t)})):y(l(e[0])),S)}function v(){var e=arguments,n=e[e.length-1],t={};return a(n)||(n=null),c(e[0])?(e[0].push(n),S.load.apply(null,e[0]),S):(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)}))}),S)}function y(e,n){return n=n||t,e.state===_?void n():e.state===k?void S.ready(e.name,n):e.state===$?void e.onpreload.push(function(){y(e,n)}):(e.state=k,void g(e,function(){e.state=_,n(),r(x[e.name],function(e){u(e)}),L&&s()&&r(x.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)&&(!C.documentMode||C.documentMode<9))&&(e.clearTimeout(n.errorTimeout),e.clearTimeout(n.cssTimeout),i.onload=i.onreadystatechange=i.onerror=null,r())}function c(){if(n.state!==_&&n.cssRetries<=20){for(var t=0,r=C.styleSheets.length;r>t;t++)if(C.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=C.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=C.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=C.head||C.getElementsByTagName("head")[0];d.insertBefore(i,d.lastChild)}function j(){for(var e=C.getElementsByTagName("script"),n=0,t=e.length;t>n;n++){var r=e[n].getAttribute("data-headjs-load");if(r)return void S.load(r)}}function T(e,n){if(e===C)return L?u(n):q.push(n),S;if(a(e)&&(n=e,e="ALL"),c(e)){var t={};return r(e,function(e){t[e]=O[e],S.ready(e,function(){s(t)&&u(n)})}),S}if("string"!=typeof e||!a(n))return S;var o=O[e];if(o&&o.state===_||"ALL"===e&&s()&&L)return u(n),S;var i=x[e];return i?i.push(n):i=x[e]=[n],S}function b(){return C.body?void(L||(L=!0,j(),r(q,function(e){u(e)}))):(e.clearTimeout(S.readyTimeout),void(S.readyTimeout=e.setTimeout(b,50)))}function E(){C.addEventListener?(C.removeEventListener("DOMContentLoaded",E,!1),b()):"complete"===C.readyState&&(C.detachEvent("onreadystatechange",E),b())}var L,C=e.document,q=[],x={},O={},w="async"in C.createElement("script")||"MozAppearance"in C.documentElement.style||e.opera,M=e.head_conf&&e.head_conf.head||"head",S=e[M]=e[M]||function(){S.ready.apply(null,arguments)},$=1,A=2,k=3,_=4;if("complete"===C.readyState)b();else if(C.addEventListener)C.addEventListener("DOMContentLoaded",E,!1),e.addEventListener("load",b,!1);else{C.attachEvent("onreadystatechange",E),e.attachEvent("onload",b);var I=!1;try{I=!e.frameElement&&C.documentElement}catch(U){}I&&I.doScroll&&!function B(){if(!L){try{I.doScroll("left")}catch(n){return e.clearTimeout(S.readyTimeout),void(S.readyTimeout=e.setTimeout(B,50))}b()}}()}S.load=S.js=w?v:p,S.test=d,S.ready=T,S.ready(C,function(){s()&&r(x.ALL,function(e){u(e)}),S.feature&&S.feature("domloaded",!0)})}(window);var oc=oc||{};!function(e,n,t){if(oc.conf=oc.conf||{},oc.cmd=oc.cmd||[],oc.renderedComponents=oc.renderedComponents||{},oc.status=oc.status||!1,oc.status)return oc;oc.status="loading";var r="https://cdnjs.cloudflare.com/ajax/libs/",o=r+"jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js",a=r+"handlebars.js/3.0.1/handlebars.runtime.js",c=r+"jade/1.9.2/runtime.min.js",i=r+"jquery/1.11.2/jquery.min.js",u=oc.conf.retryInterval||5e3,d=oc.conf.retryLimit||30,l=oc.conf.retrySendNumber||!0,s=oc.conf.pollingInterval||500,f=oc.conf.tag||"oc-component",m="baseUrl parameter is required",p="Href parameter missing",v="name parameter is required",y="Failed to load {0} component {1} times. Giving up".replace("{1}",d),h="Error getting compiled view: {0}",g="Error rendering component: {0}, error: {1}",j="Failed to retrieve the component. Retrying in {0} seconds...".replace("{0}",u/1e3),T='Error loading component: view engine "{0}" not supported',b="Loading...",E="Component '{0}' correctly rendered",L="Unrendered component found. Trying to retrieve it...",C=oc.conf.debug||!1,q=function(){},x=t.navigator.userAgent,O=!!x.match(/MSIE 8/),w=!!x.match(/MSIE 9/),M=!1,S=!1,$={},A=function(e){return"boolean"==typeof e},k={error:function(e){return console.log(e)},info:function(e){return C?console.log(e):!1}},_=function(e,n,t){return void 0===$[e]&&($[e]=d),$[e]<=0?t():(setTimeout(function(){n(d-$[e]+1)},u),void $[e]--)},I=function(e,n){if(e&&n){var t=oc.$.param(n);return e.indexOf("?")>-1?e+"&"+t:e+"?"+t}return e};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':"<"+f+' href="'+t+'">"},oc.events={},oc.ready=function(e){if(M)return e();if(S)oc.cmd.push(e);else{S=!0;var n=function(e,n){!O&&!w||e.IE_POLYFILL_LOADED?n():oc.require(o,n)},r=function(){M=!0,S=!1,oc.events=function(){var e=oc.$({});return{fire:function(n,t){return e.trigger(n,t)},on:function(n,t){return e.on(n,t||q)},reset:function(){return e.off()}}}(),e(),oc.events.fire("oc:ready",oc),oc.status="ready";for(var n=0;n'+b+""),oc.renderByHref(e.attr("href"),function(t,r){return t||!r?(k.error(t),n()):void U(e,r,n)}))})},oc.renderByHref=function(e,n,t){var r=t,o=n;"function"==typeof n&&(r=n,o=0),oc.ready(function(){if(""===e)return r(g.replace("{1}",p));var n=e;l&&(n=I(n,{__oc_Retry:o})),oc.$.ajax({url:n,headers:{Accept:"application/vnd.oc.unrendered+json"},contentType:"text/plain",crossDomain:!0,async:!0,success:function(e){if("unrendered"===e.renderMode)oc.render(e.template,e.data,function(n,t){return n?r(g.replace("{0}",e.href).replace("{1}",n)):(k.info(E.replace("{0}",e.template.src)),void r(null,{html:t,key:e.template.key,version:e.version,name:e.name}))});else if("rendered"===e.renderMode){if(k.info(E.replace("{0}",e.href)),0===e.html.indexOf("<"+f)){var n=e.html.slice(e.html.indexOf(">")+1),t=n.slice(0,n.lastIndexOf("<"));e.html=t}r(null,{html:e.html,version:e.version,name:e.name})}},error:function(){k.error(j),_(e,function(n){oc.renderByHref(e,n,r)},function(){r(y.replace("{0}",e))})}})})},oc.renderUnloadedComponents=function(){oc.ready(function(){var e=O?"div[data-oc-component=true]":f,n=oc.$(e+"[data-rendered!=true]"),t=n.length,r=function(e){t--,t||oc.renderUnloadedComponents()};if(t>0)for(var o=0;o');var r=oc.$(f,e);oc.renderNestedComponent(r,function(){t(r)})}})},oc.ready(oc.renderUnloadedComponents)}(head,document,window),oc.clientVersion="0.28.0"; //# sourceMappingURL=oc-client.min.map \ No newline at end of file diff --git a/components/oc-client/LICENSES.md b/components/oc-client/LICENSES similarity index 100% rename from components/oc-client/LICENSES.md rename to components/oc-client/LICENSES diff --git a/components/oc-client/_package/package.json b/components/oc-client/_package/package.json index 3e6461d4b..cba1d0ee3 100644 --- a/components/oc-client/_package/package.json +++ b/components/oc-client/_package/package.json @@ -1 +1 @@ -{"name":"oc-client","description":"The OpenComponents client-side javascript client","version":"0.28.0","repository":"https://github.com/opentable/oc/tree/master/components/oc-client","author":"Matteo Figus ","oc":{"container":false,"renderInfo":false,"minify":false,"parameters":{},"files":{"template":{"type":"handlebars","hashKey":"bb774de6a2b7280c2b66103bd36d7e708a1b7541","src":"template.js"},"static":["src"],"dataProvider":{"type":"node.js","hashKey":"ffb0e43eaf72f55fa13dc1e7262019c14c3dfc81","src":"server.js"}},"version":"0.28.0","packaged":true,"date":1457573038009}} +{"name":"oc-client","description":"The OpenComponents client-side javascript client","version":"0.28.0","repository":"https://github.com/opentable/oc/tree/master/components/oc-client","author":"Matteo Figus ","oc":{"container":false,"renderInfo":false,"minify":false,"parameters":{},"files":{"template":{"type":"handlebars","hashKey":"bb774de6a2b7280c2b66103bd36d7e708a1b7541","src":"template.js"},"static":["src"],"dataProvider":{"type":"node.js","hashKey":"ffb0e43eaf72f55fa13dc1e7262019c14c3dfc81","src":"server.js"}},"version":"0.28.0","packaged":true,"date":1457573489652}} diff --git a/components/oc-client/_package/src/oc-client.min.js b/components/oc-client/_package/src/oc-client.min.js index 3c7eb6e72..e126a272a 100644 --- a/components/oc-client/_package/src/oc-client.min.js +++ b/components/oc-client/_package/src/oc-client.min.js @@ -1,3 +1,3 @@ -/*! OpenComponents client v0.28.0 | (c) 2015-2016 OpenTable, Inc. | https://github.com/opentable/oc/tree/master/components/oc-client/LICENSES.md */ +/*! OpenComponents client v0.28.0 | (c) 2015-2016 OpenTable, Inc. | https://github.com/opentable/oc/tree/master/components/oc-client/LICENSES */ !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),S.load.apply(null,a.success)):!i&&a.failure?(a.failure.push(a.callback),S.load.apply(null,a.failure)):o(),S}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=O[n.name];return r&&r.url===n.url?r:(O[n.name]=n,n)}function s(e){e=e||O;for(var n in e)if(e.hasOwnProperty(n)&&e[n].state!==_)return!1;return!0}function f(e){e.state=A,r(e.onpreload,function(e){e.call()})}function m(e,t){e.state===n&&(e.state=$,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),S.load.apply(null,e[0]),S):(o?(r(t,function(e){!a(e)&&e&&m(l(e))}),y(l(e[0]),a(o)?o:function(){S.load.apply(null,t)})):y(l(e[0])),S)}function v(){var e=arguments,n=e[e.length-1],t={};return a(n)||(n=null),c(e[0])?(e[0].push(n),S.load.apply(null,e[0]),S):(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)}))}),S)}function y(e,n){return n=n||t,e.state===_?void n():e.state===k?void S.ready(e.name,n):e.state===$?void e.onpreload.push(function(){y(e,n)}):(e.state=k,void g(e,function(){e.state=_,n(),r(x[e.name],function(e){u(e)}),L&&s()&&r(x.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)&&(!C.documentMode||C.documentMode<9))&&(e.clearTimeout(n.errorTimeout),e.clearTimeout(n.cssTimeout),i.onload=i.onreadystatechange=i.onerror=null,r())}function c(){if(n.state!==_&&n.cssRetries<=20){for(var t=0,r=C.styleSheets.length;r>t;t++)if(C.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=C.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=C.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=C.head||C.getElementsByTagName("head")[0];d.insertBefore(i,d.lastChild)}function j(){for(var e=C.getElementsByTagName("script"),n=0,t=e.length;t>n;n++){var r=e[n].getAttribute("data-headjs-load");if(r)return void S.load(r)}}function T(e,n){if(e===C)return L?u(n):q.push(n),S;if(a(e)&&(n=e,e="ALL"),c(e)){var t={};return r(e,function(e){t[e]=O[e],S.ready(e,function(){s(t)&&u(n)})}),S}if("string"!=typeof e||!a(n))return S;var o=O[e];if(o&&o.state===_||"ALL"===e&&s()&&L)return u(n),S;var i=x[e];return i?i.push(n):i=x[e]=[n],S}function b(){return C.body?void(L||(L=!0,j(),r(q,function(e){u(e)}))):(e.clearTimeout(S.readyTimeout),void(S.readyTimeout=e.setTimeout(b,50)))}function E(){C.addEventListener?(C.removeEventListener("DOMContentLoaded",E,!1),b()):"complete"===C.readyState&&(C.detachEvent("onreadystatechange",E),b())}var L,C=e.document,q=[],x={},O={},w="async"in C.createElement("script")||"MozAppearance"in C.documentElement.style||e.opera,M=e.head_conf&&e.head_conf.head||"head",S=e[M]=e[M]||function(){S.ready.apply(null,arguments)},$=1,A=2,k=3,_=4;if("complete"===C.readyState)b();else if(C.addEventListener)C.addEventListener("DOMContentLoaded",E,!1),e.addEventListener("load",b,!1);else{C.attachEvent("onreadystatechange",E),e.attachEvent("onload",b);var I=!1;try{I=!e.frameElement&&C.documentElement}catch(U){}I&&I.doScroll&&!function B(){if(!L){try{I.doScroll("left")}catch(n){return e.clearTimeout(S.readyTimeout),void(S.readyTimeout=e.setTimeout(B,50))}b()}}()}S.load=S.js=w?v:p,S.test=d,S.ready=T,S.ready(C,function(){s()&&r(x.ALL,function(e){u(e)}),S.feature&&S.feature("domloaded",!0)})}(window);var oc=oc||{};!function(e,n,t){if(oc.conf=oc.conf||{},oc.cmd=oc.cmd||[],oc.renderedComponents=oc.renderedComponents||{},oc.status=oc.status||!1,oc.status)return oc;oc.status="loading";var r="https://cdnjs.cloudflare.com/ajax/libs/",o=r+"jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js",a=r+"handlebars.js/3.0.1/handlebars.runtime.js",c=r+"jade/1.9.2/runtime.min.js",i=r+"jquery/1.11.2/jquery.min.js",u=oc.conf.retryInterval||5e3,d=oc.conf.retryLimit||30,l=oc.conf.retrySendNumber||!0,s=oc.conf.pollingInterval||500,f=oc.conf.tag||"oc-component",m="baseUrl parameter is required",p="Href parameter missing",v="name parameter is required",y="Failed to load {0} component {1} times. Giving up".replace("{1}",d),h="Error getting compiled view: {0}",g="Error rendering component: {0}, error: {1}",j="Failed to retrieve the component. Retrying in {0} seconds...".replace("{0}",u/1e3),T='Error loading component: view engine "{0}" not supported',b="Loading...",E="Component '{0}' correctly rendered",L="Unrendered component found. Trying to retrieve it...",C=oc.conf.debug||!1,q=function(){},x=t.navigator.userAgent,O=!!x.match(/MSIE 8/),w=!!x.match(/MSIE 9/),M=!1,S=!1,$={},A=function(e){return"boolean"==typeof e},k={error:function(e){return console.log(e)},info:function(e){return C?console.log(e):!1}},_=function(e,n,t){return void 0===$[e]&&($[e]=d),$[e]<=0?t():(setTimeout(function(){n(d-$[e]+1)},u),void $[e]--)},I=function(e,n){if(e&&n){var t=oc.$.param(n);return e.indexOf("?")>-1?e+"&"+t:e+"?"+t}return e};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':"<"+f+' href="'+t+'">"},oc.events={},oc.ready=function(e){if(M)return e();if(S)oc.cmd.push(e);else{S=!0;var n=function(e,n){!O&&!w||e.IE_POLYFILL_LOADED?n():oc.require(o,n)},r=function(){M=!0,S=!1,oc.events=function(){var e=oc.$({});return{fire:function(n,t){return e.trigger(n,t)},on:function(n,t){return e.on(n,t||q)},reset:function(){return e.off()}}}(),e(),oc.events.fire("oc:ready",oc),oc.status="ready";for(var n=0;n'+b+""),oc.renderByHref(e.attr("href"),function(t,r){return t||!r?(k.error(t),n()):void U(e,r,n)}))})},oc.renderByHref=function(e,n,t){var r=t,o=n;"function"==typeof n&&(r=n,o=0),oc.ready(function(){if(""===e)return r(g.replace("{1}",p));var n=e;l&&(n=I(n,{__oc_Retry:o})),oc.$.ajax({url:n,headers:{Accept:"application/vnd.oc.unrendered+json"},contentType:"text/plain",crossDomain:!0,async:!0,success:function(e){if("unrendered"===e.renderMode)oc.render(e.template,e.data,function(n,t){return n?r(g.replace("{0}",e.href).replace("{1}",n)):(k.info(E.replace("{0}",e.template.src)),void r(null,{html:t,key:e.template.key,version:e.version,name:e.name}))});else if("rendered"===e.renderMode){if(k.info(E.replace("{0}",e.href)),0===e.html.indexOf("<"+f)){var n=e.html.slice(e.html.indexOf(">")+1),t=n.slice(0,n.lastIndexOf("<"));e.html=t}r(null,{html:e.html,version:e.version,name:e.name})}},error:function(){k.error(j),_(e,function(n){oc.renderByHref(e,n,r)},function(){r(y.replace("{0}",e))})}})})},oc.renderUnloadedComponents=function(){oc.ready(function(){var e=O?"div[data-oc-component=true]":f,n=oc.$(e+"[data-rendered!=true]"),t=n.length,r=function(e){t--,t||oc.renderUnloadedComponents()};if(t>0)for(var o=0;o');var r=oc.$(f,e);oc.renderNestedComponent(r,function(){t(r)})}})},oc.ready(oc.renderUnloadedComponents)}(head,document,window),oc.clientVersion="0.28.0"; //# sourceMappingURL=oc-client.min.map \ 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 3c7eb6e72..e126a272a 100644 --- a/components/oc-client/src/oc-client.min.js +++ b/components/oc-client/src/oc-client.min.js @@ -1,3 +1,3 @@ -/*! OpenComponents client v0.28.0 | (c) 2015-2016 OpenTable, Inc. | https://github.com/opentable/oc/tree/master/components/oc-client/LICENSES.md */ +/*! OpenComponents client v0.28.0 | (c) 2015-2016 OpenTable, Inc. | https://github.com/opentable/oc/tree/master/components/oc-client/LICENSES */ !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),S.load.apply(null,a.success)):!i&&a.failure?(a.failure.push(a.callback),S.load.apply(null,a.failure)):o(),S}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=O[n.name];return r&&r.url===n.url?r:(O[n.name]=n,n)}function s(e){e=e||O;for(var n in e)if(e.hasOwnProperty(n)&&e[n].state!==_)return!1;return!0}function f(e){e.state=A,r(e.onpreload,function(e){e.call()})}function m(e,t){e.state===n&&(e.state=$,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),S.load.apply(null,e[0]),S):(o?(r(t,function(e){!a(e)&&e&&m(l(e))}),y(l(e[0]),a(o)?o:function(){S.load.apply(null,t)})):y(l(e[0])),S)}function v(){var e=arguments,n=e[e.length-1],t={};return a(n)||(n=null),c(e[0])?(e[0].push(n),S.load.apply(null,e[0]),S):(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)}))}),S)}function y(e,n){return n=n||t,e.state===_?void n():e.state===k?void S.ready(e.name,n):e.state===$?void e.onpreload.push(function(){y(e,n)}):(e.state=k,void g(e,function(){e.state=_,n(),r(x[e.name],function(e){u(e)}),L&&s()&&r(x.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)&&(!C.documentMode||C.documentMode<9))&&(e.clearTimeout(n.errorTimeout),e.clearTimeout(n.cssTimeout),i.onload=i.onreadystatechange=i.onerror=null,r())}function c(){if(n.state!==_&&n.cssRetries<=20){for(var t=0,r=C.styleSheets.length;r>t;t++)if(C.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=C.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=C.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=C.head||C.getElementsByTagName("head")[0];d.insertBefore(i,d.lastChild)}function j(){for(var e=C.getElementsByTagName("script"),n=0,t=e.length;t>n;n++){var r=e[n].getAttribute("data-headjs-load");if(r)return void S.load(r)}}function T(e,n){if(e===C)return L?u(n):q.push(n),S;if(a(e)&&(n=e,e="ALL"),c(e)){var t={};return r(e,function(e){t[e]=O[e],S.ready(e,function(){s(t)&&u(n)})}),S}if("string"!=typeof e||!a(n))return S;var o=O[e];if(o&&o.state===_||"ALL"===e&&s()&&L)return u(n),S;var i=x[e];return i?i.push(n):i=x[e]=[n],S}function b(){return C.body?void(L||(L=!0,j(),r(q,function(e){u(e)}))):(e.clearTimeout(S.readyTimeout),void(S.readyTimeout=e.setTimeout(b,50)))}function E(){C.addEventListener?(C.removeEventListener("DOMContentLoaded",E,!1),b()):"complete"===C.readyState&&(C.detachEvent("onreadystatechange",E),b())}var L,C=e.document,q=[],x={},O={},w="async"in C.createElement("script")||"MozAppearance"in C.documentElement.style||e.opera,M=e.head_conf&&e.head_conf.head||"head",S=e[M]=e[M]||function(){S.ready.apply(null,arguments)},$=1,A=2,k=3,_=4;if("complete"===C.readyState)b();else if(C.addEventListener)C.addEventListener("DOMContentLoaded",E,!1),e.addEventListener("load",b,!1);else{C.attachEvent("onreadystatechange",E),e.attachEvent("onload",b);var I=!1;try{I=!e.frameElement&&C.documentElement}catch(U){}I&&I.doScroll&&!function B(){if(!L){try{I.doScroll("left")}catch(n){return e.clearTimeout(S.readyTimeout),void(S.readyTimeout=e.setTimeout(B,50))}b()}}()}S.load=S.js=w?v:p,S.test=d,S.ready=T,S.ready(C,function(){s()&&r(x.ALL,function(e){u(e)}),S.feature&&S.feature("domloaded",!0)})}(window);var oc=oc||{};!function(e,n,t){if(oc.conf=oc.conf||{},oc.cmd=oc.cmd||[],oc.renderedComponents=oc.renderedComponents||{},oc.status=oc.status||!1,oc.status)return oc;oc.status="loading";var r="https://cdnjs.cloudflare.com/ajax/libs/",o=r+"jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js",a=r+"handlebars.js/3.0.1/handlebars.runtime.js",c=r+"jade/1.9.2/runtime.min.js",i=r+"jquery/1.11.2/jquery.min.js",u=oc.conf.retryInterval||5e3,d=oc.conf.retryLimit||30,l=oc.conf.retrySendNumber||!0,s=oc.conf.pollingInterval||500,f=oc.conf.tag||"oc-component",m="baseUrl parameter is required",p="Href parameter missing",v="name parameter is required",y="Failed to load {0} component {1} times. Giving up".replace("{1}",d),h="Error getting compiled view: {0}",g="Error rendering component: {0}, error: {1}",j="Failed to retrieve the component. Retrying in {0} seconds...".replace("{0}",u/1e3),T='Error loading component: view engine "{0}" not supported',b="Loading...",E="Component '{0}' correctly rendered",L="Unrendered component found. Trying to retrieve it...",C=oc.conf.debug||!1,q=function(){},x=t.navigator.userAgent,O=!!x.match(/MSIE 8/),w=!!x.match(/MSIE 9/),M=!1,S=!1,$={},A=function(e){return"boolean"==typeof e},k={error:function(e){return console.log(e)},info:function(e){return C?console.log(e):!1}},_=function(e,n,t){return void 0===$[e]&&($[e]=d),$[e]<=0?t():(setTimeout(function(){n(d-$[e]+1)},u),void $[e]--)},I=function(e,n){if(e&&n){var t=oc.$.param(n);return e.indexOf("?")>-1?e+"&"+t:e+"?"+t}return e};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':"<"+f+' href="'+t+'">"},oc.events={},oc.ready=function(e){if(M)return e();if(S)oc.cmd.push(e);else{S=!0;var n=function(e,n){!O&&!w||e.IE_POLYFILL_LOADED?n():oc.require(o,n)},r=function(){M=!0,S=!1,oc.events=function(){var e=oc.$({});return{fire:function(n,t){return e.trigger(n,t)},on:function(n,t){return e.on(n,t||q)},reset:function(){return e.off()}}}(),e(),oc.events.fire("oc:ready",oc),oc.status="ready";for(var n=0;n'+b+""),oc.renderByHref(e.attr("href"),function(t,r){return t||!r?(k.error(t),n()):void U(e,r,n)}))})},oc.renderByHref=function(e,n,t){var r=t,o=n;"function"==typeof n&&(r=n,o=0),oc.ready(function(){if(""===e)return r(g.replace("{1}",p));var n=e;l&&(n=I(n,{__oc_Retry:o})),oc.$.ajax({url:n,headers:{Accept:"application/vnd.oc.unrendered+json"},contentType:"text/plain",crossDomain:!0,async:!0,success:function(e){if("unrendered"===e.renderMode)oc.render(e.template,e.data,function(n,t){return n?r(g.replace("{0}",e.href).replace("{1}",n)):(k.info(E.replace("{0}",e.template.src)),void r(null,{html:t,key:e.template.key,version:e.version,name:e.name}))});else if("rendered"===e.renderMode){if(k.info(E.replace("{0}",e.href)),0===e.html.indexOf("<"+f)){var n=e.html.slice(e.html.indexOf(">")+1),t=n.slice(0,n.lastIndexOf("<"));e.html=t}r(null,{html:e.html,version:e.version,name:e.name})}},error:function(){k.error(j),_(e,function(n){oc.renderByHref(e,n,r)},function(){r(y.replace("{0}",e))})}})})},oc.renderUnloadedComponents=function(){oc.ready(function(){var e=O?"div[data-oc-component=true]":f,n=oc.$(e+"[data-rendered!=true]"),t=n.length,r=function(e){t--,t||oc.renderUnloadedComponents()};if(t>0)for(var o=0;o');var r=oc.$(f,e);oc.renderNestedComponent(r,function(){t(r)})}})},oc.ready(oc.renderUnloadedComponents)}(head,document,window),oc.clientVersion="0.28.0"; //# sourceMappingURL=oc-client.min.map \ No newline at end of file diff --git a/grunt-tasks/support/task-build.js b/grunt-tasks/support/task-build.js index be404910b..c0fbc5719 100644 --- a/grunt-tasks/support/task-build.js +++ b/grunt-tasks/support/task-build.js @@ -13,7 +13,7 @@ module.exports = function(grunt, taskObject){ version = taskObject.pkg.version, clientComponentDir = '../../components/oc-client/', licenseRow = '/*! OpenComponents client v{0} | (c) 2015-{1} OpenTable, Inc. | {2} */', - licenseLink = 'https://github.com/opentable/oc/tree/master/components/oc-client/LICENSES.md', + licenseLink = 'https://github.com/opentable/oc/tree/master/components/oc-client/LICENSES', license = format(licenseRow, version, new Date().getFullYear(), licenseLink), headLoad = fs.readFileSync(path.join(__dirname, clientComponentDir, 'src/head.load.js')).toString(), ocClient = fs.readFileSync(path.join(__dirname, clientComponentDir, 'src/oc-client.js')).toString(),