diff --git a/docs/1.3/_index.html b/docs/1.3/_index.html new file mode 100644 index 00000000..b0d24aaf --- /dev/null +++ b/docs/1.3/_index.html @@ -0,0 +1,94 @@ + + + + + + + Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Documentation by YARD 0.9.28

+
+

Alphabetic Index

+ +

File Listing

+ + +
+

Namespace Listing A-Z

+ + + + + + + + +
+ +
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/class_list.html b/docs/1.3/class_list.html new file mode 100644 index 00000000..8c5b5368 --- /dev/null +++ b/docs/1.3/class_list.html @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + Class List + + + +
+
+

Class List

+ + + +
+ + +
+ + diff --git a/docs/1.3/css/common.css b/docs/1.3/css/common.css new file mode 100644 index 00000000..cf25c452 --- /dev/null +++ b/docs/1.3/css/common.css @@ -0,0 +1 @@ +/* Override this file with custom rules */ \ No newline at end of file diff --git a/docs/1.3/css/full_list.css b/docs/1.3/css/full_list.css new file mode 100644 index 00000000..fa359824 --- /dev/null +++ b/docs/1.3/css/full_list.css @@ -0,0 +1,58 @@ +body { + margin: 0; + font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + font-size: 13px; + height: 101%; + overflow-x: hidden; + background: #fafafa; +} + +h1 { padding: 12px 10px; padding-bottom: 0; margin: 0; font-size: 1.4em; } +.clear { clear: both; } +.fixed_header { position: fixed; background: #fff; width: 100%; padding-bottom: 10px; margin-top: 0; top: 0; z-index: 9999; height: 70px; } +#search { position: absolute; right: 5px; top: 9px; padding-left: 24px; } +#content.insearch #search, #content.insearch #noresults { background: url(data:image/gif;base64,R0lGODlhEAAQAPYAAP///wAAAPr6+pKSkoiIiO7u7sjIyNjY2J6engAAAI6OjsbGxjIyMlJSUuzs7KamppSUlPLy8oKCghwcHLKysqSkpJqamvT09Pj4+KioqM7OzkRERAwMDGBgYN7e3ujo6Ly8vCoqKjY2NkZGRtTU1MTExDw8PE5OTj4+PkhISNDQ0MrKylpaWrS0tOrq6nBwcKysrLi4uLq6ul5eXlxcXGJiYoaGhuDg4H5+fvz8/KKiohgYGCwsLFZWVgQEBFBQUMzMzDg4OFhYWBoaGvDw8NbW1pycnOLi4ubm5kBAQKqqqiQkJCAgIK6urnJyckpKSjQ0NGpqatLS0sDAwCYmJnx8fEJCQlRUVAoKCggICLCwsOTk5ExMTPb29ra2tmZmZmhoaNzc3KCgoBISEiIiIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCAAAACwAAAAAEAAQAAAHaIAAgoMgIiYlg4kACxIaACEJCSiKggYMCRselwkpghGJBJEcFgsjJyoAGBmfggcNEx0flBiKDhQFlIoCCA+5lAORFb4AJIihCRbDxQAFChAXw9HSqb60iREZ1omqrIPdJCTe0SWI09GBACH5BAkIAAAALAAAAAAQABAAAAdrgACCgwc0NTeDiYozCQkvOTo9GTmDKy8aFy+NOBA7CTswgywJDTIuEjYFIY0JNYMtKTEFiRU8Pjwygy4ws4owPyCKwsMAJSTEgiQlgsbIAMrO0dKDGMTViREZ14kYGRGK38nHguHEJcvTyIEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDAggPg4iJAAMJCRUAJRIqiRGCBI0WQEEJJkWDERkYAAUKEBc4Po1GiKKJHkJDNEeKig4URLS0ICImJZAkuQAhjSi/wQyNKcGDCyMnk8u5rYrTgqDVghgZlYjcACTA1sslvtHRgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCQARAtOUoQRGRiFD0kJUYWZhUhKT1OLhR8wBaaFBzQ1NwAlkIszCQkvsbOHL7Y4q4IuEjaqq0ZQD5+GEEsJTDCMmIUhtgk1lo6QFUwJVDKLiYJNUd6/hoEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4uen4ICCA+IkIsDCQkVACWmhwSpFqAABQoQF6ALTkWFnYMrVlhWvIKTlSAiJiVVPqlGhJkhqShHV1lCW4cMqSkAR1ofiwsjJyqGgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCSMhREZGIYYGY2ElYebi56fhyWQniSKAKKfpaCLFlAPhl0gXYNGEwkhGYREUywag1wJwSkHNDU3D0kJYIMZQwk8MjPBLx9eXwuETVEyAC/BOKsuEjYFhoEAIfkECQgAAAAsAAAAABAAEAAAB2eAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4ueICImip6CIQkJKJ4kigynKaqKCyMnKqSEK05StgAGQRxPYZaENqccFgIID4KXmQBhXFkzDgOnFYLNgltaSAAEpxa7BQoQF4aBACH5BAkIAAAALAAAAAAQABAAAAdogACCg4SFggJiPUqCJSWGgkZjCUwZACQkgxGEXAmdT4UYGZqCGWQ+IjKGGIUwPzGPhAc0NTewhDOdL7Ykji+dOLuOLhI2BbaFETICx4MlQitdqoUsCQ2vhKGjglNfU0SWmILaj43M5oEAOwAAAAAAAAAAAA==) no-repeat center left; } +#full_list { padding: 0; list-style: none; margin-left: 0; margin-top: 80px; font-size: 1.1em; } +#full_list ul { padding: 0; } +#full_list li { padding: 0; margin: 0; list-style: none; } +#full_list li .item { padding: 5px 5px 5px 12px; } +#noresults { padding: 7px 12px; background: #fff; } +#content.insearch #noresults { margin-left: 7px; } +li.collapsed ul { display: none; } +li a.toggle { cursor: default; position: relative; left: -5px; top: 4px; text-indent: -999px; width: 10px; height: 9px; margin-left: -10px; display: block; float: left; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC) no-repeat bottom left; } +li.collapsed a.toggle { opacity: 0.5; cursor: default; background-position: top left; } +li { color: #888; cursor: pointer; } +li.deprecated { text-decoration: line-through; font-style: italic; } +li.odd { background: #f0f0f0; } +li.even { background: #fafafa; } +.item:hover { background: #ddd; } +li small:before { content: "("; } +li small:after { content: ")"; } +li small.search_info { display: none; } +a, a:visited { text-decoration: none; color: #05a; } +li.clicked > .item { background: #05a; color: #ccc; } +li.clicked > .item a, li.clicked > .item a:visited { color: #eee; } +li.clicked > .item a.toggle { opacity: 0.5; background-position: bottom right; } +li.collapsed.clicked a.toggle { background-position: top right; } +#search input { border: 1px solid #bbb; border-radius: 3px; } +#full_list_nav { margin-left: 10px; font-size: 0.9em; display: block; color: #aaa; } +#full_list_nav a, #nav a:visited { color: #358; } +#full_list_nav a:hover { background: transparent; color: #5af; } +#full_list_nav span:after { content: ' | '; } +#full_list_nav span:last-child:after { content: ''; } + +#content h1 { margin-top: 0; } +li { white-space: nowrap; cursor: normal; } +li small { display: block; font-size: 0.8em; } +li small:before { content: ""; } +li small:after { content: ""; } +li small.search_info { display: none; } +#search { width: 170px; position: static; margin: 3px; margin-left: 10px; font-size: 0.9em; color: #888; padding-left: 0; padding-right: 24px; } +#content.insearch #search { background-position: center right; } +#search input { width: 110px; } + +#full_list.insearch ul { display: block; } +#full_list.insearch .item { display: none; } +#full_list.insearch .found { display: block; padding-left: 11px !important; } +#full_list.insearch li a.toggle { display: none; } +#full_list.insearch li small.search_info { display: block; } diff --git a/docs/1.3/css/style.css b/docs/1.3/css/style.css new file mode 100644 index 00000000..eb0dbc86 --- /dev/null +++ b/docs/1.3/css/style.css @@ -0,0 +1,497 @@ +html { + width: 100%; + height: 100%; +} +body { + font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + font-size: 13px; + width: 100%; + margin: 0; + padding: 0; + display: flex; + display: -webkit-flex; + display: -ms-flexbox; +} + +#nav { + position: relative; + width: 100%; + height: 100%; + border: 0; + border-right: 1px dotted #eee; + overflow: auto; +} +.nav_wrap { + margin: 0; + padding: 0; + width: 20%; + height: 100%; + position: relative; + display: flex; + display: -webkit-flex; + display: -ms-flexbox; + flex-shrink: 0; + -webkit-flex-shrink: 0; + -ms-flex: 1 0; +} +#resizer { + position: absolute; + right: -5px; + top: 0; + width: 10px; + height: 100%; + cursor: col-resize; + z-index: 9999; +} +#main { + flex: 5 1; + -webkit-flex: 5 1; + -ms-flex: 5 1; + outline: none; + position: relative; + background: #fff; + padding: 1.2em; + padding-top: 0.2em; + box-sizing: border-box; +} + +@media (max-width: 920px) { + .nav_wrap { width: 100%; top: 0; right: 0; overflow: visible; position: absolute; } + #resizer { display: none; } + #nav { + z-index: 9999; + background: #fff; + display: none; + position: absolute; + top: 40px; + right: 12px; + width: 500px; + max-width: 80%; + height: 80%; + overflow-y: scroll; + border: 1px solid #999; + border-collapse: collapse; + box-shadow: -7px 5px 25px #aaa; + border-radius: 2px; + } +} + +@media (min-width: 920px) { + body { height: 100%; overflow: hidden; } + #main { height: 100%; overflow: auto; } + #search { display: none; } +} + +#main img { max-width: 100%; } +h1 { font-size: 25px; margin: 1em 0 0.5em; padding-top: 4px; border-top: 1px dotted #d5d5d5; } +h1.noborder { border-top: 0px; margin-top: 0; padding-top: 4px; } +h1.title { margin-bottom: 10px; } +h1.alphaindex { margin-top: 0; font-size: 22px; } +h2 { + padding: 0; + padding-bottom: 3px; + border-bottom: 1px #aaa solid; + font-size: 1.4em; + margin: 1.8em 0 0.5em; + position: relative; +} +h2 small { font-weight: normal; font-size: 0.7em; display: inline; position: absolute; right: 0; } +h2 small a { + display: block; + height: 20px; + border: 1px solid #aaa; + border-bottom: 0; + border-top-left-radius: 5px; + background: #f8f8f8; + position: relative; + padding: 2px 7px; +} +.clear { clear: both; } +.inline { display: inline; } +.inline p:first-child { display: inline; } +.docstring, .tags, #filecontents { font-size: 15px; line-height: 1.5145em; } +.docstring p > code, .docstring p > tt, .tags p > code, .tags p > tt { + color: #c7254e; background: #f9f2f4; padding: 2px 4px; font-size: 1em; + border-radius: 4px; +} +.docstring h1, .docstring h2, .docstring h3, .docstring h4 { padding: 0; border: 0; border-bottom: 1px dotted #bbb; } +.docstring h1 { font-size: 1.2em; } +.docstring h2 { font-size: 1.1em; } +.docstring h3, .docstring h4 { font-size: 1em; border-bottom: 0; padding-top: 10px; } +.summary_desc .object_link a, .docstring .object_link a { + font-family: monospace; font-size: 1.05em; + color: #05a; background: #EDF4FA; padding: 2px 4px; font-size: 1em; + border-radius: 4px; +} +.rdoc-term { padding-right: 25px; font-weight: bold; } +.rdoc-list p { margin: 0; padding: 0; margin-bottom: 4px; } +.summary_desc pre.code .object_link a, .docstring pre.code .object_link a { + padding: 0px; background: inherit; color: inherit; border-radius: inherit; +} + +/* style for */ +#filecontents table, .docstring table { border-collapse: collapse; } +#filecontents table th, #filecontents table td, +.docstring table th, .docstring table td { border: 1px solid #ccc; padding: 8px; padding-right: 17px; } +#filecontents table tr:nth-child(odd), +.docstring table tr:nth-child(odd) { background: #eee; } +#filecontents table tr:nth-child(even), +.docstring table tr:nth-child(even) { background: #fff; } +#filecontents table th, .docstring table th { background: #fff; } + +/* style for
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; +f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() +{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/docs/1.3/method_list.html b/docs/1.3/method_list.html new file mode 100644 index 00000000..48eea1f7 --- /dev/null +++ b/docs/1.3/method_list.html @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + Method List + + + +
+
+

Method List

+ + + +
+ +
    + + + +
+
+ + diff --git a/docs/1.3/wcc-contentful-app/CreateWCCContentfulAppContactFormSubmissions.html b/docs/1.3/wcc-contentful-app/CreateWCCContentfulAppContactFormSubmissions.html new file mode 100644 index 00000000..89a44802 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/CreateWCCContentfulAppContactFormSubmissions.html @@ -0,0 +1,200 @@ + + + + + + + Class: CreateWCCContentfulAppContactFormSubmissions + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: CreateWCCContentfulAppContactFormSubmissions + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/wcc/templates/section-contact-form/migrations/create_wcc_contentful_app_contact_form_submissions.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #changeObject + + + + + +

+ + + + +
+
+
+
+4
+5
+6
+7
+8
+9
+10
+11
+
+
# File 'lib/generators/wcc/templates/section-contact-form/migrations/create_wcc_contentful_app_contact_form_submissions.rb', line 4
+
+def change
+  create_table :wcc_contentful_app_contact_form_submissions do |t|
+    t.string :form_id
+    t.json :data, default: {}
+
+    t.timestamps
+  end
+end
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/DropdownMenu.html b/docs/1.3/wcc-contentful-app/DropdownMenu.html new file mode 100644 index 00000000..bad365e6 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/DropdownMenu.html @@ -0,0 +1,135 @@ + + + + + + + Class: DropdownMenu + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: DropdownMenu + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model::DropdownMenu + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/wcc/templates/menu/models/dropdown_menu.rb
+
+ +
+ +

Overview

+
+ +

This model represents the 'dropdownMenu' content type in Contentful. Any linked entries of the 'dropdownMenu' content type will be resolved as instances of this class. It exposes #find, #find_by, and #find_all methods to query Contentful.

+ + +
+
+
+ + +
+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/FormField.html b/docs/1.3/wcc-contentful-app/FormField.html new file mode 100644 index 00000000..ca603d6f --- /dev/null +++ b/docs/1.3/wcc-contentful-app/FormField.html @@ -0,0 +1,135 @@ + + + + + + + Class: FormField + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: FormField + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model::FormField + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/wcc/templates/section-contact-form/models/form_field.rb
+
+ +
+ +

Overview

+
+ +

This model represents the 'formField' content type in Contentful. Any linked entries of the 'formField' content type will be resolved as instances of this class. It exposes #find, #find_by, and #find_all methods to query Contentful.

+ + +
+
+
+ + +
+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/Menu.html b/docs/1.3/wcc-contentful-app/Menu.html new file mode 100644 index 00000000..befb952f --- /dev/null +++ b/docs/1.3/wcc-contentful-app/Menu.html @@ -0,0 +1,135 @@ + + + + + + + Class: Menu + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: Menu + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model::Menu + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/wcc/templates/menu/models/menu.rb
+
+ +
+ +

Overview

+
+ +

This model represents the 'menu' content type in Contentful. Any linked entries of the 'menu' content type will be resolved as instances of this class. It exposes #find, #find_by, and #find_all methods to query Contentful.

+ + +
+
+
+ + +
+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/MenuButton.html b/docs/1.3/wcc-contentful-app/MenuButton.html new file mode 100644 index 00000000..bb2abfdd --- /dev/null +++ b/docs/1.3/wcc-contentful-app/MenuButton.html @@ -0,0 +1,135 @@ + + + + + + + Class: MenuButton + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: MenuButton + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model::MenuButton + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/wcc/templates/menu/models/menu_button.rb
+
+ +
+ +

Overview

+
+ +

This model represents the 'menuButton' content type in Contentful. Any linked entries of the 'menuButton' content type will be resolved as instances of this class. It exposes #find, #find_by, and #find_all methods to query Contentful.

+ + +
+
+
+ + +
+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/Page.html b/docs/1.3/wcc-contentful-app/Page.html new file mode 100644 index 00000000..f5f58633 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/Page.html @@ -0,0 +1,135 @@ + + + + + + + Class: Page + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: Page + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model::Page + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/wcc/templates/page/models/page.rb
+
+ +
+ +

Overview

+
+ +

This model represents the 'page' content type in Contentful. Any linked entries of the 'page' content type will be resolved as instances of this class. It exposes #find, #find_by, and #find_all methods to query Contentful.

+ + +
+
+
+ + +
+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/Redirect.html b/docs/1.3/wcc-contentful-app/Redirect.html new file mode 100644 index 00000000..3f7a6ce5 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/Redirect.html @@ -0,0 +1,135 @@ + + + + + + + Class: Redirect + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: Redirect + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model::Redirect + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/wcc/templates/page/models/redirect.rb
+
+ +
+ +

Overview

+
+ +

This model represents the 'redirect' content type in Contentful. Any linked entries of the 'redirect' content type will be resolved as instances of this class. It exposes .find, .find_by, and .find_all methods to query Contentful.

+ + +
+
+
+ + +
+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/SectionBlockText.html b/docs/1.3/wcc-contentful-app/SectionBlockText.html new file mode 100644 index 00000000..4bd5fcd7 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/SectionBlockText.html @@ -0,0 +1,135 @@ + + + + + + + Class: SectionBlockText + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: SectionBlockText + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model::SectionBlockText + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/wcc/templates/section-block-text/models/section_block_text.rb
+
+ +
+ +

Overview

+
+ +

This model represents the 'section-block-text' content type in Contentful. Any linked entries of the 'section-block-text' content type will be resolved as instances of this class. It exposes .find, .find_by, and .find_all methods to query Contentful.

+ + +
+
+
+ + +
+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/SectionCodeWidget.html b/docs/1.3/wcc-contentful-app/SectionCodeWidget.html new file mode 100644 index 00000000..fdb81585 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/SectionCodeWidget.html @@ -0,0 +1,135 @@ + + + + + + + Class: SectionCodeWidget + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: SectionCodeWidget + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model::SectionCodeWidget + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/wcc/templates/section-code-widget/models/section_code_widget.rb
+
+ +
+ +

Overview

+
+ +

This model represents the 'section-code-widget' content type in Contentful. Any linked entries of the 'section-code-widget' content type will be resolved as instances of this class. It exposes .find, .find_by, and .find_all methods to query Contentful.

+ + +
+
+
+ + +
+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/SectionContactForm.html b/docs/1.3/wcc-contentful-app/SectionContactForm.html new file mode 100644 index 00000000..13429bfa --- /dev/null +++ b/docs/1.3/wcc-contentful-app/SectionContactForm.html @@ -0,0 +1,135 @@ + + + + + + + Class: SectionContactForm + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: SectionContactForm + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model::SectionContactForm + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/wcc/templates/section-contact-form/models/section_contact_form.rb
+
+ +
+ +

Overview

+
+ +

This model represents the 'section-contact-form' content type in Contentful. Any linked entries of the 'section-contact-form' content type will be resolved as instances of this class. It exposes .find, .find_by, and .find_all methods to query Contentful.

+ + +
+
+
+ + +
+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/SectionFaq.html b/docs/1.3/wcc-contentful-app/SectionFaq.html new file mode 100644 index 00000000..547d5531 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/SectionFaq.html @@ -0,0 +1,135 @@ + + + + + + + Class: SectionFaq + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: SectionFaq + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model::SectionFaq + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/wcc/templates/section-faq/models/section_faq.rb
+
+ +
+ +

Overview

+
+ +

This model represents the 'section-faq' content type in Contentful. Any linked entries of the 'section-faq' content type will be resolved as instances of this class. It exposes .find, .find_by, and .find_all methods to query Contentful.

+ + +
+
+
+ + +
+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/SectionHttpError.html b/docs/1.3/wcc-contentful-app/SectionHttpError.html new file mode 100644 index 00000000..c1f5aaea --- /dev/null +++ b/docs/1.3/wcc-contentful-app/SectionHttpError.html @@ -0,0 +1,135 @@ + + + + + + + Class: SectionHttpError + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: SectionHttpError + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model::SectionHttpError + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/wcc/templates/section-http-error/models/section_http_error.rb
+
+ +
+ +

Overview

+
+ +

This model represents the 'section-http-error' content type in Contentful. Any linked entries of the 'section-http-error' content type will be resolved as instances of this class. It exposes .find, .find_by, and .find_all methods to query Contentful.

+ + +
+
+
+ + +
+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/SectionMarqueeText.html b/docs/1.3/wcc-contentful-app/SectionMarqueeText.html new file mode 100644 index 00000000..9e4c4e29 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/SectionMarqueeText.html @@ -0,0 +1,135 @@ + + + + + + + Class: SectionMarqueeText + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: SectionMarqueeText + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model::SectionMarqueeText + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/wcc/templates/section-marquee-text/models/section_marquee_text.rb
+
+ +
+ +

Overview

+
+ +

This model represents the 'section-marquee-text' content type in Contentful. Any linked entries of the 'section-marquee-text' content type will be resolved as instances of this class. It exposes .find, .find_by, and .find_all methods to query Contentful.

+ + +
+
+
+ + +
+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/SectionTestimonials.html b/docs/1.3/wcc-contentful-app/SectionTestimonials.html new file mode 100644 index 00000000..b71f2b35 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/SectionTestimonials.html @@ -0,0 +1,135 @@ + + + + + + + Class: SectionTestimonials + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: SectionTestimonials + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model::SectionTestimonials + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/wcc/templates/section-testimonial/models/section_testimonial.rb
+
+ +
+ +

Overview

+
+ +

This model represents the 'section-testimonials' content type in Contentful. Any linked entries of the 'section-testimonials' content type will be resolved as instances of this class. It exposes .find, .find_by, and .find_all methods to query Contentful.

+ + +
+
+
+ + +
+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/SectionVideo.html b/docs/1.3/wcc-contentful-app/SectionVideo.html new file mode 100644 index 00000000..860612b9 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/SectionVideo.html @@ -0,0 +1,135 @@ + + + + + + + Class: SectionVideo + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: SectionVideo + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model::SectionVideo + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/wcc/templates/section-video/models/section_video.rb
+
+ +
+ +

Overview

+
+ +

This model represents the 'section-video' content type in Contentful. Any linked entries of the 'section-video' content type will be resolved as instances of this class. It exposes .find, .find_by, and .find_all methods to query Contentful.

+ + +
+
+
+ + +
+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/SectionVideoHighlight.html b/docs/1.3/wcc-contentful-app/SectionVideoHighlight.html new file mode 100644 index 00000000..249183eb --- /dev/null +++ b/docs/1.3/wcc-contentful-app/SectionVideoHighlight.html @@ -0,0 +1,135 @@ + + + + + + + Class: SectionVideoHighlight + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: SectionVideoHighlight + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model::SectionVideoHighlight + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/wcc/templates/section-video-highlight/models/section_video_highlight.rb
+
+ +
+ +

Overview

+
+ +

This model represents the 'section-video-highlight' content type in Contentful. Any linked entries of the 'section-video-highlight' content type will be resolved as instances of this class. It exposes .find, .find_by, and .find_all methods to query Contentful.

+ + +
+
+
+ + +
+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/SiteConfig.html b/docs/1.3/wcc-contentful-app/SiteConfig.html new file mode 100644 index 00000000..7c90389d --- /dev/null +++ b/docs/1.3/wcc-contentful-app/SiteConfig.html @@ -0,0 +1,135 @@ + + + + + + + Class: SiteConfig + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: SiteConfig + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model::SiteConfig + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/wcc/templates/site-config/models/site_config.rb
+
+ +
+ +

Overview

+
+ +

This model represents the 'site-config' content type in Contentful. Any linked entries of the 'site-config' content type will be resolved as instances of this class. It exposes .find, .find_by, and .find_all methods to query Contentful.

+ + +
+
+
+ + +
+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC.html b/docs/1.3/wcc-contentful-app/WCC.html new file mode 100644 index 00000000..f5f16a73 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC.html @@ -0,0 +1,115 @@ + + + + + + + Module: WCC + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Module: WCC + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/wcc/contentful/app/version.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + Modules: Contentful + + + + +

+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful.html b/docs/1.3/wcc-contentful-app/WCC/Contentful.html new file mode 100644 index 00000000..a87a4894 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful.html @@ -0,0 +1,115 @@ + + + + + + + Module: WCC::Contentful + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Module: WCC::Contentful + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/wcc/contentful/app/version.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + Modules: App + + + + +

+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/App.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/App.html new file mode 100644 index 00000000..ff19c9a8 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/App.html @@ -0,0 +1,574 @@ + + + + + + + Module: WCC::Contentful::App + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Module: WCC::Contentful::App + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/wcc/contentful/app/version.rb,
+ lib/wcc/contentful/app/exceptions.rb,
app/mailers/wcc/contentful/app/contact_mailer.rb,
lib/wcc/contentful/app/custom_markdown_render.rb,
app/models/wcc/contentful/app/contact_form_submission.rb,
lib/wcc/contentful/app/engine.rb,
lib/wcc/contentful/app.rb
+
+
+ +
+ +

Defined Under Namespace

+

+ + + Modules: MenuHelper, PreviewPassword, SectionHelper + + + + Classes: Configuration, ContactFormController, ContactFormSubmission, ContactMailer, CustomMarkdownRender, Engine, MarkdownRenderer, PageNotFoundError, PagesController, ValidationError + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
VERSION = + +
+
'1.3.0'
+ +
+ + + + + +

Class Attribute Summary collapse

+
    + +
  • + + + .configuration ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
    +

    Gets the current configuration, after calling WCC::Contentful::App.configure.

    +
    + +
  • + + +
  • + + + .initialized ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
    +

    Returns the value of attribute initialized.

    +
    + +
  • + + +
+ + + + + +

+ Class Method Summary + collapse +

+ + + + + +
+

Class Attribute Details

+ + + +
+

+ + .configurationObject (readonly) + + + + + +

+
+ +

Gets the current configuration, after calling WCC::Contentful::App.configure

+ + +
+
+
+ + +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'lib/wcc/contentful/app.rb', line 14
+
+def configuration
+  @configuration
+end
+
+
+ + + +
+

+ + .initializedObject (readonly) + + + + + +

+
+ +

Returns the value of attribute initialized.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+11
+12
+13
+
+
# File 'lib/wcc/contentful/app.rb', line 11
+
+def initialized
+  @initialized
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .configureObject + + + + + +

+ + + + +
+
+
+
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+
+
# File 'lib/wcc/contentful/app.rb', line 17
+
+def self.configure
+  if initialized || WCC::Contentful.initialized
+    raise WCC::Contentful::InitializationError, 'Cannot configure after initialization'
+  end
+
+  WCC::Contentful.configure do |wcc_contentful_config|
+    if @configuration&.wcc_contentful_config != wcc_contentful_config
+      @configuration = Configuration.new(wcc_contentful_config)
+    end
+    yield(configuration)
+  end
+
+  configuration.validate!
+
+  configuration
+end
+
+
+ +
+

+ + .db_connected?Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+59
+60
+61
+
+
# File 'lib/wcc/contentful/app.rb', line 59
+
+def self.db_connected?
+  @db_connected
+end
+
+
+ +
+

+ + .init!Object + + + + + +

+
+ + +
+
+
+ +

Raises:

+
    + +
  • + + + (ArgumentError) + + + +
  • + +
+ +
+ + + + +
+
+
+
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+
+
# File 'lib/wcc/contentful/app.rb', line 34
+
+def self.init!
+  raise ArgumentError, 'Please first call WCC::Contentful::App.configure' if configuration.nil?
+
+  WCC::Contentful.init!
+
+  # Extend all model types w/ validation & extra fields
+  WCC::Contentful::Model.schema.each_value do |t|
+    file = File.dirname(__FILE__) + "/model/#{t.name.underscore}.rb"
+    require file if File.exist?(file)
+  end
+
+  @db_connected =
+    begin
+      ::ActiveRecord::Base.connection_pool.with_connection(&:active?)
+    rescue StandardError
+      false
+    end
+
+  @configuration = WCC::Contentful::App::Configuration::FrozenConfiguration.new(
+    configuration,
+    WCC::Contentful.configuration
+  )
+  @initialized = true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/App/Configuration.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/Configuration.html new file mode 100644 index 00000000..73b50ae7 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/Configuration.html @@ -0,0 +1,552 @@ + + + + + + + Class: WCC::Contentful::App::Configuration + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: WCC::Contentful::App::Configuration + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/wcc/contentful/app/configuration.rb
+
+ +
+ +

Overview

+
+ +

This object contains all the configuration options for the `wcc-contentful` gem.

+ + +
+
+
+ + +

Defined Under Namespace

+

+ + + + + Classes: FrozenConfiguration + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
ATTRIBUTES = +
+
+ +

TODO: things to configure in the app?

+ + +
+
+
+ + +
+
+
%i[
+  preview_password
+].freeze
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #preview_password ⇒ Object + + + + + + + + + + + + + + + + +
    +

    Sets the password that will be checked when the query string contains `preview=`, if it matches, then the Contentful entries are fetched via the preview API.

    +
    + +
  • + + +
  • + + + #wcc_contentful_config ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
    +

    Returns the value of attribute wcc_contentful_config.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(wcc_contentful_config) ⇒ Configuration + + + + + +

+
+ +

Returns a new instance of Configuration.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+23
+
+
# File 'lib/wcc/contentful/app/configuration.rb', line 20
+
+def initialize(wcc_contentful_config)
+  @wcc_contentful_config = wcc_contentful_config
+  @preview_password = ENV.fetch('CONTENTFUL_PREVIEW_PASSWORD', nil)
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #preview_passwordObject + + + + + +

+
+ +

Sets the password that will be checked when the query string contains `preview=`, if it matches, then the Contentful entries are fetched via the preview API.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+12
+13
+14
+
+
# File 'lib/wcc/contentful/app/configuration.rb', line 12
+
+def preview_password
+  @preview_password
+end
+
+
+ + + +
+

+ + #wcc_contentful_configObject (readonly) + + + + + +

+
+ +

Returns the value of attribute wcc_contentful_config.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'lib/wcc/contentful/app/configuration.rb', line 14
+
+def wcc_contentful_config
+  @wcc_contentful_config
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #frozen?Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+31
+32
+33
+
+
# File 'lib/wcc/contentful/app/configuration.rb', line 31
+
+def frozen?
+  false
+end
+
+
+ +
+

+ + #validate!Object + + + + + +

+
+ +

Validates the configuration, raising ArgumentError if anything is wrong. This is called by WCC::Contentful::App.init!

+ + +
+
+
+ + +
+ + + + +
+
+
+
+27
+28
+29
+
+
# File 'lib/wcc/contentful/app/configuration.rb', line 27
+
+def validate!
+  wcc_contentful_config.validate!
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/App/Configuration/FrozenConfiguration.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/Configuration/FrozenConfiguration.html new file mode 100644 index 00000000..9bd0c3d4 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/Configuration/FrozenConfiguration.html @@ -0,0 +1,312 @@ + + + + + + + Class: WCC::Contentful::App::Configuration::FrozenConfiguration + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: WCC::Contentful::App::Configuration::FrozenConfiguration + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/wcc/contentful/app/configuration.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(configuration, frozen_wcc_contentful_config) ⇒ FrozenConfiguration + + + + + +

+
+ +

Returns a new instance of FrozenConfiguration.

+ + +
+
+
+ +

Raises:

+
    + +
  • + + + (ArgumentError) + + + +
  • + +
+ +
+ + + + +
+
+
+
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+
+
# File 'lib/wcc/contentful/app/configuration.rb', line 40
+
+def initialize(configuration, frozen_wcc_contentful_config)
+  raise ArgumentError, 'Please first freeze the wcc_contentful_config' unless frozen_wcc_contentful_config.frozen?
+
+  @wcc_contentful_config = frozen_wcc_contentful_config
+
+  ATTRIBUTES.each do |att|
+    val = configuration.public_send(att)
+    val.freeze if val.respond_to?(:freeze)
+    instance_variable_set("@#{att}", val)
+  end
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #frozen?Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+52
+53
+54
+
+
# File 'lib/wcc/contentful/app/configuration.rb', line 52
+
+def frozen?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/App/ContactFormController.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/ContactFormController.html new file mode 100644 index 00000000..75387cb0 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/ContactFormController.html @@ -0,0 +1,233 @@ + + + + + + + Class: WCC::Contentful::App::ContactFormController + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: WCC::Contentful::App::ContactFormController + + + +

+
+ +
+
Inherits:
+
+ ApplicationController + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
PreviewPassword
+
+ + + + + + +
+
Defined in:
+
app/controllers/wcc/contentful/app/contact_form_controller.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from PreviewPassword

+

#preview?, #preview_password

+ + + +
+

Instance Method Details

+ + +
+

+ + #createObject + + + + + +

+ + + + +
+
+
+
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+
+
# File 'app/controllers/wcc/contentful/app/contact_form_controller.rb', line 6
+
+def create
+  address =
+    form_model.to_address(email_object_id: params[:email_object_id])
+
+  form_model.send_email(
+    form_params.merge!(
+      {
+        notification_email: address,
+        internal_title: params[:internal_title]
+      }
+    )
+  )
+
+  render json: { type: 'success', message: "Thanks for reaching out. We'll be in touch soon!" }
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/App/ContactFormSubmission.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/ContactFormSubmission.html new file mode 100644 index 00000000..68d20819 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/ContactFormSubmission.html @@ -0,0 +1,124 @@ + + + + + + + Class: WCC::Contentful::App::ContactFormSubmission + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: WCC::Contentful::App::ContactFormSubmission + + + +

+
+ +
+
Inherits:
+
+ ActiveRecord::Base + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
app/models/wcc/contentful/app/contact_form_submission.rb
+
+ +
+ + + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/App/ContactMailer.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/ContactMailer.html new file mode 100644 index 00000000..93f14193 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/ContactMailer.html @@ -0,0 +1,197 @@ + + + + + + + Class: WCC::Contentful::App::ContactMailer + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: WCC::Contentful::App::ContactMailer + + + +

+
+ +
+
Inherits:
+
+ ApplicationMailer + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
app/mailers/wcc/contentful/app/contact_mailer.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + +
+

Instance Method Details

+ + +
+

+ + #contact_form_email(to_email, data) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+9
+
+
# File 'app/mailers/wcc/contentful/app/contact_mailer.rb', line 5
+
+def contact_form_email(to_email, data)
+  @form_data = data
+
+  mail(from: @form_data[:Email], to: to_email, subject: "#{@form_data[:internal_title]} Submission")
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/App/CustomMarkdownRender.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/CustomMarkdownRender.html new file mode 100644 index 00000000..b46b6258 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/CustomMarkdownRender.html @@ -0,0 +1,478 @@ + + + + + + + Class: WCC::Contentful::App::CustomMarkdownRender + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: WCC::Contentful::App::CustomMarkdownRender + + + +

+
+ +
+
Inherits:
+
+ Redcarpet::Render::HTML + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/wcc/contentful/app/custom_markdown_render.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + +
+

Constructor Details

+ +
+

+ + #initialize(options) ⇒ CustomMarkdownRender + + + + + +

+
+ +

Returns a new instance of CustomMarkdownRender.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+
+
# File 'lib/wcc/contentful/app/custom_markdown_render.rb', line 7
+
+def initialize(options)
+  super
+  @options = options
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+ + + + + +
+
+
+
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
+
# File 'lib/wcc/contentful/app/custom_markdown_render.rb', line 27
+
+def hyperlink_attributes(title, url, link_class = nil)
+  link_attrs = { title: title, class: link_class }
+
+  link_attrs[:target] = use_target_blank?(url) ? '_blank' : nil
+
+  return link_attrs unless @options[:link_attributes]
+
+  @options[:link_attributes].merge(link_attrs)
+end
+
+
+ +
+ + + + + +
+
+
+
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
+
# File 'lib/wcc/contentful/app/custom_markdown_render.rb', line 12
+
+def link(link, title, content)
+  link_with_class_data =
+    @options[:links_with_classes]&.find do |link_with_class|
+      link_with_class[0] == link &&
+        link_with_class[2] == CGI.unescape_html(content)
+    end
+
+  link_class = link_with_class_data ? link_with_class_data[3] : nil
+  ActionController::Base.helpers.link_to(
+    content,
+    link,
+    hyperlink_attributes(title, link, link_class)
+  )
+end
+
+
+ +
+

+ + #table(header, body) ⇒ Object + + + + + +

+ + + + +
+
+
+
+41
+42
+43
+
+
# File 'lib/wcc/contentful/app/custom_markdown_render.rb', line 41
+
+def table(header, body)
+  "<table class=\"table\">#{header}#{body}</table>"
+end
+
+
+ +
+

+ + #use_target_blank?(url) ⇒ Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+37
+38
+39
+
+
# File 'lib/wcc/contentful/app/custom_markdown_render.rb', line 37
+
+def use_target_blank?(url)
+  url.scan(/(\s|^)(https?:\/\/\S*)/).present?
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/App/Engine.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/Engine.html new file mode 100644 index 00000000..89cb62df --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/Engine.html @@ -0,0 +1,124 @@ + + + + + + + Class: WCC::Contentful::App::Engine + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: WCC::Contentful::App::Engine + + + +

+
+ +
+
Inherits:
+
+ Rails::Engine + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/wcc/contentful/app/engine.rb
+
+ +
+ + + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/App/MarkdownRenderer.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/MarkdownRenderer.html new file mode 100644 index 00000000..31fc0734 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/MarkdownRenderer.html @@ -0,0 +1,495 @@ + + + + + + + Class: WCC::Contentful::App::MarkdownRenderer + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: WCC::Contentful::App::MarkdownRenderer + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/wcc/contentful/app/markdown_renderer.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #extensions ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
    +

    Returns the value of attribute extensions.

    +
    + +
  • + + +
  • + + + #options ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
    +

    Returns the value of attribute options.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(options = nil) ⇒ MarkdownRenderer + + + + + +

+
+ +

Returns a new instance of MarkdownRenderer.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
+
# File 'lib/wcc/contentful/app/markdown_renderer.rb', line 8
+
+def initialize(options = nil)
+  options = options&.dup
+
+  @extensions = {
+    autolink: true,
+    superscript: true,
+    disable_indented_code_blocks: true,
+    tables: true
+  }.merge!(options&.delete(:extensions) || {})
+
+  @options = {
+    filter_html: true,
+    hard_wrap: true,
+    link_attributes: { target: '_blank' },
+    space_after_headers: true,
+    fenced_code_blocks: true
+  }.merge!(options || {})
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #extensionsObject (readonly) + + + + + +

+
+ +

Returns the value of attribute extensions.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/wcc/contentful/app/markdown_renderer.rb', line 6
+
+def extensions
+  @extensions
+end
+
+
+ + + +
+

+ + #optionsObject (readonly) + + + + + +

+
+ +

Returns the value of attribute options.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/wcc/contentful/app/markdown_renderer.rb', line 6
+
+def options
+  @options
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #markdown(text) ⇒ Object + + + + Also known as: + call + + + + +

+
+ + +
+
+
+ +

Raises:

+
    + +
  • + + + (ArgumentError) + + + +
  • + +
+ +
+ + + + +
+
+
+
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
+
# File 'lib/wcc/contentful/app/markdown_renderer.rb', line 27
+
+def markdown(text)
+  raise ArgumentError, 'markdown method requires text' unless text
+
+  markdown_links = links_within_markdown(text)
+  links_with_classes, raw_classes = gather_links_with_classes_data(markdown_links)
+
+  options = @options.merge({
+    links_with_classes: links_with_classes
+  })
+
+  renderer = ::WCC::Contentful::App::CustomMarkdownRender.new(options)
+  markdown = ::Redcarpet::Markdown.new(renderer, extensions)
+  markdown.render(remove_markdown_href_class_syntax(raw_classes, text))
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/App/MenuHelper.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/MenuHelper.html new file mode 100644 index 00000000..6adae210 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/MenuHelper.html @@ -0,0 +1,816 @@ + + + + + + + Module: WCC::Contentful::App::MenuHelper + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Module: WCC::Contentful::App::MenuHelper + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
app/helpers/wcc/contentful/app/menu_helper.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+
+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+4
+5
+6
+
+
# File 'app/helpers/wcc/contentful/app/menu_helper.rb', line 4
+
+def dropdown?(item)
+  item.respond_to?(:items)
+end
+
+
+ +
+

+ + #hash_only(href) ⇒ Object + + + + + +

+ + + + +
+
+
+
+70
+71
+72
+73
+
+
# File 'app/helpers/wcc/contentful/app/menu_helper.rb', line 70
+
+def hash_only(href)
+  url = URI(href)
+  "##{url.fragment}" if url.fragment.present?
+end
+
+
+ +
+

+ + #item_active?(item) ⇒ Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+12
+13
+14
+15
+16
+17
+18
+
+
# File 'app/helpers/wcc/contentful/app/menu_helper.rb', line 12
+
+def item_active?(item)
+  return true if item.try(:label) && item_active?(item.label)
+  return item.items.any? { |i| item_active?(i) } if item.respond_to?(:items)
+  return current_page?(item.href) if item.try(:href)
+
+  false
+end
+
+
+ +
+

+ + #local?(href) ⇒ Boolean + + + + + +

+
+ +

An href is local if it points to a part of the page

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+76
+77
+78
+79
+80
+81
+82
+83
+84
+
+
# File 'app/helpers/wcc/contentful/app/menu_helper.rb', line 76
+
+def local?(href)
+  return true if href =~ /^#/
+
+  url = URI(href)
+  return false unless url.fragment.present?
+
+  url.fragment = nil
+  current_page?(url.to_s)
+end
+
+
+ +
+
+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+8
+9
+10
+
+
# File 'app/helpers/wcc/contentful/app/menu_helper.rb', line 8
+
+def menu_button?(item)
+  item.is_a? WCC::Contentful::Model::MenuButton
+end
+
+
+ +
+

+ + #push_class(classes, options) ⇒ Object + + + + + +

+ + + + +
+
+
+
+66
+67
+68
+
+
# File 'app/helpers/wcc/contentful/app/menu_helper.rb', line 66
+
+def push_class(classes, options)
+  options[:class] = [*classes, *options[:class]]
+end
+
+
+ +
+

+ + #render_button(button, options = {}, &block) ⇒ Object + + + + + +

+ + + + +
+
+
+
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
+
# File 'app/helpers/wcc/contentful/app/menu_helper.rb', line 20
+
+def render_button(button, options = {}, &block)
+  html = render_button_inner_html(button, options, &block)
+
+  if button.try(:external?)
+    push_class('external', options)
+    options[:target] = :_blank
+  end
+  if button.icon.present? || button.material_icon.present? || options.dig(:icon, :fallback)
+    push_class('icon-only', options) unless button.text.present?
+  elsif button.text.present?
+    push_class('text-only', options)
+  end
+
+  push_class(button.style, options) if button.style
+
+  href = button.href
+  href = hash_only(href) if href.present? && local?(href)
+  return link_to(html, href, options) if href.present?
+
+  (:a, html, options)
+end
+
+
+ +
+

+ + #render_button_icon(icon, options = {}) ⇒ Object + + + + + +

+ + + + +
+
+
+
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+
+
# File 'app/helpers/wcc/contentful/app/menu_helper.rb', line 50
+
+def render_button_icon(icon, options = {})
+  fallback = options&.delete(:fallback)
+  return fallback&.call unless icon
+
+  options = {
+    alt: icon.description || icon.title,
+    width: icon.file.dig('details', 'image', 'width'),
+    height: icon.file.dig('details', 'image', 'height')
+  }.merge!(options || {})
+  image_tag(icon&.file&.url, options)
+end
+
+
+ +
+

+ + #render_button_inner_html(button, options = {}, &block) ⇒ Object + + + + + +

+ + + + +
+
+
+
+42
+43
+44
+45
+46
+47
+48
+
+
# File 'app/helpers/wcc/contentful/app/menu_helper.rb', line 42
+
+def render_button_inner_html(button, options = {}, &block)
+  html = render_button_icon(button.icon, options.delete(:icon)) || ''.html_safe
+  html += render_button_material_icon(button.material_icon) + (:span, button.text)
+
+  html += capture(&block) if block_given?
+  html
+end
+
+
+ +
+

+ + #render_button_material_icon(material_icon) ⇒ Object + + + + + +

+ + + + +
+
+
+
+62
+63
+64
+
+
# File 'app/helpers/wcc/contentful/app/menu_helper.rb', line 62
+
+def render_button_material_icon(material_icon)
+  (:i, material_icon&.downcase, class: ['material-icons'])
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/App/PageNotFoundError.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/PageNotFoundError.html new file mode 100644 index 00000000..e833bdca --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/PageNotFoundError.html @@ -0,0 +1,290 @@ + + + + + + + Exception: WCC::Contentful::App::PageNotFoundError + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: WCC::Contentful::App::PageNotFoundError + + + +

+
+ +
+
Inherits:
+
+ StandardError + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/wcc/contentful/app/exceptions.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #slug ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
    +

    Returns the value of attribute slug.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + + +
+

Constructor Details

+ +
+

+ + #initialize(slug) ⇒ PageNotFoundError + + + + + +

+
+ +

Returns a new instance of PageNotFoundError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+40
+41
+42
+43
+
+
# File 'lib/wcc/contentful/app/exceptions.rb', line 40
+
+def initialize(slug)
+  super("Page not found: '#{slug}'")
+  @slug = slug
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #slugObject (readonly) + + + + + +

+
+ +

Returns the value of attribute slug.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+38
+39
+40
+
+
# File 'lib/wcc/contentful/app/exceptions.rb', line 38
+
+def slug
+  @slug
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/App/PagesController.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/PagesController.html new file mode 100644 index 00000000..eef3b912 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/PagesController.html @@ -0,0 +1,303 @@ + + + + + + + Class: WCC::Contentful::App::PagesController + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: WCC::Contentful::App::PagesController + + + +

+
+ +
+
Inherits:
+
+ ApplicationController + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
PreviewPassword
+
+ + + + + + +
+
Defined in:
+
app/controllers/wcc/contentful/app/pages_controller.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from PreviewPassword

+

#preview?, #preview_password

+ + + +
+

Instance Method Details

+ + +
+

+ + #indexObject + + + + + +

+ + + + +
+
+
+
+8
+9
+10
+11
+12
+
+
# File 'app/controllers/wcc/contentful/app/pages_controller.rb', line 8
+
+def index
+  @page = global_site_config&.homepage ||
+    page_model.find_by(slug: '/', options: { include: 3, preview: preview? })
+  render 'pages/show'
+end
+
+
+ +
+

+ + #showObject + + + + + +

+
+ + +
+
+
+ +

Raises:

+ + +
+ + + + +
+
+
+
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
+
# File 'app/controllers/wcc/contentful/app/pages_controller.rb', line 14
+
+def show
+  slug = "/#{params[:slug]}"
+  @page = page_model.find_by(slug: slug, options: { include: 3, preview: preview? })
+
+  return render 'pages/show' if @page
+
+  redirect = redirect_model.find_by(slug: slug, options: { include: 0, preview: preview? })
+  raise WCC::Contentful::App::PageNotFoundError, slug unless redirect
+
+  redirect_to redirect.href
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/App/PreviewPassword.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/PreviewPassword.html new file mode 100644 index 00000000..596e7643 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/PreviewPassword.html @@ -0,0 +1,269 @@ + + + + + + + Module: WCC::Contentful::App::PreviewPassword + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Module: WCC::Contentful::App::PreviewPassword + + + +

+
+ + + + + + + + + +
+
Included in:
+
ContactFormController, PagesController
+
+ + + +
+
Defined in:
+
app/models/concerns/wcc/contentful/app/preview_password.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #preview?Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+
+
# File 'app/models/concerns/wcc/contentful/app/preview_password.rb', line 4
+
+def preview?
+  # check ApplicationController for a :preview? method
+  return super if defined?(super)
+
+  @preview ||=
+    if preview_password.present?
+      params[:preview]&.chomp == preview_password.chomp
+    else
+      false
+    end
+end
+
+
+ +
+

+ + #preview_passwordObject + + + + + +

+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'app/models/concerns/wcc/contentful/app/preview_password.rb', line 16
+
+def preview_password
+  WCC::Contentful::App.configuration.preview_password
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/App/SectionHelper.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/SectionHelper.html new file mode 100644 index 00000000..60bef4a7 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/SectionHelper.html @@ -0,0 +1,598 @@ + + + + + + + Module: WCC::Contentful::App::SectionHelper + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Module: WCC::Contentful::App::SectionHelper + + + +

+
+ + + + +
+
Extended by:
+
SectionHelper
+
+ + + + + + +
+
Included in:
+
SectionHelper
+
+ + + +
+
Defined in:
+
app/helpers/wcc/contentful/app/section_helper.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #markdown(text, options = {}) ⇒ Object + + + + + +

+ + + + +
+
+
+
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
+
# File 'app/helpers/wcc/contentful/app/section_helper.rb', line 37
+
+def markdown(text, options = {})
+  renderer = WCC::Contentful::App::MarkdownRenderer.new(
+    options
+  )
+  html_to_render = renderer.markdown(text)
+
+  (:div,
+    CGI.unescapeHTML(html_to_render).html_safe,
+    class: 'formatted-content')
+end
+
+
+ +
+

+ + #render_section(section, index) ⇒ Object + + + + + +

+ + + + +
+
+
+
+8
+9
+10
+
+
# File 'app/helpers/wcc/contentful/app/section_helper.rb', line 8
+
+def render_section(section, index)
+  render('components/section', section: section, index: index)
+end
+
+
+ +
+

+ + #safe_line_break(text, options = {}) ⇒ Object + + + + + +

+ + + + +
+
+
+
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+
+
# File 'app/helpers/wcc/contentful/app/section_helper.rb', line 48
+
+def safe_line_break(text, options = {})
+  return unless text.present?
+
+  text = CGI.escapeHTML(text)
+  text = text.gsub(/&amp;(nbsp|vert|\#\d+);/, '&\1;')
+    .gsub(/&lt;br\/?&gt;/, '<br/>')
+  (:span, text.html_safe, {
+    class: 'safe-line-break'
+  }.merge(options))
+end
+
+
+ +
+

+ + #section_css_name(section) ⇒ Object + + + + + +

+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'app/helpers/wcc/contentful/app/section_helper.rb', line 16
+
+def section_css_name(section)
+  section_template_name(section).dasherize
+end
+
+
+ +
+

+ + #section_id(section) ⇒ Object + + + + + +

+ + + + +
+
+
+
+32
+33
+34
+35
+
+
# File 'app/helpers/wcc/contentful/app/section_helper.rb', line 32
+
+def section_id(section)
+  title = section.try(:bookmark_title) || section.try(:title)
+  CGI.escape(title.gsub(/\W+/, '-')) if title.present?
+end
+
+
+ +
+

+ + #section_styles(section) ⇒ Object + + + + + +

+ + + + +
+
+
+
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+
+
# File 'app/helpers/wcc/contentful/app/section_helper.rb', line 20
+
+def section_styles(section)
+  section_styles = ["section-#{section_css_name(section)}"]
+  if styles = section.try(:styles)
+    section_styles.push(styles.map { |style| style.downcase.gsub(/[^\w]/, '-') })
+  elsif style = section.try(:style)
+    section_styles.push(style.downcase.gsub(/[^\w]/, '-'))
+  else
+    section_styles.push('default')
+  end
+  section_styles
+end
+
+
+ +
+

+ + #section_template_name(section) ⇒ Object + + + + + +

+ + + + +
+
+
+
+12
+13
+14
+
+
# File 'app/helpers/wcc/contentful/app/section_helper.rb', line 12
+
+def section_template_name(section)
+  section.class.name.demodulize.underscore.sub('section_', '')
+end
+
+
+ +
+

+ + #split_content_for_mobile_view(visible_count, speakers) ⇒ Object + + + + + +

+ + + + +
+
+
+
+59
+60
+61
+62
+63
+
+
# File 'app/helpers/wcc/contentful/app/section_helper.rb', line 59
+
+def split_content_for_mobile_view(visible_count, speakers)
+  visible_count = visible_count.to_i
+  speakers = [*speakers].compact
+  [speakers.shift(visible_count), speakers]
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/App/ValidationError.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/ValidationError.html new file mode 100644 index 00000000..e81067cb --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/ValidationError.html @@ -0,0 +1,409 @@ + + + + + + + Exception: WCC::Contentful::App::ValidationError + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: WCC::Contentful::App::ValidationError + + + +

+
+ +
+
Inherits:
+
+ StandardError + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/wcc/contentful/app/exceptions.rb
+
+ +
+ +

Overview

+
+ +

Raised by WCC::Contentful.validate_models! if a content type in the space does not match the validation defined on the associated model.

+ + +
+
+
+ + +

Defined Under Namespace

+

+ + + + + Classes: Message + + +

+ + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #errors ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
    +

    Returns the value of attribute errors.

    +
    + +
  • + + +
+ + + + + +

+ Class Method Summary + collapse +

+ +
    + +
  • + + + .join_msg_keys(hash) ⇒ Object + + + + + + + + + + + + + +
    +

    Turns the error messages hash into an array of message structs like: menu.fields.name.type: must be equal to String.

    +
    + +
  • + + +
+ +

+ Instance Method Summary + collapse +

+ + + + + +
+

Constructor Details

+ +
+

+ + #initialize(errors) ⇒ ValidationError + + + + + +

+
+ +

Returns a new instance of ValidationError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+16
+17
+18
+19
+
+
# File 'lib/wcc/contentful/app/exceptions.rb', line 16
+
+def initialize(errors)
+  @errors = ValidationError.join_msg_keys(errors)
+  super("Content Type Schema from Contentful failed validation!\n  #{@errors.join("\n  ")}")
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #errorsObject (readonly) + + + + + +

+
+ +

Returns the value of attribute errors.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'lib/wcc/contentful/app/exceptions.rb', line 14
+
+def errors
+  @errors
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .join_msg_keys(hash) ⇒ Object + + + + + +

+
+ +

Turns the error messages hash into an array of message structs like: menu.fields.name.type: must be equal to String

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
+
# File 'lib/wcc/contentful/app/exceptions.rb', line 23
+
+def self.join_msg_keys(hash)
+  ret =
+    hash.map do |k, v|
+      if v.is_a?(Hash)
+        msgs = join_msg_keys(v)
+        msgs.map { |msg| Message.new("#{k}.#{msg.path}", msg.error) }
+      else
+        v.map { |msg| Message.new(k.to_s, msg) }
+      end
+    end
+  ret.flatten(1)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/App/ValidationError/Message.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/ValidationError/Message.html new file mode 100644 index 00000000..65182851 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/App/ValidationError/Message.html @@ -0,0 +1,379 @@ + + + + + + + Class: WCC::Contentful::App::ValidationError::Message + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: WCC::Contentful::App::ValidationError::Message + + + +

+
+ +
+
Inherits:
+
+ Struct + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/wcc/contentful/app/exceptions.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #error ⇒ Object + + + + + + + + + + + + + + + + +
    +

    Returns the value of attribute error.

    +
    + +
  • + + +
  • + + + #path ⇒ Object + + + + + + + + + + + + + + + + +
    +

    Returns the value of attribute path.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Attribute Details

+ + + +
+

+ + #errorObject + + + + + +

+
+ +

Returns the value of attribute error

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    the current value of error

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+7
+8
+9
+
+
# File 'lib/wcc/contentful/app/exceptions.rb', line 7
+
+def error
+  @error
+end
+
+
+ + + +
+

+ + #pathObject + + + + + +

+
+ +

Returns the value of attribute path

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +
    +

    the current value of path

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+7
+8
+9
+
+
# File 'lib/wcc/contentful/app/exceptions.rb', line 7
+
+def path
+  @path
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #to_sObject + + + + + +

+ + + + +
+
+
+
+9
+10
+11
+
+
# File 'lib/wcc/contentful/app/exceptions.rb', line 9
+
+def to_s
+  "#{path}: #{error}"
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/DropdownMenu.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/DropdownMenu.html new file mode 100644 index 00000000..c4e6f7a6 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/DropdownMenu.html @@ -0,0 +1,128 @@ + + + + + + + Class: WCC::Contentful::Model::DropdownMenu + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: WCC::Contentful::Model::DropdownMenu + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/wcc/contentful/model/dropdown_menu.rb
+
+ +
+ +
+

Direct Known Subclasses

+

DropdownMenu

+
+ + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/FormField.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/FormField.html new file mode 100644 index 00000000..ef5e5c15 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/FormField.html @@ -0,0 +1,128 @@ + + + + + + + Class: WCC::Contentful::Model::FormField + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: WCC::Contentful::Model::FormField + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/wcc/contentful/model/form_field.rb
+
+ +
+ +
+

Direct Known Subclasses

+

FormField

+
+ + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/Menu.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/Menu.html new file mode 100644 index 00000000..d7c37376 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/Menu.html @@ -0,0 +1,128 @@ + + + + + + + Class: WCC::Contentful::Model::Menu + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: WCC::Contentful::Model::Menu + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/wcc/contentful/model/menu.rb
+
+ +
+ +
+

Direct Known Subclasses

+

Menu

+
+ + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/MenuButton.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/MenuButton.html new file mode 100644 index 00000000..f67e4aad --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/MenuButton.html @@ -0,0 +1,406 @@ + + + + + + + Class: WCC::Contentful::Model::MenuButton + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: WCC::Contentful::Model::MenuButton + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/wcc/contentful/model/menu_button.rb
+
+ +
+ +
+

Direct Known Subclasses

+

MenuButton

+
+ + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + +
+

Instance Method Details

+ + +
+

+ + #external?Boolean + + + + + +

+
+ +

A menu link is external if `external_link` is present and not relative.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+9
+10
+11
+
+
# File 'lib/wcc/contentful/model/menu_button.rb', line 9
+
+def external?
+  external_uri&.scheme.present?
+end
+
+
+ +
+

+ + #external_uriObject + + + + + +

+ + + + +
+
+
+
+4
+5
+6
+
+
# File 'lib/wcc/contentful/model/menu_button.rb', line 4
+
+def external_uri
+  @external_url ||= URI(external_link) if external_link.present?
+end
+
+
+ +
+

+ + #fragmentObject + + + + + +

+ + + + +
+
+
+
+26
+27
+28
+
+
# File 'lib/wcc/contentful/model/menu_button.rb', line 26
+
+def fragment
+  WCC::Contentful::App::SectionHelper.section_id(section_link) if section_link
+end
+
+
+ +
+

+ + #hrefObject + + + + + +

+
+ +

Gets either the external link or the slug from the referenced page. Example usage: `<%= link_to button.title, button.href %>`

+ + +
+
+
+ + +
+ + + + +
+
+
+
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
+
# File 'lib/wcc/contentful/model/menu_button.rb', line 15
+
+def href
+  return external_link if external_link
+
+  url = (link&.try(:slug) || link&.try(:url))
+  return url unless fragment.present?
+
+  url = URI(url || '')
+  url.fragment = fragment
+  url.to_s
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/Page.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/Page.html new file mode 100644 index 00000000..8ede94e3 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/Page.html @@ -0,0 +1,128 @@ + + + + + + + Class: WCC::Contentful::Model::Page + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: WCC::Contentful::Model::Page + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/wcc/contentful/model/page.rb
+
+ +
+ +
+

Direct Known Subclasses

+

Page

+
+ + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/Redirect.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/Redirect.html new file mode 100644 index 00000000..92577c61 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/Redirect.html @@ -0,0 +1,406 @@ + + + + + + + Class: WCC::Contentful::Model::Redirect + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: WCC::Contentful::Model::Redirect + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/wcc/contentful/model/redirect.rb
+
+ +
+ +
+

Direct Known Subclasses

+

Redirect

+
+ + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + +
+

Instance Method Details

+ + +
+

+ + #external?Boolean + + + + + +

+
+ +

A menu link is external if `external_link` is present and not relative.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+9
+10
+11
+
+
# File 'lib/wcc/contentful/model/redirect.rb', line 9
+
+def external?
+  external_uri&.scheme.present?
+end
+
+
+ +
+

+ + #external_uriObject + + + + + +

+ + + + +
+
+
+
+4
+5
+6
+
+
# File 'lib/wcc/contentful/model/redirect.rb', line 4
+
+def external_uri
+  @external_uri ||= URI(external_link) if external_link.present?
+end
+
+
+ +
+

+ + #fragmentObject + + + + + +

+ + + + +
+
+
+
+26
+27
+28
+
+
# File 'lib/wcc/contentful/model/redirect.rb', line 26
+
+def fragment
+  WCC::Contentful::App::SectionHelper.section_id(section_link) if section_link
+end
+
+
+ +
+

+ + #hrefObject + + + + + +

+
+ +

Gets either the external link or the slug from the referenced page. Example usage: `redirect_to redirect.href`

+ + +
+
+
+ + +
+ + + + +
+
+
+
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
+
# File 'lib/wcc/contentful/model/redirect.rb', line 15
+
+def href
+  return external_link if external_link
+
+  url = (link&.try(:slug) || link&.try(:url))
+  return url unless fragment.present?
+
+  url = URI(url || '')
+  url.fragment = fragment
+  url.to_s
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/SectionContactForm.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/SectionContactForm.html new file mode 100644 index 00000000..2800c848 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/SectionContactForm.html @@ -0,0 +1,309 @@ + + + + + + + Class: WCC::Contentful::Model::SectionContactForm + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: WCC::Contentful::Model::SectionContactForm + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/wcc/contentful/model/section_contact_form.rb
+
+ +
+ +
+

Direct Known Subclasses

+

SectionContactForm

+
+ + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + +
+

Instance Method Details

+ + +
+

+ + #pageObject + + + + + +

+ + + + +
+
+
+
+10
+11
+12
+
+
# File 'lib/wcc/contentful/model/section_contact_form.rb', line 10
+
+def page
+  ::WCC::Contentful::Model::Page.find_by(sections: { id: id })
+end
+
+
+ +
+

+ + #send_email(data) ⇒ Object + + + + + +

+ + + + +
+
+
+
+4
+5
+6
+7
+8
+
+
# File 'lib/wcc/contentful/model/section_contact_form.rb', line 4
+
+def send_email(data)
+  save_contact_form(data)
+
+  ::WCC::Contentful::App::ContactMailer.contact_form_email(data[:notification_email], data).deliver
+end
+
+
+ +
+

+ + #to_address(email_object_id: nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+14
+15
+16
+17
+18
+
+
# File 'lib/wcc/contentful/model/section_contact_form.rb', line 14
+
+def to_address(email_object_id: nil)
+  return email_address(email_model(email_object_id)) if email_object_id.present?
+
+  notification_email
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/SiteConfig.html b/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/SiteConfig.html new file mode 100644 index 00000000..22dfefe9 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/Contentful/Model/SiteConfig.html @@ -0,0 +1,210 @@ + + + + + + + Class: WCC::Contentful::Model::SiteConfig + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: WCC::Contentful::Model::SiteConfig + + + +

+
+ +
+
Inherits:
+
+ WCC::Contentful::Model + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/wcc/contentful/model/site_config.rb
+
+ +
+ +
+

Direct Known Subclasses

+

SiteConfig

+
+ + + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + + +
+

Class Method Details

+ + +
+

+ + .instance(preview = false) ⇒ Object + + + + + +

+
+ +

rubocop:disable Style/OptionalBooleanParameter

+ + +
+
+
+ + +
+ + + + +
+
+
+
+4
+5
+6
+
+
# File 'lib/wcc/contentful/model/site_config.rb', line 4
+
+def self.instance(preview = false) # rubocop:disable Style/OptionalBooleanParameter
+  find_by(foreign_key: 'default', options: { include: 4, preview: preview })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/WCC/ModelGenerator.html b/docs/1.3/wcc-contentful-app/WCC/ModelGenerator.html new file mode 100644 index 00000000..18266a79 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/WCC/ModelGenerator.html @@ -0,0 +1,595 @@ + + + + + + + Class: Wcc::ModelGenerator + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: Wcc::ModelGenerator + + + +

+
+ +
+
Inherits:
+
+ Rails::Generators::Base + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/wcc/model_generator.rb
+
+ +
+ + + +

+ Constant Summary + collapse +

+ +
+ +
VALID_MODELS = + +
+
Dir.glob("#{__dir__}/templates/*")
+.select { |f| File.directory? f }
+.map { |f| File.basename f }
+.sort
+.freeze
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + +
+

Constructor Details

+ +
+

+ + #initializeModelGenerator + + + + + +

+
+ +

Returns a new instance of ModelGenerator.

+ + +
+
+
+ +

Raises:

+
    + +
  • + + + (ArgumentError) + + + +
  • + +
+ +
+ + + + +
+
+
+
+15
+16
+17
+18
+19
+20
+21
+
+
# File 'lib/generators/wcc/model_generator.rb', line 15
+
+def initialize(*)
+  super
+
+  return if VALID_MODELS.include?(singular)
+
+  raise ArgumentError, "Model must be one of #{VALID_MODELS.to_sentence}"
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #create_model_migrationsObject + + + + + +

+ + + + +
+
+
+
+71
+72
+73
+74
+75
+76
+77
+78
+
+
# File 'lib/generators/wcc/model_generator.rb', line 71
+
+def create_model_migrations
+  copy_file "#{singular}/migrations/generated_add_#{plural}.ts",
+    "db/migrate/#{timestamp}01_generated_add_#{plural}.ts"
+
+  Dir.glob("#{__dir__}/templates/#{singular}/migrations/*.rb").each do |f|
+    copy_file f, "db/migrate/#{timestamp}_#{File.basename(f)}"
+  end
+end
+
+
+ +
+

+ + #drop_model_overrides_in_app_modelsObject + + + + + +

+ + + + +
+
+
+
+80
+81
+82
+
+
# File 'lib/generators/wcc/model_generator.rb', line 80
+
+def drop_model_overrides_in_app_models
+  directory "#{singular}/models", 'app/models'
+end
+
+
+ +
+

+ + #ensure_initializer_existsObject + + + + + +

+ + + + +
+
+
+
+65
+66
+67
+68
+69
+
+
# File 'lib/generators/wcc/model_generator.rb', line 65
+
+def ensure_initializer_exists
+  return if inside('config/initializers') { File.exist?('wcc_contentful.rb') }
+
+  copy_file 'wcc_contentful.rb', 'config/initializers/wcc_contentful.rb'
+end
+
+
+ +
+

+ + #ensure_migration_tools_installedObject + + + + + +

+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
+
# File 'lib/generators/wcc/model_generator.rb', line 23
+
+def ensure_migration_tools_installed
+  in_root do
+    run 'npm init -y' unless File.exist?('package.json')
+    package = JSON.parse(File.read('package.json'))
+    deps = package['dependencies']
+
+    unless deps.try(:[], '@watermarkchurch/contentful-migration').present?
+      run 'npm install --save @watermarkchurch/contentful-migration ts-node ' \
+          'typescript contentful-export'
+    end
+  end
+end
+
+
+ +
+

+ + #ensure_wrapper_script_in_bin_dirObject + + + + + +

+ + + + +
+
+
+
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+
+
# File 'lib/generators/wcc/model_generator.rb', line 36
+
+def ensure_wrapper_script_in_bin_dir
+  copy_file 'contentful_shell_wrapper', 'bin/contentful' unless inside('bin') { File.exist?('contentful') }
+
+  if inside('bin') { File.exist?('release') }
+    release = inside('bin') { File.read('release') }
+    unless release.include?('contentful migrate')
+      insert_into_file('bin/release', after: 'bundle exec rake db:migrate') do
+        <<~HEREDOC
+          DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+          $DIR/contentful migrate -y
+        HEREDOC
+      end
+    end
+  else
+    copy_file 'release', 'bin/release'
+  end
+
+  if in_root { File.exist?('Procfile') }
+    procfile = in_root { File.read('Procfile') }
+    unless procfile.include?('release:')
+      insert_into_file('Procfile') do
+        'release: bin/release'
+      end
+    end
+  else
+    copy_file 'Procfile'
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/Wcc_.html b/docs/1.3/wcc-contentful-app/Wcc_.html new file mode 100644 index 00000000..9d211868 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/Wcc_.html @@ -0,0 +1,115 @@ + + + + + + + Module: Wcc + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Module: Wcc + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/wcc/model_generator.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: ModelGenerator + + +

+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/_index.html b/docs/1.3/wcc-contentful-app/_index.html new file mode 100644 index 00000000..34c39350 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/_index.html @@ -0,0 +1,462 @@ + + + + + + + Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
+ + +

Documentation by YARD 0.9.28

+
+

Alphabetic Index

+ +

File Listing

+ + +
+

Namespace Listing A-Z

+ + + + + + + + +
+ + +
    +
  • A
  • +
      + +
    • + App + + (WCC::Contentful) + +
    • + +
    +
+ + + + + + + + +
    +
  • E
  • +
      + +
    • + Engine + + (WCC::Contentful::App) + +
    • + +
    +
+ + + + + + + + + + + +
+ + +
    +
  • R
  • + +
+ + + + + + + + +
    +
  • W
  • +
      + +
    • + WCC + +
    • + +
    • + Wcc + +
    • + +
    +
+ +
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/class_list.html b/docs/1.3/wcc-contentful-app/class_list.html new file mode 100644 index 00000000..e4efcab8 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/class_list.html @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + Class List + + + +
+
+

Class List

+ + + +
+ + +
+ + diff --git a/docs/1.3/wcc-contentful-app/css/common.css b/docs/1.3/wcc-contentful-app/css/common.css new file mode 100644 index 00000000..cf25c452 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/css/common.css @@ -0,0 +1 @@ +/* Override this file with custom rules */ \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/css/full_list.css b/docs/1.3/wcc-contentful-app/css/full_list.css new file mode 100644 index 00000000..fa359824 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/css/full_list.css @@ -0,0 +1,58 @@ +body { + margin: 0; + font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + font-size: 13px; + height: 101%; + overflow-x: hidden; + background: #fafafa; +} + +h1 { padding: 12px 10px; padding-bottom: 0; margin: 0; font-size: 1.4em; } +.clear { clear: both; } +.fixed_header { position: fixed; background: #fff; width: 100%; padding-bottom: 10px; margin-top: 0; top: 0; z-index: 9999; height: 70px; } +#search { position: absolute; right: 5px; top: 9px; padding-left: 24px; } +#content.insearch #search, #content.insearch #noresults { background: url(data:image/gif;base64,R0lGODlhEAAQAPYAAP///wAAAPr6+pKSkoiIiO7u7sjIyNjY2J6engAAAI6OjsbGxjIyMlJSUuzs7KamppSUlPLy8oKCghwcHLKysqSkpJqamvT09Pj4+KioqM7OzkRERAwMDGBgYN7e3ujo6Ly8vCoqKjY2NkZGRtTU1MTExDw8PE5OTj4+PkhISNDQ0MrKylpaWrS0tOrq6nBwcKysrLi4uLq6ul5eXlxcXGJiYoaGhuDg4H5+fvz8/KKiohgYGCwsLFZWVgQEBFBQUMzMzDg4OFhYWBoaGvDw8NbW1pycnOLi4ubm5kBAQKqqqiQkJCAgIK6urnJyckpKSjQ0NGpqatLS0sDAwCYmJnx8fEJCQlRUVAoKCggICLCwsOTk5ExMTPb29ra2tmZmZmhoaNzc3KCgoBISEiIiIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCAAAACwAAAAAEAAQAAAHaIAAgoMgIiYlg4kACxIaACEJCSiKggYMCRselwkpghGJBJEcFgsjJyoAGBmfggcNEx0flBiKDhQFlIoCCA+5lAORFb4AJIihCRbDxQAFChAXw9HSqb60iREZ1omqrIPdJCTe0SWI09GBACH5BAkIAAAALAAAAAAQABAAAAdrgACCgwc0NTeDiYozCQkvOTo9GTmDKy8aFy+NOBA7CTswgywJDTIuEjYFIY0JNYMtKTEFiRU8Pjwygy4ws4owPyCKwsMAJSTEgiQlgsbIAMrO0dKDGMTViREZ14kYGRGK38nHguHEJcvTyIEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDAggPg4iJAAMJCRUAJRIqiRGCBI0WQEEJJkWDERkYAAUKEBc4Po1GiKKJHkJDNEeKig4URLS0ICImJZAkuQAhjSi/wQyNKcGDCyMnk8u5rYrTgqDVghgZlYjcACTA1sslvtHRgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCQARAtOUoQRGRiFD0kJUYWZhUhKT1OLhR8wBaaFBzQ1NwAlkIszCQkvsbOHL7Y4q4IuEjaqq0ZQD5+GEEsJTDCMmIUhtgk1lo6QFUwJVDKLiYJNUd6/hoEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4uen4ICCA+IkIsDCQkVACWmhwSpFqAABQoQF6ALTkWFnYMrVlhWvIKTlSAiJiVVPqlGhJkhqShHV1lCW4cMqSkAR1ofiwsjJyqGgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCSMhREZGIYYGY2ElYebi56fhyWQniSKAKKfpaCLFlAPhl0gXYNGEwkhGYREUywag1wJwSkHNDU3D0kJYIMZQwk8MjPBLx9eXwuETVEyAC/BOKsuEjYFhoEAIfkECQgAAAAsAAAAABAAEAAAB2eAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4ueICImip6CIQkJKJ4kigynKaqKCyMnKqSEK05StgAGQRxPYZaENqccFgIID4KXmQBhXFkzDgOnFYLNgltaSAAEpxa7BQoQF4aBACH5BAkIAAAALAAAAAAQABAAAAdogACCg4SFggJiPUqCJSWGgkZjCUwZACQkgxGEXAmdT4UYGZqCGWQ+IjKGGIUwPzGPhAc0NTewhDOdL7Ykji+dOLuOLhI2BbaFETICx4MlQitdqoUsCQ2vhKGjglNfU0SWmILaj43M5oEAOwAAAAAAAAAAAA==) no-repeat center left; } +#full_list { padding: 0; list-style: none; margin-left: 0; margin-top: 80px; font-size: 1.1em; } +#full_list ul { padding: 0; } +#full_list li { padding: 0; margin: 0; list-style: none; } +#full_list li .item { padding: 5px 5px 5px 12px; } +#noresults { padding: 7px 12px; background: #fff; } +#content.insearch #noresults { margin-left: 7px; } +li.collapsed ul { display: none; } +li a.toggle { cursor: default; position: relative; left: -5px; top: 4px; text-indent: -999px; width: 10px; height: 9px; margin-left: -10px; display: block; float: left; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC) no-repeat bottom left; } +li.collapsed a.toggle { opacity: 0.5; cursor: default; background-position: top left; } +li { color: #888; cursor: pointer; } +li.deprecated { text-decoration: line-through; font-style: italic; } +li.odd { background: #f0f0f0; } +li.even { background: #fafafa; } +.item:hover { background: #ddd; } +li small:before { content: "("; } +li small:after { content: ")"; } +li small.search_info { display: none; } +a, a:visited { text-decoration: none; color: #05a; } +li.clicked > .item { background: #05a; color: #ccc; } +li.clicked > .item a, li.clicked > .item a:visited { color: #eee; } +li.clicked > .item a.toggle { opacity: 0.5; background-position: bottom right; } +li.collapsed.clicked a.toggle { background-position: top right; } +#search input { border: 1px solid #bbb; border-radius: 3px; } +#full_list_nav { margin-left: 10px; font-size: 0.9em; display: block; color: #aaa; } +#full_list_nav a, #nav a:visited { color: #358; } +#full_list_nav a:hover { background: transparent; color: #5af; } +#full_list_nav span:after { content: ' | '; } +#full_list_nav span:last-child:after { content: ''; } + +#content h1 { margin-top: 0; } +li { white-space: nowrap; cursor: normal; } +li small { display: block; font-size: 0.8em; } +li small:before { content: ""; } +li small:after { content: ""; } +li small.search_info { display: none; } +#search { width: 170px; position: static; margin: 3px; margin-left: 10px; font-size: 0.9em; color: #888; padding-left: 0; padding-right: 24px; } +#content.insearch #search { background-position: center right; } +#search input { width: 110px; } + +#full_list.insearch ul { display: block; } +#full_list.insearch .item { display: none; } +#full_list.insearch .found { display: block; padding-left: 11px !important; } +#full_list.insearch li a.toggle { display: none; } +#full_list.insearch li small.search_info { display: block; } diff --git a/docs/1.3/wcc-contentful-app/css/style.css b/docs/1.3/wcc-contentful-app/css/style.css new file mode 100644 index 00000000..eb0dbc86 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/css/style.css @@ -0,0 +1,497 @@ +html { + width: 100%; + height: 100%; +} +body { + font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + font-size: 13px; + width: 100%; + margin: 0; + padding: 0; + display: flex; + display: -webkit-flex; + display: -ms-flexbox; +} + +#nav { + position: relative; + width: 100%; + height: 100%; + border: 0; + border-right: 1px dotted #eee; + overflow: auto; +} +.nav_wrap { + margin: 0; + padding: 0; + width: 20%; + height: 100%; + position: relative; + display: flex; + display: -webkit-flex; + display: -ms-flexbox; + flex-shrink: 0; + -webkit-flex-shrink: 0; + -ms-flex: 1 0; +} +#resizer { + position: absolute; + right: -5px; + top: 0; + width: 10px; + height: 100%; + cursor: col-resize; + z-index: 9999; +} +#main { + flex: 5 1; + -webkit-flex: 5 1; + -ms-flex: 5 1; + outline: none; + position: relative; + background: #fff; + padding: 1.2em; + padding-top: 0.2em; + box-sizing: border-box; +} + +@media (max-width: 920px) { + .nav_wrap { width: 100%; top: 0; right: 0; overflow: visible; position: absolute; } + #resizer { display: none; } + #nav { + z-index: 9999; + background: #fff; + display: none; + position: absolute; + top: 40px; + right: 12px; + width: 500px; + max-width: 80%; + height: 80%; + overflow-y: scroll; + border: 1px solid #999; + border-collapse: collapse; + box-shadow: -7px 5px 25px #aaa; + border-radius: 2px; + } +} + +@media (min-width: 920px) { + body { height: 100%; overflow: hidden; } + #main { height: 100%; overflow: auto; } + #search { display: none; } +} + +#main img { max-width: 100%; } +h1 { font-size: 25px; margin: 1em 0 0.5em; padding-top: 4px; border-top: 1px dotted #d5d5d5; } +h1.noborder { border-top: 0px; margin-top: 0; padding-top: 4px; } +h1.title { margin-bottom: 10px; } +h1.alphaindex { margin-top: 0; font-size: 22px; } +h2 { + padding: 0; + padding-bottom: 3px; + border-bottom: 1px #aaa solid; + font-size: 1.4em; + margin: 1.8em 0 0.5em; + position: relative; +} +h2 small { font-weight: normal; font-size: 0.7em; display: inline; position: absolute; right: 0; } +h2 small a { + display: block; + height: 20px; + border: 1px solid #aaa; + border-bottom: 0; + border-top-left-radius: 5px; + background: #f8f8f8; + position: relative; + padding: 2px 7px; +} +.clear { clear: both; } +.inline { display: inline; } +.inline p:first-child { display: inline; } +.docstring, .tags, #filecontents { font-size: 15px; line-height: 1.5145em; } +.docstring p > code, .docstring p > tt, .tags p > code, .tags p > tt { + color: #c7254e; background: #f9f2f4; padding: 2px 4px; font-size: 1em; + border-radius: 4px; +} +.docstring h1, .docstring h2, .docstring h3, .docstring h4 { padding: 0; border: 0; border-bottom: 1px dotted #bbb; } +.docstring h1 { font-size: 1.2em; } +.docstring h2 { font-size: 1.1em; } +.docstring h3, .docstring h4 { font-size: 1em; border-bottom: 0; padding-top: 10px; } +.summary_desc .object_link a, .docstring .object_link a { + font-family: monospace; font-size: 1.05em; + color: #05a; background: #EDF4FA; padding: 2px 4px; font-size: 1em; + border-radius: 4px; +} +.rdoc-term { padding-right: 25px; font-weight: bold; } +.rdoc-list p { margin: 0; padding: 0; margin-bottom: 4px; } +.summary_desc pre.code .object_link a, .docstring pre.code .object_link a { + padding: 0px; background: inherit; color: inherit; border-radius: inherit; +} + +/* style for */ +#filecontents table, .docstring table { border-collapse: collapse; } +#filecontents table th, #filecontents table td, +.docstring table th, .docstring table td { border: 1px solid #ccc; padding: 8px; padding-right: 17px; } +#filecontents table tr:nth-child(odd), +.docstring table tr:nth-child(odd) { background: #eee; } +#filecontents table tr:nth-child(even), +.docstring table tr:nth-child(even) { background: #fff; } +#filecontents table th, .docstring table th { background: #fff; } + +/* style for
    */ +#filecontents li > p, .docstring li > p { margin: 0px; } +#filecontents ul, .docstring ul { padding-left: 20px; } +/* style for
    */ +#filecontents dl, .docstring dl { border: 1px solid #ccc; } +#filecontents dt, .docstring dt { background: #ddd; font-weight: bold; padding: 3px 5px; } +#filecontents dd, .docstring dd { padding: 5px 0px; margin-left: 18px; } +#filecontents dd > p, .docstring dd > p { margin: 0px; } + +.note { + color: #222; + margin: 20px 0; + padding: 10px; + border: 1px solid #eee; + border-radius: 3px; + display: block; +} +.docstring .note { + border-left-color: #ccc; + border-left-width: 5px; +} +.note.todo { background: #ffffc5; border-color: #ececaa; } +.note.returns_void { background: #efefef; } +.note.deprecated { background: #ffe5e5; border-color: #e9dada; } +.note.title.deprecated { background: #ffe5e5; border-color: #e9dada; } +.note.private { background: #ffffc5; border-color: #ececaa; } +.note.title { padding: 3px 6px; font-size: 0.9em; font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; display: inline; } +.summary_signature + .note.title { margin-left: 7px; } +h1 .note.title { font-size: 0.5em; font-weight: normal; padding: 3px 5px; position: relative; top: -3px; text-transform: capitalize; } +.note.title { background: #efefef; } +.note.title.constructor { color: #fff; background: #6a98d6; border-color: #6689d6; } +.note.title.writeonly { color: #fff; background: #45a638; border-color: #2da31d; } +.note.title.readonly { color: #fff; background: #6a98d6; border-color: #6689d6; } +.note.title.private { background: #d5d5d5; border-color: #c5c5c5; } +.note.title.not_defined_here { background: transparent; border: none; font-style: italic; } +.discussion .note { margin-top: 6px; } +.discussion .note:first-child { margin-top: 0; } + +h3.inherited { + font-style: italic; + font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + font-weight: normal; + padding: 0; + margin: 0; + margin-top: 12px; + margin-bottom: 3px; + font-size: 13px; +} +p.inherited { + padding: 0; + margin: 0; + margin-left: 25px; +} + +.box_info dl { + margin: 0; + border: 0; + width: 100%; + font-size: 1em; + display: flex; + display: -webkit-flex; + display: -ms-flexbox; +} +.box_info dl dt { + flex-shrink: 0; + -webkit-flex-shrink: 1; + -ms-flex-shrink: 1; + width: 100px; + text-align: right; + font-weight: bold; + border: 1px solid #aaa; + border-width: 1px 0px 0px 1px; + padding: 6px 0; + padding-right: 10px; +} +.box_info dl dd { + flex-grow: 1; + -webkit-flex-grow: 1; + -ms-flex: 1; + max-width: 420px; + padding: 6px 0; + padding-right: 20px; + border: 1px solid #aaa; + border-width: 1px 1px 0 0; + overflow: hidden; + position: relative; +} +.box_info dl:last-child > * { + border-bottom: 1px solid #aaa; +} +.box_info dl:nth-child(odd) > * { background: #eee; } +.box_info dl:nth-child(even) > * { background: #fff; } +.box_info dl > * { margin: 0; } + +ul.toplevel { list-style: none; padding-left: 0; font-size: 1.1em; } +.index_inline_list { padding-left: 0; font-size: 1.1em; } + +.index_inline_list li { + list-style: none; + display: inline-block; + padding: 0 12px; + line-height: 30px; + margin-bottom: 5px; +} + +dl.constants { margin-left: 10px; } +dl.constants dt { font-weight: bold; font-size: 1.1em; margin-bottom: 5px; } +dl.constants.compact dt { display: inline-block; font-weight: normal } +dl.constants dd { width: 75%; white-space: pre; font-family: monospace; margin-bottom: 18px; } +dl.constants .docstring .note:first-child { margin-top: 5px; } + +.summary_desc { + margin-left: 32px; + display: block; + font-family: sans-serif; + font-size: 1.1em; + margin-top: 8px; + line-height: 1.5145em; + margin-bottom: 0.8em; +} +.summary_desc tt { font-size: 0.9em; } +dl.constants .note { padding: 2px 6px; padding-right: 12px; margin-top: 6px; } +dl.constants .docstring { margin-left: 32px; font-size: 0.9em; font-weight: normal; } +dl.constants .tags { padding-left: 32px; font-size: 0.9em; line-height: 0.8em; } +dl.constants .discussion *:first-child { margin-top: 0; } +dl.constants .discussion *:last-child { margin-bottom: 0; } + +.method_details { border-top: 1px dotted #ccc; margin-top: 25px; padding-top: 0; } +.method_details.first { border: 0; margin-top: 5px; } +.method_details.first h3.signature { margin-top: 1em; } +p.signature, h3.signature { + font-size: 1.1em; font-weight: normal; font-family: Monaco, Consolas, Courier, monospace; + padding: 6px 10px; margin-top: 1em; + background: #E8F4FF; border: 1px solid #d8d8e5; border-radius: 5px; +} +p.signature tt, +h3.signature tt { font-family: Monaco, Consolas, Courier, monospace; } +p.signature .overload, +h3.signature .overload { display: block; } +p.signature .extras, +h3.signature .extras { font-weight: normal; font-family: sans-serif; color: #444; font-size: 1em; } +p.signature .not_defined_here, +h3.signature .not_defined_here, +p.signature .aliases, +h3.signature .aliases { display: block; font-weight: normal; font-size: 0.9em; font-family: sans-serif; margin-top: 0px; color: #555; } +p.signature .aliases .names, +h3.signature .aliases .names { font-family: Monaco, Consolas, Courier, monospace; font-weight: bold; color: #000; font-size: 1.2em; } + +.tags .tag_title { font-size: 1.05em; margin-bottom: 0; font-weight: bold; } +.tags .tag_title tt { color: initial; padding: initial; background: initial; } +.tags ul { margin-top: 5px; padding-left: 30px; list-style: square; } +.tags ul li { margin-bottom: 3px; } +.tags ul .name { font-family: monospace; font-weight: bold; } +.tags ul .note { padding: 3px 6px; } +.tags { margin-bottom: 12px; } + +.tags .examples .tag_title { margin-bottom: 10px; font-weight: bold; } +.tags .examples .inline p { padding: 0; margin: 0; font-weight: bold; font-size: 1em; } +.tags .examples .inline p:before { content: "▸"; font-size: 1em; margin-right: 5px; } + +.tags .overload .overload_item { list-style: none; margin-bottom: 25px; } +.tags .overload .overload_item .signature { + padding: 2px 8px; + background: #F1F8FF; border: 1px solid #d8d8e5; border-radius: 3px; +} +.tags .overload .signature { margin-left: -15px; font-family: monospace; display: block; font-size: 1.1em; } +.tags .overload .docstring { margin-top: 15px; } + +.defines { display: none; } + +#method_missing_details .notice.this { position: relative; top: -8px; color: #888; padding: 0; margin: 0; } + +.showSource { font-size: 0.9em; } +.showSource a, .showSource a:visited { text-decoration: none; color: #666; } + +#content a, #content a:visited { text-decoration: none; color: #05a; } +#content a:hover { background: #ffffa5; } + +ul.summary { + list-style: none; + font-family: monospace; + font-size: 1em; + line-height: 1.5em; + padding-left: 0px; +} +ul.summary a, ul.summary a:visited { + text-decoration: none; font-size: 1.1em; +} +ul.summary li { margin-bottom: 5px; } +.summary_signature { padding: 4px 8px; background: #f8f8f8; border: 1px solid #f0f0f0; border-radius: 5px; } +.summary_signature:hover { background: #CFEBFF; border-color: #A4CCDA; cursor: pointer; } +.summary_signature.deprecated { background: #ffe5e5; border-color: #e9dada; } +ul.summary.compact li { display: inline-block; margin: 0px 5px 0px 0px; line-height: 2.6em;} +ul.summary.compact .summary_signature { padding: 5px 7px; padding-right: 4px; } +#content .summary_signature:hover a, +#content .summary_signature:hover a:visited { + background: transparent; + color: #049; +} + +p.inherited a { font-family: monospace; font-size: 0.9em; } +p.inherited { word-spacing: 5px; font-size: 1.2em; } + +p.children { font-size: 1.2em; } +p.children a { font-size: 0.9em; } +p.children strong { font-size: 0.8em; } +p.children strong.modules { padding-left: 5px; } + +ul.fullTree { display: none; padding-left: 0; list-style: none; margin-left: 0; margin-bottom: 10px; } +ul.fullTree ul { margin-left: 0; padding-left: 0; list-style: none; } +ul.fullTree li { text-align: center; padding-top: 18px; padding-bottom: 12px; background: url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAHtJREFUeNqMzrEJAkEURdGzuhgZbSoYWcAWoBVsB4JgZAGmphsZCZYzTQgWNCYrDN9RvMmHx+X916SUBFbo8CzD1idXrLErw1mQttgXtyrOcQ/Ny5p4Qh+2XqLYYazsPWNTiuMkRxa4vcV+evuNAUOLIx5+c2hyzv7hNQC67Q+/HHmlEwAAAABJRU5ErkJggg==) no-repeat top center; } +ul.fullTree li:first-child { padding-top: 0; background: transparent; } +ul.fullTree li:last-child { padding-bottom: 0; } +.showAll ul.fullTree { display: block; } +.showAll .inheritName { display: none; } + +#search { position: absolute; right: 12px; top: 0px; z-index: 9000; } +#search a { + display: block; float: left; + padding: 4px 8px; text-decoration: none; color: #05a; fill: #05a; + border: 1px solid #d8d8e5; + border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; + background: #F1F8FF; + box-shadow: -1px 1px 3px #ddd; +} +#search a:hover { background: #f5faff; color: #06b; fill: #06b; } +#search a.active { + background: #568; padding-bottom: 20px; color: #fff; fill: #fff; + border: 1px solid #457; + border-top-left-radius: 5px; border-top-right-radius: 5px; +} +#search a.inactive { color: #999; fill: #999; } +.inheritanceTree, .toggleDefines { + float: right; + border-left: 1px solid #aaa; + position: absolute; top: 0; right: 0; + height: 100%; + background: #f6f6f6; + padding: 5px; + min-width: 55px; + text-align: center; +} + +#menu { font-size: 1.3em; color: #bbb; } +#menu .title, #menu a { font-size: 0.7em; } +#menu .title a { font-size: 1em; } +#menu .title { color: #555; } +#menu a, #menu a:visited { color: #333; text-decoration: none; border-bottom: 1px dotted #bbd; } +#menu a:hover { color: #05a; } + +#footer { margin-top: 15px; border-top: 1px solid #ccc; text-align: center; padding: 7px 0; color: #999; } +#footer a, #footer a:visited { color: #444; text-decoration: none; border-bottom: 1px dotted #bbd; } +#footer a:hover { color: #05a; } + +#listing ul.alpha { font-size: 1.1em; } +#listing ul.alpha { margin: 0; padding: 0; padding-bottom: 10px; list-style: none; } +#listing ul.alpha li.letter { font-size: 1.4em; padding-bottom: 10px; } +#listing ul.alpha ul { margin: 0; padding-left: 15px; } +#listing ul small { color: #666; font-size: 0.7em; } + +li.r1 { background: #f0f0f0; } +li.r2 { background: #fafafa; } + +#content ul.summary li.deprecated .summary_signature a, +#content ul.summary li.deprecated .summary_signature a:visited { text-decoration: line-through; font-style: italic; } + +#toc { + position: relative; + float: right; + overflow-x: auto; + right: -3px; + margin-left: 20px; + margin-bottom: 20px; + padding: 20px; padding-right: 30px; + max-width: 300px; + z-index: 5000; + background: #fefefe; + border: 1px solid #ddd; + box-shadow: -2px 2px 6px #bbb; +} +#toc .title { margin: 0; } +#toc ol { padding-left: 1.8em; } +#toc li { font-size: 1.1em; line-height: 1.7em; } +#toc > ol > li { font-size: 1.1em; font-weight: bold; } +#toc ol > li > ol { font-size: 0.9em; } +#toc ol ol > li > ol { padding-left: 2.3em; } +#toc ol + li { margin-top: 0.3em; } +#toc.hidden { padding: 10px; background: #fefefe; box-shadow: none; } +#toc.hidden:hover { background: #fafafa; } +#filecontents h1 + #toc.nofloat { margin-top: 0; } +@media (max-width: 560px) { + #toc { + margin-left: 0; + margin-top: 16px; + float: none; + max-width: none; + } +} + +/* syntax highlighting */ +.source_code { display: none; padding: 3px 8px; border-left: 8px solid #ddd; margin-top: 5px; } +#filecontents pre.code, .docstring pre.code, .source_code pre { font-family: monospace; } +#filecontents pre.code, .docstring pre.code { display: block; } +.source_code .lines { padding-right: 12px; color: #555; text-align: right; } +#filecontents pre.code, .docstring pre.code, +.tags pre.example { + padding: 9px 14px; + margin-top: 4px; + border: 1px solid #e1e1e8; + background: #f7f7f9; + border-radius: 4px; + font-size: 1em; + overflow-x: auto; + line-height: 1.2em; +} +pre.code { color: #000; tab-size: 2; } +pre.code .info.file { color: #555; } +pre.code .val { color: #036A07; } +pre.code .tstring_content, +pre.code .heredoc_beg, pre.code .heredoc_end, +pre.code .qwords_beg, pre.code .qwords_end, pre.code .qwords_sep, +pre.code .words_beg, pre.code .words_end, pre.code .words_sep, +pre.code .qsymbols_beg, pre.code .qsymbols_end, pre.code .qsymbols_sep, +pre.code .symbols_beg, pre.code .symbols_end, pre.code .symbols_sep, +pre.code .tstring, pre.code .dstring { color: #036A07; } +pre.code .fid, pre.code .rubyid_new, pre.code .rubyid_to_s, +pre.code .rubyid_to_sym, pre.code .rubyid_to_f, +pre.code .dot + pre.code .id, +pre.code .rubyid_to_i pre.code .rubyid_each { color: #0085FF; } +pre.code .comment { color: #0066FF; } +pre.code .const, pre.code .constant { color: #585CF6; } +pre.code .label, +pre.code .symbol { color: #C5060B; } +pre.code .kw, +pre.code .rubyid_require, +pre.code .rubyid_extend, +pre.code .rubyid_include { color: #0000FF; } +pre.code .ivar { color: #318495; } +pre.code .gvar, +pre.code .rubyid_backref, +pre.code .rubyid_nth_ref { color: #6D79DE; } +pre.code .regexp, .dregexp { color: #036A07; } +pre.code a { border-bottom: 1px dotted #bbf; } +/* inline code */ +*:not(pre) > code { + padding: 1px 3px 1px 3px; + border: 1px solid #E1E1E8; + background: #F7F7F9; + border-radius: 4px; +} + +/* Color fix for links */ +#content .summary_desc pre.code .id > .object_link a, /* identifier */ +#content .docstring pre.code .id > .object_link a { color: #0085FF; } +#content .summary_desc pre.code .const > .object_link a, /* constant */ +#content .docstring pre.code .const > .object_link a { color: #585CF6; } diff --git a/docs/1.3/wcc-contentful-app/file.README.html b/docs/1.3/wcc-contentful-app/file.README.html new file mode 100644 index 00000000..6af5860d --- /dev/null +++ b/docs/1.3/wcc-contentful-app/file.README.html @@ -0,0 +1,81 @@ + + + + + + + File: README + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
    + + +

    Gem Version +Build Status +Coverage Status

    + +

    WCC::Contentful::App

    + +

    This gem specifies default models, controllers, views, and javascripts that +get installed into all Watermarkchurch apps that use contentful. It is a highly +opinionated starting point for a very flexible site design using Contentful.

    + +

    You probably should not use this.

    +
    + + + +
    + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/file_list.html b/docs/1.3/wcc-contentful-app/file_list.html new file mode 100644 index 00000000..2b6df404 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/file_list.html @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + File List + + + +
    +
    +

    File List

    + + + +
    + + +
    + + diff --git a/docs/1.3/wcc-contentful-app/frames.html b/docs/1.3/wcc-contentful-app/frames.html new file mode 100644 index 00000000..a65e9365 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/frames.html @@ -0,0 +1,17 @@ + + + + + Documentation by YARD 0.9.28 + + + + diff --git a/docs/1.3/wcc-contentful-app/index.html b/docs/1.3/wcc-contentful-app/index.html new file mode 100644 index 00000000..5ee2120f --- /dev/null +++ b/docs/1.3/wcc-contentful-app/index.html @@ -0,0 +1,81 @@ + + + + + + + File: README + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
    + + +

    Gem Version +Build Status +Coverage Status

    + +

    WCC::Contentful::App

    + +

    This gem specifies default models, controllers, views, and javascripts that +get installed into all Watermarkchurch apps that use contentful. It is a highly +opinionated starting point for a very flexible site design using Contentful.

    + +

    You probably should not use this.

    +
    + + + +
    + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/js/app.js b/docs/1.3/wcc-contentful-app/js/app.js new file mode 100644 index 00000000..8d067fe3 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/js/app.js @@ -0,0 +1,314 @@ +(function() { + +var localStorage = {}, sessionStorage = {}; +try { localStorage = window.localStorage; } catch (e) { } +try { sessionStorage = window.sessionStorage; } catch (e) { } + +function createSourceLinks() { + $('.method_details_list .source_code'). + before("[View source]"); + $('.toggleSource').toggle(function() { + $(this).parent().nextAll('.source_code').slideDown(100); + $(this).text("Hide source"); + }, + function() { + $(this).parent().nextAll('.source_code').slideUp(100); + $(this).text("View source"); + }); +} + +function createDefineLinks() { + var tHeight = 0; + $('.defines').after(" more..."); + $('.toggleDefines').toggle(function() { + tHeight = $(this).parent().prev().height(); + $(this).prev().css('display', 'inline'); + $(this).parent().prev().height($(this).parent().height()); + $(this).text("(less)"); + }, + function() { + $(this).prev().hide(); + $(this).parent().prev().height(tHeight); + $(this).text("more..."); + }); +} + +function createFullTreeLinks() { + var tHeight = 0; + $('.inheritanceTree').toggle(function() { + tHeight = $(this).parent().prev().height(); + $(this).parent().toggleClass('showAll'); + $(this).text("(hide)"); + $(this).parent().prev().height($(this).parent().height()); + }, + function() { + $(this).parent().toggleClass('showAll'); + $(this).parent().prev().height(tHeight); + $(this).text("show all"); + }); +} + +function searchFrameButtons() { + $('.full_list_link').click(function() { + toggleSearchFrame(this, $(this).attr('href')); + return false; + }); + window.addEventListener('message', function(e) { + if (e.data === 'navEscape') { + $('#nav').slideUp(100); + $('#search a').removeClass('active inactive'); + $(window).focus(); + } + }); + + $(window).resize(function() { + if ($('#search:visible').length === 0) { + $('#nav').removeAttr('style'); + $('#search a').removeClass('active inactive'); + $(window).focus(); + } + }); +} + +function toggleSearchFrame(id, link) { + var frame = $('#nav'); + $('#search a').removeClass('active').addClass('inactive'); + if (frame.attr('src') === link && frame.css('display') !== "none") { + frame.slideUp(100); + $('#search a').removeClass('active inactive'); + } + else { + $(id).addClass('active').removeClass('inactive'); + if (frame.attr('src') !== link) frame.attr('src', link); + frame.slideDown(100); + } +} + +function linkSummaries() { + $('.summary_signature').click(function() { + document.location = $(this).find('a').attr('href'); + }); +} + +function summaryToggle() { + $('.summary_toggle').click(function(e) { + e.preventDefault(); + localStorage.summaryCollapsed = $(this).text(); + $('.summary_toggle').each(function() { + $(this).text($(this).text() == "collapse" ? "expand" : "collapse"); + var next = $(this).parent().parent().nextAll('ul.summary').first(); + if (next.hasClass('compact')) { + next.toggle(); + next.nextAll('ul.summary').first().toggle(); + } + else if (next.hasClass('summary')) { + var list = $('
      '); + list.html(next.html()); + list.find('.summary_desc, .note').remove(); + list.find('a').each(function() { + $(this).html($(this).find('strong').html()); + $(this).parent().html($(this)[0].outerHTML); + }); + next.before(list); + next.toggle(); + } + }); + return false; + }); + if (localStorage.summaryCollapsed == "collapse") { + $('.summary_toggle').first().click(); + } else { localStorage.summaryCollapsed = "expand"; } +} + +function constantSummaryToggle() { + $('.constants_summary_toggle').click(function(e) { + e.preventDefault(); + localStorage.summaryCollapsed = $(this).text(); + $('.constants_summary_toggle').each(function() { + $(this).text($(this).text() == "collapse" ? "expand" : "collapse"); + var next = $(this).parent().parent().nextAll('dl.constants').first(); + if (next.hasClass('compact')) { + next.toggle(); + next.nextAll('dl.constants').first().toggle(); + } + else if (next.hasClass('constants')) { + var list = $('
      '); + list.html(next.html()); + list.find('dt').each(function() { + $(this).addClass('summary_signature'); + $(this).text( $(this).text().split('=')[0]); + if ($(this).has(".deprecated").length) { + $(this).addClass('deprecated'); + }; + }); + // Add the value of the constant as "Tooltip" to the summary object + list.find('pre.code').each(function() { + console.log($(this).parent()); + var dt_element = $(this).parent().prev(); + var tooltip = $(this).text(); + if (dt_element.hasClass("deprecated")) { + tooltip = 'Deprecated. ' + tooltip; + }; + dt_element.attr('title', tooltip); + }); + list.find('.docstring, .tags, dd').remove(); + next.before(list); + next.toggle(); + } + }); + return false; + }); + if (localStorage.summaryCollapsed == "collapse") { + $('.constants_summary_toggle').first().click(); + } else { localStorage.summaryCollapsed = "expand"; } +} + +function generateTOC() { + if ($('#filecontents').length === 0) return; + var _toc = $('
        '); + var show = false; + var toc = _toc; + var counter = 0; + var tags = ['h2', 'h3', 'h4', 'h5', 'h6']; + var i; + var curli; + if ($('#filecontents h1').length > 1) tags.unshift('h1'); + for (i = 0; i < tags.length; i++) { tags[i] = '#filecontents ' + tags[i]; } + var lastTag = parseInt(tags[0][1], 10); + $(tags.join(', ')).each(function() { + if ($(this).parents('.method_details .docstring').length != 0) return; + if (this.id == "filecontents") return; + show = true; + var thisTag = parseInt(this.tagName[1], 10); + if (this.id.length === 0) { + var proposedId = $(this).attr('toc-id'); + if (typeof(proposedId) != "undefined") this.id = proposedId; + else { + var proposedId = $(this).text().replace(/[^a-z0-9-]/ig, '_'); + if ($('#' + proposedId).length > 0) { proposedId += counter; counter++; } + this.id = proposedId; + } + } + if (thisTag > lastTag) { + for (i = 0; i < thisTag - lastTag; i++) { + if ( typeof(curli) == "undefined" ) { + curli = $('
      1. '); + toc.append(curli); + } + toc = $('
          '); + curli.append(toc); + curli = undefined; + } + } + if (thisTag < lastTag) { + for (i = 0; i < lastTag - thisTag; i++) { + toc = toc.parent(); + toc = toc.parent(); + } + } + var title = $(this).attr('toc-title'); + if (typeof(title) == "undefined") title = $(this).text(); + curli =$('
        1. ' + title + '
        2. '); + toc.append(curli); + lastTag = thisTag; + }); + if (!show) return; + html = ''; + $('#content').prepend(html); + $('#toc').append(_toc); + $('#toc .hide_toc').toggle(function() { + $('#toc .top').slideUp('fast'); + $('#toc').toggleClass('hidden'); + $('#toc .title small').toggle(); + }, function() { + $('#toc .top').slideDown('fast'); + $('#toc').toggleClass('hidden'); + $('#toc .title small').toggle(); + }); +} + +function navResizeFn(e) { + if (e.which !== 1) { + navResizeFnStop(); + return; + } + + sessionStorage.navWidth = e.pageX.toString(); + $('.nav_wrap').css('width', e.pageX); + $('.nav_wrap').css('-ms-flex', 'inherit'); +} + +function navResizeFnStop() { + $(window).unbind('mousemove', navResizeFn); + window.removeEventListener('message', navMessageFn, false); +} + +function navMessageFn(e) { + if (e.data.action === 'mousemove') navResizeFn(e.data.event); + if (e.data.action === 'mouseup') navResizeFnStop(); +} + +function navResizer() { + $('#resizer').mousedown(function(e) { + e.preventDefault(); + $(window).mousemove(navResizeFn); + window.addEventListener('message', navMessageFn, false); + }); + $(window).mouseup(navResizeFnStop); + + if (sessionStorage.navWidth) { + navResizeFn({which: 1, pageX: parseInt(sessionStorage.navWidth, 10)}); + } +} + +function navExpander() { + var done = false, timer = setTimeout(postMessage, 500); + function postMessage() { + if (done) return; + clearTimeout(timer); + var opts = { action: 'expand', path: pathId }; + document.getElementById('nav').contentWindow.postMessage(opts, '*'); + done = true; + } + + window.addEventListener('message', function(event) { + if (event.data === 'navReady') postMessage(); + return false; + }, false); +} + +function mainFocus() { + var hash = window.location.hash; + if (hash !== '' && $(hash)[0]) { + $(hash)[0].scrollIntoView(); + } + + setTimeout(function() { $('#main').focus(); }, 10); +} + +function navigationChange() { + // This works around the broken anchor navigation with the YARD template. + window.onpopstate = function() { + var hash = window.location.hash; + if (hash !== '' && $(hash)[0]) { + $(hash)[0].scrollIntoView(); + } + }; +} + +$(document).ready(function() { + navResizer(); + navExpander(); + createSourceLinks(); + createDefineLinks(); + createFullTreeLinks(); + searchFrameButtons(); + linkSummaries(); + summaryToggle(); + constantSummaryToggle(); + generateTOC(); + mainFocus(); + navigationChange(); +}); + +})(); diff --git a/docs/1.3/wcc-contentful-app/js/full_list.js b/docs/1.3/wcc-contentful-app/js/full_list.js new file mode 100644 index 00000000..59069c5e --- /dev/null +++ b/docs/1.3/wcc-contentful-app/js/full_list.js @@ -0,0 +1,216 @@ +(function() { + +var $clicked = $(null); +var searchTimeout = null; +var searchCache = []; +var caseSensitiveMatch = false; +var ignoreKeyCodeMin = 8; +var ignoreKeyCodeMax = 46; +var commandKey = 91; + +RegExp.escape = function(text) { + return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); +} + +function escapeShortcut() { + $(document).keydown(function(evt) { + if (evt.which == 27) { + window.parent.postMessage('navEscape', '*'); + } + }); +} + +function navResizer() { + $(window).mousemove(function(e) { + window.parent.postMessage({ + action: 'mousemove', event: {pageX: e.pageX, which: e.which} + }, '*'); + }).mouseup(function(e) { + window.parent.postMessage({action: 'mouseup'}, '*'); + }); + window.parent.postMessage("navReady", "*"); +} + +function clearSearchTimeout() { + clearTimeout(searchTimeout); + searchTimeout = null; +} + +function enableLinks() { + // load the target page in the parent window + $('#full_list li').on('click', function(evt) { + $('#full_list li').removeClass('clicked'); + $clicked = $(this); + $clicked.addClass('clicked'); + evt.stopPropagation(); + + if (evt.target.tagName === 'A') return true; + + var elem = $clicked.find('> .item .object_link a')[0]; + var e = evt.originalEvent; + var newEvent = new MouseEvent(evt.originalEvent.type); + newEvent.initMouseEvent(e.type, e.canBubble, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget); + elem.dispatchEvent(newEvent); + evt.preventDefault(); + return false; + }); +} + +function enableToggles() { + // show/hide nested classes on toggle click + $('#full_list a.toggle').on('click', function(evt) { + evt.stopPropagation(); + evt.preventDefault(); + $(this).parent().parent().toggleClass('collapsed'); + highlight(); + }); +} + +function populateSearchCache() { + $('#full_list li .item').each(function() { + var $node = $(this); + var $link = $node.find('.object_link a'); + if ($link.length > 0) { + searchCache.push({ + node: $node, + link: $link, + name: $link.text(), + fullName: $link.attr('title').split(' ')[0] + }); + } + }); +} + +function enableSearch() { + $('#search input').keyup(function(event) { + if (ignoredKeyPress(event)) return; + if (this.value === "") { + clearSearch(); + } else { + performSearch(this.value); + } + }); + + $('#full_list').after(""); +} + +function ignoredKeyPress(event) { + if ( + (event.keyCode > ignoreKeyCodeMin && event.keyCode < ignoreKeyCodeMax) || + (event.keyCode == commandKey) + ) { + return true; + } else { + return false; + } +} + +function clearSearch() { + clearSearchTimeout(); + $('#full_list .found').removeClass('found').each(function() { + var $link = $(this).find('.object_link a'); + $link.text($link.text()); + }); + $('#full_list, #content').removeClass('insearch'); + $clicked.parents().removeClass('collapsed'); + highlight(); +} + +function performSearch(searchString) { + clearSearchTimeout(); + $('#full_list, #content').addClass('insearch'); + $('#noresults').text('').hide(); + partialSearch(searchString, 0); +} + +function partialSearch(searchString, offset) { + var lastRowClass = ''; + var i = null; + for (i = offset; i < Math.min(offset + 50, searchCache.length); i++) { + var item = searchCache[i]; + var searchName = (searchString.indexOf('::') != -1 ? item.fullName : item.name); + var matchString = buildMatchString(searchString); + var matchRegexp = new RegExp(matchString, caseSensitiveMatch ? "" : "i"); + if (searchName.match(matchRegexp) == null) { + item.node.removeClass('found'); + item.link.text(item.link.text()); + } + else { + item.node.addClass('found'); + item.node.removeClass(lastRowClass).addClass(lastRowClass == 'r1' ? 'r2' : 'r1'); + lastRowClass = item.node.hasClass('r1') ? 'r1' : 'r2'; + item.link.html(item.name.replace(matchRegexp, "$&")); + } + } + if(i == searchCache.length) { + searchDone(); + } else { + searchTimeout = setTimeout(function() { + partialSearch(searchString, i); + }, 0); + } +} + +function searchDone() { + searchTimeout = null; + highlight(); + if ($('#full_list li:visible').size() === 0) { + $('#noresults').text('No results were found.').hide().fadeIn(); + } else { + $('#noresults').text('').hide(); + } + $('#content').removeClass('insearch'); +} + +function buildMatchString(searchString, event) { + caseSensitiveMatch = searchString.match(/[A-Z]/) != null; + var regexSearchString = RegExp.escape(searchString); + if (caseSensitiveMatch) { + regexSearchString += "|" + + $.map(searchString.split(''), function(e) { return RegExp.escape(e); }). + join('.+?'); + } + return regexSearchString; +} + +function highlight() { + $('#full_list li:visible').each(function(n) { + $(this).removeClass('even odd').addClass(n % 2 == 0 ? 'odd' : 'even'); + }); +} + +/** + * Expands the tree to the target element and its immediate + * children. + */ +function expandTo(path) { + var $target = $(document.getElementById('object_' + path)); + $target.addClass('clicked'); + $target.removeClass('collapsed'); + $target.parentsUntil('#full_list', 'li').removeClass('collapsed'); + if($target[0]) { + window.scrollTo(window.scrollX, $target.offset().top - 250); + highlight(); + } +} + +function windowEvents(event) { + var msg = event.data; + if (msg.action === "expand") { + expandTo(msg.path); + } + return false; +} + +window.addEventListener("message", windowEvents, false); + +$(document).ready(function() { + escapeShortcut(); + navResizer(); + enableLinks(); + enableToggles(); + populateSearchCache(); + enableSearch(); +}); + +})(); diff --git a/docs/1.3/wcc-contentful-app/js/jquery.js b/docs/1.3/wcc-contentful-app/js/jquery.js new file mode 100644 index 00000000..198b3ff0 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/js/jquery.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.1 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
    a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
    "+""+"
    ",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
    t
    ",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
    ",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; +f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

    ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
    ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
    ","
    "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() +{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
    ").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-app/method_list.html b/docs/1.3/wcc-contentful-app/method_list.html new file mode 100644 index 00000000..375434a9 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/method_list.html @@ -0,0 +1,627 @@ + + + + + + + + + + + + + + + + + + Method List + + + +
    +
    +

    Method List

    + + + +
    + +
      + + +
    • +
      + #change + CreateWCCContentfulAppContactFormSubmissions +
      +
    • + + +
    • +
      + configuration + WCC::Contentful::App +
      +
    • + + +
    • +
      + configure + WCC::Contentful::App +
      +
    • + + +
    • +
      + #contact_form_email + WCC::Contentful::App::ContactMailer +
      +
    • + + +
    • +
      + #create + WCC::Contentful::App::ContactFormController +
      +
    • + + +
    • +
      + #create_model_migrations + Wcc::ModelGenerator +
      +
    • + + +
    • +
      + db_connected? + WCC::Contentful::App +
      +
    • + + +
    • +
      + #drop_model_overrides_in_app_models + Wcc::ModelGenerator +
      +
    • + + +
    • +
      + #dropdown? + WCC::Contentful::App::MenuHelper +
      +
    • + + +
    • +
      + #ensure_initializer_exists + Wcc::ModelGenerator +
      +
    • + + +
    • +
      + #ensure_migration_tools_installed + Wcc::ModelGenerator +
      +
    • + + +
    • +
      + #ensure_wrapper_script_in_bin_dir + Wcc::ModelGenerator +
      +
    • + + +
    • +
      + #error + WCC::Contentful::App::ValidationError::Message +
      +
    • + + +
    • +
      + #errors + WCC::Contentful::App::ValidationError +
      +
    • + + +
    • +
      + #extensions + WCC::Contentful::App::MarkdownRenderer +
      +
    • + + +
    • +
      + #external? + WCC::Contentful::Model::MenuButton +
      +
    • + + +
    • +
      + #external? + WCC::Contentful::Model::Redirect +
      +
    • + + +
    • +
      + #external_uri + WCC::Contentful::Model::MenuButton +
      +
    • + + +
    • +
      + #external_uri + WCC::Contentful::Model::Redirect +
      +
    • + + +
    • +
      + #fragment + WCC::Contentful::Model::Redirect +
      +
    • + + +
    • +
      + #fragment + WCC::Contentful::Model::MenuButton +
      +
    • + + +
    • +
      + #frozen? + WCC::Contentful::App::Configuration +
      +
    • + + +
    • +
      + #frozen? + WCC::Contentful::App::Configuration::FrozenConfiguration +
      +
    • + + +
    • +
      + #hash_only + WCC::Contentful::App::MenuHelper +
      +
    • + + +
    • +
      + #href + WCC::Contentful::Model::Redirect +
      +
    • + + +
    • +
      + #href + WCC::Contentful::Model::MenuButton +
      +
    • + + +
    • +
      + #hyperlink_attributes + WCC::Contentful::App::CustomMarkdownRender +
      +
    • + + +
    • +
      + #index + WCC::Contentful::App::PagesController +
      +
    • + + +
    • +
      + init! + WCC::Contentful::App +
      +
    • + + +
    • +
      + #initialize + WCC::Contentful::App::PageNotFoundError +
      +
    • + + +
    • +
      + #initialize + WCC::Contentful::App::CustomMarkdownRender +
      +
    • + + +
    • +
      + #initialize + WCC::Contentful::App::Configuration::FrozenConfiguration +
      +
    • + + +
    • +
      + #initialize + WCC::Contentful::App::MarkdownRenderer +
      +
    • + + +
    • +
      + #initialize + WCC::Contentful::App::Configuration +
      +
    • + + +
    • +
      + #initialize + WCC::Contentful::App::ValidationError +
      +
    • + + +
    • +
      + #initialize + Wcc::ModelGenerator +
      +
    • + + +
    • +
      + initialized + WCC::Contentful::App +
      +
    • + + +
    • +
      + instance + WCC::Contentful::Model::SiteConfig +
      +
    • + + +
    • +
      + #item_active? + WCC::Contentful::App::MenuHelper +
      +
    • + + +
    • +
      + join_msg_keys + WCC::Contentful::App::ValidationError +
      +
    • + + +
    • +
      + #link + WCC::Contentful::App::CustomMarkdownRender +
      +
    • + + +
    • +
      + #local? + WCC::Contentful::App::MenuHelper +
      +
    • + + +
    • +
      + #markdown + WCC::Contentful::App::SectionHelper +
      +
    • + + +
    • +
      + #markdown + WCC::Contentful::App::MarkdownRenderer +
      +
    • + + +
    • +
      + #menu_button? + WCC::Contentful::App::MenuHelper +
      +
    • + + +
    • +
      + #options + WCC::Contentful::App::MarkdownRenderer +
      +
    • + + +
    • +
      + #page + WCC::Contentful::Model::SectionContactForm +
      +
    • + + +
    • +
      + #path + WCC::Contentful::App::ValidationError::Message +
      +
    • + + +
    • +
      + #preview? + WCC::Contentful::App::PreviewPassword +
      +
    • + + +
    • +
      + #preview_password + WCC::Contentful::App::Configuration +
      +
    • + + +
    • +
      + #preview_password + WCC::Contentful::App::PreviewPassword +
      +
    • + + +
    • +
      + #push_class + WCC::Contentful::App::MenuHelper +
      +
    • + + +
    • +
      + #render_button + WCC::Contentful::App::MenuHelper +
      +
    • + + +
    • +
      + #render_button_icon + WCC::Contentful::App::MenuHelper +
      +
    • + + +
    • +
      + #render_button_inner_html + WCC::Contentful::App::MenuHelper +
      +
    • + + +
    • +
      + #render_button_material_icon + WCC::Contentful::App::MenuHelper +
      +
    • + + +
    • +
      + #render_section + WCC::Contentful::App::SectionHelper +
      +
    • + + +
    • +
      + #safe_line_break + WCC::Contentful::App::SectionHelper +
      +
    • + + +
    • +
      + #section_css_name + WCC::Contentful::App::SectionHelper +
      +
    • + + +
    • +
      + #section_id + WCC::Contentful::App::SectionHelper +
      +
    • + + +
    • +
      + #section_styles + WCC::Contentful::App::SectionHelper +
      +
    • + + +
    • +
      + #section_template_name + WCC::Contentful::App::SectionHelper +
      +
    • + + +
    • +
      + #send_email + WCC::Contentful::Model::SectionContactForm +
      +
    • + + +
    • +
      + #show + WCC::Contentful::App::PagesController +
      +
    • + + +
    • +
      + #slug + WCC::Contentful::App::PageNotFoundError +
      +
    • + + +
    • +
      + #split_content_for_mobile_view + WCC::Contentful::App::SectionHelper +
      +
    • + + +
    • +
      + #table + WCC::Contentful::App::CustomMarkdownRender +
      +
    • + + +
    • +
      + #to_address + WCC::Contentful::Model::SectionContactForm +
      +
    • + + +
    • +
      + #to_s + WCC::Contentful::App::ValidationError::Message +
      +
    • + + +
    • +
      + #use_target_blank? + WCC::Contentful::App::CustomMarkdownRender +
      +
    • + + +
    • +
      + #validate! + WCC::Contentful::App::Configuration +
      +
    • + + +
    • +
      + #wcc_contentful_config + WCC::Contentful::App::Configuration +
      +
    • + + + +
    +
    + + diff --git a/docs/1.3/wcc-contentful-app/top-level-namespace.html b/docs/1.3/wcc-contentful-app/top-level-namespace.html new file mode 100644 index 00000000..71b3e242 --- /dev/null +++ b/docs/1.3/wcc-contentful-app/top-level-namespace.html @@ -0,0 +1,112 @@ + + + + + + + Top Level Namespace + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
    + + +

    Top Level Namespace + + + +

    +
    + + + + + + + + + + + +
    + +

    Defined Under Namespace

    +

    + + + Modules: WCC, Wcc + + + + Classes: CreateWCCContentfulAppContactFormSubmissions, DropdownMenu, FormField, Menu, MenuButton, Page, Redirect, SectionBlockText, SectionCodeWidget, SectionContactForm, SectionFaq, SectionHttpError, SectionMarqueeText, SectionTestimonials, SectionVideo, SectionVideoHighlight, SiteConfig + + +

    + + + + + + + + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-middleman/WCC.html b/docs/1.3/wcc-contentful-middleman/WCC.html new file mode 100644 index 00000000..f5f38385 --- /dev/null +++ b/docs/1.3/wcc-contentful-middleman/WCC.html @@ -0,0 +1,115 @@ + + + + + + + Module: WCC + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
    + + +

    Module: WCC + + + +

    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/wcc/contentful/middleman/version.rb
    +
    + +
    + +

    Defined Under Namespace

    +

    + + + Modules: Contentful + + + + +

    + + + + + + + + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-middleman/WCC/Contentful.html b/docs/1.3/wcc-contentful-middleman/WCC/Contentful.html new file mode 100644 index 00000000..2a62614d --- /dev/null +++ b/docs/1.3/wcc-contentful-middleman/WCC/Contentful.html @@ -0,0 +1,115 @@ + + + + + + + Module: WCC::Contentful + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
    + + +

    Module: WCC::Contentful + + + +

    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/wcc/contentful/middleman/version.rb
    +
    + +
    + +

    Defined Under Namespace

    +

    + + + Modules: Middleman + + + + +

    + + + + + + + + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-middleman/WCC/Contentful/Middleman.html b/docs/1.3/wcc-contentful-middleman/WCC/Contentful/Middleman.html new file mode 100644 index 00000000..3a5f6195 --- /dev/null +++ b/docs/1.3/wcc-contentful-middleman/WCC/Contentful/Middleman.html @@ -0,0 +1,131 @@ + + + + + + + Module: WCC::Contentful::Middleman + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
    + + +

    Module: WCC::Contentful::Middleman + + + +

    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/wcc/contentful/middleman/version.rb
    +
    + +
    + +

    Defined Under Namespace

    +

    + + + + + Classes: Extension + + +

    + + +

    + Constant Summary + collapse +

    + +
    + +
    VERSION = + +
    +
    '1.3.0'
    + +
    + + + + + + + + + + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-middleman/WCC/Contentful/Middleman/Extension.html b/docs/1.3/wcc-contentful-middleman/WCC/Contentful/Middleman/Extension.html new file mode 100644 index 00000000..4f09437b --- /dev/null +++ b/docs/1.3/wcc-contentful-middleman/WCC/Contentful/Middleman/Extension.html @@ -0,0 +1,343 @@ + + + + + + + Class: WCC::Contentful::Middleman::Extension + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: WCC::Contentful::Middleman::Extension + + + +

    +
    + +
    +
    Inherits:
    +
    + Middleman::Extension + +
      +
    • Object
    • + + + + + +
    + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/wcc/contentful/middleman/extension.rb
    +
    + +
    + +

    Defined Under Namespace

    +

    + + + + + Classes: ContentfulSyncUpdate + + +

    + + + + + + + + +

    + Instance Method Summary + collapse +

    + + + + + +
    +

    Constructor Details

    + +
    +

    + + #initialize(app, options_hash = {}, &block) ⇒ Extension + + + + + +

    +
    + +

    Returns a new instance of Extension.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +
    +
    # File 'lib/wcc/contentful/middleman/extension.rb', line 20
    +
    +def initialize(app, options_hash = {}, &block)
    +  # don't pass block to super b/c we use it to configure WCC::Contentful
    +  super(app, options_hash) {} # rubocop:disable Lint/EmptyBlock
    +
    +  # Require libraries only when activated
    +  require 'wcc/contentful'
    +
    +  # set up your extension
    +  return if WCC::Contentful.initialized
    +
    +  WCC::Contentful.configure do |config|
    +    config.store :eager_sync, :memory
    +
    +    options.to_h.each do |(k, v)|
    +      config.public_send("#{k}=", v) if config.respond_to?("#{k}=")
    +    end
    +
    +    instance_exec(config, &block) if block_given?
    +  end
    +
    +  WCC::Contentful.init!
    +  model_glob = File.join(Middleman::Application.root, 'lib/models/**/*.rb')
    +  Dir[model_glob].sort.each { |f| require f }
    +
    +  # Sync the latest data from Contentful
    +  WCC::Contentful::Services.instance.sync_engine&.next
    +end
    +
    + + + + + +
    +

    Instance Method Details

    + + +
    +

    + + #readyObject + + + + + +

    +
    + +

    helpers do

    + +
    def a_helper
    +end
    +
    + +

    end

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +53
    +54
    +55
    +56
    +
    +
    # File 'lib/wcc/contentful/middleman/extension.rb', line 53
    +
    +def ready
    +  # resync every page load in development & test mode only
    +  app.use ContentfulSyncUpdate if app.server?
    +end
    +
    +
    + +
    + + + + + + + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-middleman/WCC/Contentful/Middleman/Extension/ContentfulSyncUpdate.html b/docs/1.3/wcc-contentful-middleman/WCC/Contentful/Middleman/Extension/ContentfulSyncUpdate.html new file mode 100644 index 00000000..b0b5b41a --- /dev/null +++ b/docs/1.3/wcc-contentful-middleman/WCC/Contentful/Middleman/Extension/ContentfulSyncUpdate.html @@ -0,0 +1,401 @@ + + + + + + + Class: WCC::Contentful::Middleman::Extension::ContentfulSyncUpdate + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: WCC::Contentful::Middleman::Extension::ContentfulSyncUpdate + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + +
      +
    • Object
    • + + + +
    + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/wcc/contentful/middleman/extension.rb
    +
    + +
    + +

    Overview

    +
    + +

    Rack app that advances the sync engine whenever we load a page

    + + +
    +
    +
    + + +
    + + + + + + + +

    + Class Method Summary + collapse +

    + + + +

    + Instance Method Summary + collapse +

    + + + + +
    +

    Constructor Details

    + +
    +

    + + #initialize(app) ⇒ ContentfulSyncUpdate + + + + + +

    +
    + +

    Returns a new instance of ContentfulSyncUpdate.

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +60
    +61
    +62
    +
    +
    # File 'lib/wcc/contentful/middleman/extension.rb', line 60
    +
    +def initialize(app)
    +  @app = app
    +end
    +
    +
    + +
    + + +
    +

    Class Method Details

    + + +
    +

    + + .last_syncObject + + + + + +

    + + + + +
    +
    +
    +
    +74
    +75
    +76
    +
    +
    # File 'lib/wcc/contentful/middleman/extension.rb', line 74
    +
    +def last_sync
    +  @@last_sync ||= Time.at(0) # rubocop:disable Style/ClassVars
    +end
    +
    +
    + +
    +

    + + .last_sync=(time) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +78
    +79
    +80
    +
    +
    # File 'lib/wcc/contentful/middleman/extension.rb', line 78
    +
    +def last_sync=(time)
    +  @@last_sync = time # rubocop:disable Style/ClassVars
    +end
    +
    +
    + +
    + +
    +

    Instance Method Details

    + + +
    +

    + + #call(env) ⇒ Object + + + + + +

    + + + + +
    +
    +
    +
    +64
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +
    +
    # File 'lib/wcc/contentful/middleman/extension.rb', line 64
    +
    +def call(env)
    +  if (Time.now - ContentfulSyncUpdate.last_sync) > 10.seconds
    +    ::WCC::Contentful::Services.instance.sync_engine&.next
    +    ContentfulSyncUpdate.last_sync = Time.now
    +  end
    +
    +  @app.call(env)
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-middleman/_index.html b/docs/1.3/wcc-contentful-middleman/_index.html new file mode 100644 index 00000000..55d43d8a --- /dev/null +++ b/docs/1.3/wcc-contentful-middleman/_index.html @@ -0,0 +1,159 @@ + + + + + + + Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
    + + +

    Documentation by YARD 0.9.28

    +
    +

    Alphabetic Index

    + +

    File Listing

    + + +
    +

    Namespace Listing A-Z

    + + + + + + + + +
    + + + + + +
      +
    • E
    • +
        + +
      • + Extension + + (WCC::Contentful::Middleman) + +
      • + +
      +
    + + +
      +
    • M
    • +
        + +
      • + Middleman + + (WCC::Contentful) + +
      • + +
      +
    + + +
      +
    • W
    • +
        + +
      • + WCC + +
      • + +
      +
    + +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-middleman/class_list.html b/docs/1.3/wcc-contentful-middleman/class_list.html new file mode 100644 index 00000000..347701b7 --- /dev/null +++ b/docs/1.3/wcc-contentful-middleman/class_list.html @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + Class List + + + +
    +
    +

    Class List

    + + + +
    + + +
    + + diff --git a/docs/1.3/wcc-contentful-middleman/css/common.css b/docs/1.3/wcc-contentful-middleman/css/common.css new file mode 100644 index 00000000..cf25c452 --- /dev/null +++ b/docs/1.3/wcc-contentful-middleman/css/common.css @@ -0,0 +1 @@ +/* Override this file with custom rules */ \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-middleman/css/full_list.css b/docs/1.3/wcc-contentful-middleman/css/full_list.css new file mode 100644 index 00000000..fa359824 --- /dev/null +++ b/docs/1.3/wcc-contentful-middleman/css/full_list.css @@ -0,0 +1,58 @@ +body { + margin: 0; + font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + font-size: 13px; + height: 101%; + overflow-x: hidden; + background: #fafafa; +} + +h1 { padding: 12px 10px; padding-bottom: 0; margin: 0; font-size: 1.4em; } +.clear { clear: both; } +.fixed_header { position: fixed; background: #fff; width: 100%; padding-bottom: 10px; margin-top: 0; top: 0; z-index: 9999; height: 70px; } +#search { position: absolute; right: 5px; top: 9px; padding-left: 24px; } +#content.insearch #search, #content.insearch #noresults { background: url(data:image/gif;base64,R0lGODlhEAAQAPYAAP///wAAAPr6+pKSkoiIiO7u7sjIyNjY2J6engAAAI6OjsbGxjIyMlJSUuzs7KamppSUlPLy8oKCghwcHLKysqSkpJqamvT09Pj4+KioqM7OzkRERAwMDGBgYN7e3ujo6Ly8vCoqKjY2NkZGRtTU1MTExDw8PE5OTj4+PkhISNDQ0MrKylpaWrS0tOrq6nBwcKysrLi4uLq6ul5eXlxcXGJiYoaGhuDg4H5+fvz8/KKiohgYGCwsLFZWVgQEBFBQUMzMzDg4OFhYWBoaGvDw8NbW1pycnOLi4ubm5kBAQKqqqiQkJCAgIK6urnJyckpKSjQ0NGpqatLS0sDAwCYmJnx8fEJCQlRUVAoKCggICLCwsOTk5ExMTPb29ra2tmZmZmhoaNzc3KCgoBISEiIiIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCAAAACwAAAAAEAAQAAAHaIAAgoMgIiYlg4kACxIaACEJCSiKggYMCRselwkpghGJBJEcFgsjJyoAGBmfggcNEx0flBiKDhQFlIoCCA+5lAORFb4AJIihCRbDxQAFChAXw9HSqb60iREZ1omqrIPdJCTe0SWI09GBACH5BAkIAAAALAAAAAAQABAAAAdrgACCgwc0NTeDiYozCQkvOTo9GTmDKy8aFy+NOBA7CTswgywJDTIuEjYFIY0JNYMtKTEFiRU8Pjwygy4ws4owPyCKwsMAJSTEgiQlgsbIAMrO0dKDGMTViREZ14kYGRGK38nHguHEJcvTyIEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDAggPg4iJAAMJCRUAJRIqiRGCBI0WQEEJJkWDERkYAAUKEBc4Po1GiKKJHkJDNEeKig4URLS0ICImJZAkuQAhjSi/wQyNKcGDCyMnk8u5rYrTgqDVghgZlYjcACTA1sslvtHRgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCQARAtOUoQRGRiFD0kJUYWZhUhKT1OLhR8wBaaFBzQ1NwAlkIszCQkvsbOHL7Y4q4IuEjaqq0ZQD5+GEEsJTDCMmIUhtgk1lo6QFUwJVDKLiYJNUd6/hoEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4uen4ICCA+IkIsDCQkVACWmhwSpFqAABQoQF6ALTkWFnYMrVlhWvIKTlSAiJiVVPqlGhJkhqShHV1lCW4cMqSkAR1ofiwsjJyqGgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCSMhREZGIYYGY2ElYebi56fhyWQniSKAKKfpaCLFlAPhl0gXYNGEwkhGYREUywag1wJwSkHNDU3D0kJYIMZQwk8MjPBLx9eXwuETVEyAC/BOKsuEjYFhoEAIfkECQgAAAAsAAAAABAAEAAAB2eAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4ueICImip6CIQkJKJ4kigynKaqKCyMnKqSEK05StgAGQRxPYZaENqccFgIID4KXmQBhXFkzDgOnFYLNgltaSAAEpxa7BQoQF4aBACH5BAkIAAAALAAAAAAQABAAAAdogACCg4SFggJiPUqCJSWGgkZjCUwZACQkgxGEXAmdT4UYGZqCGWQ+IjKGGIUwPzGPhAc0NTewhDOdL7Ykji+dOLuOLhI2BbaFETICx4MlQitdqoUsCQ2vhKGjglNfU0SWmILaj43M5oEAOwAAAAAAAAAAAA==) no-repeat center left; } +#full_list { padding: 0; list-style: none; margin-left: 0; margin-top: 80px; font-size: 1.1em; } +#full_list ul { padding: 0; } +#full_list li { padding: 0; margin: 0; list-style: none; } +#full_list li .item { padding: 5px 5px 5px 12px; } +#noresults { padding: 7px 12px; background: #fff; } +#content.insearch #noresults { margin-left: 7px; } +li.collapsed ul { display: none; } +li a.toggle { cursor: default; position: relative; left: -5px; top: 4px; text-indent: -999px; width: 10px; height: 9px; margin-left: -10px; display: block; float: left; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC) no-repeat bottom left; } +li.collapsed a.toggle { opacity: 0.5; cursor: default; background-position: top left; } +li { color: #888; cursor: pointer; } +li.deprecated { text-decoration: line-through; font-style: italic; } +li.odd { background: #f0f0f0; } +li.even { background: #fafafa; } +.item:hover { background: #ddd; } +li small:before { content: "("; } +li small:after { content: ")"; } +li small.search_info { display: none; } +a, a:visited { text-decoration: none; color: #05a; } +li.clicked > .item { background: #05a; color: #ccc; } +li.clicked > .item a, li.clicked > .item a:visited { color: #eee; } +li.clicked > .item a.toggle { opacity: 0.5; background-position: bottom right; } +li.collapsed.clicked a.toggle { background-position: top right; } +#search input { border: 1px solid #bbb; border-radius: 3px; } +#full_list_nav { margin-left: 10px; font-size: 0.9em; display: block; color: #aaa; } +#full_list_nav a, #nav a:visited { color: #358; } +#full_list_nav a:hover { background: transparent; color: #5af; } +#full_list_nav span:after { content: ' | '; } +#full_list_nav span:last-child:after { content: ''; } + +#content h1 { margin-top: 0; } +li { white-space: nowrap; cursor: normal; } +li small { display: block; font-size: 0.8em; } +li small:before { content: ""; } +li small:after { content: ""; } +li small.search_info { display: none; } +#search { width: 170px; position: static; margin: 3px; margin-left: 10px; font-size: 0.9em; color: #888; padding-left: 0; padding-right: 24px; } +#content.insearch #search { background-position: center right; } +#search input { width: 110px; } + +#full_list.insearch ul { display: block; } +#full_list.insearch .item { display: none; } +#full_list.insearch .found { display: block; padding-left: 11px !important; } +#full_list.insearch li a.toggle { display: none; } +#full_list.insearch li small.search_info { display: block; } diff --git a/docs/1.3/wcc-contentful-middleman/css/style.css b/docs/1.3/wcc-contentful-middleman/css/style.css new file mode 100644 index 00000000..eb0dbc86 --- /dev/null +++ b/docs/1.3/wcc-contentful-middleman/css/style.css @@ -0,0 +1,497 @@ +html { + width: 100%; + height: 100%; +} +body { + font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + font-size: 13px; + width: 100%; + margin: 0; + padding: 0; + display: flex; + display: -webkit-flex; + display: -ms-flexbox; +} + +#nav { + position: relative; + width: 100%; + height: 100%; + border: 0; + border-right: 1px dotted #eee; + overflow: auto; +} +.nav_wrap { + margin: 0; + padding: 0; + width: 20%; + height: 100%; + position: relative; + display: flex; + display: -webkit-flex; + display: -ms-flexbox; + flex-shrink: 0; + -webkit-flex-shrink: 0; + -ms-flex: 1 0; +} +#resizer { + position: absolute; + right: -5px; + top: 0; + width: 10px; + height: 100%; + cursor: col-resize; + z-index: 9999; +} +#main { + flex: 5 1; + -webkit-flex: 5 1; + -ms-flex: 5 1; + outline: none; + position: relative; + background: #fff; + padding: 1.2em; + padding-top: 0.2em; + box-sizing: border-box; +} + +@media (max-width: 920px) { + .nav_wrap { width: 100%; top: 0; right: 0; overflow: visible; position: absolute; } + #resizer { display: none; } + #nav { + z-index: 9999; + background: #fff; + display: none; + position: absolute; + top: 40px; + right: 12px; + width: 500px; + max-width: 80%; + height: 80%; + overflow-y: scroll; + border: 1px solid #999; + border-collapse: collapse; + box-shadow: -7px 5px 25px #aaa; + border-radius: 2px; + } +} + +@media (min-width: 920px) { + body { height: 100%; overflow: hidden; } + #main { height: 100%; overflow: auto; } + #search { display: none; } +} + +#main img { max-width: 100%; } +h1 { font-size: 25px; margin: 1em 0 0.5em; padding-top: 4px; border-top: 1px dotted #d5d5d5; } +h1.noborder { border-top: 0px; margin-top: 0; padding-top: 4px; } +h1.title { margin-bottom: 10px; } +h1.alphaindex { margin-top: 0; font-size: 22px; } +h2 { + padding: 0; + padding-bottom: 3px; + border-bottom: 1px #aaa solid; + font-size: 1.4em; + margin: 1.8em 0 0.5em; + position: relative; +} +h2 small { font-weight: normal; font-size: 0.7em; display: inline; position: absolute; right: 0; } +h2 small a { + display: block; + height: 20px; + border: 1px solid #aaa; + border-bottom: 0; + border-top-left-radius: 5px; + background: #f8f8f8; + position: relative; + padding: 2px 7px; +} +.clear { clear: both; } +.inline { display: inline; } +.inline p:first-child { display: inline; } +.docstring, .tags, #filecontents { font-size: 15px; line-height: 1.5145em; } +.docstring p > code, .docstring p > tt, .tags p > code, .tags p > tt { + color: #c7254e; background: #f9f2f4; padding: 2px 4px; font-size: 1em; + border-radius: 4px; +} +.docstring h1, .docstring h2, .docstring h3, .docstring h4 { padding: 0; border: 0; border-bottom: 1px dotted #bbb; } +.docstring h1 { font-size: 1.2em; } +.docstring h2 { font-size: 1.1em; } +.docstring h3, .docstring h4 { font-size: 1em; border-bottom: 0; padding-top: 10px; } +.summary_desc .object_link a, .docstring .object_link a { + font-family: monospace; font-size: 1.05em; + color: #05a; background: #EDF4FA; padding: 2px 4px; font-size: 1em; + border-radius: 4px; +} +.rdoc-term { padding-right: 25px; font-weight: bold; } +.rdoc-list p { margin: 0; padding: 0; margin-bottom: 4px; } +.summary_desc pre.code .object_link a, .docstring pre.code .object_link a { + padding: 0px; background: inherit; color: inherit; border-radius: inherit; +} + +/* style for */ +#filecontents table, .docstring table { border-collapse: collapse; } +#filecontents table th, #filecontents table td, +.docstring table th, .docstring table td { border: 1px solid #ccc; padding: 8px; padding-right: 17px; } +#filecontents table tr:nth-child(odd), +.docstring table tr:nth-child(odd) { background: #eee; } +#filecontents table tr:nth-child(even), +.docstring table tr:nth-child(even) { background: #fff; } +#filecontents table th, .docstring table th { background: #fff; } + +/* style for
      */ +#filecontents li > p, .docstring li > p { margin: 0px; } +#filecontents ul, .docstring ul { padding-left: 20px; } +/* style for
      */ +#filecontents dl, .docstring dl { border: 1px solid #ccc; } +#filecontents dt, .docstring dt { background: #ddd; font-weight: bold; padding: 3px 5px; } +#filecontents dd, .docstring dd { padding: 5px 0px; margin-left: 18px; } +#filecontents dd > p, .docstring dd > p { margin: 0px; } + +.note { + color: #222; + margin: 20px 0; + padding: 10px; + border: 1px solid #eee; + border-radius: 3px; + display: block; +} +.docstring .note { + border-left-color: #ccc; + border-left-width: 5px; +} +.note.todo { background: #ffffc5; border-color: #ececaa; } +.note.returns_void { background: #efefef; } +.note.deprecated { background: #ffe5e5; border-color: #e9dada; } +.note.title.deprecated { background: #ffe5e5; border-color: #e9dada; } +.note.private { background: #ffffc5; border-color: #ececaa; } +.note.title { padding: 3px 6px; font-size: 0.9em; font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; display: inline; } +.summary_signature + .note.title { margin-left: 7px; } +h1 .note.title { font-size: 0.5em; font-weight: normal; padding: 3px 5px; position: relative; top: -3px; text-transform: capitalize; } +.note.title { background: #efefef; } +.note.title.constructor { color: #fff; background: #6a98d6; border-color: #6689d6; } +.note.title.writeonly { color: #fff; background: #45a638; border-color: #2da31d; } +.note.title.readonly { color: #fff; background: #6a98d6; border-color: #6689d6; } +.note.title.private { background: #d5d5d5; border-color: #c5c5c5; } +.note.title.not_defined_here { background: transparent; border: none; font-style: italic; } +.discussion .note { margin-top: 6px; } +.discussion .note:first-child { margin-top: 0; } + +h3.inherited { + font-style: italic; + font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + font-weight: normal; + padding: 0; + margin: 0; + margin-top: 12px; + margin-bottom: 3px; + font-size: 13px; +} +p.inherited { + padding: 0; + margin: 0; + margin-left: 25px; +} + +.box_info dl { + margin: 0; + border: 0; + width: 100%; + font-size: 1em; + display: flex; + display: -webkit-flex; + display: -ms-flexbox; +} +.box_info dl dt { + flex-shrink: 0; + -webkit-flex-shrink: 1; + -ms-flex-shrink: 1; + width: 100px; + text-align: right; + font-weight: bold; + border: 1px solid #aaa; + border-width: 1px 0px 0px 1px; + padding: 6px 0; + padding-right: 10px; +} +.box_info dl dd { + flex-grow: 1; + -webkit-flex-grow: 1; + -ms-flex: 1; + max-width: 420px; + padding: 6px 0; + padding-right: 20px; + border: 1px solid #aaa; + border-width: 1px 1px 0 0; + overflow: hidden; + position: relative; +} +.box_info dl:last-child > * { + border-bottom: 1px solid #aaa; +} +.box_info dl:nth-child(odd) > * { background: #eee; } +.box_info dl:nth-child(even) > * { background: #fff; } +.box_info dl > * { margin: 0; } + +ul.toplevel { list-style: none; padding-left: 0; font-size: 1.1em; } +.index_inline_list { padding-left: 0; font-size: 1.1em; } + +.index_inline_list li { + list-style: none; + display: inline-block; + padding: 0 12px; + line-height: 30px; + margin-bottom: 5px; +} + +dl.constants { margin-left: 10px; } +dl.constants dt { font-weight: bold; font-size: 1.1em; margin-bottom: 5px; } +dl.constants.compact dt { display: inline-block; font-weight: normal } +dl.constants dd { width: 75%; white-space: pre; font-family: monospace; margin-bottom: 18px; } +dl.constants .docstring .note:first-child { margin-top: 5px; } + +.summary_desc { + margin-left: 32px; + display: block; + font-family: sans-serif; + font-size: 1.1em; + margin-top: 8px; + line-height: 1.5145em; + margin-bottom: 0.8em; +} +.summary_desc tt { font-size: 0.9em; } +dl.constants .note { padding: 2px 6px; padding-right: 12px; margin-top: 6px; } +dl.constants .docstring { margin-left: 32px; font-size: 0.9em; font-weight: normal; } +dl.constants .tags { padding-left: 32px; font-size: 0.9em; line-height: 0.8em; } +dl.constants .discussion *:first-child { margin-top: 0; } +dl.constants .discussion *:last-child { margin-bottom: 0; } + +.method_details { border-top: 1px dotted #ccc; margin-top: 25px; padding-top: 0; } +.method_details.first { border: 0; margin-top: 5px; } +.method_details.first h3.signature { margin-top: 1em; } +p.signature, h3.signature { + font-size: 1.1em; font-weight: normal; font-family: Monaco, Consolas, Courier, monospace; + padding: 6px 10px; margin-top: 1em; + background: #E8F4FF; border: 1px solid #d8d8e5; border-radius: 5px; +} +p.signature tt, +h3.signature tt { font-family: Monaco, Consolas, Courier, monospace; } +p.signature .overload, +h3.signature .overload { display: block; } +p.signature .extras, +h3.signature .extras { font-weight: normal; font-family: sans-serif; color: #444; font-size: 1em; } +p.signature .not_defined_here, +h3.signature .not_defined_here, +p.signature .aliases, +h3.signature .aliases { display: block; font-weight: normal; font-size: 0.9em; font-family: sans-serif; margin-top: 0px; color: #555; } +p.signature .aliases .names, +h3.signature .aliases .names { font-family: Monaco, Consolas, Courier, monospace; font-weight: bold; color: #000; font-size: 1.2em; } + +.tags .tag_title { font-size: 1.05em; margin-bottom: 0; font-weight: bold; } +.tags .tag_title tt { color: initial; padding: initial; background: initial; } +.tags ul { margin-top: 5px; padding-left: 30px; list-style: square; } +.tags ul li { margin-bottom: 3px; } +.tags ul .name { font-family: monospace; font-weight: bold; } +.tags ul .note { padding: 3px 6px; } +.tags { margin-bottom: 12px; } + +.tags .examples .tag_title { margin-bottom: 10px; font-weight: bold; } +.tags .examples .inline p { padding: 0; margin: 0; font-weight: bold; font-size: 1em; } +.tags .examples .inline p:before { content: "▸"; font-size: 1em; margin-right: 5px; } + +.tags .overload .overload_item { list-style: none; margin-bottom: 25px; } +.tags .overload .overload_item .signature { + padding: 2px 8px; + background: #F1F8FF; border: 1px solid #d8d8e5; border-radius: 3px; +} +.tags .overload .signature { margin-left: -15px; font-family: monospace; display: block; font-size: 1.1em; } +.tags .overload .docstring { margin-top: 15px; } + +.defines { display: none; } + +#method_missing_details .notice.this { position: relative; top: -8px; color: #888; padding: 0; margin: 0; } + +.showSource { font-size: 0.9em; } +.showSource a, .showSource a:visited { text-decoration: none; color: #666; } + +#content a, #content a:visited { text-decoration: none; color: #05a; } +#content a:hover { background: #ffffa5; } + +ul.summary { + list-style: none; + font-family: monospace; + font-size: 1em; + line-height: 1.5em; + padding-left: 0px; +} +ul.summary a, ul.summary a:visited { + text-decoration: none; font-size: 1.1em; +} +ul.summary li { margin-bottom: 5px; } +.summary_signature { padding: 4px 8px; background: #f8f8f8; border: 1px solid #f0f0f0; border-radius: 5px; } +.summary_signature:hover { background: #CFEBFF; border-color: #A4CCDA; cursor: pointer; } +.summary_signature.deprecated { background: #ffe5e5; border-color: #e9dada; } +ul.summary.compact li { display: inline-block; margin: 0px 5px 0px 0px; line-height: 2.6em;} +ul.summary.compact .summary_signature { padding: 5px 7px; padding-right: 4px; } +#content .summary_signature:hover a, +#content .summary_signature:hover a:visited { + background: transparent; + color: #049; +} + +p.inherited a { font-family: monospace; font-size: 0.9em; } +p.inherited { word-spacing: 5px; font-size: 1.2em; } + +p.children { font-size: 1.2em; } +p.children a { font-size: 0.9em; } +p.children strong { font-size: 0.8em; } +p.children strong.modules { padding-left: 5px; } + +ul.fullTree { display: none; padding-left: 0; list-style: none; margin-left: 0; margin-bottom: 10px; } +ul.fullTree ul { margin-left: 0; padding-left: 0; list-style: none; } +ul.fullTree li { text-align: center; padding-top: 18px; padding-bottom: 12px; background: url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAHtJREFUeNqMzrEJAkEURdGzuhgZbSoYWcAWoBVsB4JgZAGmphsZCZYzTQgWNCYrDN9RvMmHx+X916SUBFbo8CzD1idXrLErw1mQttgXtyrOcQ/Ny5p4Qh+2XqLYYazsPWNTiuMkRxa4vcV+evuNAUOLIx5+c2hyzv7hNQC67Q+/HHmlEwAAAABJRU5ErkJggg==) no-repeat top center; } +ul.fullTree li:first-child { padding-top: 0; background: transparent; } +ul.fullTree li:last-child { padding-bottom: 0; } +.showAll ul.fullTree { display: block; } +.showAll .inheritName { display: none; } + +#search { position: absolute; right: 12px; top: 0px; z-index: 9000; } +#search a { + display: block; float: left; + padding: 4px 8px; text-decoration: none; color: #05a; fill: #05a; + border: 1px solid #d8d8e5; + border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; + background: #F1F8FF; + box-shadow: -1px 1px 3px #ddd; +} +#search a:hover { background: #f5faff; color: #06b; fill: #06b; } +#search a.active { + background: #568; padding-bottom: 20px; color: #fff; fill: #fff; + border: 1px solid #457; + border-top-left-radius: 5px; border-top-right-radius: 5px; +} +#search a.inactive { color: #999; fill: #999; } +.inheritanceTree, .toggleDefines { + float: right; + border-left: 1px solid #aaa; + position: absolute; top: 0; right: 0; + height: 100%; + background: #f6f6f6; + padding: 5px; + min-width: 55px; + text-align: center; +} + +#menu { font-size: 1.3em; color: #bbb; } +#menu .title, #menu a { font-size: 0.7em; } +#menu .title a { font-size: 1em; } +#menu .title { color: #555; } +#menu a, #menu a:visited { color: #333; text-decoration: none; border-bottom: 1px dotted #bbd; } +#menu a:hover { color: #05a; } + +#footer { margin-top: 15px; border-top: 1px solid #ccc; text-align: center; padding: 7px 0; color: #999; } +#footer a, #footer a:visited { color: #444; text-decoration: none; border-bottom: 1px dotted #bbd; } +#footer a:hover { color: #05a; } + +#listing ul.alpha { font-size: 1.1em; } +#listing ul.alpha { margin: 0; padding: 0; padding-bottom: 10px; list-style: none; } +#listing ul.alpha li.letter { font-size: 1.4em; padding-bottom: 10px; } +#listing ul.alpha ul { margin: 0; padding-left: 15px; } +#listing ul small { color: #666; font-size: 0.7em; } + +li.r1 { background: #f0f0f0; } +li.r2 { background: #fafafa; } + +#content ul.summary li.deprecated .summary_signature a, +#content ul.summary li.deprecated .summary_signature a:visited { text-decoration: line-through; font-style: italic; } + +#toc { + position: relative; + float: right; + overflow-x: auto; + right: -3px; + margin-left: 20px; + margin-bottom: 20px; + padding: 20px; padding-right: 30px; + max-width: 300px; + z-index: 5000; + background: #fefefe; + border: 1px solid #ddd; + box-shadow: -2px 2px 6px #bbb; +} +#toc .title { margin: 0; } +#toc ol { padding-left: 1.8em; } +#toc li { font-size: 1.1em; line-height: 1.7em; } +#toc > ol > li { font-size: 1.1em; font-weight: bold; } +#toc ol > li > ol { font-size: 0.9em; } +#toc ol ol > li > ol { padding-left: 2.3em; } +#toc ol + li { margin-top: 0.3em; } +#toc.hidden { padding: 10px; background: #fefefe; box-shadow: none; } +#toc.hidden:hover { background: #fafafa; } +#filecontents h1 + #toc.nofloat { margin-top: 0; } +@media (max-width: 560px) { + #toc { + margin-left: 0; + margin-top: 16px; + float: none; + max-width: none; + } +} + +/* syntax highlighting */ +.source_code { display: none; padding: 3px 8px; border-left: 8px solid #ddd; margin-top: 5px; } +#filecontents pre.code, .docstring pre.code, .source_code pre { font-family: monospace; } +#filecontents pre.code, .docstring pre.code { display: block; } +.source_code .lines { padding-right: 12px; color: #555; text-align: right; } +#filecontents pre.code, .docstring pre.code, +.tags pre.example { + padding: 9px 14px; + margin-top: 4px; + border: 1px solid #e1e1e8; + background: #f7f7f9; + border-radius: 4px; + font-size: 1em; + overflow-x: auto; + line-height: 1.2em; +} +pre.code { color: #000; tab-size: 2; } +pre.code .info.file { color: #555; } +pre.code .val { color: #036A07; } +pre.code .tstring_content, +pre.code .heredoc_beg, pre.code .heredoc_end, +pre.code .qwords_beg, pre.code .qwords_end, pre.code .qwords_sep, +pre.code .words_beg, pre.code .words_end, pre.code .words_sep, +pre.code .qsymbols_beg, pre.code .qsymbols_end, pre.code .qsymbols_sep, +pre.code .symbols_beg, pre.code .symbols_end, pre.code .symbols_sep, +pre.code .tstring, pre.code .dstring { color: #036A07; } +pre.code .fid, pre.code .rubyid_new, pre.code .rubyid_to_s, +pre.code .rubyid_to_sym, pre.code .rubyid_to_f, +pre.code .dot + pre.code .id, +pre.code .rubyid_to_i pre.code .rubyid_each { color: #0085FF; } +pre.code .comment { color: #0066FF; } +pre.code .const, pre.code .constant { color: #585CF6; } +pre.code .label, +pre.code .symbol { color: #C5060B; } +pre.code .kw, +pre.code .rubyid_require, +pre.code .rubyid_extend, +pre.code .rubyid_include { color: #0000FF; } +pre.code .ivar { color: #318495; } +pre.code .gvar, +pre.code .rubyid_backref, +pre.code .rubyid_nth_ref { color: #6D79DE; } +pre.code .regexp, .dregexp { color: #036A07; } +pre.code a { border-bottom: 1px dotted #bbf; } +/* inline code */ +*:not(pre) > code { + padding: 1px 3px 1px 3px; + border: 1px solid #E1E1E8; + background: #F7F7F9; + border-radius: 4px; +} + +/* Color fix for links */ +#content .summary_desc pre.code .id > .object_link a, /* identifier */ +#content .docstring pre.code .id > .object_link a { color: #0085FF; } +#content .summary_desc pre.code .const > .object_link a, /* constant */ +#content .docstring pre.code .const > .object_link a { color: #585CF6; } diff --git a/docs/1.3/wcc-contentful-middleman/file.README.html b/docs/1.3/wcc-contentful-middleman/file.README.html new file mode 100644 index 00000000..a74ae802 --- /dev/null +++ b/docs/1.3/wcc-contentful-middleman/file.README.html @@ -0,0 +1,77 @@ + + + + + + + File: README + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Gem Version +Build Status +Coverage Status

      + +

      WCC::Contentful::Middleman

      + +

      A plugin for middleman static sites to use the wcc-contentful gem for connecting to Contentful.

      +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-middleman/file_list.html b/docs/1.3/wcc-contentful-middleman/file_list.html new file mode 100644 index 00000000..2b6df404 --- /dev/null +++ b/docs/1.3/wcc-contentful-middleman/file_list.html @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + File List + + + +
      +
      +

      File List

      + + + +
      + + +
      + + diff --git a/docs/1.3/wcc-contentful-middleman/frames.html b/docs/1.3/wcc-contentful-middleman/frames.html new file mode 100644 index 00000000..a65e9365 --- /dev/null +++ b/docs/1.3/wcc-contentful-middleman/frames.html @@ -0,0 +1,17 @@ + + + + + Documentation by YARD 0.9.28 + + + + diff --git a/docs/1.3/wcc-contentful-middleman/index.html b/docs/1.3/wcc-contentful-middleman/index.html new file mode 100644 index 00000000..c0ed8a1a --- /dev/null +++ b/docs/1.3/wcc-contentful-middleman/index.html @@ -0,0 +1,77 @@ + + + + + + + File: README + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Gem Version +Build Status +Coverage Status

      + +

      WCC::Contentful::Middleman

      + +

      A plugin for middleman static sites to use the wcc-contentful gem for connecting to Contentful.

      +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-middleman/js/app.js b/docs/1.3/wcc-contentful-middleman/js/app.js new file mode 100644 index 00000000..8d067fe3 --- /dev/null +++ b/docs/1.3/wcc-contentful-middleman/js/app.js @@ -0,0 +1,314 @@ +(function() { + +var localStorage = {}, sessionStorage = {}; +try { localStorage = window.localStorage; } catch (e) { } +try { sessionStorage = window.sessionStorage; } catch (e) { } + +function createSourceLinks() { + $('.method_details_list .source_code'). + before("[View source]"); + $('.toggleSource').toggle(function() { + $(this).parent().nextAll('.source_code').slideDown(100); + $(this).text("Hide source"); + }, + function() { + $(this).parent().nextAll('.source_code').slideUp(100); + $(this).text("View source"); + }); +} + +function createDefineLinks() { + var tHeight = 0; + $('.defines').after(" more..."); + $('.toggleDefines').toggle(function() { + tHeight = $(this).parent().prev().height(); + $(this).prev().css('display', 'inline'); + $(this).parent().prev().height($(this).parent().height()); + $(this).text("(less)"); + }, + function() { + $(this).prev().hide(); + $(this).parent().prev().height(tHeight); + $(this).text("more..."); + }); +} + +function createFullTreeLinks() { + var tHeight = 0; + $('.inheritanceTree').toggle(function() { + tHeight = $(this).parent().prev().height(); + $(this).parent().toggleClass('showAll'); + $(this).text("(hide)"); + $(this).parent().prev().height($(this).parent().height()); + }, + function() { + $(this).parent().toggleClass('showAll'); + $(this).parent().prev().height(tHeight); + $(this).text("show all"); + }); +} + +function searchFrameButtons() { + $('.full_list_link').click(function() { + toggleSearchFrame(this, $(this).attr('href')); + return false; + }); + window.addEventListener('message', function(e) { + if (e.data === 'navEscape') { + $('#nav').slideUp(100); + $('#search a').removeClass('active inactive'); + $(window).focus(); + } + }); + + $(window).resize(function() { + if ($('#search:visible').length === 0) { + $('#nav').removeAttr('style'); + $('#search a').removeClass('active inactive'); + $(window).focus(); + } + }); +} + +function toggleSearchFrame(id, link) { + var frame = $('#nav'); + $('#search a').removeClass('active').addClass('inactive'); + if (frame.attr('src') === link && frame.css('display') !== "none") { + frame.slideUp(100); + $('#search a').removeClass('active inactive'); + } + else { + $(id).addClass('active').removeClass('inactive'); + if (frame.attr('src') !== link) frame.attr('src', link); + frame.slideDown(100); + } +} + +function linkSummaries() { + $('.summary_signature').click(function() { + document.location = $(this).find('a').attr('href'); + }); +} + +function summaryToggle() { + $('.summary_toggle').click(function(e) { + e.preventDefault(); + localStorage.summaryCollapsed = $(this).text(); + $('.summary_toggle').each(function() { + $(this).text($(this).text() == "collapse" ? "expand" : "collapse"); + var next = $(this).parent().parent().nextAll('ul.summary').first(); + if (next.hasClass('compact')) { + next.toggle(); + next.nextAll('ul.summary').first().toggle(); + } + else if (next.hasClass('summary')) { + var list = $('
        '); + list.html(next.html()); + list.find('.summary_desc, .note').remove(); + list.find('a').each(function() { + $(this).html($(this).find('strong').html()); + $(this).parent().html($(this)[0].outerHTML); + }); + next.before(list); + next.toggle(); + } + }); + return false; + }); + if (localStorage.summaryCollapsed == "collapse") { + $('.summary_toggle').first().click(); + } else { localStorage.summaryCollapsed = "expand"; } +} + +function constantSummaryToggle() { + $('.constants_summary_toggle').click(function(e) { + e.preventDefault(); + localStorage.summaryCollapsed = $(this).text(); + $('.constants_summary_toggle').each(function() { + $(this).text($(this).text() == "collapse" ? "expand" : "collapse"); + var next = $(this).parent().parent().nextAll('dl.constants').first(); + if (next.hasClass('compact')) { + next.toggle(); + next.nextAll('dl.constants').first().toggle(); + } + else if (next.hasClass('constants')) { + var list = $('
        '); + list.html(next.html()); + list.find('dt').each(function() { + $(this).addClass('summary_signature'); + $(this).text( $(this).text().split('=')[0]); + if ($(this).has(".deprecated").length) { + $(this).addClass('deprecated'); + }; + }); + // Add the value of the constant as "Tooltip" to the summary object + list.find('pre.code').each(function() { + console.log($(this).parent()); + var dt_element = $(this).parent().prev(); + var tooltip = $(this).text(); + if (dt_element.hasClass("deprecated")) { + tooltip = 'Deprecated. ' + tooltip; + }; + dt_element.attr('title', tooltip); + }); + list.find('.docstring, .tags, dd').remove(); + next.before(list); + next.toggle(); + } + }); + return false; + }); + if (localStorage.summaryCollapsed == "collapse") { + $('.constants_summary_toggle').first().click(); + } else { localStorage.summaryCollapsed = "expand"; } +} + +function generateTOC() { + if ($('#filecontents').length === 0) return; + var _toc = $('
          '); + var show = false; + var toc = _toc; + var counter = 0; + var tags = ['h2', 'h3', 'h4', 'h5', 'h6']; + var i; + var curli; + if ($('#filecontents h1').length > 1) tags.unshift('h1'); + for (i = 0; i < tags.length; i++) { tags[i] = '#filecontents ' + tags[i]; } + var lastTag = parseInt(tags[0][1], 10); + $(tags.join(', ')).each(function() { + if ($(this).parents('.method_details .docstring').length != 0) return; + if (this.id == "filecontents") return; + show = true; + var thisTag = parseInt(this.tagName[1], 10); + if (this.id.length === 0) { + var proposedId = $(this).attr('toc-id'); + if (typeof(proposedId) != "undefined") this.id = proposedId; + else { + var proposedId = $(this).text().replace(/[^a-z0-9-]/ig, '_'); + if ($('#' + proposedId).length > 0) { proposedId += counter; counter++; } + this.id = proposedId; + } + } + if (thisTag > lastTag) { + for (i = 0; i < thisTag - lastTag; i++) { + if ( typeof(curli) == "undefined" ) { + curli = $('
        1. '); + toc.append(curli); + } + toc = $('
            '); + curli.append(toc); + curli = undefined; + } + } + if (thisTag < lastTag) { + for (i = 0; i < lastTag - thisTag; i++) { + toc = toc.parent(); + toc = toc.parent(); + } + } + var title = $(this).attr('toc-title'); + if (typeof(title) == "undefined") title = $(this).text(); + curli =$('
          1. ' + title + '
          2. '); + toc.append(curli); + lastTag = thisTag; + }); + if (!show) return; + html = ''; + $('#content').prepend(html); + $('#toc').append(_toc); + $('#toc .hide_toc').toggle(function() { + $('#toc .top').slideUp('fast'); + $('#toc').toggleClass('hidden'); + $('#toc .title small').toggle(); + }, function() { + $('#toc .top').slideDown('fast'); + $('#toc').toggleClass('hidden'); + $('#toc .title small').toggle(); + }); +} + +function navResizeFn(e) { + if (e.which !== 1) { + navResizeFnStop(); + return; + } + + sessionStorage.navWidth = e.pageX.toString(); + $('.nav_wrap').css('width', e.pageX); + $('.nav_wrap').css('-ms-flex', 'inherit'); +} + +function navResizeFnStop() { + $(window).unbind('mousemove', navResizeFn); + window.removeEventListener('message', navMessageFn, false); +} + +function navMessageFn(e) { + if (e.data.action === 'mousemove') navResizeFn(e.data.event); + if (e.data.action === 'mouseup') navResizeFnStop(); +} + +function navResizer() { + $('#resizer').mousedown(function(e) { + e.preventDefault(); + $(window).mousemove(navResizeFn); + window.addEventListener('message', navMessageFn, false); + }); + $(window).mouseup(navResizeFnStop); + + if (sessionStorage.navWidth) { + navResizeFn({which: 1, pageX: parseInt(sessionStorage.navWidth, 10)}); + } +} + +function navExpander() { + var done = false, timer = setTimeout(postMessage, 500); + function postMessage() { + if (done) return; + clearTimeout(timer); + var opts = { action: 'expand', path: pathId }; + document.getElementById('nav').contentWindow.postMessage(opts, '*'); + done = true; + } + + window.addEventListener('message', function(event) { + if (event.data === 'navReady') postMessage(); + return false; + }, false); +} + +function mainFocus() { + var hash = window.location.hash; + if (hash !== '' && $(hash)[0]) { + $(hash)[0].scrollIntoView(); + } + + setTimeout(function() { $('#main').focus(); }, 10); +} + +function navigationChange() { + // This works around the broken anchor navigation with the YARD template. + window.onpopstate = function() { + var hash = window.location.hash; + if (hash !== '' && $(hash)[0]) { + $(hash)[0].scrollIntoView(); + } + }; +} + +$(document).ready(function() { + navResizer(); + navExpander(); + createSourceLinks(); + createDefineLinks(); + createFullTreeLinks(); + searchFrameButtons(); + linkSummaries(); + summaryToggle(); + constantSummaryToggle(); + generateTOC(); + mainFocus(); + navigationChange(); +}); + +})(); diff --git a/docs/1.3/wcc-contentful-middleman/js/full_list.js b/docs/1.3/wcc-contentful-middleman/js/full_list.js new file mode 100644 index 00000000..59069c5e --- /dev/null +++ b/docs/1.3/wcc-contentful-middleman/js/full_list.js @@ -0,0 +1,216 @@ +(function() { + +var $clicked = $(null); +var searchTimeout = null; +var searchCache = []; +var caseSensitiveMatch = false; +var ignoreKeyCodeMin = 8; +var ignoreKeyCodeMax = 46; +var commandKey = 91; + +RegExp.escape = function(text) { + return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); +} + +function escapeShortcut() { + $(document).keydown(function(evt) { + if (evt.which == 27) { + window.parent.postMessage('navEscape', '*'); + } + }); +} + +function navResizer() { + $(window).mousemove(function(e) { + window.parent.postMessage({ + action: 'mousemove', event: {pageX: e.pageX, which: e.which} + }, '*'); + }).mouseup(function(e) { + window.parent.postMessage({action: 'mouseup'}, '*'); + }); + window.parent.postMessage("navReady", "*"); +} + +function clearSearchTimeout() { + clearTimeout(searchTimeout); + searchTimeout = null; +} + +function enableLinks() { + // load the target page in the parent window + $('#full_list li').on('click', function(evt) { + $('#full_list li').removeClass('clicked'); + $clicked = $(this); + $clicked.addClass('clicked'); + evt.stopPropagation(); + + if (evt.target.tagName === 'A') return true; + + var elem = $clicked.find('> .item .object_link a')[0]; + var e = evt.originalEvent; + var newEvent = new MouseEvent(evt.originalEvent.type); + newEvent.initMouseEvent(e.type, e.canBubble, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget); + elem.dispatchEvent(newEvent); + evt.preventDefault(); + return false; + }); +} + +function enableToggles() { + // show/hide nested classes on toggle click + $('#full_list a.toggle').on('click', function(evt) { + evt.stopPropagation(); + evt.preventDefault(); + $(this).parent().parent().toggleClass('collapsed'); + highlight(); + }); +} + +function populateSearchCache() { + $('#full_list li .item').each(function() { + var $node = $(this); + var $link = $node.find('.object_link a'); + if ($link.length > 0) { + searchCache.push({ + node: $node, + link: $link, + name: $link.text(), + fullName: $link.attr('title').split(' ')[0] + }); + } + }); +} + +function enableSearch() { + $('#search input').keyup(function(event) { + if (ignoredKeyPress(event)) return; + if (this.value === "") { + clearSearch(); + } else { + performSearch(this.value); + } + }); + + $('#full_list').after(""); +} + +function ignoredKeyPress(event) { + if ( + (event.keyCode > ignoreKeyCodeMin && event.keyCode < ignoreKeyCodeMax) || + (event.keyCode == commandKey) + ) { + return true; + } else { + return false; + } +} + +function clearSearch() { + clearSearchTimeout(); + $('#full_list .found').removeClass('found').each(function() { + var $link = $(this).find('.object_link a'); + $link.text($link.text()); + }); + $('#full_list, #content').removeClass('insearch'); + $clicked.parents().removeClass('collapsed'); + highlight(); +} + +function performSearch(searchString) { + clearSearchTimeout(); + $('#full_list, #content').addClass('insearch'); + $('#noresults').text('').hide(); + partialSearch(searchString, 0); +} + +function partialSearch(searchString, offset) { + var lastRowClass = ''; + var i = null; + for (i = offset; i < Math.min(offset + 50, searchCache.length); i++) { + var item = searchCache[i]; + var searchName = (searchString.indexOf('::') != -1 ? item.fullName : item.name); + var matchString = buildMatchString(searchString); + var matchRegexp = new RegExp(matchString, caseSensitiveMatch ? "" : "i"); + if (searchName.match(matchRegexp) == null) { + item.node.removeClass('found'); + item.link.text(item.link.text()); + } + else { + item.node.addClass('found'); + item.node.removeClass(lastRowClass).addClass(lastRowClass == 'r1' ? 'r2' : 'r1'); + lastRowClass = item.node.hasClass('r1') ? 'r1' : 'r2'; + item.link.html(item.name.replace(matchRegexp, "$&")); + } + } + if(i == searchCache.length) { + searchDone(); + } else { + searchTimeout = setTimeout(function() { + partialSearch(searchString, i); + }, 0); + } +} + +function searchDone() { + searchTimeout = null; + highlight(); + if ($('#full_list li:visible').size() === 0) { + $('#noresults').text('No results were found.').hide().fadeIn(); + } else { + $('#noresults').text('').hide(); + } + $('#content').removeClass('insearch'); +} + +function buildMatchString(searchString, event) { + caseSensitiveMatch = searchString.match(/[A-Z]/) != null; + var regexSearchString = RegExp.escape(searchString); + if (caseSensitiveMatch) { + regexSearchString += "|" + + $.map(searchString.split(''), function(e) { return RegExp.escape(e); }). + join('.+?'); + } + return regexSearchString; +} + +function highlight() { + $('#full_list li:visible').each(function(n) { + $(this).removeClass('even odd').addClass(n % 2 == 0 ? 'odd' : 'even'); + }); +} + +/** + * Expands the tree to the target element and its immediate + * children. + */ +function expandTo(path) { + var $target = $(document.getElementById('object_' + path)); + $target.addClass('clicked'); + $target.removeClass('collapsed'); + $target.parentsUntil('#full_list', 'li').removeClass('collapsed'); + if($target[0]) { + window.scrollTo(window.scrollX, $target.offset().top - 250); + highlight(); + } +} + +function windowEvents(event) { + var msg = event.data; + if (msg.action === "expand") { + expandTo(msg.path); + } + return false; +} + +window.addEventListener("message", windowEvents, false); + +$(document).ready(function() { + escapeShortcut(); + navResizer(); + enableLinks(); + enableToggles(); + populateSearchCache(); + enableSearch(); +}); + +})(); diff --git a/docs/1.3/wcc-contentful-middleman/js/jquery.js b/docs/1.3/wcc-contentful-middleman/js/jquery.js new file mode 100644 index 00000000..198b3ff0 --- /dev/null +++ b/docs/1.3/wcc-contentful-middleman/js/jquery.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.1 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
      a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
      "+""+"
      ",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
      t
      ",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
      ",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; +f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

      ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
      ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
      ","
      "],thead:[1,"","
      "],tr:[2,"","
      "],td:[3,"","
      "],col:[2,"","
      "],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
      ","
      "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() +{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
      ").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/docs/1.3/wcc-contentful-middleman/method_list.html b/docs/1.3/wcc-contentful-middleman/method_list.html new file mode 100644 index 00000000..2883df44 --- /dev/null +++ b/docs/1.3/wcc-contentful-middleman/method_list.html @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + Method List + + + +
      +
      +

      Method List

      + + + +
      + +
        + + +
      • +
        + #call + WCC::Contentful::Middleman::Extension::ContentfulSyncUpdate +
        +
      • + + +
      • +
        + #initialize + WCC::Contentful::Middleman::Extension +
        +
      • + + +
      • +
        + #initialize + WCC::Contentful::Middleman::Extension::ContentfulSyncUpdate +
        +
      • + + +
      • +
        + last_sync + WCC::Contentful::Middleman::Extension::ContentfulSyncUpdate +
        +
      • + + +
      • +
        + last_sync= + WCC::Contentful::Middleman::Extension::ContentfulSyncUpdate +
        +
      • + + +
      • +
        + #ready + WCC::Contentful::Middleman::Extension +
        +
      • + + + +
      +
      + + diff --git a/docs/1.3/wcc-contentful-middleman/top-level-namespace.html b/docs/1.3/wcc-contentful-middleman/top-level-namespace.html new file mode 100644 index 00000000..d920436e --- /dev/null +++ b/docs/1.3/wcc-contentful-middleman/top-level-namespace.html @@ -0,0 +1,110 @@ + + + + + + + Top Level Namespace + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Top Level Namespace + + + +

      +
      + + + + + + + + + + + +
      + +

      Defined Under Namespace

      +

      + + + Modules: WCC + + + + +

      + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC.html b/docs/1.3/wcc-contentful/WCC.html new file mode 100644 index 00000000..2a579d97 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC.html @@ -0,0 +1,115 @@ + + + + + + + Module: WCC + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/version.rb
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + Modules: Contentful + + + + +

      + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful.html b/docs/1.3/wcc-contentful/WCC/Contentful.html new file mode 100644 index 00000000..cd1323bd --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful.html @@ -0,0 +1,802 @@ + + + + + + + Module: WCC::Contentful + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC::Contentful + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful.rb,
      + lib/wcc/contentful/version.rb,
      lib/wcc/contentful/services.rb,
      lib/wcc/contentful/exceptions.rb,
      lib/wcc/contentful/sync_engine.rb,
      lib/wcc/contentful/model_builder.rb,
      lib/wcc/contentful/simple_client.rb,
      lib/wcc/contentful/instrumentation.rb,
      lib/wcc/contentful/content_type_indexer.rb,
      lib/wcc/contentful/indexed_representation.rb,
      app/jobs/wcc/contentful/webhook_enable_job.rb,
      app/controllers/wcc/contentful/webhook_controller.rb,
      app/controllers/wcc/contentful/application_controller.rb,
      lib/wcc/contentful/engine.rb
      +
      +
      + +
      + +

      Overview

      +
      + +

      The root namespace of the wcc-contentful gem

      + +

      Initialize the gem with the `configure` and `init` methods inside your initializer.

      + + +
      +
      +
      + + +

      Defined Under Namespace

      +

      + + + Modules: ActiveRecordShim, Event, Helpers, Instrumentation, Middleware, ModelAPI, ModelMethods, ModelSingletonMethods, RSpec, RichText, ServiceAccessors, Store, Test + + + + Classes: ApplicationController, CircularReferenceError, Configuration, ContentTypeIndexer, ContentTypeNotFoundError, DownloadsSchema, Engine, Events, IndexedRepresentation, InitializationError, Link, LinkVisitor, Model, ModelBuilder, ResolveError, Services, SimpleClient, SyncEngine, SyncError, WebhookController, WebhookEnableJob + + +

      + + +

      + Constant Summary + collapse +

      + +
      + +
      VERSION = + +
      +
      '1.3.0'
      + +
      SERVICES = + +
      +
      WCC::Contentful::Services.instance_methods(false)
      +.select { |m| WCC::Contentful::Services.instance_method(m).arity == 0 }
      + +
      + + + + + +

      Class Attribute Summary collapse

      +
        + +
      • + + + .configuration ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
        +

        Gets the current configuration, after calling WCC::Contentful.configure.

        +
        + +
      • + + +
      • + + + .initialized ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
        +

        Returns the value of attribute initialized.

        +
        + +
      • + + +
      + + + + + +

      + Class Method Summary + collapse +

      + + + + + +
      +

      Class Attribute Details

      + + + +
      +

      + + .configurationObject (readonly) + + + + + +

      +
      + +

      Gets the current configuration, after calling WCC::Contentful.configure

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +35
      +36
      +37
      +
      +
      # File 'lib/wcc/contentful.rb', line 35
      +
      +def configuration
      +  @configuration
      +end
      +
      + + + + +
      +

      + + .initializedObject (readonly) + + + + + +

      +
      + +

      Returns the value of attribute initialized.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +32
      +33
      +34
      +
      +
      # File 'lib/wcc/contentful.rb', line 32
      +
      +def initialized
      +  @initialized
      +end
      +
      +
      + + + + +
      +

      Class Method Details

      + + +
      +

      + + .configure {|configuration| ... } ⇒ Object + + + + + +

      +
      + +

      Configures the WCC::Contentful gem to talk to a Contentful space. This must be called first in your initializer, before #init! or accessing the client. See WCC::Contentful::Configuration for all configuration options.

      + + +
      +
      +
      + +

      Yields:

      + +

      Raises:

      + + +
      + + + + +
      +
      +
      +
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +
      +
      # File 'lib/wcc/contentful.rb', line 58
      +
      +def self.configure
      +  raise InitializationError, 'Cannot configure after initialization' if @initialized
      +
      +  @configuration ||= Configuration.new
      +  yield(configuration)
      +
      +  configuration.validate!
      +
      +  configuration
      +end
      +
      +
      + +
      +

      + + .init!Object + + + + + +

      +
      + +

      Initializes the WCC::Contentful model-space and backing store. This populates the WCC::Contentful::Model namespace with Ruby classes that represent content types in the configured Contentful space.

      + +

      These content types can be queried directly:

      + +
      WCC::Contentful::Model::Page.find('1xab...')
      +
      + +

      Or you can inherit from them in your own app:

      + +
      class Page < WCC::Contentful::Model::Page; end
      +Page.find_by(slug: 'about-us')
      +
      + + +
      +
      +
      + +

      Raises:

      + + +
      + + + + +
      +
      +
      +
      +78
      +79
      +80
      +81
      +82
      +83
      +84
      +85
      +86
      +87
      +88
      +89
      +90
      +91
      +92
      +93
      +94
      +95
      +96
      +97
      +98
      +99
      +100
      +101
      +102
      +103
      +104
      +105
      +106
      +107
      +108
      +109
      +110
      +111
      +112
      +113
      +114
      +115
      +116
      +117
      +118
      +119
      +120
      +121
      +122
      +123
      +124
      +125
      +126
      +127
      +128
      +129
      +130
      +131
      +132
      +133
      +134
      +135
      +
      +
      # File 'lib/wcc/contentful.rb', line 78
      +
      +def self.init!
      +  raise InitializationError, 'Please first call WCC:Contentful.configure' if configuration.nil?
      +  raise InitializationError, 'Already Initialized' if @initialized
      +
      +  if configuration.update_schema_file == :always ||
      +      (configuration.update_schema_file == :if_possible && Services.instance.management_client) ||
      +      (configuration.update_schema_file == :if_missing && !File.exist?(configuration.schema_file))
      +
      +    begin
      +      downloader = WCC::Contentful::DownloadsSchema.new
      +      downloader.update! if configuration.update_schema_file == :always || downloader.needs_update?
      +    rescue WCC::Contentful::SimpleClient::ApiError => e
      +      raise InitializationError, e if configuration.update_schema_file == :always
      +
      +      Services.instance.logger.warn("Unable to download schema from management API - #{e.message}")
      +    end
      +  end
      +
      +  content_types =
      +    begin
      +      JSON.parse(File.read(configuration.schema_file))['contentTypes'] if File.exist?(configuration.schema_file)
      +    rescue JSON::ParserError
      +      Services.instance.warn("Schema file invalid, ignoring it: #{configuration.schema_file}")
      +      nil
      +    end
      +
      +  if !content_types && %i[if_possible never].include?(configuration.update_schema_file)
      +    # Final fallback - try to grab content types from CDN.  We can't update the file
      +    # because the CDN doesn't have all the field validation info, but we can at least
      +    # build the WCC::Contentful::Model instances.
      +    client = Services.instance.management_client ||
      +      Services.instance.client
      +    begin
      +      content_types = client.content_types(limit: 1000).items if client
      +    rescue WCC::Contentful::SimpleClient::ApiError => e
      +      # indicates bad credentials
      +      Services.instance.logger.warn("Unable to load content types from API - #{e.message}")
      +    end
      +  end
      +
      +  unless content_types
      +    raise InitializationError, 'Unable to load content types from schema file or API! ' \
      +                               'Check your access token and space ID.'
      +  end
      +
      +  # Set the schema on the default WCC::Contentful::Model
      +  WCC::Contentful::Model.configure(
      +    configuration,
      +    schema: WCC::Contentful::ContentTypeIndexer.from_json_schema(content_types).types,
      +    services: WCC::Contentful::Services.instance
      +  )
      +
      +  # Drop an initial sync
      +  WCC::Contentful::SyncEngine::Job.perform_later if defined?(WCC::Contentful::SyncEngine::Job)
      +
      +  @configuration = @configuration.freeze
      +  @initialized = true
      +end
      +
      +
      + +
      +

      + + .localesObject + + + + + +

      +
      + +

      Gets all queryable locales. Reserved for future use.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +44
      +45
      +46
      +
      +
      # File 'lib/wcc/contentful.rb', line 44
      +
      +def locales
      +  @locales ||= { 'en-US' => {} }.freeze
      +end
      +
      +
      + +
      +

      + + .loggerObject + + + + + +

      + + + + +
      +
      +
      +
      +48
      +49
      +50
      +51
      +
      +
      # File 'lib/wcc/contentful.rb', line 48
      +
      +def logger
      +  ActiveSupport::Deprecation.warn('Use WCC::Contentful::Services.instance.logger instead')
      +  WCC::Contentful::Services.instance.logger
      +end
      +
      +
      + +
      +

      + + .typesObject + + + + + +

      + + + + +
      +
      +
      +
      +37
      +38
      +39
      +40
      +
      +
      # File 'lib/wcc/contentful.rb', line 37
      +
      +def types
      +  ActiveSupport::Deprecation.warn('Use WCC::Contentful::Model.schema instead')
      +  WCC::Contentful::Model.schema
      +end
      +
      +
      + +
      + + + + + + + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/ActiveRecordShim.html b/docs/1.3/wcc-contentful/WCC/Contentful/ActiveRecordShim.html new file mode 100644 index 00000000..1ccf6516 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/ActiveRecordShim.html @@ -0,0 +1,392 @@ + + + + + + + Module: WCC::Contentful::ActiveRecordShim + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC::Contentful::ActiveRecordShim + + + +

      +
      + + + + +
      +
      Extended by:
      +
      ActiveSupport::Concern
      +
      + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/active_record_shim.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #attributesObject + + + + + +

      + + + + +
      +
      +
      +
      +6
      +7
      +8
      +
      +
      # File 'lib/wcc/contentful/active_record_shim.rb', line 6
      +
      +def attributes
      +  @attributes ||= to_h['fields'].tap { |fields| fields['id'] = id }
      +end
      +
      +
      + +
      +

      + + #cache_keyObject + + + + + +

      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +13
      +14
      +
      +
      # File 'lib/wcc/contentful/active_record_shim.rb', line 10
      +
      +def cache_key
      +  return cache_key_with_version unless ActiveRecord::Base.try(:cache_versioning) == true
      +
      +  "#{self.class.model_name}/#{id}"
      +end
      +
      +
      + +
      +

      + + #cache_key_with_versionObject + + + + + +

      + + + + +
      +
      +
      +
      +16
      +17
      +18
      +
      +
      # File 'lib/wcc/contentful/active_record_shim.rb', line 16
      +
      +def cache_key_with_version
      +  "#{cache_key_without_version}-#{cache_version}"
      +end
      +
      +
      + +
      +

      + + #cache_key_without_versionObject + + + + + +

      + + + + +
      +
      +
      +
      +20
      +21
      +22
      +
      +
      # File 'lib/wcc/contentful/active_record_shim.rb', line 20
      +
      +def cache_key_without_version
      +  "#{self.class.model_name}/#{id}"
      +end
      +
      +
      + +
      +

      + + #cache_versionObject + + + + + +

      + + + + +
      +
      +
      +
      +24
      +25
      +26
      +
      +
      # File 'lib/wcc/contentful/active_record_shim.rb', line 24
      +
      +def cache_version
      +  sys.revision.to_s
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/ApplicationController.html b/docs/1.3/wcc-contentful/WCC/Contentful/ApplicationController.html new file mode 100644 index 00000000..f7272516 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/ApplicationController.html @@ -0,0 +1,128 @@ + + + + + + + Class: WCC::Contentful::ApplicationController + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::ApplicationController + + + +

      +
      + +
      +
      Inherits:
      +
      + ActionController::Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      app/controllers/wcc/contentful/application_controller.rb
      +
      + +
      + +
      +

      Direct Known Subclasses

      +

      WebhookController

      +
      + + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/CircularReferenceError.html b/docs/1.3/wcc-contentful/WCC/Contentful/CircularReferenceError.html new file mode 100644 index 00000000..056f8804 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/CircularReferenceError.html @@ -0,0 +1,441 @@ + + + + + + + Exception: WCC::Contentful::CircularReferenceError + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: WCC::Contentful::CircularReferenceError + + + +

      +
      + +
      +
      Inherits:
      +
      + StandardError + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/exceptions.rb
      +
      + +
      + +

      Overview

      +
      + +

      Raised when an entry contains a circular reference and cannot be represented as a flat tree.

      + + +
      +
      +
      + + +
      + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #id ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
        +

        Returns the value of attribute id.

        +
        + +
      • + + +
      • + + + #stack ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
        +

        Returns the value of attribute stack.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(stack, id) ⇒ CircularReferenceError + + + + + +

      +
      + +

      Returns a new instance of CircularReferenceError.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +17
      +18
      +19
      +20
      +21
      +
      +
      # File 'lib/wcc/contentful/exceptions.rb', line 17
      +
      +def initialize(stack, id)
      +  @id = id
      +  @stack = stack.slice(stack.index(id)..stack.length)
      +  super('Circular reference detected!')
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #idObject (readonly) + + + + + +

      +
      + +

      Returns the value of attribute id.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +15
      +16
      +17
      +
      +
      # File 'lib/wcc/contentful/exceptions.rb', line 15
      +
      +def id
      +  @id
      +end
      +
      +
      + + + +
      +

      + + #stackObject (readonly) + + + + + +

      +
      + +

      Returns the value of attribute stack.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +15
      +16
      +17
      +
      +
      # File 'lib/wcc/contentful/exceptions.rb', line 15
      +
      +def stack
      +  @stack
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #messageObject + + + + + +

      + + + + +
      +
      +
      +
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +
      +
      # File 'lib/wcc/contentful/exceptions.rb', line 23
      +
      +def message
      +  return super unless stack
      +
      +  super + "\n  " \
      +          "#{stack.last} points to #{id} which is also it's ancestor\n  " +
      +    stack.join('->')
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Configuration.html b/docs/1.3/wcc-contentful/WCC/Contentful/Configuration.html new file mode 100644 index 00000000..5f38bde6 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Configuration.html @@ -0,0 +1,2117 @@ + + + + + + + Class: WCC::Contentful::Configuration + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Configuration + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/configuration.rb
      +
      + +
      + +

      Overview

      +
      + +

      This object contains all the configuration options for the `wcc-contentful` gem.

      + + +
      +
      +
      + + +

      Defined Under Namespace

      +

      + + + + + Classes: FrozenConfiguration + + +

      + + +

      + Constant Summary + collapse +

      + +
      + +
      ATTRIBUTES = + +
      +
      %i[
      +  access_token
      +  app_url
      +  connection
      +  connection_options
      +  default_locale
      +  environment
      +  instrumentation_adapter
      +  logger
      +  management_token
      +  preview_token
      +  schema_file
      +  space
      +  store
      +  sync_retry_limit
      +  sync_retry_wait
      +  update_schema_file
      +  webhook_jobs
      +  webhook_password
      +  webhook_username
      +].freeze
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #access_token ⇒ Object + + + + + + + + + + + + + + + + +
        +

        (required) Sets the Content Delivery API access token.

        +
        + +
      • + + +
      • + + + #app_url ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Sets the app's root URL for a Rails app.

        +
        + +
      • + + +
      • + + + #connection ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Sets the connection which is used to make HTTP requests.

        +
        + +
      • + + +
      • + + + #connection_options ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Sets the connection options which are given to the client.

        +
        + +
      • + + +
      • + + + #default_locale ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Sets the default locale.

        +
        + +
      • + + +
      • + + + #environment ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Sets the Environment ID.

        +
        + +
      • + + +
      • + + + #instrumentation_adapter ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Overrides the use of ActiveSupport::Notifications throughout this library to emit instrumentation events.

        +
        + +
      • + + +
      • + + + #logger ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Sets the logger to be used by the wcc-contentful gem, including stores.

        +
        + +
      • + + +
      • + + + #management_token ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Sets the Content Management Token used to communicate with the Management API.

        +
        + +
      • + + +
      • + + + #preview_token ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Sets the Content Preview API access token.

        +
        + +
      • + + +
      • + + + #schema_file ⇒ Object + + + + + + + + + + + + + + + + +
        + +
      • + + +
      • + + + #space ⇒ Object + + + + + + + + + + + + + + + + +
        +

        (required) Sets the Contentful Space ID.

        +
        + +
      • + + +
      • + + + #store_factory ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
        +

        Explicitly read the store factory.

        +
        + +
      • + + +
      • + + + #sync_retry_limit ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Sets the maximum number of times that the SyncEngine will retry synchronization when it detects that the Contentful CDN's cache has not been updated after a webhook.

        +
        + +
      • + + +
      • + + + #sync_retry_wait ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Sets the base ActiveSupport::Duration that the SyncEngine will wait before retrying.

        +
        + +
      • + + +
      • + + + #update_schema_file ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute update_schema_file.

        +
        + +
      • + + +
      • + + + #webhook_jobs ⇒ Object + + + + + + + + + + + + + + + + +
        +

        An array of jobs that are run whenever a webhook is received by the webhook controller.

        +
        + +
      • + + +
      • + + + #webhook_password ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Sets an optional basic auth password that will be validated by the webhook controller.

        +
        + +
      • + + +
      • + + + #webhook_username ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Sets an optional basic auth username that will be validated by the webhook controller.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initializeConfiguration + + + + + +

      +
      + +

      Returns a new instance of Configuration.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +191
      +192
      +193
      +194
      +195
      +196
      +197
      +198
      +199
      +200
      +201
      +202
      +203
      +204
      +205
      +206
      +207
      +208
      +209
      +210
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 191
      +
      +def initialize
      +  @access_token = ENV.fetch('CONTENTFUL_ACCESS_TOKEN', nil)
      +  @app_url = ENV.fetch('APP_URL', nil)
      +  @connection_options = {
      +    api_url: 'https://cdn.contentful.com/',
      +    preview_api_url: 'https://preview.contentful.com/',
      +    management_api_url: 'https://api.contentful.com'
      +  }
      +  @management_token = ENV.fetch('CONTENTFUL_MANAGEMENT_TOKEN', nil)
      +  @preview_token = ENV.fetch('CONTENTFUL_PREVIEW_TOKEN', nil)
      +  @space = ENV.fetch('CONTENTFUL_SPACE_ID', nil)
      +  @default_locale = nil
      +  @middleware = []
      +  @update_schema_file = :if_possible
      +  @schema_file = 'db/contentful-schema.json'
      +  @webhook_jobs = []
      +  @store_factory = WCC::Contentful::Store::Factory.new(self, :direct)
      +  @sync_retry_limit = 3
      +  @sync_retry_wait = 1.second
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #access_tokenObject + + + + + +

      +
      + +

      (required) Sets the Content Delivery API access token.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +30
      +31
      +32
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 30
      +
      +def access_token
      +  @access_token
      +end
      +
      +
      + + + +
      +

      + + #app_urlObject + + + + + +

      +
      + +

      Sets the app's root URL for a Rails app. Used by the WCC::Contentful::Engine to automatically set up webhooks to point at the WCC::Contentful::WebhookController

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +34
      +35
      +36
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 34
      +
      +def app_url
      +  @app_url
      +end
      +
      +
      + + + +
      +

      + + #connectionObject + + + + + +

      +
      + +

      Sets the connection which is used to make HTTP requests. If left unset, the gem attempts to load 'faraday' or 'typhoeus'. You can pass your own adapter which responds to 'get' and 'post', and returns a response that quacks like Faraday.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +134
      +135
      +136
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 134
      +
      +def connection
      +  @connection
      +end
      +
      +
      + + + +
      +

      + + #connection_optionsObject + + + + + +

      +
      + +

      Sets the connection options which are given to the client. This can include an alternative Cdn API URL, timeouts, etc. See WCC::Contentful::SimpleClient constructor for details.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +139
      +140
      +141
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 139
      +
      +def connection_options
      +  @connection_options
      +end
      +
      +
      + + + +
      +

      + + #default_localeObject + + + + + +

      +
      + +

      Sets the default locale. Defaults to 'en-US'.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +42
      +43
      +44
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 42
      +
      +def default_locale
      +  @default_locale
      +end
      +
      +
      + + + +
      +

      + + #environmentObject + + + + + +

      +
      + +

      Sets the Environment ID. Leave blank to use master.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +40
      +41
      +42
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 40
      +
      +def environment
      +  @environment
      +end
      +
      +
      + + + +
      +

      + + #instrumentation_adapterObject + + + + + +

      +
      + +

      Overrides the use of ActiveSupport::Notifications throughout this library to emit instrumentation events. The object or module provided here must respond to :instrument like ActiveSupport::Notifications.instrument

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +184
      +185
      +186
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 184
      +
      +def instrumentation_adapter
      +  @instrumentation_adapter
      +end
      +
      +
      + + + +
      +

      + + #loggerObject + + + + + +

      +
      + +

      Sets the logger to be used by the wcc-contentful gem, including stores. Defaults to the rails logger if in a rails context, otherwise creates a new logger that writes to STDERR.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +189
      +190
      +191
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 189
      +
      +def logger
      +  @logger
      +end
      +
      +
      + + + +
      +

      + + #management_tokenObject + + + + + +

      +
      + +

      Sets the Content Management Token used to communicate with the Management API. This is required for automatically setting up webhooks, and to create the WCC::Contentful::Services#management_client.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +38
      +39
      +40
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 38
      +
      +def management_token
      +  @management_token
      +end
      +
      +
      + + + +
      +

      + + #preview_tokenObject + + + + + +

      +
      + +

      Sets the Content Preview API access token. Only required if you use the preview flag.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +45
      +46
      +47
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 45
      +
      +def preview_token
      +  @preview_token
      +end
      +
      +
      + + + +
      +

      + + #schema_fileObject + + + + + +

      + + + + +
      +
      +
      +
      +173
      +174
      +175
      +176
      +177
      +178
      +179
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 173
      +
      +def schema_file
      +  if defined?(Rails)
      +    Rails.root.join(@schema_file)
      +  else
      +    @schema_file
      +  end
      +end
      +
      +
      + + + +
      +

      + + #spaceObject + + + + + +

      +
      + +

      (required) Sets the Contentful Space ID.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +28
      +29
      +30
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 28
      +
      +def space
      +  @space
      +end
      +
      +
      + + + +
      +

      + + #store_factoryObject (readonly) + + + + + +

      +
      + +

      Explicitly read the store factory

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +128
      +129
      +130
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 128
      +
      +def store_factory
      +  @store_factory
      +end
      +
      +
      + + + +
      +

      + + #sync_retry_limitObject + + + + + +

      +
      + +

      Sets the maximum number of times that the SyncEngine will retry synchronization when it detects that the Contentful CDN's cache has not been updated after a webhook. Default: 2

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +66
      +67
      +68
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 66
      +
      +def sync_retry_limit
      +  @sync_retry_limit
      +end
      +
      +
      + + + +
      +

      + + #sync_retry_waitObject + + + + + +

      +
      + +

      Sets the base ActiveSupport::Duration that the SyncEngine will wait before retrying. Each subsequent retry uses an exponential backoff, so the second retry will be after (2 * sync_retry_wait), the third after (4 * sync_retry_wait), etc. Default: 2.seconds

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +72
      +73
      +74
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 72
      +
      +def sync_retry_wait
      +  @sync_retry_wait
      +end
      +
      +
      + + + +
      +

      + + #update_schema_fileObject + + + + + +

      +
      + +

      Returns the value of attribute update_schema_file.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +166
      +167
      +168
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 166
      +
      +def update_schema_file
      +  @update_schema_file
      +end
      +
      +
      + + + +
      +

      + + #webhook_jobsObject + + + + + +

      +
      + +

      An array of jobs that are run whenever a webhook is received by the webhook controller. The job can be an ActiveJob class which responds to `:perform_later`, or a lambda or other object that responds to `:call`. Example:

      + +
      config.webhook_jobs << MyJobClass
      +config.webhook_jobs << ->(event) { ... }
      +
      + +

      See the source code for WCC::Contentful::SyncEngine::Job for an example of how to implement a webhook job.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +61
      +62
      +63
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 61
      +
      +def webhook_jobs
      +  @webhook_jobs
      +end
      +
      +
      + + + +
      +

      + + #webhook_passwordObject + + + + + +

      +
      + +

      Sets an optional basic auth password that will be validated by the webhook controller. You must ensure the configured webhook sets the “HTTP Basic Auth password”

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +51
      +52
      +53
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 51
      +
      +def webhook_password
      +  @webhook_password
      +end
      +
      +
      + + + +
      +

      + + #webhook_usernameObject + + + + + +

      +
      + +

      Sets an optional basic auth username that will be validated by the webhook controller. You must ensure the configured webhook sets the “HTTP Basic Auth username”

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +48
      +49
      +50
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 48
      +
      +def webhook_username
      +  @webhook_username
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #freezeObject + + + + + +

      + + + + +
      +
      +
      +
      +235
      +236
      +237
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 235
      +
      +def freeze
      +  FrozenConfiguration.new(self)
      +end
      +
      +
      + +
      +

      + + #frozen?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +231
      +232
      +233
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 231
      +
      +def frozen?
      +  false
      +end
      +
      +
      + +
      +

      + + #master?Boolean + + + + + +

      +
      + +

      Returns true if the currently configured environment is pointing at `master`.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +75
      +76
      +77
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 75
      +
      +def master?
      +  !environment.present?
      +end
      +
      +
      + +
      +

      + + #store(*params, &block) ⇒ Object + + + + + +

      +
      + +

      Defines the method by which content is downloaded from the Contentful CDN.

      +
      :direct +
      +

      `config.store :direct` with the `:direct` method, all queries result in web requests to 'cdn.contentful.com' via the SimpleClient

      +
      :eager_sync +
      +

      `config.store :eager_sync, [sync_store], [options]` with the `:eager_sync` method, the entire content of the Contentful space is downloaded locally and stored in the configured store. The application is responsible to periodically call the WCC::Contentful::SyncEngine#next to keep the store updated. Alternatively, the provided Engine can be mounted to automatically call WCC::Contentful::SyncEngine#next on webhook events. In `routes.rb` add the following:

      + +
      mount WCC::Contentful::Engine, at: '/'
      +
      +
      :lazy_sync +
      +

      `config.store :lazy_sync, [cache]` The `:lazy_sync` method is a hybrid between the other two methods. Frequently accessed data is stored in an ActiveSupport::Cache implementation and is kept up-to-date via the Sync API. Any data that is not present in the cache is fetched from the CDN like in the `:direct` method. The application is still responsible to periodically call `sync!` or to mount the provided Engine.

      +
      :custom +
      +

      `config.store :custom, do … end` The block is executed in the context of a WCC::Contentful::Store::Factory. this can be used to apply middleware, etc.

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +108
      +109
      +110
      +111
      +112
      +113
      +114
      +115
      +116
      +117
      +118
      +119
      +120
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 108
      +
      +def store(*params, &block)
      +  type, *params = params
      +  if type
      +    @store_factory = WCC::Contentful::Store::Factory.new(
      +      self,
      +      type,
      +      params
      +    )
      +  end
      +
      +  @store_factory.instance_exec(&block) if block_given?
      +  @store_factory
      +end
      +
      +
      + +
      +

      + + #store=(param_array) ⇒ Object + + + + + +

      +
      + +

      Convenience for setting store without a block

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +123
      +124
      +125
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 123
      +
      +def store=(param_array)
      +  store(*param_array)
      +end
      +
      +
      + +
      +

      + + #validate!Object + + + + + +

      +
      + +

      Validates the configuration, raising ArgumentError if anything is wrong. This is called by WCC::Contentful.init!

      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (ArgumentError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +214
      +215
      +216
      +217
      +218
      +219
      +220
      +221
      +222
      +223
      +224
      +225
      +226
      +227
      +228
      +229
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 214
      +
      +def validate!
      +  raise ArgumentError, 'Please provide "space"' unless space.present?
      +  raise ArgumentError, 'Please provide "access_token"' unless access_token.present?
      +
      +  store_factory.validate!
      +
      +  if update_schema_file == :always && management_token.blank?
      +    raise ArgumentError, 'A management_token is required in order to update the schema file.'
      +  end
      +
      +  webhook_jobs.each do |job|
      +    next if job.respond_to?(:call) || job.respond_to?(:perform_later)
      +
      +    raise ArgumentError, "The job '#{job}' must be an instance of ActiveJob::Base or respond to :call"
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Configuration/FrozenConfiguration.html b/docs/1.3/wcc-contentful/WCC/Contentful/Configuration/FrozenConfiguration.html new file mode 100644 index 00000000..8064d587 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Configuration/FrozenConfiguration.html @@ -0,0 +1,369 @@ + + + + + + + Class: WCC::Contentful::Configuration::FrozenConfiguration + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Configuration::FrozenConfiguration + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/configuration.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(configuration) ⇒ FrozenConfiguration + + + + + +

      +
      + +

      Returns a new instance of FrozenConfiguration.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +242
      +243
      +244
      +245
      +246
      +247
      +248
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 242
      +
      +def initialize(configuration)
      +  ATTRIBUTES.each do |att|
      +    val = configuration.public_send(att)
      +    val.freeze if val.is_a?(Hash) || val.is_a?(Array)
      +    instance_variable_set("@#{att}", val)
      +  end
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #frozen?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +255
      +256
      +257
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 255
      +
      +def frozen?
      +  true
      +end
      +
      +
      + +
      +

      + + #master?Boolean + + + + + +

      +
      + +

      Returns true if the currently configured environment is pointing at `master`.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +251
      +252
      +253
      +
      +
      # File 'lib/wcc/contentful/configuration.rb', line 251
      +
      +def master?
      +  !environment.present?
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/ContentTypeIndexer.html b/docs/1.3/wcc-contentful/WCC/Contentful/ContentTypeIndexer.html new file mode 100644 index 00000000..42d08ed6 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/ContentTypeIndexer.html @@ -0,0 +1,657 @@ + + + + + + + Class: WCC::Contentful::ContentTypeIndexer + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::ContentTypeIndexer + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Helpers
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/content_type_indexer.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #types ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
        +

        Returns the value of attribute types.

        +
        + +
      • + + +
      + + + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + +

      Methods included from Helpers

      +

      #constant_from_content_type, #content_type_from_constant, #content_type_from_raw, #shared_prefix

      +
      +

      Constructor Details

      + +
      +

      + + #initializeContentTypeIndexer + + + + + +

      +
      + +

      Returns a new instance of ContentTypeIndexer.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +25
      +26
      +27
      +28
      +29
      +
      +
      # File 'lib/wcc/contentful/content_type_indexer.rb', line 25
      +
      +def initialize
      +  @types = IndexedRepresentation.new({
      +    'Asset' => create_asset_type
      +  })
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #typesObject (readonly) + + + + + +

      +
      + +

      Returns the value of attribute types.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +23
      +24
      +25
      +
      +
      # File 'lib/wcc/contentful/content_type_indexer.rb', line 23
      +
      +def types
      +  @types
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .from_json_schema(schema) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +16
      +17
      +18
      +19
      +20
      +
      +
      # File 'lib/wcc/contentful/content_type_indexer.rb', line 16
      +
      +def from_json_schema(schema)
      +  new.tap do |ixr|
      +    schema.each { |type| ixr.index(type) }
      +  end
      +end
      +
      +
      + +
      +

      + + .load(schema_file) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +13
      +14
      +
      +
      # File 'lib/wcc/contentful/content_type_indexer.rb', line 10
      +
      +def load(schema_file)
      +  from_json_schema(
      +    JSON.parse(File.read(schema_file))['contentTypes']
      +  )
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #create_asset_typeObject + + + + + +

      +
      + +

      hardcoded because the Asset type is a “magic type” in their system

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +
      +
      # File 'lib/wcc/contentful/content_type_indexer.rb', line 57
      +
      +def create_asset_type
      +  IndexedRepresentation::ContentType.new({
      +    name: 'Asset',
      +    content_type: 'Asset',
      +    fields: {
      +      'title' => { name: 'title', type: :String },
      +      'description' => { name: 'description', type: :String },
      +      'file' => { name: 'file', type: :Json }
      +    }
      +  })
      +end
      +
      +
      + +
      +

      + + #create_type(content_type_id, fields) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +
      +
      # File 'lib/wcc/contentful/content_type_indexer.rb', line 42
      +
      +def create_type(content_type_id, fields)
      +  content_type = IndexedRepresentation::ContentType.new({
      +    name: constant_from_content_type(content_type_id),
      +    content_type: content_type_id
      +  })
      +
      +  fields.each do |f|
      +    field = create_field(f)
      +    content_type.fields[field.name] = field
      +  end
      +
      +  content_type
      +end
      +
      +
      + +
      +

      + + #index(content_type) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +
      +
      # File 'lib/wcc/contentful/content_type_indexer.rb', line 31
      +
      +def index(content_type)
      +  content_type =
      +    if content_type.respond_to?(:fields)
      +      create_type(content_type.id, content_type.fields)
      +    else
      +      create_type(content_type.dig('sys', 'id'), content_type['fields'])
      +    end
      +
      +  @types[content_type.content_type] = content_type
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/ContentTypeNotFoundError.html b/docs/1.3/wcc-contentful/WCC/Contentful/ContentTypeNotFoundError.html new file mode 100644 index 00000000..b10cec7c --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/ContentTypeNotFoundError.html @@ -0,0 +1,135 @@ + + + + + + + Exception: WCC::Contentful::ContentTypeNotFoundError + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: WCC::Contentful::ContentTypeNotFoundError + + + +

      +
      + +
      +
      Inherits:
      +
      + NameError + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/exceptions.rb
      +
      + +
      + +

      Overview

      +
      + +

      Raised when a constant under Model does not match to a content type in the configured Contentful space

      + + +
      +
      +
      + + +
      + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/DownloadsSchema.html b/docs/1.3/wcc-contentful/WCC/Contentful/DownloadsSchema.html new file mode 100644 index 00000000..0b52e40b --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/DownloadsSchema.html @@ -0,0 +1,639 @@ + + + + + + + Class: WCC::Contentful::DownloadsSchema + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::DownloadsSchema + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/downloads_schema.rb
      +
      + +
      + + + + + + + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(file = nil, management_client: nil) ⇒ DownloadsSchema + + + + + +

      +
      + +

      Returns a new instance of DownloadsSchema.

      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (ArgumentError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +13
      +14
      +15
      +
      +
      # File 'lib/wcc/contentful/downloads_schema.rb', line 10
      +
      +def initialize(file = nil, management_client: nil)
      +  @client = management_client || WCC::Contentful::Services.instance.management_client
      +  @file = file || WCC::Contentful.configuration&.schema_file
      +  raise ArgumentError, 'Please configure your management token' unless @client
      +  raise ArgumentError, 'Please pass filename or call WCC::Contentful.configure' unless @file
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .call(file = nil, management_client: nil) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +6
      +7
      +8
      +
      +
      # File 'lib/wcc/contentful/downloads_schema.rb', line 6
      +
      +def self.call(file = nil, management_client: nil)
      +  new(file, management_client: management_client).call
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #callObject + + + + + +

      + + + + +
      +
      +
      +
      +17
      +18
      +19
      +20
      +21
      +
      +
      # File 'lib/wcc/contentful/downloads_schema.rb', line 17
      +
      +def call
      +  return unless needs_update?
      +
      +  update!
      +end
      +
      +
      + +
      +

      + + #content_typesObject + + + + + +

      + + + + +
      +
      +
      +
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +
      +
      # File 'lib/wcc/contentful/downloads_schema.rb', line 52
      +
      +def content_types
      +  @content_types ||=
      +    @client.content_types(limit: 1000)
      +      .items
      +      .map { |ct| strip_sys(ct) }
      +      .sort_by { |ct| ct.dig('sys', 'id') }
      +end
      +
      +
      + +
      +

      + + #editor_interfacesObject + + + + + +

      + + + + +
      +
      +
      +
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +
      +
      # File 'lib/wcc/contentful/downloads_schema.rb', line 60
      +
      +def editor_interfaces
      +  @editor_interfaces ||=
      +    content_types
      +      .map { |ct| @client.editor_interface(ct.dig('sys', 'id')).raw }
      +      .map { |i| sort_controls(strip_sys(i)) }
      +      .sort_by { |i| i.dig('sys', 'contentType', 'sys', 'id') }
      +end
      +
      +
      + +
      +

      + + #needs_update?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +
      +
      # File 'lib/wcc/contentful/downloads_schema.rb', line 32
      +
      +def needs_update?
      +  return true unless File.exist?(@file)
      +
      +  contents =
      +    begin
      +      JSON.parse(File.read(@file))
      +    rescue JSON::ParserError
      +      return true # rubocop:disable Lint/NoReturnInBeginEndBlocks
      +    end
      +
      +  existing_cts = contents['contentTypes'].sort_by { |ct| ct.dig('sys', 'id') }
      +  return true unless content_types.count == existing_cts.count
      +  return true unless deep_contains_all(content_types, existing_cts)
      +
      +  existing_eis = contents['editorInterfaces'].sort_by { |i| i.dig('sys', 'contentType', 'sys', 'id') }
      +  return true unless editor_interfaces.count == existing_eis.count
      +
      +  !deep_contains_all(editor_interfaces, existing_eis)
      +end
      +
      +
      + +
      +

      + + #update!Object + + + + + +

      + + + + +
      +
      +
      +
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +
      +
      # File 'lib/wcc/contentful/downloads_schema.rb', line 23
      +
      +def update!
      +  FileUtils.mkdir_p(File.dirname(@file))
      +
      +  File.write(@file, format_json({
      +    'contentTypes' => content_types,
      +    'editorInterfaces' => editor_interfaces
      +  }))
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Engine.html b/docs/1.3/wcc-contentful/WCC/Contentful/Engine.html new file mode 100644 index 00000000..4462f82a --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Engine.html @@ -0,0 +1,124 @@ + + + + + + + Class: WCC::Contentful::Engine + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Engine + + + +

      +
      + +
      +
      Inherits:
      +
      + Rails::Engine + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/engine.rb
      +
      + +
      + + + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Event.html b/docs/1.3/wcc-contentful/WCC/Contentful/Event.html new file mode 100644 index 00000000..27a0d561 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Event.html @@ -0,0 +1,212 @@ + + + + + + + Module: WCC::Contentful::Event + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC::Contentful::Event + + + +

      +
      + + + + +
      +
      Extended by:
      +
      ActiveSupport::Concern
      +
      + + + + + + +
      +
      Included in:
      +
      Asset, DeletedAsset, DeletedEntry, Entry, SyncComplete, Unknown
      +
      + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/event.rb
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + + + Classes: Asset, DeletedAsset, DeletedEntry, Entry, Registry, SyncComplete, Unknown + + +

      + + + + + + + + +

      + Class Method Summary + collapse +

      + + + + + + + +
      +

      Class Method Details

      + + +
      +

      + + .from_raw(raw, context = nil, source: nil) ⇒ Object + + + + + +

      +
      + +

      Creates an Event out of a raw value received by a webhook or given from the Contentful Sync API.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +13
      +14
      +
      +
      # File 'lib/wcc/contentful/event.rb', line 10
      +
      +def self.from_raw(raw, context = nil, source: nil)
      +  const = Registry.instance.get(raw.dig('sys', 'type'))
      +
      +  const.new(raw, context, source: source)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Event/Asset.html b/docs/1.3/wcc-contentful/WCC/Contentful/Event/Asset.html new file mode 100644 index 00000000..8f64fba5 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Event/Asset.html @@ -0,0 +1,265 @@ + + + + + + + Class: WCC::Contentful::Event::Asset + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Event::Asset + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      WCC::Contentful::Event
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/event.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + +

      Methods included from WCC::Contentful::Event

      +

      from_raw

      + + + +
      +

      Instance Method Details

      + + +
      +

      + + #assetObject + + + + Also known as: + entry + + + + +

      + + + + +
      +
      +
      +
      +91
      +92
      +93
      +
      +
      # File 'lib/wcc/contentful/event.rb', line 91
      +
      +def asset
      +  @asset ||= WCC::Contentful::Model.new_from_raw(raw, sys.context)
      +end
      +
      +
      + +
      +

      + + #content_typeObject + + + + + +

      + + + + +
      +
      +
      +
      +87
      +88
      +89
      +
      +
      # File 'lib/wcc/contentful/event.rb', line 87
      +
      +def content_type
      +  'Asset'
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Event/DeletedAsset.html b/docs/1.3/wcc-contentful/WCC/Contentful/Event/DeletedAsset.html new file mode 100644 index 00000000..eb9aaab3 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Event/DeletedAsset.html @@ -0,0 +1,317 @@ + + + + + + + Class: WCC::Contentful::Event::DeletedAsset + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Event::DeletedAsset + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      WCC::Contentful::Event
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/event.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + +

      Methods included from WCC::Contentful::Event

      +

      from_raw

      + + + +
      +

      Instance Method Details

      + + +
      +

      + + #assetObject + + + + Also known as: + entry + + + + +

      + + + + +
      +
      +
      +
      +125
      +126
      +127
      +
      +
      # File 'lib/wcc/contentful/event.rb', line 125
      +
      +def asset
      +  @asset ||= WCC::Contentful::Model.new_from_raw(raw, sys.context)
      +end
      +
      +
      + +
      +

      + + #content_typeObject + + + + + +

      + + + + +
      +
      +
      +
      +121
      +122
      +123
      +
      +
      # File 'lib/wcc/contentful/event.rb', line 121
      +
      +def content_type
      +  'Asset'
      +end
      +
      +
      + +
      +

      + + #deleted_atObject + + + + + +

      + + + + +
      +
      +
      +
      +117
      +118
      +119
      +
      +
      # File 'lib/wcc/contentful/event.rb', line 117
      +
      +def deleted_at
      +  raw.dig('sys', 'deletedAt')
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Event/DeletedEntry.html b/docs/1.3/wcc-contentful/WCC/Contentful/Event/DeletedEntry.html new file mode 100644 index 00000000..993b9bc3 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Event/DeletedEntry.html @@ -0,0 +1,311 @@ + + + + + + + Class: WCC::Contentful::Event::DeletedEntry + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Event::DeletedEntry + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      WCC::Contentful::Event
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/event.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + +

      Methods included from WCC::Contentful::Event

      +

      from_raw

      + + + +
      +

      Instance Method Details

      + + +
      +

      + + #content_typeObject + + + + + +

      + + + + +
      +
      +
      +
      +105
      +106
      +107
      +
      +
      # File 'lib/wcc/contentful/event.rb', line 105
      +
      +def content_type
      +  raw.dig('sys', 'contentType', 'sys', 'id')
      +end
      +
      +
      + +
      +

      + + #deleted_atObject + + + + + +

      + + + + +
      +
      +
      +
      +101
      +102
      +103
      +
      +
      # File 'lib/wcc/contentful/event.rb', line 101
      +
      +def deleted_at
      +  raw.dig('sys', 'deletedAt')
      +end
      +
      +
      + +
      +

      + + #entryObject + + + + + +

      + + + + +
      +
      +
      +
      +109
      +110
      +111
      +
      +
      # File 'lib/wcc/contentful/event.rb', line 109
      +
      +def entry
      +  @entry ||= WCC::Contentful::Model.new_from_raw(raw, sys.context)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Event/Entry.html b/docs/1.3/wcc-contentful/WCC/Contentful/Event/Entry.html new file mode 100644 index 00000000..70fad877 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Event/Entry.html @@ -0,0 +1,259 @@ + + + + + + + Class: WCC::Contentful::Event::Entry + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Event::Entry + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      WCC::Contentful::Event
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/event.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + +

      Methods included from WCC::Contentful::Event

      +

      from_raw

      + + + +
      +

      Instance Method Details

      + + +
      +

      + + #content_typeObject + + + + + +

      + + + + +
      +
      +
      +
      +75
      +76
      +77
      +
      +
      # File 'lib/wcc/contentful/event.rb', line 75
      +
      +def content_type
      +  raw.dig('sys', 'contentType', 'sys', 'id')
      +end
      +
      +
      + +
      +

      + + #entryObject + + + + + +

      + + + + +
      +
      +
      +
      +79
      +80
      +81
      +
      +
      # File 'lib/wcc/contentful/event.rb', line 79
      +
      +def entry
      +  @entry ||= WCC::Contentful::Model.new_from_raw(raw, sys.context)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Event/Registry.html b/docs/1.3/wcc-contentful/WCC/Contentful/Event/Registry.html new file mode 100644 index 00000000..65787642 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Event/Registry.html @@ -0,0 +1,280 @@ + + + + + + + Class: WCC::Contentful::Event::Registry + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Event::Registry + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Singleton
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/event.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #get(name) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +19
      +20
      +21
      +22
      +
      +
      # File 'lib/wcc/contentful/event.rb', line 19
      +
      +def get(name)
      +  @event_types ||= {}
      +  @event_types[name] || WCC::Contentful::Event::Unknown
      +end
      +
      +
      + +
      +

      + + #register(constant) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (ArgumentError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +
      +
      # File 'lib/wcc/contentful/event.rb', line 24
      +
      +def register(constant)
      +  name = constant.try(:type) || constant.name.demodulize
      +  raise ArgumentError, "Constant #{constant} does not define 'new'" unless constant.respond_to?(:new)
      +
      +  @event_types ||= {}
      +  @event_types[name] = constant
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Event/SyncComplete.html b/docs/1.3/wcc-contentful/WCC/Contentful/Event/SyncComplete.html new file mode 100644 index 00000000..43d9faa4 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Event/SyncComplete.html @@ -0,0 +1,536 @@ + + + + + + + Class: WCC::Contentful::Event::SyncComplete + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Event::SyncComplete + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      WCC::Contentful::Event
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/event.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #items ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
        +

        Returns the value of attribute items.

        +
        + +
      • + + +
      • + + + #source ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
        +

        Returns the value of attribute source.

        +
        + +
      • + + +
      • + + + #sys ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
        +

        Returns the value of attribute sys.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + +

      Methods included from WCC::Contentful::Event

      +

      from_raw

      + +
      +

      Constructor Details

      + +
      +

      + + #initialize(items, context = nil, source: nil) ⇒ SyncComplete + + + + + +

      +
      + +

      Returns a new instance of SyncComplete.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +135
      +136
      +137
      +138
      +139
      +140
      +141
      +142
      +143
      +144
      +145
      +146
      +147
      +148
      +
      +
      # File 'lib/wcc/contentful/event.rb', line 135
      +
      +def initialize(items, context = nil, source: nil)
      +  @items = items.freeze
      +  @source = source
      +  @sys = WCC::Contentful::Sys.new(
      +    nil,
      +    'Array',
      +    nil,
      +    nil,
      +    nil,
      +    nil,
      +    nil,
      +    OpenStruct.new(context).freeze
      +  )
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #itemsObject (readonly) + + + + + +

      +
      + +

      Returns the value of attribute items.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +150
      +151
      +152
      +
      +
      # File 'lib/wcc/contentful/event.rb', line 150
      +
      +def items
      +  @items
      +end
      +
      +
      + + + +
      +

      + + #sourceObject (readonly) + + + + + +

      +
      + +

      Returns the value of attribute source.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +150
      +151
      +152
      +
      +
      # File 'lib/wcc/contentful/event.rb', line 150
      +
      +def source
      +  @source
      +end
      +
      +
      + + + +
      +

      + + #sysObject (readonly) + + + + + +

      +
      + +

      Returns the value of attribute sys.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +150
      +151
      +152
      +
      +
      # File 'lib/wcc/contentful/event.rb', line 150
      +
      +def sys
      +  @sys
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #to_hObject + + + + + +

      + + + + +
      +
      +
      +
      +152
      +153
      +154
      +155
      +156
      +157
      +158
      +159
      +
      +
      # File 'lib/wcc/contentful/event.rb', line 152
      +
      +def to_h
      +  {
      +    'sys' => {
      +      'type' => 'Array'
      +    },
      +    'items' => items.map(&:to_h)
      +  }
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Event/Unknown.html b/docs/1.3/wcc-contentful/WCC/Contentful/Event/Unknown.html new file mode 100644 index 00000000..8aba777f --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Event/Unknown.html @@ -0,0 +1,138 @@ + + + + + + + Class: WCC::Contentful::Event::Unknown + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Event::Unknown + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      WCC::Contentful::Event
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/event.rb
      +
      + +
      + + + + + + + + + + + + + + + +

      Method Summary

      + +

      Methods included from WCC::Contentful::Event

      +

      from_raw

      + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Events.html b/docs/1.3/wcc-contentful/WCC/Contentful/Events.html new file mode 100644 index 00000000..423549d1 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Events.html @@ -0,0 +1,373 @@ + + + + + + + Class: WCC::Contentful::Events + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Events + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Wisper::Publisher
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/events.rb
      +
      + +
      + +

      Overview

      +
      + +

      WCC::Contentful::Events is a singleton which rebroadcasts Contentful update events. You can subscribe to these events in your initializer using the [wisper gem syntax](github.com/krisleech/wisper). All published events are in the namespace WCC::Contentful::Event.

      + + +
      +
      +
      + + +
      + + + + + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + + + + + +
      +

      Constructor Details

      + +
      +

      + + #initializeEvents + + + + + +

      +
      + +

      Returns a new instance of Events.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +17
      +18
      +19
      +
      +
      # File 'lib/wcc/contentful/events.rb', line 17
      +
      +def initialize
      +  _attach_listeners
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .instanceObject + + + + + +

      + + + + +
      +
      +
      +
      +13
      +14
      +15
      +
      +
      # File 'lib/wcc/contentful/events.rb', line 13
      +
      +def self.instance
      +  @instance ||= new
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #rebroadcast(event) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (ArgumentError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +21
      +22
      +23
      +24
      +25
      +26
      +
      +
      # File 'lib/wcc/contentful/events.rb', line 21
      +
      +def rebroadcast(event)
      +  type = event.dig('sys', 'type')
      +  raise ArgumentError, "Unknown event type #{event}" unless type.present?
      +
      +  broadcast(type, event)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Helpers.html b/docs/1.3/wcc-contentful/WCC/Contentful/Helpers.html new file mode 100644 index 00000000..9288ebfd --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Helpers.html @@ -0,0 +1,366 @@ + + + + + + + Module: WCC::Contentful::Helpers + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC::Contentful::Helpers + + + +

      +
      + + + + +
      +
      Extended by:
      +
      Helpers
      +
      + + + + + + +
      +
      Included in:
      +
      ContentTypeIndexer, Helpers, ModelBuilder
      +
      + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/helpers.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #constant_from_content_type(content_type) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +17
      +18
      +19
      +
      +
      # File 'lib/wcc/contentful/helpers.rb', line 17
      +
      +def constant_from_content_type(content_type)
      +  content_type.gsub(/[^_a-zA-Z0-9]/, '_').camelize
      +end
      +
      +
      + +
      +

      + + #content_type_from_constant(const) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +28
      +29
      +30
      +31
      +32
      +33
      +
      +
      # File 'lib/wcc/contentful/helpers.rb', line 28
      +
      +def content_type_from_constant(const)
      +  return const.content_type if const.respond_to?(:content_type)
      +
      +  name = const.try(:name) || const.to_s
      +  name.demodulize.camelize(:lower)
      +end
      +
      +
      + +
      +

      + + #content_type_from_raw(value) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +6
      +7
      +8
      +9
      +10
      +11
      +12
      +13
      +14
      +15
      +
      +
      # File 'lib/wcc/contentful/helpers.rb', line 6
      +
      +def content_type_from_raw(value)
      +  case value.dig('sys', 'type')
      +  when 'Entry', 'DeletedEntry'
      +    value.dig('sys', 'contentType', 'sys', 'id')
      +  when 'Asset', 'DeletedAsset'
      +    'Asset'
      +  else
      +    raise ArgumentError, "Unknown content type '#{value.dig('sys', 'type') || 'null'}'"
      +  end
      +end
      +
      +
      + +
      +

      + + #shared_prefix(string_array) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +21
      +22
      +23
      +24
      +25
      +26
      +
      +
      # File 'lib/wcc/contentful/helpers.rb', line 21
      +
      +def shared_prefix(string_array)
      +  string_array.reduce do |l, s|
      +    l = l.chop while l != s[0...l.length]
      +    l
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/IndexedRepresentation.html b/docs/1.3/wcc-contentful/WCC/Contentful/IndexedRepresentation.html new file mode 100644 index 00000000..1d7fb405 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/IndexedRepresentation.html @@ -0,0 +1,549 @@ + + + + + + + Class: WCC::Contentful::IndexedRepresentation + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::IndexedRepresentation + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/indexed_representation.rb
      +
      + +
      + +

      Overview

      +
      + +

      The result of running the indexer on raw content types to produce a type definition which can be used to build models or graphql types.

      + + +
      +
      +
      + + +

      Defined Under Namespace

      +

      + + + + + Classes: ContentType, Field + + +

      + + + + + + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(types = {}) ⇒ IndexedRepresentation + + + + + +

      +
      + +

      Returns a new instance of IndexedRepresentation.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +7
      +8
      +9
      +
      +
      # File 'lib/wcc/contentful/indexed_representation.rb', line 7
      +
      +def initialize(types = {})
      +  @types = types
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .from_json(hash) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +
      +
      # File 'lib/wcc/contentful/indexed_representation.rb', line 22
      +
      +def self.from_json(hash)
      +  hash = JSON.parse(hash) if hash.is_a?(String)
      +
      +  ret = IndexedRepresentation.new
      +  hash.each do |id, content_type_hash|
      +    ret[id] = ContentType.new(content_type_hash)
      +  end
      +  ret
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #==(other) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +40
      +41
      +42
      +43
      +44
      +45
      +
      +
      # File 'lib/wcc/contentful/indexed_representation.rb', line 40
      +
      +def ==(other)
      +  my_keys = keys
      +  return false unless my_keys == other.keys
      +
      +  my_keys.all? { |k| self[k] == other[k] }
      +end
      +
      +
      + +
      +

      + + #[]=(id, value) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (ArgumentError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +16
      +17
      +18
      +19
      +20
      +
      +
      # File 'lib/wcc/contentful/indexed_representation.rb', line 16
      +
      +def []=(id, value)
      +  raise ArgumentError unless value.is_a?(ContentType)
      +
      +  @types[id] = value
      +end
      +
      +
      + +
      +

      + + #deep_dupObject + + + + + +

      + + + + +
      +
      +
      +
      +36
      +37
      +38
      +
      +
      # File 'lib/wcc/contentful/indexed_representation.rb', line 36
      +
      +def deep_dup
      +  self.class.new(@types.deep_dup)
      +end
      +
      +
      + +
      +

      + + #to_json(*args) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +32
      +33
      +34
      +
      +
      # File 'lib/wcc/contentful/indexed_representation.rb', line 32
      +
      +def to_json(*args)
      +  @types.to_json(*args)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/IndexedRepresentation/ContentType.html b/docs/1.3/wcc-contentful/WCC/Contentful/IndexedRepresentation/ContentType.html new file mode 100644 index 00000000..17d2897c --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/IndexedRepresentation/ContentType.html @@ -0,0 +1,369 @@ + + + + + + + Class: WCC::Contentful::IndexedRepresentation::ContentType + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::IndexedRepresentation::ContentType + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/indexed_representation.rb
      +
      + +
      + + + +

      + Constant Summary + collapse +

      + +
      + +
      ATTRIBUTES = + +
      +
      %i[
      +  name
      +  content_type
      +  fields
      +].freeze
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(hash_or_id = nil) ⇒ ContentType + + + + + +

      +
      + +

      Returns a new instance of ContentType.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +
      +
      # File 'lib/wcc/contentful/indexed_representation.rb', line 56
      +
      +def initialize(hash_or_id = nil)
      +  @fields = {}
      +  return unless hash_or_id
      +
      +  if hash_or_id.is_a?(String)
      +    @name = hash_or_id
      +    return
      +  end
      +
      +  if raw_fields = (hash_or_id.delete('fields') || hash_or_id.delete(:fields))
      +    raw_fields.each do |field_name, raw_field|
      +      @fields[field_name] = Field.new(raw_field)
      +    end
      +  end
      +
      +  hash_or_id.each { |k, v| public_send("#{k}=", v) }
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #==(other) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +82
      +83
      +84
      +
      +
      # File 'lib/wcc/contentful/indexed_representation.rb', line 82
      +
      +def ==(other)
      +  ATTRIBUTES.all? { |att| public_send(att) == other.public_send(att) }
      +end
      +
      +
      + +
      +

      + + #deep_dupObject + + + + + +

      + + + + +
      +
      +
      +
      +74
      +75
      +76
      +77
      +78
      +79
      +80
      +
      +
      # File 'lib/wcc/contentful/indexed_representation.rb', line 74
      +
      +def deep_dup
      +  dup_hash =
      +    ATTRIBUTES.each_with_object({}) do |att, h|
      +      h[att] = public_send(att)
      +    end
      +  self.class.new(dup_hash)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/IndexedRepresentation/Field.html b/docs/1.3/wcc-contentful/WCC/Contentful/IndexedRepresentation/Field.html new file mode 100644 index 00000000..cf9191d3 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/IndexedRepresentation/Field.html @@ -0,0 +1,415 @@ + + + + + + + Class: WCC::Contentful::IndexedRepresentation::Field + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::IndexedRepresentation::Field + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/indexed_representation.rb
      +
      + +
      + + + +

      + Constant Summary + collapse +

      + +
      + +
      ATTRIBUTES = + +
      +
      %i[
      +  name
      +  type
      +  array
      +  required
      +  link_types
      +].freeze
      + +
      TYPES = + +
      +
      %i[
      +  String
      +  Int
      +  Float
      +  DateTime
      +  Boolean
      +  Json
      +  Coordinates
      +  RichText
      +  Link
      +  Asset
      +].freeze
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(hash_or_id = nil) ⇒ Field + + + + + +

      +
      + +

      Returns a new instance of Field.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +117
      +118
      +119
      +120
      +121
      +122
      +123
      +124
      +125
      +126
      +127
      +128
      +129
      +130
      +131
      +132
      +133
      +134
      +135
      +136
      +137
      +138
      +
      +
      # File 'lib/wcc/contentful/indexed_representation.rb', line 117
      +
      +def initialize(hash_or_id = nil)
      +  return unless hash_or_id
      +
      +  if hash_or_id.is_a?(String)
      +    @name = hash_or_id
      +    return
      +  end
      +
      +  unless hash_or_id.is_a?(Hash)
      +    ATTRIBUTES.each { |att| public_send("#{att}=", hash_or_id.public_send(att)) }
      +    return
      +  end
      +
      +  if raw_type = hash_or_id.delete('type')
      +    raw_type = raw_type.to_sym
      +    raise ArgumentError, "Unknown type #{raw_type}, expected one of: #{TYPES}" unless TYPES.include?(raw_type)
      +
      +    @type = raw_type
      +  end
      +
      +  hash_or_id.each { |k, v| public_send("#{k}=", v) }
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #==(other) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +140
      +141
      +142
      +
      +
      # File 'lib/wcc/contentful/indexed_representation.rb', line 140
      +
      +def ==(other)
      +  ATTRIBUTES.all? { |att| public_send(att) == other.public_send(att) }
      +end
      +
      +
      + +
      +

      + + #type=(raw_type) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (ArgumentError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +111
      +112
      +113
      +114
      +115
      +
      +
      # File 'lib/wcc/contentful/indexed_representation.rb', line 111
      +
      +def type=(raw_type)
      +  raise ArgumentError, "Unknown type #{raw_type}, expected one of: #{TYPES}" unless TYPES.include?(raw_type)
      +
      +  @type = raw_type
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/InitializationError.html b/docs/1.3/wcc-contentful/WCC/Contentful/InitializationError.html new file mode 100644 index 00000000..cffcc493 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/InitializationError.html @@ -0,0 +1,124 @@ + + + + + + + Exception: WCC::Contentful::InitializationError + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: WCC::Contentful::InitializationError + + + +

      +
      + +
      +
      Inherits:
      +
      + StandardError + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/exceptions.rb
      +
      + +
      + + + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Instrumentation.html b/docs/1.3/wcc-contentful/WCC/Contentful/Instrumentation.html new file mode 100644 index 00000000..29c48e23 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Instrumentation.html @@ -0,0 +1,329 @@ + + + + + + + Module: WCC::Contentful::Instrumentation + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC::Contentful::Instrumentation + + + +

      +
      + + + + +
      +
      Extended by:
      +
      ActiveSupport::Concern
      +
      + + + + + + +
      +
      Included in:
      +
      Middleware::Store::CachingMiddleware, SimpleClient, SimpleClient::Response, Store::PostgresStore
      +
      + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/instrumentation.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      + + + + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #_instrumentationObject + + + + + +

      + + + + +
      +
      +
      +
      +16
      +17
      +18
      +19
      +
      +
      # File 'lib/wcc/contentful/instrumentation.rb', line 16
      +
      +def _instrumentation
      +  # look for per-instance instrumentation then try class level
      +  @_instrumentation || self.class._instrumentation
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .instrument(name, payload = {}, &block) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +44
      +45
      +46
      +47
      +
      +
      # File 'lib/wcc/contentful/instrumentation.rb', line 44
      +
      +def instrument(name, payload = {}, &block)
      +  WCC::Contentful::Services.instance
      +    .instrumentation.instrument(name, payload, &block)
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #_instrumentation_event_prefixObject + + + + + +

      + + + + +
      +
      +
      +
      +7
      +8
      +9
      +10
      +11
      +12
      +
      +
      # File 'lib/wcc/contentful/instrumentation.rb', line 7
      +
      +def _instrumentation_event_prefix
      +  @_instrumentation_event_prefix ||=
      +    # WCC::Contentful => contentful.wcc
      +    '.' + (is_a?(Class) || is_a?(Module) ? self : self.class) # rubocop:disable Style/StringConcatenation
      +      .name.parameterize.split('-').reverse.join('.')
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Link.html b/docs/1.3/wcc-contentful/WCC/Contentful/Link.html new file mode 100644 index 00000000..abf49e5f --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Link.html @@ -0,0 +1,474 @@ + + + + + + + Class: WCC::Contentful::Link + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Link + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/link.rb
      +
      + +
      + + + +

      + Constant Summary + collapse +

      + +
      + + +
      {
      +  Asset: 'Asset',
      +  Link: 'Entry'
      +}.freeze
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #id ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
        +

        Returns the value of attribute id.

        +
        + +
      • + + +
      • + + + #link_type ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
        +

        Returns the value of attribute link_type.

        +
        + +
      • + + +
      • + + + #raw ⇒ Object + + + + (also: #to_h) + + + + + + + readonly + + + + + + + + + +
        +

        Returns the value of attribute raw.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(model, link_type = nil) ⇒ Link + + + + + +

      +
      + +

      Returns a new instance of Link.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +
      +
      # File 'lib/wcc/contentful/link.rb', line 11
      +
      +def initialize(model, link_type = nil)
      +  @id = model.try(:id) || model
      +  @link_type = link_type
      +  @link_type ||= model.is_a?(WCC::Contentful::Model::Asset) ? :Asset : :Link
      +  @raw =
      +    {
      +      'sys' => {
      +        'type' => 'Link',
      +        'linkType' => LINK_TYPES[@link_type] || link_type,
      +        'id' => @id
      +      }
      +    }
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #idObject (readonly) + + + + + +

      +
      + +

      Returns the value of attribute id.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +4
      +5
      +6
      +
      +
      # File 'lib/wcc/contentful/link.rb', line 4
      +
      +def id
      +  @id
      +end
      +
      +
      + + + +
      +
      +
      + +

      Returns the value of attribute link_type.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +4
      +5
      +6
      +
      +
      # File 'lib/wcc/contentful/link.rb', line 4
      +
      +def link_type
      +  @link_type
      +end
      +
      +
      + + + +
      +

      + + #rawObject (readonly) + + + + Also known as: + to_h + + + + +

      +
      + +

      Returns the value of attribute raw.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +4
      +5
      +6
      +
      +
      # File 'lib/wcc/contentful/link.rb', line 4
      +
      +def raw
      +  @raw
      +end
      +
      +
      + +
      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/LinkVisitor.html b/docs/1.3/wcc-contentful/WCC/Contentful/LinkVisitor.html new file mode 100644 index 00000000..f0effdd7 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/LinkVisitor.html @@ -0,0 +1,732 @@ + + + + + + + Class: WCC::Contentful::LinkVisitor + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::LinkVisitor + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/link_visitor.rb
      +
      + +
      + +

      Overview

      +
      + +

      The LinkVisitor is a utility class for walking trees of linked entries. It is used internally by the Store layer to compose the resulting resolved hashes. But you can use it too!

      + + +
      +
      +
      + + +
      + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #depth ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
        +

        Returns the value of attribute depth.

        +
        + +
      • + + +
      • + + + #entry ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
        +

        Returns the value of attribute entry.

        +
        + +
      • + + +
      • + + + #fields ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
        +

        Returns the value of attribute fields.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(entry, *fields, depth: 0) ⇒ LinkVisitor + + + + + +

      +
      + +

      Returns a new instance of LinkVisitor.

      + + +
      +
      +
      +

      Parameters:

      +
        + +
      • + + entry + + + (Hash) + + + + — +
        +

        The entry hash (resolved or unresolved) to walk

        +
        + +
      • + +
      • + + The + + + (Array<Symbol>) + + + + — +
        +

        type of fields to select from the entry tree. Must be one of `:Link`, `:Entry`, `:Asset`.

        +
        + +
      • + +
      • + + depth + + + (Fixnum) + + + (defaults to: 0) + + + — +
        +

        (optional) How far to walk down the tree of links. Be careful of recursive trees!

        +
        + +
      • + +
      + + +
      + + + + +
      +
      +
      +
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +
      +
      # File 'lib/wcc/contentful/link_visitor.rb', line 14
      +
      +def initialize(entry, *fields, depth: 0)
      +  unless entry.is_a?(Hash) && entry.dig('sys', 'type') == 'Entry'
      +    raise ArgumentError, "Please provide an entry as a hash value (got #{entry})"
      +  end
      +
      +  @entry = entry
      +  @fields = fields.map(&:to_s)
      +  @depth = depth
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #depthObject (readonly) + + + + + +

      +
      + +

      Returns the value of attribute depth.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +7
      +8
      +9
      +
      +
      # File 'lib/wcc/contentful/link_visitor.rb', line 7
      +
      +def depth
      +  @depth
      +end
      +
      +
      + + + +
      +

      + + #entryObject (readonly) + + + + + +

      +
      + +

      Returns the value of attribute entry.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +7
      +8
      +9
      +
      +
      # File 'lib/wcc/contentful/link_visitor.rb', line 7
      +
      +def entry
      +  @entry
      +end
      +
      +
      + + + +
      +

      + + #fieldsObject (readonly) + + + + + +

      +
      + +

      Returns the value of attribute fields.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +7
      +8
      +9
      +
      +
      # File 'lib/wcc/contentful/link_visitor.rb', line 7
      +
      +def fields
      +  @fields
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #each {|value, field, locale| ... } ⇒ Object + + + + + +

      +
      + +

      Walks an entry and its resolved links, without transforming the entry.

      + + +
      +
      +
      + +

      Yields:

      +
        + +
      • + + + (value, field, locale) + + + +
      • + +
      +

      Yield Parameters:

      +
        + +
      • + + value + + + (Object) + + + + — +
        +

        The value of the selected field.

        +
        + +
      • + +
      • + + field + + + (WCC::Contentful::IndexedRepresentation::Field) + + + + — +
        +

        The type of the selected field

        +
        + +
      • + +
      • + + locale + + + (String) + + + + — +
        +

        The locale of the current field value

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +
      +
      # File 'lib/wcc/contentful/link_visitor.rb', line 30
      +
      +def each(&block)
      +  _each do |val, field, locale, index|
      +    yield(val, field, locale, index) if should_yield_field?(field, val)
      +
      +    next unless should_walk_link?(field, val)
      +
      +    self.class.new(val, *fields, depth: depth - 1).each(&block)
      +  end
      +
      +  nil
      +end
      +
      +
      + +
      +

      + + #map!(&block) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +
      +
      # File 'lib/wcc/contentful/link_visitor.rb', line 42
      +
      +def map!(&block)
      +  _each do |val, field, locale, index|
      +    if should_yield_field?(field, val)
      +      val = yield(val, field, locale, index)
      +      set_field(field, locale, index, val)
      +    end
      +
      +    next unless should_walk_link?(field, val)
      +
      +    self.class.new(val, *fields, depth: depth - 1).map!(&block)
      +  end
      +
      +  entry
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Middleware.html b/docs/1.3/wcc-contentful/WCC/Contentful/Middleware.html new file mode 100644 index 00000000..32933594 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Middleware.html @@ -0,0 +1,115 @@ + + + + + + + Module: WCC::Contentful::Middleware + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC::Contentful::Middleware + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/middleware.rb
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + Modules: Store + + + + +

      + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Middleware/Store.html b/docs/1.3/wcc-contentful/WCC/Contentful/Middleware/Store.html new file mode 100644 index 00000000..debbd034 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Middleware/Store.html @@ -0,0 +1,783 @@ + + + + + + + Module: WCC::Contentful::Middleware::Store + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC::Contentful::Middleware::Store + + + +

      +
      + + + + +
      +
      Extended by:
      +
      ActiveSupport::Concern
      +
      + + + +
      +
      Includes:
      +
      Store::Interface
      +
      + + + + +
      +
      Included in:
      +
      CachingMiddleware, Store::InstrumentationMiddleware
      +
      + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/middleware/store.rb,
      + lib/wcc/contentful/middleware/store/caching_middleware.rb
      +
      +
      + +
      + +

      Overview

      +
      + +

      A Store middleware wraps the Store interface to perform any desired transformations on the Contentful entries coming back from the store. A Store middleware must implement the Store interface as well as a `store=` attribute writer, which is used to inject the next store or middleware in the chain.

      + +

      The Store interface can be seen on the WCC::Contentful::Store::Base class. It consists of the `#find, #find_by, #find_all, #set, #delete,` and `#index` methods.

      + +

      Including this concern will define those methods to pass through to the next store. Any of those methods can be overridden on the implementing middleware. It will also expose two overridable methods, `#select?` and `#transform`. These methods are applied when reading values out of the store, and can be used to apply a filter or transformation to each entry in the store.

      + + +
      +
      +
      + + +

      Defined Under Namespace

      +

      + + + + + Classes: CachingMiddleware, DelegatingQuery + + +

      + + + +

      Constant Summary

      + +

      Constants included + from Store::Interface

      +

      Store::Interface::INTERFACE_METHODS

      + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #store ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute store.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + + +

      Methods included from Store::Interface

      +

      #index, #index?

      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #storeObject + + + + + +

      +
      + +

      Returns the value of attribute store.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +22
      +23
      +24
      +
      +
      # File 'lib/wcc/contentful/middleware/store.rb', line 22
      +
      +def store
      +  @store
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #find(id, **options) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +34
      +35
      +36
      +37
      +
      +
      # File 'lib/wcc/contentful/middleware/store.rb', line 34
      +
      +def find(id, **options)
      +  found = store.find(id, **options)
      +  return transform(found) if found && (!has_select? || select?(found))
      +end
      +
      +
      + +
      +

      + + #find_all(options: nil, **args) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +
      +
      # File 'lib/wcc/contentful/middleware/store.rb', line 47
      +
      +def find_all(options: nil, **args)
      +  DelegatingQuery.new(
      +    store.find_all(**args.merge(options: options)),
      +    middleware: self,
      +    options: options
      +  )
      +end
      +
      +
      + +
      +

      + + #find_by(options: nil, **args) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +
      +
      # File 'lib/wcc/contentful/middleware/store.rb', line 39
      +
      +def find_by(options: nil, **args)
      +  result = store.find_by(**args.merge(options: options))
      +  return unless result && (!has_select? || select?(result))
      +
      +  result = resolve_includes(result, options[:include]) if options && options[:include]
      +  transform(result)
      +end
      +
      +
      + +
      +

      + + #has_select?Boolean + + + + + +

      +
      + +

      rubocop:disable Naming/PredicateName

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +80
      +81
      +82
      +
      +
      # File 'lib/wcc/contentful/middleware/store.rb', line 80
      +
      +def has_select? # rubocop:disable Naming/PredicateName
      +  respond_to?(:select?)
      +end
      +
      +
      + +
      +

      + + #resolve_includes(entry, depth) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +
      +
      # File 'lib/wcc/contentful/middleware/store.rb', line 55
      +
      +def resolve_includes(entry, depth)
      +  return entry unless entry && depth && depth > 0
      +
      +  # We only care about entries (see #resolved_link?)
      +  WCC::Contentful::LinkVisitor.new(entry, :Entry, depth: depth).map! do |val|
      +    resolve_link(val)
      +  end
      +end
      +
      +
      + +
      + + + + + +
      +
      +
      +
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +74
      +
      +
      # File 'lib/wcc/contentful/middleware/store.rb', line 64
      +
      +def resolve_link(val)
      +  return val unless resolved_link?(val)
      +
      +  if !has_select? || select?(val)
      +    transform(val)
      +  else
      +    # Pretend it's an unresolved link -
      +    # matches the behavior of a store when the link cannot be retrieved
      +    WCC::Contentful::Link.new(val.dig('sys', 'id'), val.dig('sys', 'type')).to_h
      +  end
      +end
      +
      +
      + +
      +

      + + #resolved_link?(value) ⇒ Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +76
      +77
      +78
      +
      +
      # File 'lib/wcc/contentful/middleware/store.rb', line 76
      +
      +def resolved_link?(value)
      +  value.is_a?(Hash) && value.dig('sys', 'type') == 'Entry'
      +end
      +
      +
      + +
      +

      + + #transform(entry) ⇒ Object + + + + + +

      +
      + +

      The default version of `#transform` just returns the entry. Override this with your own implementation.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +86
      +87
      +88
      +
      +
      # File 'lib/wcc/contentful/middleware/store.rb', line 86
      +
      +def transform(entry)
      +  entry
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Middleware/Store/CachingMiddleware.html b/docs/1.3/wcc-contentful/WCC/Contentful/Middleware/Store/CachingMiddleware.html new file mode 100644 index 00000000..32aa7682 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Middleware/Store/CachingMiddleware.html @@ -0,0 +1,655 @@ + + + + + + + Class: WCC::Contentful::Middleware::Store::CachingMiddleware + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Middleware::Store::CachingMiddleware + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Instrumentation, WCC::Contentful::Middleware::Store
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/middleware/store/caching_middleware.rb
      +
      + +
      + + + + +

      Constant Summary

      + +

      Constants included + from Store::Interface

      +

      Store::Interface::INTERFACE_METHODS

      + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #expires_in ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute expires_in.

        +
        + +
      • + + +
      + + + + + +

      Attributes included from Instrumentation

      +

      #_instrumentation

      + + + +

      Attributes included from WCC::Contentful::Middleware::Store

      +

      #store

      + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + +

      Methods included from Instrumentation

      +

      #_instrumentation_event_prefix, instrument

      + + + + + + + + + + +

      Methods included from WCC::Contentful::Middleware::Store

      +

      #find_all, #has_select?, #resolve_includes, #resolve_link, #resolved_link?, #transform

      + + + + + + + + + + +

      Methods included from Store::Interface

      +

      #find_all

      +
      +

      Constructor Details

      + +
      +

      + + #initialize(cache = nil) ⇒ CachingMiddleware + + + + + +

      +
      + +

      Returns a new instance of CachingMiddleware.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +11
      +12
      +13
      +14
      +
      +
      # File 'lib/wcc/contentful/middleware/store/caching_middleware.rb', line 11
      +
      +def initialize(cache = nil)
      +  @cache = cache || ActiveSupport::Cache::MemoryStore.new
      +  @expires_in = nil
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #expires_inObject + + + + + +

      +
      + +

      Returns the value of attribute expires_in.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +9
      +10
      +11
      +
      +
      # File 'lib/wcc/contentful/middleware/store/caching_middleware.rb', line 9
      +
      +def expires_in
      +  @expires_in
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #find(key, **options) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +31
      +32
      +33
      +
      +
      # File 'lib/wcc/contentful/middleware/store/caching_middleware.rb', line 16
      +
      +def find(key, **options)
      +  event = 'fresh'
      +  found =
      +    @cache.fetch(key, expires_in: expires_in) do
      +      event = 'miss'
      +      # if it's not a contentful ID don't hit the API.
      +      # Store a nil object if we can't find the object on the CDN.
      +      (store.find(key, **options) || nil_obj(key)) if key =~ /^\w+$/
      +    end
      +  _instrument(event, key: key, options: options)
      +
      +  case found.try(:dig, 'sys', 'type')
      +  when 'Nil', 'DeletedEntry', 'DeletedAsset'
      +    nil
      +  else
      +    found
      +  end
      +end
      +
      +
      + +
      +

      + + #find_by(content_type:, filter: nil, options: nil) ⇒ Object + + + + + +

      +
      + +

      TODO: github.com/watermarkchurch/wcc-contentful/issues/18

      + +
      figure out how to cache the results of a find_by query, ex:
      +`find_by('slug' => '/about')`
      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +38
      +39
      +40
      +41
      +42
      +43
      +44
      +
      +
      # File 'lib/wcc/contentful/middleware/store/caching_middleware.rb', line 38
      +
      +def find_by(content_type:, filter: nil, options: nil)
      +  if filter&.keys == ['sys.id'] && found = @cache.read(filter['sys.id'])
      +    return found
      +  end
      +
      +  store.find_by(content_type: content_type, filter: filter, options: options)
      +end
      +
      +
      + +
      +

      + + #index(json) ⇒ Object + + + + + +

      +
      + +

      #index is called whenever the sync API comes back with more data.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +
      +
      # File 'lib/wcc/contentful/middleware/store/caching_middleware.rb', line 49
      +
      +def index(json)
      +  delegated_result = store.index(json) if store.index?
      +  caching_result = _index(json)
      +  # _index returns nil if we don't already have it cached - so use the store result.
      +  # store result is nil if it doesn't index, so use the caching result if we have it.
      +  # They ought to be the same thing if it's cached and the store also indexes.
      +  caching_result || delegated_result
      +end
      +
      +
      + +
      +

      + + #index?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +58
      +59
      +60
      +
      +
      # File 'lib/wcc/contentful/middleware/store/caching_middleware.rb', line 58
      +
      +def index?
      +  true
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Middleware/Store/DelegatingQuery.html b/docs/1.3/wcc-contentful/WCC/Contentful/Middleware/Store/DelegatingQuery.html new file mode 100644 index 00000000..f5e39dbc --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Middleware/Store/DelegatingQuery.html @@ -0,0 +1,719 @@ + + + + + + + Class: WCC::Contentful::Middleware::Store::DelegatingQuery + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Middleware::Store::DelegatingQuery + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Enumerable, Store::Query::Interface
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/middleware/store.rb
      +
      + +
      + + + + +

      Constant Summary

      + +

      Constants included + from Store::Query::Interface

      +

      Store::Query::Interface::OPERATORS

      + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #middleware ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
        +

        Returns the value of attribute middleware.

        +
        + +
      • + + +
      • + + + #options ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
        +

        Returns the value of attribute options.

        +
        + +
      • + + +
      • + + + #wrapped_query ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
        +

        Returns the value of attribute wrapped_query.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + + +

      Methods included from Store::Query::Interface

      +

      #eq

      + +
      +

      Constructor Details

      + +
      +

      + + #initialize(wrapped_query, middleware:, options: nil, **extra) ⇒ DelegatingQuery + + + + + +

      +
      + +

      Returns a new instance of DelegatingQuery.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +150
      +151
      +152
      +153
      +154
      +155
      +
      +
      # File 'lib/wcc/contentful/middleware/store.rb', line 150
      +
      +def initialize(wrapped_query, middleware:, options: nil, **extra)
      +  @wrapped_query = wrapped_query
      +  @middleware = middleware
      +  @options = options
      +  @extra = extra
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #middlewareObject (readonly) + + + + + +

      +
      + +

      Returns the value of attribute middleware.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +109
      +110
      +111
      +
      +
      # File 'lib/wcc/contentful/middleware/store.rb', line 109
      +
      +def middleware
      +  @middleware
      +end
      +
      +
      + + + +
      +

      + + #optionsObject (readonly) + + + + + +

      +
      + +

      Returns the value of attribute options.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +109
      +110
      +111
      +
      +
      # File 'lib/wcc/contentful/middleware/store.rb', line 109
      +
      +def options
      +  @options
      +end
      +
      +
      + + + +
      +

      + + #wrapped_queryObject (readonly) + + + + + +

      +
      + +

      Returns the value of attribute wrapped_query.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +109
      +110
      +111
      +
      +
      # File 'lib/wcc/contentful/middleware/store.rb', line 109
      +
      +def wrapped_query
      +  @wrapped_query
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #apply(filter, context = nil) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +120
      +121
      +122
      +123
      +124
      +125
      +126
      +127
      +
      +
      # File 'lib/wcc/contentful/middleware/store.rb', line 120
      +
      +def apply(filter, context = nil)
      +  self.class.new(
      +    wrapped_query.apply(filter, context),
      +    middleware: middleware,
      +    options: options,
      +    **@extra
      +  )
      +end
      +
      +
      + +
      +

      + + #apply_operator(operator, field, expected, context = nil) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +129
      +130
      +131
      +132
      +133
      +134
      +135
      +136
      +
      +
      # File 'lib/wcc/contentful/middleware/store.rb', line 129
      +
      +def apply_operator(operator, field, expected, context = nil)
      +  self.class.new(
      +    wrapped_query.apply_operator(operator, field, expected, context),
      +    middleware: middleware,
      +    options: options,
      +    **@extra
      +  )
      +end
      +
      +
      + +
      +

      + + #countObject + + + + + +

      + + + + +
      +
      +
      +
      +97
      +98
      +99
      +100
      +101
      +102
      +103
      +104
      +105
      +106
      +107
      +
      +
      # File 'lib/wcc/contentful/middleware/store.rb', line 97
      +
      +def count
      +  if middleware.has_select?
      +    raise NameError, "Count cannot be determined because the middleware '#{middleware}' " \
      +                     "implements the #select? method.  Please use '.to_a.count' to count entries that " \
      +                     'pass the #select? method.'
      +  end
      +
      +  # The wrapped query may get count from the "Total" field in the response,
      +  # or apply a "COUNT(*)" to the query.
      +  wrapped_query.count
      +end
      +
      +
      + +
      +

      + + #to_enumObject + + + + + +

      + + + + +
      +
      +
      +
      +111
      +112
      +113
      +114
      +115
      +116
      +117
      +118
      +
      +
      # File 'lib/wcc/contentful/middleware/store.rb', line 111
      +
      +def to_enum
      +  result = wrapped_query.to_enum
      +  result = result.select { |x| middleware.select?(x) } if middleware.has_select?
      +
      +  result = result.map { |x| middleware.resolve_includes(x, options[:include]) } if options && options[:include]
      +
      +  result.map { |x| middleware.transform(x) }
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Model.html b/docs/1.3/wcc-contentful/WCC/Contentful/Model.html new file mode 100644 index 00000000..4fe385f3 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Model.html @@ -0,0 +1,266 @@ + + + + + + + Class: WCC::Contentful::Model + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Model + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      ModelAPI
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/model.rb
      +
      + +
      + +

      Overview

      +
      + +

      This is the top layer of the WCC::Contentful gem. It exposes an API by which you can query for data from Contentful. The API is only accessible after calling WCC::Contentful.init!

      + +

      The WCC::Contentful::Model class is the base class for all auto-generated model classes. A model class represents a content type inside Contentful. For example, the “page” content type is represented by a class named WCC::Contentful::Model::Page

      + +

      This WCC::Contentful::Model::Page class exposes the following API methods:

      + + +

      The returned objects are instances of WCC::Contentful::Model::Page, or whatever constant exists in the registry for the page content type. You can register custom types to be instantiated for each content type. If a Model is subclassed, the subclass is automatically registered. This allows you to put models in your app's `app/models` directory:

      + +
      class Page < WCC::Contentful::Model::Page; end
      +
      + +

      and then use the API via those models:

      + +
      # this returns a ::Page, not a WCC::Contentful::Model::Page
      +Page.find_by(slug: 'foo')
      +
      + +

      Furthermore, anytime links are automatically resolved, the registered classes will be used:

      + +
      Menu.find_by(name: 'home').buttons.first.linked_page # is a ::Page
      +
      + + +
      +
      +
      + + +
      + + + + + + + +

      + Class Method Summary + collapse +

      + + + + + + + + + + + + + +
      +

      Class Method Details

      + + +
      +

      + + .const_missing(name) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + +

      Raises:

      + + +
      + + + + +
      +
      +
      +
      +45
      +46
      +47
      +48
      +49
      +
      +
      # File 'lib/wcc/contentful/model.rb', line 45
      +
      +def const_missing(name)
      +  type = WCC::Contentful::Helpers.content_type_from_constant(name)
      +  raise WCC::Contentful::ContentTypeNotFoundError,
      +    "Content type '#{type}' does not exist in the space"
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/ModelAPI.html b/docs/1.3/wcc-contentful/WCC/Contentful/ModelAPI.html new file mode 100644 index 00000000..43d0dcc7 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/ModelAPI.html @@ -0,0 +1,116 @@ + + + + + + + Module: WCC::Contentful::ModelAPI + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC::Contentful::ModelAPI + + + +

      +
      + + + + +
      +
      Extended by:
      +
      ActiveSupport::Concern
      +
      + + + + + + +
      +
      Included in:
      +
      Model
      +
      + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/model_api.rb
      +
      + +
      + + + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/ModelBuilder.html b/docs/1.3/wcc-contentful/WCC/Contentful/ModelBuilder.html new file mode 100644 index 00000000..0ebae49c --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/ModelBuilder.html @@ -0,0 +1,365 @@ + + + + + + + Class: WCC::Contentful::ModelBuilder + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::ModelBuilder + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Helpers
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/model_builder.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #namespace ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
        +

        Returns the value of attribute namespace.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + +

      Methods included from Helpers

      +

      #constant_from_content_type, #content_type_from_constant, #content_type_from_raw, #shared_prefix

      +
      +

      Constructor Details

      + +
      +

      + + #initialize(types, namespace: WCC::Contentful::Model) ⇒ ModelBuilder + + + + + +

      +
      + +

      Returns a new instance of ModelBuilder.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +13
      +14
      +15
      +16
      +
      +
      # File 'lib/wcc/contentful/model_builder.rb', line 13
      +
      +def initialize(types, namespace: WCC::Contentful::Model)
      +  @types = types
      +  @namespace = namespace
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #namespaceObject (readonly) + + + + + +

      +
      + +

      Returns the value of attribute namespace.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +11
      +12
      +13
      +
      +
      # File 'lib/wcc/contentful/model_builder.rb', line 11
      +
      +def namespace
      +  @namespace
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #build_modelsObject + + + + + +

      + + + + +
      +
      +
      +
      +18
      +19
      +20
      +21
      +22
      +
      +
      # File 'lib/wcc/contentful/model_builder.rb', line 18
      +
      +def build_models
      +  @types.each_with_object([]) do |(_k, v), a|
      +    a << build_model(v)
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/ModelMethods.html b/docs/1.3/wcc-contentful/WCC/Contentful/ModelMethods.html new file mode 100644 index 00000000..db6d99f5 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/ModelMethods.html @@ -0,0 +1,672 @@ + + + + + + + Module: WCC::Contentful::ModelMethods + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC::Contentful::ModelMethods + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/model_methods.rb
      +
      + +
      + +

      Overview

      +
      + +

      This module is included by all models and defines instance methods that are not dynamically generated.

      + + +
      +
      +
      + + +
      + +

      + Constant Summary + collapse +

      + +
      + +
      MODEL_LAYER_CONTEXT_KEYS = +
      +
      + +

      The set of options keys that are specific to the Model layer and shouldn't be passed down to the Store layer.

      + + +
      +
      +
      + + +
      +
      +
      %i[
      +  preview
      +  backlinks
      +].freeze
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #resolve(depth: 1, fields: nil, context: sys.context.to_h, **options) ⇒ Object + + + + + +

      +
      + +

      Resolves all links in an entry to the specified depth.

      + +

      Each link in the entry is recursively retrieved from the store until the given depth is satisfied. Depth resolution is unlimited, circular references will be resolved to the same object.

      + + +
      +
      +
      +

      Parameters:

      +
        + +
      • + + depth + + + (Fixnum) + + + (defaults to: 1) + + + — +
        +

        how far to recursively resolve. Must be >= 1

        +
        + +
      • + +
      • + + fields + + + (Array<String, Symbol>) + + + (defaults to: nil) + + + — +
        +

        (optional) A subset of fields whose links should be resolved. Defaults to all fields.

        +
        + +
      • + +
      • + + context + + + (Hash) + + + (defaults to: sys.context.to_h) + + + — +
        +

        passed to the resolved model's `new` function to provide contextual information ex. current locale. See Model#find, Sys#context

        +
        + +
      • + +
      • + + options + + + (Hash) + + + + — +
        +

        The remaining optional parameters, defined below

        +
        + +
      • + +
      + + + + + + + + + + +

      Options Hash (**options):

      +
        + +
      • + circular_reference + (Symbol) + + + + + —
        +

        Determines how circular references are handled. `:raise` causes a CircularReferenceError to be raised, `:ignore` will cause the field to remain unresolved, and any other value (or nil) will cause the field to point to the previously resolved ruby object for that ID.

        +
        + +
      • + +
      + + +

      Raises:

      +
        + +
      • + + + (ArgumentError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +
      +
      # File 'lib/wcc/contentful/model_methods.rb', line 32
      +
      +def resolve(depth: 1, fields: nil, context: sys.context.to_h, **options)
      +  raise ArgumentError, "Depth must be > 0 (was #{depth})" unless depth && depth > 0
      +  return self if resolved?(depth: depth, fields: fields)
      +
      +  fields = fields.map { |f| f.to_s.camelize(:lower) } if fields.present?
      +  fields ||= self.class::FIELDS
      +
      +  typedef = self.class.content_type_definition
      +  links = fields.select { |f| %i[Asset Link].include?(typedef.fields[f].type) }
      +  store = context[:preview] ? self.class.services.preview_store : self.class.services.store
      +
      +  raw_link_ids =
      +    links.map { |field_name| raw.dig('fields', field_name, sys.locale) }
      +      .flat_map do |raw_value|
      +        _try_map(raw_value) { |v| v.dig('sys', 'id') if v.dig('sys', 'type') == 'Link' }
      +      end
      +  raw_link_ids = raw_link_ids.compact
      +  backlinked_ids = (context[:backlinks]&.map { |m| m.id } || [])
      +
      +  has_unresolved_raw_links = (raw_link_ids - backlinked_ids).any?
      +  if has_unresolved_raw_links
      +    raw =
      +      _instrument 'resolve', id: id, depth: depth, backlinks: backlinked_ids do
      +        # use include param to do resolution
      +        store.find_by(content_type: self.class.content_type,
      +          filter: { 'sys.id' => id },
      +          options: context.except(*MODEL_LAYER_CONTEXT_KEYS).merge!({
      +            include: [depth, 10].min
      +          }))
      +      end
      +    raise WCC::Contentful::ResolveError, "Cannot find #{self.class.content_type} with ID #{id}" unless raw
      +
      +    @raw = raw.freeze
      +    links.each { |f| instance_variable_set("@#{f}", raw.dig('fields', f, sys.locale)) }
      +  end
      +
      +  links.each { |f| _resolve_field(f, depth, context, options) }
      +  self
      +end
      +
      +
      + +
      +

      + + #resolved?(depth: 1, fields: nil) ⇒ Boolean + + + + + +

      +
      + +

      Determines whether the object has been resolved up to the prescribed depth.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      +

      Raises:

      +
        + +
      • + + + (ArgumentError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +73
      +74
      +75
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +
      +
      # File 'lib/wcc/contentful/model_methods.rb', line 73
      +
      +def resolved?(depth: 1, fields: nil)
      +  raise ArgumentError, "Depth must be > 0 (was #{depth})" unless depth && depth > 0
      +
      +  fields = fields.map { |f| f.to_s.camelize(:lower) } if fields.present?
      +  fields ||= self.class::FIELDS
      +
      +  typedef = self.class.content_type_definition
      +  links = fields.select { |f| %i[Asset Link].include?(typedef.fields[f].type) }
      +  links.all? { |f| _resolved_field?(f, depth) }
      +end
      +
      +
      + +
      +

      + + #to_h(stack = nil) ⇒ Object + + + + + +

      +
      + +

      Turns the current model into a hash representation as though it had been retrieved from the Contentful API.

      + +

      This differs from `#raw` in that it recursively includes the `#to_h` of resolved links. It also sets the fields to the value for the entry's `#sys.locale`, as though the entry had been retrieved from the API with `locale=WCC::Contentful::ModelMethods#sys#sys.locale` rather than `locale=*`.

      + + +
      +
      +
      + +

      Raises:

      + + +
      + + + + +
      +
      +
      +
      +91
      +92
      +93
      +94
      +95
      +96
      +97
      +98
      +99
      +100
      +101
      +102
      +103
      +104
      +105
      +106
      +107
      +108
      +109
      +110
      +111
      +112
      +113
      +114
      +115
      +116
      +117
      +118
      +119
      +120
      +121
      +122
      +123
      +124
      +125
      +126
      +127
      +128
      +
      +
      # File 'lib/wcc/contentful/model_methods.rb', line 91
      +
      +def to_h(stack = nil)
      +  raise WCC::Contentful::CircularReferenceError.new(stack, id) if stack&.include?(id)
      +
      +  stack = [*stack, id]
      +  typedef = self.class.content_type_definition
      +  fields =
      +    typedef.fields.each_with_object({}) do |(name, field_def), h|
      +      if field_def.type == :Link || field_def.type == :Asset
      +        if _resolved_field?(name, 0)
      +          val = public_send(name)
      +          val =
      +            _try_map(val) { |v| v.to_h(stack) }
      +        else
      +          ids = field_def.array ? public_send("#{name}_ids") : public_send("#{name}_id")
      +          val =
      +            _try_map(ids) do |id|
      +              {
      +                'sys' => {
      +                  'type' => 'Link',
      +                  'linkType' => field_def.type == :Asset ? 'Asset' : 'Entry',
      +                  'id' => id
      +                }
      +              }
      +            end
      +        end
      +      else
      +        val = public_send(name)
      +        val = _try_map(val) { |v| v.respond_to?(:to_h) ? v.to_h.stringify_keys! : v }
      +      end
      +
      +      h[name] = val
      +    end
      +
      +  {
      +    'sys' => { 'locale' => @sys.locale }.merge!(@raw['sys']),
      +    'fields' => fields
      +  }
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/ModelSingletonMethods.html b/docs/1.3/wcc-contentful/WCC/Contentful/ModelSingletonMethods.html new file mode 100644 index 00000000..af9e2d81 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/ModelSingletonMethods.html @@ -0,0 +1,551 @@ + + + + + + + Module: WCC::Contentful::ModelSingletonMethods + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC::Contentful::ModelSingletonMethods + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/model_singleton_methods.rb
      +
      + +
      + +

      Overview

      +
      + +

      This module is extended by all models and defines singleton methods that are not dynamically generated.

      + + +
      +
      +
      + + +

      Defined Under Namespace

      +

      + + + + + Classes: ModelQuery + + +

      + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #find(id, options: nil) ⇒ nil, WCC::Contentful::Model + + + + + +

      +
      + +

      Finds an instance of this content type.

      + + +
      +
      +
      + +
      +

      Examples:

      + + +
      WCC::Contentful::Model::Page.find(id)
      + +
      + +

      Returns:

      +
        + +
      • + + + (nil, WCC::Contentful::Model) + + + + — +
        +

        An instance of the appropriate model class for this content type, or nil if the ID does not exist in the space.

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +13
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +
      +
      # File 'lib/wcc/contentful/model_singleton_methods.rb', line 13
      +
      +def find(id, options: nil)
      +  options ||= {}
      +  store = options[:preview] ? services.preview_store : services.store
      +  raw =
      +    _instrumentation.instrument 'find.model.contentful.wcc',
      +      content_type: content_type, id: id, options: options do
      +      store.find(id, **{ hint: type }.merge!(options.except(:preview)))
      +    end
      +  new(raw, options) if raw.present?
      +end
      +
      +
      + +
      +

      + + #find_all(filter = nil) ⇒ Enumerator::Lazy<WCC::Contentful::Model>, <WCC::Contentful::Model> + + + + + +

      +
      + +

      Finds all instances of this content type, optionally limiting to those matching a given filter query.

      + + +
      +
      +
      + +
      +

      Examples:

      + + +
      WCC::Contentful::Model::Page.find_all('sys.created_at' => { lte: Date.today })
      + +
      + +

      Returns:

      + + +
      + + + + +
      +
      +
      +
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +
      +
      # File 'lib/wcc/contentful/model_singleton_methods.rb', line 31
      +
      +def find_all(filter = nil)
      +  filter = filter&.dup
      +  options = filter&.delete(:options) || {}
      +
      +  filter.transform_keys! { |k| k.to_s.camelize(:lower) } if filter.present?
      +
      +  store = options[:preview] ? services.preview_store : services.store
      +  query =
      +    _instrumentation.instrument 'find_all.model.contentful.wcc',
      +      content_type: content_type, filter: filter, options: options do
      +      store.find_all(content_type: content_type, options: options.except(:preview))
      +    end
      +  query = query.apply(filter) if filter.present?
      +  ModelQuery.new(query, options, self)
      +end
      +
      +
      + +
      +

      + + #find_by(filter = nil) ⇒ nil, WCC::Contentful::Model + + + + + +

      +
      + +

      Finds the first instance of this content type matching the given query.

      + + +
      +
      +
      + +
      +

      Examples:

      + + +
      WCC::Contentful::Model::Page.find_by(slug: '/some-slug')
      + +
      + +

      Returns:

      +
        + +
      • + + + (nil, WCC::Contentful::Model) + + + + — +
        +

        A set of instantiated model objects matching the given query.

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +
      +
      # File 'lib/wcc/contentful/model_singleton_methods.rb', line 53
      +
      +def find_by(filter = nil)
      +  filter = filter&.dup
      +  options = filter&.delete(:options) || {}
      +
      +  filter.transform_keys! { |k| k.to_s.camelize(:lower) } if filter.present?
      +
      +  store = options[:preview] ? services.preview_store : services.store
      +  result =
      +    _instrumentation.instrument 'find_by.model.contentful.wcc',
      +      content_type: content_type, filter: filter, options: options do
      +      store.find_by(content_type: content_type, filter: filter, options: options.except(:preview))
      +    end
      +
      +  new(result, options) if result
      +end
      +
      +
      + +
      +

      + + #inherited(subclass) ⇒ Object + + + + + +

      +
      + +

      rubocop:disable Lint/MissingSuper

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +69
      +70
      +71
      +72
      +73
      +74
      +75
      +
      +
      # File 'lib/wcc/contentful/model_singleton_methods.rb', line 69
      +
      +def inherited(subclass) # rubocop:disable Lint/MissingSuper
      +  # If another different class is already registered for this content type,
      +  # don't auto-register this one.
      +  return if model_namespace.registered?(content_type)
      +
      +  model_namespace.register_for_content_type(content_type, klass: subclass)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/ModelSingletonMethods/ModelQuery.html b/docs/1.3/wcc-contentful/WCC/Contentful/ModelSingletonMethods/ModelQuery.html new file mode 100644 index 00000000..6770cbc8 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/ModelSingletonMethods/ModelQuery.html @@ -0,0 +1,505 @@ + + + + + + + Class: WCC::Contentful::ModelSingletonMethods::ModelQuery + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::ModelSingletonMethods::ModelQuery + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Enumerable
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/model_singleton_methods.rb
      +
      + +
      + +
      +
      + + +
      +
      +
      + + +
      + + + +

      Instance Attribute Summary collapse

      + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(wrapped_query, options, klass) ⇒ ModelQuery + + + + + +

      +
      + +

      Returns a new instance of ModelQuery.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +89
      +90
      +91
      +92
      +93
      +
      +
      # File 'lib/wcc/contentful/model_singleton_methods.rb', line 89
      +
      +def initialize(wrapped_query, options, klass)
      +  @wrapped_query = wrapped_query
      +  @options = options
      +  @klass = klass
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #klassObject (readonly) + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +87
      +88
      +89
      +
      +
      # File 'lib/wcc/contentful/model_singleton_methods.rb', line 87
      +
      +def klass
      +  @klass
      +end
      +
      +
      + + + +
      +

      + + #optionsObject (readonly) + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +87
      +88
      +89
      +
      +
      # File 'lib/wcc/contentful/model_singleton_methods.rb', line 87
      +
      +def options
      +  @options
      +end
      +
      +
      + + + +
      +

      + + #wrapped_queryObject (readonly) + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +87
      +88
      +89
      +
      +
      # File 'lib/wcc/contentful/model_singleton_methods.rb', line 87
      +
      +def wrapped_query
      +  @wrapped_query
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #to_enumObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +95
      +96
      +97
      +98
      +
      +
      # File 'lib/wcc/contentful/model_singleton_methods.rb', line 95
      +
      +def to_enum
      +  wrapped_query.to_enum
      +    .map { |r| klass.new(r, options) }
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/RSpec.html b/docs/1.3/wcc-contentful/WCC/Contentful/RSpec.html new file mode 100644 index 00000000..91133f85 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/RSpec.html @@ -0,0 +1,258 @@ + + + + + + + Module: WCC::Contentful::RSpec + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC::Contentful::RSpec + + + +

      +
      + + + + + + +
      +
      Includes:
      +
      Test::Double, Test::Factory
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/rspec.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + +
        + +
      • + + + #contentful_stub(const, **attrs) ⇒ Object + + + + + + + + + + + + + +
        +

        Builds out a fake Contentful entry for the given content type, and then stubs the Model API to return that content type for `.find` and `.find_by` query methods.

        +
        + +
      • + + +
      + + + + + + + + + + + +

      Methods included from Test::Factory

      +

      #contentful_create

      + + + + + + + + + +

      Methods included from Test::Double

      +

      #contentful_double, #contentful_image_double

      + + +
      +

      Instance Method Details

      + + +
      +

      + + #contentful_stub(const, **attrs) ⇒ Object + + + + + +

      +
      + +

      Builds out a fake Contentful entry for the given content type, and then stubs the Model API to return that content type for `.find` and `.find_by` query methods.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +
      +
      # File 'lib/wcc/contentful/rspec.rb', line 15
      +
      +def contentful_stub(const, **attrs)
      +  const = WCC::Contentful::Model.resolve_constant(const.to_s) unless const.respond_to?(:content_type_definition)
      +  instance = contentful_create(const, **attrs)
      +
      +  # mimic what's going on inside model_singleton_methods.rb
      +  # find, find_by, etc always return a new instance from the same raw
      +  allow(WCC::Contentful::Model).to receive(:find)
      +    .with(instance.id, any_args) do |_id, keyword_params|
      +      options = keyword_params && keyword_params[:options]
      +      contentful_create(const, options, raw: instance.raw, **attrs)
      +    end
      +  allow(const).to receive(:find) { |id, options| WCC::Contentful::Model.find(id, **(options || {})) }
      +
      +  attrs.each do |k, v|
      +    allow(const).to receive(:find_by)
      +      .with(hash_including(k => v)) do |filter|
      +        filter = filter&.dup
      +        options = filter&.delete(:options) || {}
      +
      +        contentful_create(const, options, raw: instance.raw, **attrs)
      +      end
      +  end
      +
      +  instance
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/ResolveError.html b/docs/1.3/wcc-contentful/WCC/Contentful/ResolveError.html new file mode 100644 index 00000000..17c4151a --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/ResolveError.html @@ -0,0 +1,135 @@ + + + + + + + Exception: WCC::Contentful::ResolveError + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: WCC::Contentful::ResolveError + + + +

      +
      + +
      +
      Inherits:
      +
      + StandardError + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/exceptions.rb
      +
      + +
      + +

      Overview

      +
      + +

      Raised by Model#resolve when attempting to resolve an entry's links and that entry cannot be found in the space.

      + + +
      +
      +
      + + +
      + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/RichText.html b/docs/1.3/wcc-contentful/WCC/Contentful/RichText.html new file mode 100644 index 00000000..c0c41f31 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/RichText.html @@ -0,0 +1,268 @@ + + + + + + + Module: WCC::Contentful::RichText + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC::Contentful::RichText + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/rich_text.rb,
      + lib/wcc/contentful/rich_text/node.rb
      +
      +
      + +
      + +

      Overview

      +
      + +

      This module contains a number of structs representing nodes in a Contentful rich text field. When the Model layer parses a Rich Text field from Contentful, it is turned into a WCC::Contentful::RichText::Document node. The content method of this node is an Array containing paragraph, blockquote, entry, and other nodes.

      + +

      The various structs in the RichText object model are designed to mimic the Hash interface, so that the indexing operator `#[]` and the `#dig` method can be used to traverse the data. The data can also be accessed by the attribute reader methods defined on the structs. Both of these are considered part of the public API of the model and will not change.

      + +

      In a future release we plan to implement automatic link resolution. When that happens, the `.data` attribute of embedded entries and assets will return a new class that is able to resolve the `.target` automatically into a full entry or asset. This future class will still respect the hash accessor methods `#[]`, `#dig`, `#keys`, and `#each`, so it is safe to use those.

      + + +
      +
      +
      + + +

      Defined Under Namespace

      +

      + + + Modules: Node + + + + Classes: Blockquote, Document, EmbeddedAssetBlock, EmbeddedEntryBlock, EmbeddedEntryInline, Paragraph, Text, Unknown + + +

      + + + + + + + + +

      + Class Method Summary + collapse +

      + + + + + + +
      +

      Class Method Details

      + + +
      +

      + + .tokenize(raw, context = nil) ⇒ Object + + + + + +

      +
      + +

      Recursively converts a raw JSON-parsed hash into the RichText object model.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +26
      +27
      +28
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 26
      +
      +def self.tokenize(raw, context = nil)
      +  return unless raw
      +  return raw.map { |c| tokenize(c, context) } if raw.is_a?(Array)
      +
      +  klass =
      +    case raw['nodeType']
      +    when 'document'
      +      Document
      +    when 'paragraph'
      +      Paragraph
      +    when 'blockquote'
      +      Blockquote
      +    when 'text'
      +      Text
      +    when 'embedded-entry-inline'
      +      EmbeddedEntryInline
      +    when 'embedded-entry-block'
      +      EmbeddedEntryBlock
      +    when 'embedded-asset-block'
      +      EmbeddedAssetBlock
      +    when /heading-(\d+)/
      +      size = Regexp.last_match(1)
      +      const_get("Heading#{size}")
      +    else
      +      Unknown
      +    end
      +
      +  klass.tokenize(raw, context)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/RichText/Blockquote.html b/docs/1.3/wcc-contentful/WCC/Contentful/RichText/Blockquote.html new file mode 100644 index 00000000..68f1164b --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/RichText/Blockquote.html @@ -0,0 +1,415 @@ + + + + + + + Class: WCC::Contentful::RichText::Blockquote + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::RichText::Blockquote + + + +

      +
      + +
      +
      Inherits:
      +
      + Struct + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Node
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/rich_text.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #content ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute content.

        +
        + +
      • + + +
      • + + + #data ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute data.

        +
        + +
      • + + +
      • + + + #nodeType ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute nodeType.

        +
        + +
      • + + +
      + + + + + + + + + + + +

      Method Summary

      + +

      Methods included from Node

      +

      #keys

      + + + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #contentObject + + + + + +

      +
      + +

      Returns the value of attribute content

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of content

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +66
      +67
      +68
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 66
      +
      +def content
      +  @content
      +end
      +
      +
      + + + +
      +

      + + #dataObject + + + + + +

      +
      + +

      Returns the value of attribute data

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of data

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +66
      +67
      +68
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 66
      +
      +def data
      +  @data
      +end
      +
      +
      + + + +
      +

      + + #nodeTypeObject + + + + + +

      +
      + +

      Returns the value of attribute nodeType

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of nodeType

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +66
      +67
      +68
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 66
      +
      +def nodeType
      +  @nodeType
      +end
      +
      +
      + +
      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/RichText/Document.html b/docs/1.3/wcc-contentful/WCC/Contentful/RichText/Document.html new file mode 100644 index 00000000..fa8d7b84 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/RichText/Document.html @@ -0,0 +1,415 @@ + + + + + + + Class: WCC::Contentful::RichText::Document + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::RichText::Document + + + +

      +
      + +
      +
      Inherits:
      +
      + Struct + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Node
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/rich_text.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #content ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute content.

        +
        + +
      • + + +
      • + + + #data ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute data.

        +
        + +
      • + + +
      • + + + #nodeType ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute nodeType.

        +
        + +
      • + + +
      + + + + + + + + + + + +

      Method Summary

      + +

      Methods included from Node

      +

      #keys

      + + + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #contentObject + + + + + +

      +
      + +

      Returns the value of attribute content

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of content

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +56
      +57
      +58
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 56
      +
      +def content
      +  @content
      +end
      +
      +
      + + + +
      +

      + + #dataObject + + + + + +

      +
      + +

      Returns the value of attribute data

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of data

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +56
      +57
      +58
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 56
      +
      +def data
      +  @data
      +end
      +
      +
      + + + +
      +

      + + #nodeTypeObject + + + + + +

      +
      + +

      Returns the value of attribute nodeType

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of nodeType

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +56
      +57
      +58
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 56
      +
      +def nodeType
      +  @nodeType
      +end
      +
      +
      + +
      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/RichText/EmbeddedAssetBlock.html b/docs/1.3/wcc-contentful/WCC/Contentful/RichText/EmbeddedAssetBlock.html new file mode 100644 index 00000000..303c7b09 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/RichText/EmbeddedAssetBlock.html @@ -0,0 +1,415 @@ + + + + + + + Class: WCC::Contentful::RichText::EmbeddedAssetBlock + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::RichText::EmbeddedAssetBlock + + + +

      +
      + +
      +
      Inherits:
      +
      + Struct + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Node
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/rich_text.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #content ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute content.

        +
        + +
      • + + +
      • + + + #data ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute data.

        +
        + +
      • + + +
      • + + + #nodeType ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute nodeType.

        +
        + +
      • + + +
      + + + + + + + + + + + +

      Method Summary

      + +

      Methods included from Node

      +

      #keys

      + + + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #contentObject + + + + + +

      +
      + +

      Returns the value of attribute content

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of content

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +86
      +87
      +88
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 86
      +
      +def content
      +  @content
      +end
      +
      +
      + + + +
      +

      + + #dataObject + + + + + +

      +
      + +

      Returns the value of attribute data

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of data

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +86
      +87
      +88
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 86
      +
      +def data
      +  @data
      +end
      +
      +
      + + + +
      +

      + + #nodeTypeObject + + + + + +

      +
      + +

      Returns the value of attribute nodeType

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of nodeType

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +86
      +87
      +88
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 86
      +
      +def nodeType
      +  @nodeType
      +end
      +
      +
      + +
      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/RichText/EmbeddedEntryBlock.html b/docs/1.3/wcc-contentful/WCC/Contentful/RichText/EmbeddedEntryBlock.html new file mode 100644 index 00000000..3a09f5bd --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/RichText/EmbeddedEntryBlock.html @@ -0,0 +1,415 @@ + + + + + + + Class: WCC::Contentful::RichText::EmbeddedEntryBlock + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::RichText::EmbeddedEntryBlock + + + +

      +
      + +
      +
      Inherits:
      +
      + Struct + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Node
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/rich_text.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #content ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute content.

        +
        + +
      • + + +
      • + + + #data ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute data.

        +
        + +
      • + + +
      • + + + #nodeType ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute nodeType.

        +
        + +
      • + + +
      + + + + + + + + + + + +

      Method Summary

      + +

      Methods included from Node

      +

      #keys

      + + + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #contentObject + + + + + +

      +
      + +

      Returns the value of attribute content

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of content

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +81
      +82
      +83
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 81
      +
      +def content
      +  @content
      +end
      +
      +
      + + + +
      +

      + + #dataObject + + + + + +

      +
      + +

      Returns the value of attribute data

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of data

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +81
      +82
      +83
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 81
      +
      +def data
      +  @data
      +end
      +
      +
      + + + +
      +

      + + #nodeTypeObject + + + + + +

      +
      + +

      Returns the value of attribute nodeType

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of nodeType

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +81
      +82
      +83
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 81
      +
      +def nodeType
      +  @nodeType
      +end
      +
      +
      + +
      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/RichText/EmbeddedEntryInline.html b/docs/1.3/wcc-contentful/WCC/Contentful/RichText/EmbeddedEntryInline.html new file mode 100644 index 00000000..e72e76e2 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/RichText/EmbeddedEntryInline.html @@ -0,0 +1,415 @@ + + + + + + + Class: WCC::Contentful::RichText::EmbeddedEntryInline + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::RichText::EmbeddedEntryInline + + + +

      +
      + +
      +
      Inherits:
      +
      + Struct + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Node
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/rich_text.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #content ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute content.

        +
        + +
      • + + +
      • + + + #data ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute data.

        +
        + +
      • + + +
      • + + + #nodeType ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute nodeType.

        +
        + +
      • + + +
      + + + + + + + + + + + +

      Method Summary

      + +

      Methods included from Node

      +

      #keys

      + + + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #contentObject + + + + + +

      +
      + +

      Returns the value of attribute content

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of content

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +76
      +77
      +78
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 76
      +
      +def content
      +  @content
      +end
      +
      +
      + + + +
      +

      + + #dataObject + + + + + +

      +
      + +

      Returns the value of attribute data

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of data

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +76
      +77
      +78
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 76
      +
      +def data
      +  @data
      +end
      +
      +
      + + + +
      +

      + + #nodeTypeObject + + + + + +

      +
      + +

      Returns the value of attribute nodeType

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of nodeType

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +76
      +77
      +78
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 76
      +
      +def nodeType
      +  @nodeType
      +end
      +
      +
      + +
      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/RichText/Node.html b/docs/1.3/wcc-contentful/WCC/Contentful/RichText/Node.html new file mode 100644 index 00000000..c9a4f554 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/RichText/Node.html @@ -0,0 +1,185 @@ + + + + + + + Module: WCC::Contentful::RichText::Node + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC::Contentful::RichText::Node + + + +

      +
      + + + + +
      +
      Extended by:
      +
      ActiveSupport::Concern
      +
      + + + + + + +
      +
      Included in:
      +
      Blockquote, Document, EmbeddedAssetBlock, EmbeddedEntryBlock, EmbeddedEntryInline, Paragraph, Text, Unknown
      +
      + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/rich_text/node.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #keysObject + + + + + +

      + + + + +
      +
      +
      +
      +7
      +8
      +9
      +
      +
      # File 'lib/wcc/contentful/rich_text/node.rb', line 7
      +
      +def keys
      +  members.map(&:to_s)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/RichText/Paragraph.html b/docs/1.3/wcc-contentful/WCC/Contentful/RichText/Paragraph.html new file mode 100644 index 00000000..ed5b881c --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/RichText/Paragraph.html @@ -0,0 +1,415 @@ + + + + + + + Class: WCC::Contentful::RichText::Paragraph + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::RichText::Paragraph + + + +

      +
      + +
      +
      Inherits:
      +
      + Struct + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Node
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/rich_text.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #content ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute content.

        +
        + +
      • + + +
      • + + + #data ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute data.

        +
        + +
      • + + +
      • + + + #nodeType ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute nodeType.

        +
        + +
      • + + +
      + + + + + + + + + + + +

      Method Summary

      + +

      Methods included from Node

      +

      #keys

      + + + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #contentObject + + + + + +

      +
      + +

      Returns the value of attribute content

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of content

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +61
      +62
      +63
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 61
      +
      +def content
      +  @content
      +end
      +
      +
      + + + +
      +

      + + #dataObject + + + + + +

      +
      + +

      Returns the value of attribute data

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of data

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +61
      +62
      +63
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 61
      +
      +def data
      +  @data
      +end
      +
      +
      + + + +
      +

      + + #nodeTypeObject + + + + + +

      +
      + +

      Returns the value of attribute nodeType

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of nodeType

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +61
      +62
      +63
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 61
      +
      +def nodeType
      +  @nodeType
      +end
      +
      +
      + +
      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/RichText/Text.html b/docs/1.3/wcc-contentful/WCC/Contentful/RichText/Text.html new file mode 100644 index 00000000..74e1b62c --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/RichText/Text.html @@ -0,0 +1,503 @@ + + + + + + + Class: WCC::Contentful::RichText::Text + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::RichText::Text + + + +

      +
      + +
      +
      Inherits:
      +
      + Struct + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Node
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/rich_text.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #data ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute data.

        +
        + +
      • + + +
      • + + + #marks ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute marks.

        +
        + +
      • + + +
      • + + + #nodeType ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute nodeType.

        +
        + +
      • + + +
      • + + + #value ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute value.

        +
        + +
      • + + +
      + + + + + + + + + + + +

      Method Summary

      + +

      Methods included from Node

      +

      #keys

      + + + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #dataObject + + + + + +

      +
      + +

      Returns the value of attribute data

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of data

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +71
      +72
      +73
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 71
      +
      +def data
      +  @data
      +end
      +
      +
      + + + +
      +

      + + #marksObject + + + + + +

      +
      + +

      Returns the value of attribute marks

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of marks

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +71
      +72
      +73
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 71
      +
      +def marks
      +  @marks
      +end
      +
      +
      + + + +
      +

      + + #nodeTypeObject + + + + + +

      +
      + +

      Returns the value of attribute nodeType

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of nodeType

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +71
      +72
      +73
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 71
      +
      +def nodeType
      +  @nodeType
      +end
      +
      +
      + + + +
      +

      + + #valueObject + + + + + +

      +
      + +

      Returns the value of attribute value

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of value

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +71
      +72
      +73
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 71
      +
      +def value
      +  @value
      +end
      +
      +
      + +
      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/RichText/Unknown.html b/docs/1.3/wcc-contentful/WCC/Contentful/RichText/Unknown.html new file mode 100644 index 00000000..8f2ea6b2 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/RichText/Unknown.html @@ -0,0 +1,415 @@ + + + + + + + Class: WCC::Contentful::RichText::Unknown + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::RichText::Unknown + + + +

      +
      + +
      +
      Inherits:
      +
      + Struct + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Node
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/rich_text.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #content ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute content.

        +
        + +
      • + + +
      • + + + #data ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute data.

        +
        + +
      • + + +
      • + + + #nodeType ⇒ Object + + + + + + + + + + + + + + + + +
        +

        Returns the value of attribute nodeType.

        +
        + +
      • + + +
      + + + + + + + + + + + +

      Method Summary

      + +

      Methods included from Node

      +

      #keys

      + + + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #contentObject + + + + + +

      +
      + +

      Returns the value of attribute content

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of content

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +101
      +102
      +103
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 101
      +
      +def content
      +  @content
      +end
      +
      +
      + + + +
      +

      + + #dataObject + + + + + +

      +
      + +

      Returns the value of attribute data

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of data

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +101
      +102
      +103
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 101
      +
      +def data
      +  @data
      +end
      +
      +
      + + + +
      +

      + + #nodeTypeObject + + + + + +

      +
      + +

      Returns the value of attribute nodeType

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Object) + + + + — +
        +

        the current value of nodeType

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +101
      +102
      +103
      +
      +
      # File 'lib/wcc/contentful/rich_text.rb', line 101
      +
      +def nodeType
      +  @nodeType
      +end
      +
      +
      + +
      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/ServiceAccessors.html b/docs/1.3/wcc-contentful/WCC/Contentful/ServiceAccessors.html new file mode 100644 index 00000000..e015484d --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/ServiceAccessors.html @@ -0,0 +1,148 @@ + + + + + + + Module: WCC::Contentful::ServiceAccessors + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC::Contentful::ServiceAccessors + + + +

      +
      + + + + + + + + + +
      +
      Included in:
      +
      WebhookController
      +
      + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/services.rb
      +
      + +
      + +

      Overview

      +
      + +

      Include this module to define accessors for every method defined on the Services singleton.

      + + +
      +
      +
      + +
      +

      Examples:

      + + +
      class MyJob < ApplicationJob
      +  include WCC::Contentful::ServiceAccessors
      +
      +  def perform
      +    Page.find(...)
      +
      +    store.find(...)
      +
      +    client.entries(...)
      +
      +    sync_engine.next
      +  end
      +end
      + +
      + + +

      See Also:

      + + +
      + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Services.html b/docs/1.3/wcc-contentful/WCC/Contentful/Services.html new file mode 100644 index 00000000..821b41e0 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Services.html @@ -0,0 +1,1086 @@ + + + + + + + Class: WCC::Contentful::Services + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Services + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/services.rb
      +
      + +
      + + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #configuration ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
        +

        Returns the value of attribute configuration.

        +
        + +
      • + + +
      + + + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + +
        + +
      • + + + #client ⇒ Object + + + + + + + + + + + + + +
        +

        Gets a CDN Client which provides methods for getting and paging raw JSON data from the Contentful CDN.

        +
        + +
      • + + +
      • + + + #initialize(configuration) ⇒ Services + + + + + + + constructor + + + + + + + + +
        +

        A new instance of Services.

        +
        + +
      • + + +
      • + + + #inject_into(target, except: []) ⇒ Object + + + + + + + + + + + + + +
        +

        This method enables simple dependency injection - If the target has a setter matching the name of one of the services, set that setter with the value of the service.

        +
        + +
      • + + +
      • + + + #instrumentation ⇒ Object + + + + (also: #_instrumentation) + + + + + + + + + + + +
        +

        Gets the configured instrumentation adapter, defaulting to ActiveSupport::Notifications.

        +
        + +
      • + + +
      • + + + #logger ⇒ Object + + + + + + + + + + + + + +
        +

        Gets the configured logger, defaulting to Rails.logger in a rails context, or logging to STDERR in a non-rails context.

        +
        + +
      • + + +
      • + + + #management_client ⇒ Object + + + + + + + + + + + + + +
        +

        Gets a Management Client which provides methods for updating data via the Contentful Management API.

        +
        + +
      • + + +
      • + + + #preview_client ⇒ Object + + + + + + + + + + + + + +
        +

        Gets a CDN Client which provides methods for getting and paging raw JSON data from the Contentful Preview API.

        +
        + +
      • + + +
      • + + + #preview_store ⇒ Object + + + + + + + + + + + + + +
        +

        An instance of WCC::Contentful::Store::CDNAdapter which connects to the Contentful Preview API to return preview content.

        +
        + +
      • + + +
      • + + + #store ⇒ Object + + + + + + + + + + + + + +
        +

        Gets the data-store which executes the queries run against the dynamic models in the WCC::Contentful::Model namespace.

        +
        + +
      • + + +
      • + + + #sync_engine ⇒ Object + + + + + + + + + + + + + +
        +

        Gets the configured WCC::Contentful::SyncEngine which is responsible for updating the currently configured store.

        +
        + +
      • + + +
      + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(configuration) ⇒ Services + + + + + +

      +
      + +

      Returns a new instance of Services.

      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (ArgumentError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +14
      +15
      +16
      +17
      +18
      +
      +
      # File 'lib/wcc/contentful/services.rb', line 14
      +
      +def initialize(configuration)
      +  raise ArgumentError, 'Not yet configured!' unless configuration
      +
      +  @configuration = configuration
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #configurationObject (readonly) + + + + + +

      +
      + +

      Returns the value of attribute configuration.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +12
      +13
      +14
      +
      +
      # File 'lib/wcc/contentful/services.rb', line 12
      +
      +def configuration
      +  @configuration
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .instanceObject + + + + + +

      + + + + +
      +
      +
      +
      +6
      +7
      +8
      +9
      +
      +
      # File 'lib/wcc/contentful/services.rb', line 6
      +
      +def instance
      +  @singleton__instance__ ||= # rubocop:disable Naming/MemoizedInstanceVariableName
      +    (new(WCC::Contentful.configuration) if WCC::Contentful.configuration)
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #clientObject + + + + + +

      +
      + +

      Gets a CDN Client which provides methods for getting and paging raw JSON data from the Contentful CDN.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +
      +
      # File 'lib/wcc/contentful/services.rb', line 57
      +
      +def client
      +  @client ||=
      +    WCC::Contentful::SimpleClient::Cdn.new(
      +      **configuration.connection_options,
      +      access_token: configuration.access_token,
      +      space: configuration.space,
      +      default_locale: configuration.default_locale,
      +      connection: configuration.connection,
      +      environment: configuration.environment,
      +      instrumentation: instrumentation
      +    )
      +end
      +
      +
      + +
      +

      + + #inject_into(target, except: []) ⇒ Object + + + + + +

      +
      + +

      This method enables simple dependency injection - If the target has a setter matching the name of one of the services, set that setter with the value of the service.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +148
      +149
      +150
      +151
      +152
      +153
      +154
      +155
      +
      +
      # File 'lib/wcc/contentful/services.rb', line 148
      +
      +def inject_into(target, except: [])
      +  (WCC::Contentful::SERVICES - except).each do |s|
      +    next unless target.respond_to?("#{s}=")
      +
      +    target.public_send("#{s}=",
      +      public_send(s))
      +  end
      +end
      +
      +
      + +
      +

      + + #instrumentationObject + + + + Also known as: + _instrumentation + + + + +

      +
      + +

      Gets the configured instrumentation adapter, defaulting to ActiveSupport::Notifications

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +127
      +128
      +129
      +130
      +131
      +
      +
      # File 'lib/wcc/contentful/services.rb', line 127
      +
      +def instrumentation
      +  @instrumentation ||=
      +    configuration.instrumentation_adapter ||
      +    ActiveSupport::Notifications
      +end
      +
      +
      + +
      +

      + + #loggerObject + + + + + +

      +
      + +

      Gets the configured logger, defaulting to Rails.logger in a rails context, or logging to STDERR in a non-rails context.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +137
      +138
      +139
      +140
      +141
      +142
      +
      +
      # File 'lib/wcc/contentful/services.rb', line 137
      +
      +def logger
      +  @logger ||=
      +    configuration.logger ||
      +    (Rails.logger if defined?(Rails)) ||
      +    Logger.new($stderr)
      +end
      +
      +
      + +
      +

      + + #management_clientObject + + + + + +

      +
      + +

      Gets a Management Client which provides methods for updating data via the Contentful Management API

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +93
      +94
      +95
      +96
      +97
      +98
      +99
      +100
      +101
      +102
      +103
      +104
      +105
      +106
      +
      +
      # File 'lib/wcc/contentful/services.rb', line 93
      +
      +def management_client
      +  @management_client ||=
      +    if configuration.management_token.present?
      +      WCC::Contentful::SimpleClient::Management.new(
      +        **configuration.connection_options,
      +        management_token: configuration.management_token,
      +        space: configuration.space,
      +        default_locale: configuration.default_locale,
      +        connection: configuration.connection,
      +        environment: configuration.environment,
      +        instrumentation: instrumentation
      +      )
      +    end
      +end
      +
      +
      + +
      +

      + + #preview_clientObject + + + + + +

      +
      + +

      Gets a CDN Client which provides methods for getting and paging raw JSON data from the Contentful Preview API.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +74
      +75
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +83
      +84
      +85
      +86
      +87
      +
      +
      # File 'lib/wcc/contentful/services.rb', line 74
      +
      +def preview_client
      +  @preview_client ||=
      +    if configuration.preview_token.present?
      +      WCC::Contentful::SimpleClient::Preview.new(
      +        **configuration.connection_options,
      +        preview_token: configuration.preview_token,
      +        space: configuration.space,
      +        default_locale: configuration.default_locale,
      +        connection: configuration.connection,
      +        environment: configuration.environment,
      +        instrumentation: instrumentation
      +      )
      +    end
      +end
      +
      +
      + +
      +

      + + #preview_storeObject + + + + + +

      +
      + +

      An instance of WCC::Contentful::Store::CDNAdapter which connects to the Contentful Preview API to return preview content.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +
      +
      # File 'lib/wcc/contentful/services.rb', line 44
      +
      +def preview_store
      +  @preview_store ||=
      +    WCC::Contentful::Store::Factory.new(
      +      configuration,
      +      :direct,
      +      :preview
      +    ).build(self)
      +end
      +
      +
      + +
      +

      + + #storeObject + + + + + +

      +
      + +

      Gets the data-store which executes the queries run against the dynamic models in the WCC::Contentful::Model namespace. This is one of the following based on the configured store method:

      +
      :direct +
      +

      an instance of WCC::Contentful::Store::CDNAdapter with a CDN Client to access the CDN.

      +
      :lazy_sync +
      +

      an instance of Middleware::Store::CachingMiddleware with the configured ActiveSupport::Cache implementation around a WCC::Contentful::Store::CDNAdapter for when data cannot be found in the cache.

      +
      :eager_sync +
      +

      an instance of the configured Store type, defined by Configuration#sync_store

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +36
      +37
      +38
      +
      +
      # File 'lib/wcc/contentful/services.rb', line 36
      +
      +def store
      +  @store ||= configuration.store.build(self)
      +end
      +
      +
      + +
      +

      + + #sync_engineObject + + + + + +

      +
      + +

      Gets the configured WCC::Contentful::SyncEngine which is responsible for updating the currently configured store. The application must periodically call #next on this instance. Alternately, the application can mount the WCC::Contentful::Engine, which will call #next anytime a webhook is received.

      + +

      This returns `nil` if the currently configured store does not respond to sync events.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +115
      +116
      +117
      +118
      +119
      +120
      +121
      +122
      +123
      +124
      +
      +
      # File 'lib/wcc/contentful/services.rb', line 115
      +
      +def sync_engine
      +  @sync_engine ||=
      +    if store.index?
      +      SyncEngine.new(
      +        store: store,
      +        client: client,
      +        key: 'sync:token'
      +      )
      +    end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient.html b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient.html new file mode 100644 index 00000000..198a78b2 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient.html @@ -0,0 +1,825 @@ + + + + + + + Class: WCC::Contentful::SimpleClient + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::SimpleClient + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Instrumentation
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/simple_client.rb,
      + lib/wcc/contentful/simple_client/response.rb
      +
      +
      + +
      + +

      Overview

      +
      + +

      The SimpleClient accesses the Contentful CDN to get JSON responses, returning the raw JSON data as a parsed hash. This is the bottom layer of the WCC::Contentful gem.

      + +

      Note: Do not create this directly, instead create one of WCC::Contentful::SimpleClient::Cdn, WCC::Contentful::SimpleClient::Preview, WCC::Contentful::SimpleClient::Management

      + +

      It can be configured to access any API url and exposes only a single method, `get`. This method returns a WCC::Contentful::SimpleClient::Response that handles paging automatically.

      + +

      The SimpleClient by default uses 'faraday' to perform the gets, but any HTTP client adapter be injected by passing the `connection:` option.

      + + +
      +
      +
      + + +
      +

      Direct Known Subclasses

      +

      Cdn, Management

      +
      +

      Defined Under Namespace

      +

      + + + + + Classes: ApiError, Cdn, Management, NotFoundError, PaginatingEnumerable, Preview, RateLimitError, Response, SyncResponse, TyphoeusAdapter, UnauthorizedError + + +

      + + +

      + Constant Summary + collapse +

      + +
      + +
      ADAPTERS = +
      +
      + + +
      +
      +
      + + +
      +
      +
      {
      +  faraday: ['faraday', '>= 0.9'],
      +  typhoeus: ['typhoeus', '~> 1.0']
      +}.freeze
      + +
      + + + + + +

      Instance Attribute Summary collapse

      + + + + + + +

      Attributes included from Instrumentation

      +

      #_instrumentation

      + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + +

      Methods included from Instrumentation

      +

      instrument

      + +
      +

      Constructor Details

      + +
      +

      + + #initialize(api_url:, space:, access_token:, **options) ⇒ SimpleClient + + + + + +

      +
      + +

      Creates a new SimpleClient with the given configuration.

      + + +
      +
      +
      +

      Parameters:

      +
        + +
      • + + api_url + + + (String) + + + + — +
        +

        the base URL of the Contentful API to connect to

        +
        + +
      • + +
      • + + space + + + (String) + + + + — +
        +

        The Space ID to access

        +
        + +
      • + +
      • + + access_token + + + (String) + + + + — +
        +

        A Contentful Access Token to be sent in the Authorization header

        +
        + +
      • + +
      • + + options + + + (Hash) + + + + — +
        +

        The remaining optional parameters, defined below

        +
        + +
      • + +
      + + + + + + + + + + +

      Options Hash (**options):

      +
        + +
      • + connection + (Symbol, Object) + + + + + —
        +

        The Faraday connection to use to make requests. Auto-discovered based on what gems are installed if this is not provided.

        +
        + +
      • + +
      • + default_locale + (String) + + + + + —
        +

        The locale query param to set by default.

        +
        + +
      • + +
      • + environment + (String) + + + + + —
        +

        The contentful environment to access. Defaults to 'master'.

        +
        + +
      • + +
      • + no_follow_redirects + (Boolean) + + + + + —
        +

        If true, do not follow 300 level redirects.

        +
        + +
      • + +
      • + rate_limit_wait_timeout + (Number) + + + + + —
        +

        The maximum time to block the thread waiting on a rate limit response. By default will wait for one 429 and then fail on the second 429.

        +
        + +
      • + +
      + + + +
      + + + + +
      +
      +
      +
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +
      +
      # File 'lib/wcc/contentful/simple_client.rb', line 44
      +
      +def initialize(api_url:, space:, access_token:, **options)
      +  @api_url = URI.join(api_url, '/spaces/', "#{space}/")
      +  @space = space
      +  @access_token = access_token
      +
      +  @adapter = SimpleClient.load_adapter(options[:connection])
      +
      +  @options = options
      +  @_instrumentation = @options[:instrumentation]
      +  @query_defaults = {}
      +  @query_defaults[:locale] = @options[:default_locale] if @options[:default_locale]
      +  # default 1.5 so that we retry one time then fail if still rate limited
      +  # https://www.contentful.com/developers/docs/references/content-preview-api/#/introduction/api-rate-limits
      +  @rate_limit_wait_timeout = @options[:rate_limit_wait_timeout] || 1.5
      +
      +  return unless options[:environment].present?
      +
      +  @api_url = URI.join(@api_url, 'environments/', "#{options[:environment]}/")
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #api_urlObject (readonly) + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +29
      +30
      +31
      +
      +
      # File 'lib/wcc/contentful/simple_client.rb', line 29
      +
      +def api_url
      +  @api_url
      +end
      +
      +
      + + + +
      +

      + + #spaceObject (readonly) + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +29
      +30
      +31
      +
      +
      # File 'lib/wcc/contentful/simple_client.rb', line 29
      +
      +def space
      +  @space
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .load_adapter(adapter) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +84
      +85
      +86
      +87
      +88
      +89
      +90
      +91
      +92
      +93
      +94
      +95
      +96
      +97
      +98
      +99
      +100
      +101
      +102
      +103
      +104
      +105
      +106
      +107
      +108
      +109
      +110
      +111
      +
      +
      # File 'lib/wcc/contentful/simple_client.rb', line 84
      +
      +def self.load_adapter(adapter)
      +  case adapter
      +  when nil
      +    ADAPTERS.each do |a, spec|
      +      gem(*spec)
      +      return load_adapter(a)
      +    rescue Gem::LoadError
      +      next
      +    end
      +    raise ArgumentError, 'Unable to load adapter!  Please install one of ' \
      +                         "#{ADAPTERS.values.map(&:join).join(',')}"
      +  when :faraday
      +    require 'faraday'
      +    ::Faraday.new do |faraday|
      +      faraday.response :logger, (Rails.logger if defined?(Rails)), { headers: false, bodies: false }
      +      faraday.adapter :net_http
      +    end
      +  when :typhoeus
      +    require_relative 'simple_client/typhoeus_adapter'
      +    TyphoeusAdapter.new
      +  else
      +    unless adapter.respond_to?(:get)
      +      raise ArgumentError, "Adapter #{adapter} is not invokeable!  Please " \
      +                           "pass use one of #{ADAPTERS.keys} or create a Faraday-compatible adapter"
      +    end
      +    adapter
      +  end
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #get(path, query = {}) ⇒ Object + + + + + +

      +
      + +

      performs an HTTP GET request to the specified path within the configured space and environment. Query parameters are merged with the defaults and appended to the request.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +74
      +75
      +76
      +77
      +
      +
      # File 'lib/wcc/contentful/simple_client.rb', line 67
      +
      +def get(path, query = {})
      +  url = URI.join(@api_url, path)
      +
      +  resp =
      +    _instrument 'get_http', url: url, query: query do
      +      get_http(url, query)
      +    end
      +  Response.new(self,
      +    { url: url, query: query },
      +    resp)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/ApiError.html b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/ApiError.html new file mode 100644 index 00000000..c3435df6 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/ApiError.html @@ -0,0 +1,393 @@ + + + + + + + Exception: WCC::Contentful::SimpleClient::ApiError + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: WCC::Contentful::SimpleClient::ApiError + + + +

      +
      + +
      +
      Inherits:
      +
      + StandardError + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/simple_client/response.rb
      +
      + +
      + +
      +
      + + +
      +
      +
      + + +
      +

      Direct Known Subclasses

      +

      NotFoundError, RateLimitError, UnauthorizedError

      +
      + + + + +

      Instance Attribute Summary collapse

      + + + + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(response) ⇒ ApiError + + + + + +

      +
      + +

      Returns a new instance of ApiError.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +210
      +211
      +212
      +213
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 210
      +
      +def initialize(response)
      +  @response = response
      +  super(response.error_message)
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #responseObject (readonly) + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +195
      +196
      +197
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 195
      +
      +def response
      +  @response
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .[](code) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +197
      +198
      +199
      +200
      +201
      +202
      +203
      +204
      +205
      +206
      +207
      +208
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 197
      +
      +def self.[](code)
      +  case code
      +  when 404
      +    NotFoundError
      +  when 401
      +    UnauthorizedError
      +  when 429
      +    RateLimitError
      +  else
      +    ApiError
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/Cdn.html b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/Cdn.html new file mode 100644 index 00000000..277e43d7 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/Cdn.html @@ -0,0 +1,840 @@ + + + + + + + Class: WCC::Contentful::SimpleClient::Cdn + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::SimpleClient::Cdn + + + +

      +
      + +
      +
      Inherits:
      +
      + WCC::Contentful::SimpleClient + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/simple_client/cdn.rb
      +
      + +
      + +

      Overview

      +
      + +

      The CDN SimpleClient accesses 'cdn.contentful.com' to get raw JSON responses. It exposes methods to query entries, assets, and content_types. The responses are instances of WCC::Contentful::SimpleClient::Response which handles paging automatically.

      + + +
      +
      +
      + + +
      +

      Direct Known Subclasses

      +

      Preview

      +
      + + + +

      Constant Summary

      + +

      Constants inherited + from WCC::Contentful::SimpleClient

      +

      ADAPTERS

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from WCC::Contentful::SimpleClient

      +

      #api_url, #space

      + + + +

      Attributes included from Instrumentation

      +

      #_instrumentation

      + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + +

      Methods inherited from WCC::Contentful::SimpleClient

      +

      #get, load_adapter

      + + + + + + + + + +

      Methods included from Instrumentation

      +

      #_instrumentation_event_prefix, instrument

      + +
      +

      Constructor Details

      + +
      +

      + + #initialize(space:, access_token:, **options) ⇒ Cdn + + + + + +

      +
      + +

      Returns a new instance of Cdn.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +
      +
      # File 'lib/wcc/contentful/simple_client/cdn.rb', line 10
      +
      +def initialize(space:, access_token:, **options)
      +  super(
      +    api_url: options[:api_url] || 'https://cdn.contentful.com/',
      +    space: space,
      +    access_token: access_token,
      +    **options
      +  )
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #asset(key, query = {}) ⇒ Object + + + + + +

      +
      + +

      Gets an asset by ID

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +
      +
      # File 'lib/wcc/contentful/simple_client/cdn.rb', line 42
      +
      +def asset(key, query = {})
      +  resp =
      +    _instrument 'entries', type: 'Asset', id: key, query: query do
      +      get("assets/#{key}", query)
      +    end
      +  resp.assert_ok!
      +end
      +
      +
      + +
      +

      + + #assets(query = {}) ⇒ Object + + + + + +

      +
      + +

      Queries assets with optional query parameters

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +
      +
      # File 'lib/wcc/contentful/simple_client/cdn.rb', line 51
      +
      +def assets(query = {})
      +  resp =
      +    _instrument 'entries', type: 'Asset', query: query do
      +      get('assets', query)
      +    end
      +  resp.assert_ok!
      +end
      +
      +
      + +
      +

      + + #client_typeObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +19
      +20
      +21
      +
      +
      # File 'lib/wcc/contentful/simple_client/cdn.rb', line 19
      +
      +def client_type
      +  'cdn'
      +end
      +
      +
      + +
      +

      + + #content_types(query = {}) ⇒ Object + + + + + +

      +
      + +

      Queries content types with optional query parameters

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +
      +
      # File 'lib/wcc/contentful/simple_client/cdn.rb', line 60
      +
      +def content_types(query = {})
      +  resp =
      +    _instrument 'content_types', query: query do
      +      get('content_types', query)
      +    end
      +  resp.assert_ok!
      +end
      +
      +
      + +
      +

      + + #entries(query = {}) ⇒ Object + + + + + +

      +
      + +

      Queries entries with optional query parameters

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +
      +
      # File 'lib/wcc/contentful/simple_client/cdn.rb', line 33
      +
      +def entries(query = {})
      +  resp =
      +    _instrument 'entries', type: 'Entry', query: query do
      +      get('entries', query)
      +    end
      +  resp.assert_ok!
      +end
      +
      +
      + +
      +

      + + #entry(key, query = {}) ⇒ Object + + + + + +

      +
      + +

      Gets an entry by ID

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +
      +
      # File 'lib/wcc/contentful/simple_client/cdn.rb', line 24
      +
      +def entry(key, query = {})
      +  resp =
      +    _instrument 'entries', id: key, type: 'Entry', query: query do
      +      get("entries/#{key}", query)
      +    end
      +  resp.assert_ok!
      +end
      +
      +
      + +
      +

      + + #sync(sync_token: nil, **query, &block) ⇒ Object + + + + + +

      +
      + +

      Accesses the Sync API to get a list of items that have changed since the last sync. Accepts a block that receives each changed item, and returns the next sync token.

      + +

      If `sync_token` is nil, an initial sync is performed.

      + + +
      +
      +
      + +
      +

      Examples:

      + + +
      my_sync_token = storage.get('sync_token')
      +my_sync_token = client.sync(sync_token: my_sync_token) do |item|
      +  storage.put(item.dig('sys', 'id'), item) }
      +end
      +storage.put('sync_token', my_sync_token)
      + +
      + +

      Returns:

      +
        + +
      • + + + + + + + +
        +

        String the next sync token parsed from nextSyncUrl

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +81
      +82
      +83
      +84
      +85
      +86
      +87
      +88
      +89
      +90
      +91
      +92
      +93
      +94
      +95
      +96
      +97
      +98
      +99
      +100
      +101
      +102
      +103
      +104
      +
      +
      # File 'lib/wcc/contentful/simple_client/cdn.rb', line 81
      +
      +def sync(sync_token: nil, **query, &block)
      +  return sync_old(sync_token: sync_token, **query) unless block_given?
      +
      +  sync_token =
      +    if sync_token
      +      { sync_token: sync_token }
      +    else
      +      { initial: true }
      +    end
      +  query = query.merge(sync_token)
      +
      +  _instrument 'sync', sync_token: sync_token, query: query do
      +    resp = get('sync', query)
      +    resp = SyncResponse.new(resp)
      +    resp.assert_ok!
      +
      +    resp.each_page do |page|
      +      page.page_items.each(&block)
      +      sync_token = resp.next_sync_token
      +    end
      +  end
      +
      +  sync_token
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/Management.html b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/Management.html new file mode 100644 index 00000000..972b6552 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/Management.html @@ -0,0 +1,788 @@ + + + + + + + Class: WCC::Contentful::SimpleClient::Management + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::SimpleClient::Management + + + +

      +
      + +
      +
      Inherits:
      +
      + WCC::Contentful::SimpleClient + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/simple_client/management.rb
      +
      + +
      + +
      +
      + + +
      +
      +
      + + +
      + + +

      Constant Summary

      + +

      Constants inherited + from WCC::Contentful::SimpleClient

      +

      ADAPTERS

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from WCC::Contentful::SimpleClient

      +

      #api_url, #space

      + + + +

      Attributes included from Instrumentation

      +

      #_instrumentation

      + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + +

      Methods inherited from WCC::Contentful::SimpleClient

      +

      #get, load_adapter

      + + + + + + + + + +

      Methods included from Instrumentation

      +

      #_instrumentation_event_prefix, instrument

      + +
      +

      Constructor Details

      + +
      +

      + + #initialize(space:, management_token:, **options) ⇒ Management + + + + + +

      +
      + +

      Returns a new instance of Management.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +5
      +6
      +7
      +8
      +9
      +10
      +11
      +12
      +13
      +14
      +15
      +
      +
      # File 'lib/wcc/contentful/simple_client/management.rb', line 5
      +
      +def initialize(space:, management_token:, **options)
      +  super(
      +    **options,
      +    api_url: options[:management_api_url] || 'https://api.contentful.com',
      +    space: space,
      +    access_token: management_token,
      +  )
      +
      +  @post_adapter = @adapter if @adapter.respond_to?(:post)
      +  @post_adapter ||= self.class.load_adapter(nil)
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #client_typeObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +17
      +18
      +19
      +
      +
      # File 'lib/wcc/contentful/simple_client/management.rb', line 17
      +
      +def client_type
      +  'management'
      +end
      +
      +
      + +
      +

      + + #content_type(key, query = {}) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +
      +
      # File 'lib/wcc/contentful/simple_client/management.rb', line 29
      +
      +def content_type(key, query = {})
      +  resp =
      +    _instrument 'content_types', content_type: key, query: query do
      +      get("content_types/#{key}", query)
      +    end
      +  resp.assert_ok!
      +end
      +
      +
      + +
      +

      + + #content_types(**query) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +
      +
      # File 'lib/wcc/contentful/simple_client/management.rb', line 21
      +
      +def content_types(**query)
      +  resp =
      +    _instrument 'content_types', query: query do
      +      get('content_types', query)
      +    end
      +  resp.assert_ok!
      +end
      +
      +
      + +
      +

      + + #editor_interface(content_type_id, query = {}) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +37
      +38
      +39
      +40
      +41
      +42
      +43
      +
      +
      # File 'lib/wcc/contentful/simple_client/management.rb', line 37
      +
      +def editor_interface(content_type_id, query = {})
      +  resp =
      +    _instrument 'editor_interfaces', content_type: content_type_id, query: query do
      +      get("content_types/#{content_type_id}/editor_interface", query)
      +    end
      +  resp.assert_ok!
      +end
      +
      +
      + +
      +

      + + #post(path, body) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +83
      +84
      +85
      +86
      +87
      +88
      +89
      +90
      +91
      +92
      +93
      +94
      +
      +
      # File 'lib/wcc/contentful/simple_client/management.rb', line 83
      +
      +def post(path, body)
      +  url = URI.join(@api_url, path)
      +
      +  resp =
      +    _instrument 'post_http', url: url do
      +      post_http(url, body)
      +    end
      +
      +  Response.new(self,
      +    { url: url, body: body },
      +    resp)
      +end
      +
      +
      + +
      +

      + + #post_webhook_definition(webhook) ⇒ Object + + + + + +

      +
      + +

      {

      + +
      "name": "My webhook",
      +"url": "https://www.example.com/test",
      +"topics": [
      +  "Entry.create",
      +  "ContentType.create",
      +  "*.publish",
      +  "Asset.*"
      +],
      +"httpBasicUsername": "yolo",
      +"httpBasicPassword": "yolo",
      +"headers": [
      +  {
      +    "key": "header1",
      +    "value": "value1"
      +  },
      +  {
      +    "key": "header2",
      +    "value": "value2"
      +  }
      +]
      +
      + +

      }

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +75
      +76
      +77
      +78
      +79
      +80
      +81
      +
      +
      # File 'lib/wcc/contentful/simple_client/management.rb', line 75
      +
      +def post_webhook_definition(webhook)
      +  resp =
      +    _instrument 'post.webhook_definitions' do
      +      post("/spaces/#{space}/webhook_definitions", webhook)
      +    end
      +  resp.assert_ok!
      +end
      +
      +
      + +
      +

      + + #webhook_definitions(**query) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +
      +
      # File 'lib/wcc/contentful/simple_client/management.rb', line 45
      +
      +def webhook_definitions(**query)
      +  resp =
      +    _instrument 'webhook_definitions', query: query do
      +      get("/spaces/#{space}/webhook_definitions", query)
      +    end
      +  resp.assert_ok!
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/NotFoundError.html b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/NotFoundError.html new file mode 100644 index 00000000..219c07f7 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/NotFoundError.html @@ -0,0 +1,157 @@ + + + + + + + Exception: WCC::Contentful::SimpleClient::NotFoundError + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: WCC::Contentful::SimpleClient::NotFoundError + + + +

      +
      + +
      +
      Inherits:
      +
      + ApiError + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/simple_client/response.rb
      +
      + +
      + +
      +
      + + +
      +
      +
      + + +
      + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from ApiError

      +

      #response

      + + + + + + + + + +

      Method Summary

      + +

      Methods inherited from ApiError

      +

      [], #initialize

      + +
      +

      Constructor Details

      + +

      This class inherits a constructor from WCC::Contentful::SimpleClient::ApiError

      + +
      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/PaginatingEnumerable.html b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/PaginatingEnumerable.html new file mode 100644 index 00000000..988ad761 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/PaginatingEnumerable.html @@ -0,0 +1,327 @@ + + + + + + + Class: WCC::Contentful::SimpleClient::PaginatingEnumerable + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::SimpleClient::PaginatingEnumerable + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Enumerable
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/simple_client/response.rb
      +
      + +
      + +
      +
      + + +
      +
      +
      + + +
      + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(initial_page) ⇒ PaginatingEnumerable + + + + + +

      +
      + +

      Returns a new instance of PaginatingEnumerable.

      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (ArgumentError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +177
      +178
      +179
      +180
      +181
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 177
      +
      +def initialize(initial_page)
      +  raise ArgumentError, 'Must provide initial page' unless initial_page.present?
      +
      +  @initial_page = initial_page
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #each {|page| ... } ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + +

      Yields:

      +
        + +
      • + + + (page) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +183
      +184
      +185
      +186
      +187
      +188
      +189
      +190
      +191
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 183
      +
      +def each
      +  page = @initial_page
      +  yield page
      +
      +  while page.next_page?
      +    page = page.next_page
      +    yield page
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/Preview.html b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/Preview.html new file mode 100644 index 00000000..467506ac --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/Preview.html @@ -0,0 +1,343 @@ + + + + + + + Class: WCC::Contentful::SimpleClient::Preview + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::SimpleClient::Preview + + + +

      +
      + +
      +
      Inherits:
      +
      + Cdn + + + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/simple_client/preview.rb
      +
      + +
      + +
      +
      + + +
      +
      +
      + + +
      + + +

      Constant Summary

      + +

      Constants inherited + from WCC::Contentful::SimpleClient

      +

      ADAPTERS

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from WCC::Contentful::SimpleClient

      +

      #api_url, #space

      + + + +

      Attributes included from Instrumentation

      +

      #_instrumentation

      + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + +

      Methods inherited from Cdn

      +

      #asset, #assets, #content_types, #entries, #entry, #sync

      + + + + + + + + + +

      Methods inherited from WCC::Contentful::SimpleClient

      +

      #get, load_adapter

      + + + + + + + + + +

      Methods included from Instrumentation

      +

      #_instrumentation_event_prefix, instrument

      + +
      +

      Constructor Details

      + +
      +

      + + #initialize(space:, preview_token:, **options) ⇒ Preview + + + + + +

      +
      + +

      Returns a new instance of Preview.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +5
      +6
      +7
      +8
      +9
      +10
      +11
      +12
      +
      +
      # File 'lib/wcc/contentful/simple_client/preview.rb', line 5
      +
      +def initialize(space:, preview_token:, **options)
      +  super(
      +    **options,
      +    api_url: options[:preview_api_url] || 'https://preview.contentful.com/',
      +    space: space,
      +    access_token: preview_token
      +  )
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #client_typeObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +14
      +15
      +16
      +
      +
      # File 'lib/wcc/contentful/simple_client/preview.rb', line 14
      +
      +def client_type
      +  'preview'
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/RateLimitError.html b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/RateLimitError.html new file mode 100644 index 00000000..3c668d4b --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/RateLimitError.html @@ -0,0 +1,157 @@ + + + + + + + Exception: WCC::Contentful::SimpleClient::RateLimitError + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: WCC::Contentful::SimpleClient::RateLimitError + + + +

      +
      + +
      +
      Inherits:
      +
      + ApiError + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/simple_client/response.rb
      +
      + +
      + +
      +
      + + +
      +
      +
      + + +
      + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from ApiError

      +

      #response

      + + + + + + + + + +

      Method Summary

      + +

      Methods inherited from ApiError

      +

      [], #initialize

      + +
      +

      Constructor Details

      + +

      This class inherits a constructor from WCC::Contentful::SimpleClient::ApiError

      + +
      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/Response.html b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/Response.html new file mode 100644 index 00000000..5bc2bebe --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/Response.html @@ -0,0 +1,1440 @@ + + + + + + + Class: WCC::Contentful::SimpleClient::Response + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::SimpleClient::Response + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Instrumentation
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/simple_client/response.rb
      +
      + +
      + +
      +
      + + +
      +
      +
      + + +
      +

      Direct Known Subclasses

      +

      SyncResponse

      +
      + + + + +

      Instance Attribute Summary collapse

      + + + + + + +

      Attributes included from Instrumentation

      +

      #_instrumentation

      + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + +

      Methods included from Instrumentation

      +

      #_instrumentation_event_prefix, instrument

      + +
      +

      Constructor Details

      + +
      +

      + + #initialize(client, request, raw_response) ⇒ Response + + + + + +

      +
      + +

      Returns a new instance of Response.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +61
      +62
      +63
      +64
      +65
      +66
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 61
      +
      +def initialize(client, request, raw_response)
      +  @client = client
      +  @request = request
      +  @raw_response = raw_response
      +  @body = raw_response.body.to_s
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #clientObject (readonly) + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +9
      +10
      +11
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 9
      +
      +def client
      +  @client
      +end
      +
      +
      + + + +
      +

      + + #raw_responseObject (readonly) + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +9
      +10
      +11
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 9
      +
      +def raw_response
      +  @raw_response
      +end
      +
      +
      + + + +
      +

      + + #requestObject (readonly) + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +9
      +10
      +11
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 9
      +
      +def request
      +  @request
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #assert_ok!Object + + + + + +

      +
      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (ApiError[status]) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +68
      +69
      +70
      +71
      +72
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 68
      +
      +def assert_ok!
      +  return self if status >= 200 && status < 300
      +
      +  raise ApiError[status], self
      +end
      +
      +
      + +
      +

      + + #bodyObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +15
      +16
      +17
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 15
      +
      +def body
      +  @body ||= raw_response.body.to_s
      +end
      +
      +
      + +
      +

      + + #countObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +94
      +95
      +96
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 94
      +
      +def count
      +  total
      +end
      +
      +
      + +
      +

      + + #each_page(&block) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (ArgumentError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +74
      +75
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +83
      +84
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 74
      +
      +def each_page(&block)
      +  raise ArgumentError, 'Not a collection response' unless page_items
      +
      +  ret = PaginatingEnumerable.new(self)
      +
      +  if block_given?
      +    ret.map(&block)
      +  else
      +    ret.lazy
      +  end
      +end
      +
      +
      + +
      +

      + + #error_messageObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +31
      +32
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 24
      +
      +def error_message
      +  parsed_message =
      +    begin
      +      raw['message']
      +    rescue JSON::ParserError
      +      nil
      +    end
      +  parsed_message || "#{code}: #{raw_response.body}"
      +end
      +
      +
      + +
      +

      + + #firstObject + + + + + +

      +
      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (ArgumentError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +98
      +99
      +100
      +101
      +102
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 98
      +
      +def first
      +  raise ArgumentError, 'Not a collection response' unless page_items
      +
      +  page_items.first
      +end
      +
      +
      + +
      +

      + + #includesObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +104
      +105
      +106
      +107
      +108
      +109
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 104
      +
      +def includes
      +  @includes ||=
      +    raw['includes']&.each_with_object({}) do |(_t, entries), h|
      +      entries.each { |e| h[e.dig('sys', 'id')] = e }
      +    end || {}
      +end
      +
      +
      + +
      +

      + + #itemsObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +86
      +87
      +88
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 86
      +
      +def items
      +  each_page.flat_map(&:page_items)
      +end
      +
      +
      + +
      +

      + + #next_pageObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 48
      +
      +def next_page
      +  return unless next_page?
      +
      +  query = (@request[:query] || {}).merge({
      +    skip: page_items.length + skip
      +  })
      +  np =
      +    _instrument 'page', url: @request[:url], query: query do
      +      @client.get(@request[:url], query)
      +    end
      +  np.assert_ok!
      +end
      +
      +
      + +
      +

      + + #next_page?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +42
      +43
      +44
      +45
      +46
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 42
      +
      +def next_page?
      +  return unless raw.key? 'items'
      +
      +  page_items.length + skip < total
      +end
      +
      +
      + +
      +

      + + #page_itemsObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +90
      +91
      +92
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 90
      +
      +def page_items
      +  raw['items']
      +end
      +
      +
      + +
      +

      + + #rawObject + + + + Also known as: + to_json + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +19
      +20
      +21
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 19
      +
      +def raw
      +  @raw ||= JSON.parse(body)
      +end
      +
      +
      + +
      +

      + + #skipObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +34
      +35
      +36
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 34
      +
      +def skip
      +  raw['skip']
      +end
      +
      +
      + +
      +

      + + #totalObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +38
      +39
      +40
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 38
      +
      +def total
      +  raw['total']
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/SyncResponse.html b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/SyncResponse.html new file mode 100644 index 00000000..d927a998 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/SyncResponse.html @@ -0,0 +1,724 @@ + + + + + + + Class: WCC::Contentful::SimpleClient::SyncResponse + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::SimpleClient::SyncResponse + + + +

      +
      + +
      +
      Inherits:
      +
      + Response + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/simple_client/response.rb
      +
      + +
      + +
      +
      + + +
      +
      +
      + + +
      + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Response

      +

      #client, #raw_response, #request

      + + + +

      Attributes included from Instrumentation

      +

      #_instrumentation

      + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + +

      Methods inherited from Response

      +

      #assert_ok!, #body, #error_message, #first, #includes, #items, #page_items, #raw, #skip, #total

      + + + + + + + + + +

      Methods included from Instrumentation

      +

      #_instrumentation_event_prefix, instrument

      + +
      +

      Constructor Details

      + +
      +

      + + #initialize(response, memoize: false) ⇒ SyncResponse + + + + + +

      +
      + +

      Returns a new instance of SyncResponse.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +113
      +114
      +115
      +116
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 113
      +
      +def initialize(response, memoize: false)
      +  super(response.client, response.request, response.raw_response)
      +  @memoize = memoize
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .parse_sync_token(url) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +167
      +168
      +169
      +170
      +171
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 167
      +
      +def self.parse_sync_token(url)
      +  url = URI.parse(url)
      +  q = CGI.parse(url.query)
      +  q['sync_token']&.first
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #countObject + + + + + +

      +
      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (NotImplementedError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +162
      +163
      +164
      +165
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 162
      +
      +def count
      +  raise NotImplementedError,
      +    'Sync does not return an accurate total.  Use #items.count instead.'
      +end
      +
      +
      + +
      +

      + + #each_page(&block) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +147
      +148
      +149
      +150
      +151
      +152
      +153
      +154
      +155
      +156
      +157
      +158
      +159
      +160
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 147
      +
      +def each_page(&block)
      +  if block_given?
      +    super do |page|
      +      @last_sync_token = page.next_sync_token
      +
      +      yield page
      +    end
      +  else
      +    super.map do |page|
      +      @last_sync_token = page.next_sync_token
      +      page
      +    end
      +  end
      +end
      +
      +
      + +
      +

      + + #next_pageObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +122
      +123
      +124
      +125
      +126
      +127
      +128
      +129
      +130
      +131
      +132
      +133
      +134
      +135
      +136
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 122
      +
      +def next_page
      +  return unless next_page?
      +  return @next_page if @next_page
      +
      +  url = raw['nextPageUrl']
      +  next_page =
      +    _instrument 'page', url: url do
      +      @client.get(url)
      +    end
      +
      +  next_page = SyncResponse.new(next_page)
      +  next_page.assert_ok!
      +  @next_page = next_page if @memoize
      +  next_page
      +end
      +
      +
      + +
      +

      + + #next_page?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +118
      +119
      +120
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 118
      +
      +def next_page?
      +  raw['nextPageUrl'].present?
      +end
      +
      +
      + +
      +

      + + #next_sync_tokenObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +138
      +139
      +140
      +141
      +142
      +143
      +144
      +145
      +
      +
      # File 'lib/wcc/contentful/simple_client/response.rb', line 138
      +
      +def next_sync_token
      +  # If we have iterated some pages, return the sync token of the final
      +  # page that was iterated.  Do this without maintaining a reference to
      +  # all the pages.
      +  return @last_sync_token if @last_sync_token
      +
      +  SyncResponse.parse_sync_token(raw['nextPageUrl'] || raw['nextSyncUrl'])
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/TyphoeusAdapter.html b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/TyphoeusAdapter.html new file mode 100644 index 00000000..a3cfd438 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/TyphoeusAdapter.html @@ -0,0 +1,337 @@ + + + + + + + Class: WCC::Contentful::SimpleClient::TyphoeusAdapter + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::SimpleClient::TyphoeusAdapter + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/simple_client/typhoeus_adapter.rb
      +
      + +
      + +
      +
      + + +
      +
      +
      + + +

      Defined Under Namespace

      +

      + + + + + Classes: Response + + +

      + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #get(url, params = {}, headers = {}) {|req| ... } ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + +

      Yields:

      +
        + +
      • + + + (req) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +7
      +8
      +9
      +10
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +
      +
      # File 'lib/wcc/contentful/simple_client/typhoeus_adapter.rb', line 7
      +
      +def get(url, params = {}, headers = {})
      +  req = OpenStruct.new(params: params, headers: headers)
      +  yield req if block_given?
      +  Response.new(
      +    Typhoeus.get(
      +      url,
      +      params: req.params,
      +      headers: req.headers
      +    )
      +  )
      +end
      +
      +
      + +
      +

      + + #post(url, body, headers = {}, proxy = {}) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (NotImplementedError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +
      +
      # File 'lib/wcc/contentful/simple_client/typhoeus_adapter.rb', line 19
      +
      +def post(url, body, headers = {}, proxy = {})
      +  raise NotImplementedError, 'Proxying Not Yet Implemented' if proxy[:host]
      +
      +  Response.new(
      +    Typhoeus.post(
      +      url,
      +      body: body.to_json,
      +      headers: headers
      +    )
      +  )
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/TyphoeusAdapter/Response.html b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/TyphoeusAdapter/Response.html new file mode 100644 index 00000000..10259040 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/TyphoeusAdapter/Response.html @@ -0,0 +1,272 @@ + + + + + + + Class: WCC::Contentful::SimpleClient::TyphoeusAdapter::Response + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::SimpleClient::TyphoeusAdapter::Response + + + +

      +
      + +
      +
      Inherits:
      +
      + SimpleDelegator + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/simple_client/typhoeus_adapter.rb
      +
      + +
      + +
      +
      + + +
      +
      +
      + + +
      + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #rawObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +34
      +35
      +36
      +
      +
      # File 'lib/wcc/contentful/simple_client/typhoeus_adapter.rb', line 34
      +
      +def raw
      +  __getobj__
      +end
      +
      +
      + +
      +

      + + #statusObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +38
      +39
      +40
      +
      +
      # File 'lib/wcc/contentful/simple_client/typhoeus_adapter.rb', line 38
      +
      +def status
      +  code
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/UnauthorizedError.html b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/UnauthorizedError.html new file mode 100644 index 00000000..4afaa8e3 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/SimpleClient/UnauthorizedError.html @@ -0,0 +1,157 @@ + + + + + + + Exception: WCC::Contentful::SimpleClient::UnauthorizedError + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: WCC::Contentful::SimpleClient::UnauthorizedError + + + +

      +
      + +
      +
      Inherits:
      +
      + ApiError + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/simple_client/response.rb
      +
      + +
      + +
      +
      + + +
      +
      +
      + + +
      + + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from ApiError

      +

      #response

      + + + + + + + + + +

      Method Summary

      + +

      Methods inherited from ApiError

      +

      [], #initialize

      + +
      +

      Constructor Details

      + +

      This class inherits a constructor from WCC::Contentful::SimpleClient::ApiError

      + +
      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Store.html b/docs/1.3/wcc-contentful/WCC/Contentful/Store.html new file mode 100644 index 00000000..30722f8d --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Store.html @@ -0,0 +1,176 @@ + + + + + + + Module: WCC::Contentful::Store + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC::Contentful::Store + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/store/base.rb,
      + lib/wcc/contentful/store/query.rb,
      lib/wcc/contentful/store/factory.rb,
      lib/wcc/contentful/store/interface.rb,
      lib/wcc/contentful/store/cdn_adapter.rb,
      lib/wcc/contentful/store/memory_store.rb,
      lib/wcc/contentful/store/postgres_store.rb,
      lib/wcc/contentful/store/instrumentation.rb,
      lib/wcc/contentful/store.rb
      +
      +
      + +
      + +

      Overview

      +
      + +

      The “Store” is the middle layer in the WCC::Contentful gem. It exposes an API that implements the configured content delivery strategy.

      + +

      The different content delivery strategies require different store implementations.

      +
      direct +
      +

      Uses the WCC::Contentful::Store::CDNAdapter to wrap the Contentful CDN, providing an API consistent with the other stores. Any query made to the CDNAdapter will be immediately passed through to the API. The CDNAdapter does not implement #index because it does not care about updates coming from the Sync API.

      +
      lazy_sync +
      +

      Uses the Contentful CDN in combination with an ActiveSupport::Cache implementation in order to respond with the cached data where possible, saving your CDN quota. The cache is kept up-to-date via the Sync Engine and the WCC::Contentful::SyncEngine::Job. It is correct, but not complete.

      +
      eager_sync +
      +

      Uses one of the full store implementations to store the entirety of the Contentful space locally. All queries are run against this local copy, which is kept up to date via the Sync Engine and the WCC::Contentful::SyncEngine::Job. The local store is correct and complete.

      +
      + +

      The currently configured store is available on WCC::Contentful::Services.instance.store

      + + +
      +
      +
      + + +

      Defined Under Namespace

      +

      + + + Modules: Instrumentation, InstrumentationWrapper, Interface + + + + Classes: Base, CDNAdapter, Factory, InstrumentationMiddleware, MemoryStore, PostgresStore, Query + + +

      + + +

      + Constant Summary + collapse +

      + +
      + +
      SYNC_STORES = + +
      +
      {
      +  memory: ->(_config, *_options) { WCC::Contentful::Store::MemoryStore.new },
      +  postgres: ->(config, *options) {
      +    require_relative 'store/postgres_store'
      +    WCC::Contentful::Store::PostgresStore.new(config, *options)
      +  }
      +}.freeze
      + +
      PRESETS = + +
      +
      %i[
      +  eager_sync
      +  lazy_sync
      +  direct
      +  custom
      +].freeze
      + +
      + + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Store/Base.html b/docs/1.3/wcc-contentful/WCC/Contentful/Store/Base.html new file mode 100644 index 00000000..787aa2ae --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Store/Base.html @@ -0,0 +1,955 @@ + + + + + + + Class: WCC::Contentful::Store::Base + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Store::Base + Abstract + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Interface
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/store/base.rb
      +
      + +
      + +

      Overview

      +
      +
      + This class is abstract. +
      +

      At a minimum subclasses should override Interface#find, #execute, #set, and ##delete. As an alternative to overriding set and delete, the subclass can override #index. Index is called when a webhook triggers a sync, to update the store.

      +
      +
      + +

      This is the base class for stores which implement #index, and therefore must be kept up-to-date via the Sync API. To implement a new store, you should include the rspec_examples in your rspec tests for the store. See spec/wcc/contentful/store/memory_store_spec.rb for an example.

      + + +
      +
      +
      + + +
      +

      Direct Known Subclasses

      +

      MemoryStore, PostgresStore

      +
      + + + +

      Constant Summary

      + +

      Constants included + from Interface

      +

      Interface::INTERFACE_METHODS

      + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + +

      Methods included from Interface

      +

      #find

      + + +
      +

      Instance Method Details

      + + +
      +

      + + #delete(_id) ⇒ Object + + + + + +

      +
      +
      + This method is abstract. +
      +
      + +

      Removes the entry by ID from the store.

      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (NotImplementedError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +28
      +29
      +30
      +
      +
      # File 'lib/wcc/contentful/store/base.rb', line 28
      +
      +def delete(_id)
      +  raise NotImplementedError, "#{self.class} does not implement #delete"
      +end
      +
      +
      + +
      +

      + + #ensure_hash(val) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (ArgumentError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +110
      +111
      +112
      +
      +
      # File 'lib/wcc/contentful/store/base.rb', line 110
      +
      +def ensure_hash(val)
      +  raise ArgumentError, 'Value must be a Hash' unless val.is_a?(Hash)
      +end
      +
      +
      + +
      +

      + + #execute(_query) ⇒ Object + + + + + +

      +
      +
      + This method is abstract. +
      +
      + +

      Executes a WCC::Contentful::Store::Query object created by #find_all or #find_by. Implementations should override this to translate the query's conditions into a query against the datastore.

      + +

      For a very naiive implementation see WCC::Contentful::Store::MemoryStore#execute

      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (NotImplementedError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +38
      +39
      +40
      +
      +
      # File 'lib/wcc/contentful/store/base.rb', line 38
      +
      +def execute(_query)
      +  raise NotImplementedError, "#{self.class} does not implement #execute"
      +end
      +
      +
      + +
      +

      + + #find_all(content_type:, options: nil) ⇒ Query + + + + + +

      +
      + +

      Finds all entries of the given content type. A content type is required.

      + +

      Subclasses may override this to provide their own query implementation,

      + +
      or else override #execute to run the query after it has been parsed.
      +
      + + +
      +
      +
      +

      Parameters:

      +
        + +
      • + + content_type + + + (String) + + + + — +
        +

        The ID of the content type to search for.

        +
        + +
      • + +
      • + + options + + + (Hash) + + + (defaults to: nil) + + + — +
        +

        An optional set of additional parameters to the query defining for example include depth. Not all store implementations respect all options.

        +
        + +
      • + +
      + +

      Returns:

      +
        + +
      • + + + (Query) + + + + — +
        +

        A query object that exposes methods to apply filters

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +102
      +103
      +104
      +105
      +106
      +107
      +108
      +
      +
      # File 'lib/wcc/contentful/store/base.rb', line 102
      +
      +def find_all(content_type:, options: nil)
      +  Query.new(
      +    self,
      +    content_type: content_type,
      +    options: options
      +  )
      +end
      +
      +
      + +
      +

      + + #find_by(content_type:, filter: nil, options: nil) ⇒ Object + + + + + +

      +
      + +

      Finds the first entry matching the given filter. A content type is required.

      + + +
      +
      +
      +

      Parameters:

      +
        + +
      • + + content_type + + + (String) + + + + — +
        +

        The ID of the content type to search for.

        +
        + +
      • + +
      • + + filter + + + (Hash) + + + (defaults to: nil) + + + — +
        +

        A set of key-value pairs defining filter operations. See WCC::Contentful::Store::Base::Query

        +
        + +
      • + +
      • + + options + + + (Hash) + + + (defaults to: nil) + + + — +
        +

        An optional set of additional parameters to the query defining for example include depth. Not all store implementations respect all options.

        +
        + +
      • + +
      + + +
      + + + + +
      +
      +
      +
      +87
      +88
      +89
      +90
      +91
      +92
      +
      +
      # File 'lib/wcc/contentful/store/base.rb', line 87
      +
      +def find_by(content_type:, filter: nil, options: nil)
      +  # default implementation - can be overridden
      +  q = find_all(content_type: content_type, options: { limit: 1 }.merge!(options || {}))
      +  q = q.apply(filter) if filter
      +  q.first
      +end
      +
      +
      + +
      +

      + + #index(json) ⇒ Object + + + + + +

      +
      + +

      Processes a data point received via the Sync API. This can be a published entry or asset, or a 'DeletedEntry' or 'DeletedAsset'. The default implementation calls into #set and #delete to perform the appropriate operations in the store.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +74
      +75
      +76
      +77
      +78
      +
      +
      # File 'lib/wcc/contentful/store/base.rb', line 52
      +
      +def index(json)
      +  # This implementation assumes that #delete and #set are individually thread-safe.
      +  # No mutex is needed so long as the revisions are accurate.
      +  # Subclasses can override to do this in a more performant thread-safe way.
      +  # Example: postgres_store could do this in a stored procedure for speed
      +  prev =
      +    case type = json.dig('sys', 'type')
      +    when 'DeletedEntry', 'DeletedAsset'
      +      delete(json.dig('sys', 'id'))
      +    else
      +      set(json.dig('sys', 'id'), json)
      +    end
      +
      +  if (prev_rev = prev&.dig('sys', 'revision')) &&
      +      (next_rev = json.dig('sys', 'revision')) &&
      +      (next_rev < prev_rev)
      +    # Uh oh! we overwrote an entry with a prior revision.  Put the previous back.
      +    return index(prev)
      +  end
      +
      +  case type
      +  when 'DeletedEntry', 'DeletedAsset'
      +    nil
      +  else
      +    json
      +  end
      +end
      +
      +
      + +
      +

      + + #index?Boolean + + + + + +

      +
      + +

      Returns true if this store can persist entries and assets which are retrieved from the sync API.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +44
      +45
      +46
      +
      +
      # File 'lib/wcc/contentful/store/base.rb', line 44
      +
      +def index?
      +  true
      +end
      +
      +
      + +
      +

      + + #set(_id, _value) ⇒ Object + + + + + +

      +
      +
      + This method is abstract. +
      +
      + +

      Sets the value of the entry with the given ID in the store.

      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (NotImplementedError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +22
      +23
      +24
      +
      +
      # File 'lib/wcc/contentful/store/base.rb', line 22
      +
      +def set(_id, _value)
      +  raise NotImplementedError, "#{self.class} does not implement #set"
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Store/CDNAdapter.html b/docs/1.3/wcc-contentful/WCC/Contentful/Store/CDNAdapter.html new file mode 100644 index 00000000..d2acb995 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Store/CDNAdapter.html @@ -0,0 +1,774 @@ + + + + + + + Class: WCC::Contentful::Store::CDNAdapter + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Store::CDNAdapter + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Interface
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/store/cdn_adapter.rb
      +
      + +
      + +
      +
      + + +
      +
      +
      + + +

      Defined Under Namespace

      +

      + + + + + Classes: Query + + +

      + + + +

      Constant Summary

      + +

      Constants included + from Interface

      +

      Interface::INTERFACE_METHODS

      + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #client ⇒ Object + + + + + + + + + + + + + + + + +
        + +
      • + + +
      • + + + #preview_client ⇒ Object + + + + + + + + + + writeonly + + + + + + + + +
        +

        NOTE: CDNAdapter should not instrument store events cause it's not a store.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(client = nil, preview: false) ⇒ CDNAdapter + + + + + +

      +
      + +

      Intentionally not implementing write methods

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +25
      +26
      +27
      +28
      +29
      +
      +
      # File 'lib/wcc/contentful/store/cdn_adapter.rb', line 25
      +
      +def initialize(client = nil, preview: false)
      +  super()
      +  @client = client
      +  @preview = preview
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #clientObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +
      +
      # File 'lib/wcc/contentful/store/cdn_adapter.rb', line 10
      +
      +def client
      +  @preview ? @preview_client : @client
      +end
      +
      +
      + + + +
      +

      + + #preview_client=(value) ⇒ Object (writeonly) + + + + + +

      +
      + +

      NOTE: CDNAdapter should not instrument store events cause it's not a store.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +8
      +9
      +10
      +
      +
      # File 'lib/wcc/contentful/store/cdn_adapter.rb', line 8
      +
      +def preview_client=(value)
      +  @preview_client = value
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #find(key, hint: nil, **options) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +
      +
      # File 'lib/wcc/contentful/store/cdn_adapter.rb', line 31
      +
      +def find(key, hint: nil, **options)
      +  options = { locale: '*' }.merge!(options || {})
      +  entry =
      +    if hint
      +      client.public_send(hint.underscore, key, options)
      +    else
      +      begin
      +        client.entry(key, options)
      +      rescue WCC::Contentful::SimpleClient::NotFoundError
      +        client.asset(key, options)
      +      end
      +    end
      +  entry&.raw
      +rescue WCC::Contentful::SimpleClient::NotFoundError
      +  nil
      +end
      +
      +
      + +
      +

      + + #find_all(content_type:, options: nil) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +
      +
      # File 'lib/wcc/contentful/store/cdn_adapter.rb', line 55
      +
      +def find_all(content_type:, options: nil)
      +  Query.new(
      +    self,
      +    client: client,
      +    relation: { content_type: content_type },
      +    options: options
      +  )
      +end
      +
      +
      + +
      +

      + + #find_by(content_type:, filter: nil, options: nil) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +48
      +49
      +50
      +51
      +52
      +53
      +
      +
      # File 'lib/wcc/contentful/store/cdn_adapter.rb', line 48
      +
      +def find_by(content_type:, filter: nil, options: nil)
      +  # default implementation - can be overridden
      +  q = find_all(content_type: content_type, options: { limit: 1 }.merge!(options || {}))
      +  q = q.apply(filter) if filter
      +  q.first
      +end
      +
      +
      + +
      +

      + + #indexObject + + + + + +

      +
      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (NotImplementedError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +19
      +20
      +21
      +
      +
      # File 'lib/wcc/contentful/store/cdn_adapter.rb', line 19
      +
      +def index
      +  raise NotImplementedError, 'Cannot put data to the CDN!'
      +end
      +
      +
      + +
      +

      + + #index?Boolean + + + + + +

      +
      + +

      The CDNAdapter cannot index data coming back from the Sync API.

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +15
      +16
      +17
      +
      +
      # File 'lib/wcc/contentful/store/cdn_adapter.rb', line 15
      +
      +def index?
      +  false
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Store/CDNAdapter/Query.html b/docs/1.3/wcc-contentful/WCC/Contentful/Store/CDNAdapter/Query.html new file mode 100644 index 00000000..6caa2a8a --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Store/CDNAdapter/Query.html @@ -0,0 +1,585 @@ + + + + + + + Class: WCC::Contentful::Store::CDNAdapter::Query + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Store::CDNAdapter::Query + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Enumerable, Query::Interface
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/store/cdn_adapter.rb
      +
      + +
      + +
      +
      + + +
      +
      +
      + + +
      + + +

      Constant Summary

      + +

      Constants included + from Query::Interface

      +

      Query::Interface::OPERATORS

      + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + + +

      Methods included from Query::Interface

      +

      #eq

      + +
      +

      Constructor Details

      + +
      +

      + + #initialize(store, client:, relation:, options: nil, **extra) ⇒ Query + + + + + +

      +
      + +

      Returns a new instance of Query.

      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (ArgumentError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +84
      +85
      +86
      +87
      +88
      +89
      +90
      +91
      +92
      +93
      +
      +
      # File 'lib/wcc/contentful/store/cdn_adapter.rb', line 84
      +
      +def initialize(store, client:, relation:, options: nil, **extra)
      +  raise ArgumentError, 'Client cannot be nil' unless client.present?
      +  raise ArgumentError, 'content_type must be provided' unless relation[:content_type].present?
      +
      +  @store = store
      +  @client = client
      +  @relation = relation
      +  @options = options || {}
      +  @extra = extra || {}
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #apply(filter, context = nil) ⇒ Object + + + + + +

      +
      + +

      Called with a filter object by Base#find_by in order to apply the filter.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +96
      +97
      +98
      +99
      +100
      +101
      +102
      +103
      +104
      +105
      +106
      +107
      +108
      +
      +
      # File 'lib/wcc/contentful/store/cdn_adapter.rb', line 96
      +
      +def apply(filter, context = nil)
      +  filter.reduce(self) do |query, (field, value)|
      +    if value.is_a?(Hash)
      +      if op?(k = value.keys.first)
      +        query.apply_operator(k.to_sym, field.to_s, value[k], context)
      +      else
      +        query.nested_conditions(field, value, context)
      +      end
      +    else
      +      query.apply_operator(:eq, field.to_s, value)
      +    end
      +  end
      +end
      +
      +
      + +
      +

      + + #apply_operator(operator, field, expected, context = nil) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +110
      +111
      +112
      +113
      +114
      +115
      +116
      +117
      +118
      +119
      +120
      +121
      +122
      +123
      +124
      +125
      +126
      +
      +
      # File 'lib/wcc/contentful/store/cdn_adapter.rb', line 110
      +
      +def apply_operator(operator, field, expected, context = nil)
      +  op = operator == :eq ? nil : operator
      +  if expected.is_a?(Array)
      +    expected = expected.join(',')
      +    op = :in if op.nil?
      +  end
      +
      +  param = parameter(field, operator: op, context: context, locale: true)
      +
      +  self.class.new(
      +    @store,
      +    client: @client,
      +    relation: @relation.merge(param => expected),
      +    options: @options,
      +    **@extra
      +  )
      +end
      +
      +
      + +
      +

      + + #nested_conditions(field, conditions, context) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +128
      +129
      +130
      +131
      +132
      +133
      +134
      +
      +
      # File 'lib/wcc/contentful/store/cdn_adapter.rb', line 128
      +
      +def nested_conditions(field, conditions, context)
      +  base_param = parameter(field)
      +
      +  conditions.reduce(self) do |query, (ref, value)|
      +    query.apply({ "#{base_param}.#{parameter(ref)}" => value }, context)
      +  end
      +end
      +
      +
      + +
      +

      + + #to_enumObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +74
      +75
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +
      +
      # File 'lib/wcc/contentful/store/cdn_adapter.rb', line 74
      +
      +def to_enum
      +  return response.each_page.flat_map(&:page_items) unless @options[:include]
      +
      +  response.each_page
      +    .flat_map { |page| page.page_items.each_with_object(page).to_a }
      +    .map do |e, page|
      +      resolve_includes(e, page.includes, depth: @options[:include])
      +    end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Store/Factory.html b/docs/1.3/wcc-contentful/WCC/Contentful/Store/Factory.html new file mode 100644 index 00000000..b2c1c32b --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Store/Factory.html @@ -0,0 +1,1333 @@ + + + + + + + Class: WCC::Contentful::Store::Factory + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Store::Factory + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/store/factory.rb
      +
      + +
      + +

      Overview

      +
      + +

      This factory presents a DSL for configuring the store stack. The store stack sits in between the Model layer and the datastore, which can be Contentful or something else like Postgres.

      + +

      A set of “presets” are available to get pre-configured stacks based on what we've found most useful.

      + + +
      +
      +
      + + +
      + + + +

      Instance Attribute Summary collapse

      + + + + + + +

      + Class Method Summary + collapse +

      + +
        + +
      • + + + .default_middleware ⇒ Object + + + + + + + + + + + + + +
        +

        The middleware that by default lives at the top of the middleware stack.

        +
        + +
      • + + +
      + +

      + Instance Method Summary + collapse +

      + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(config = WCC::Contentful.configuration, preset = :direct, options = nil) ⇒ Factory + + + + + +

      +
      + +

      Returns a new instance of Factory.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +27
      +28
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +
      +
      # File 'lib/wcc/contentful/store/factory.rb', line 27
      +
      +def initialize(config = WCC::Contentful.configuration, preset = :direct, options = nil)
      +  @config = config
      +  @preset = preset || :custom
      +  @options = [*options] || []
      +
      +  # Infer whether they passed in a store implementation object or class
      +  if class_implements_store_interface?(@preset) ||
      +      object_implements_store_interface?(@preset)
      +    @options.unshift(@preset)
      +    @preset = :custom
      +  end
      +
      +  configure_preset(@preset)
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #configObject (readonly) + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +17
      +18
      +19
      +
      +
      # File 'lib/wcc/contentful/store/factory.rb', line 17
      +
      +def config
      +  @config
      +end
      +
      +
      + + + +
      +

      + + #optionsObject (readonly) + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +17
      +18
      +19
      +
      +
      # File 'lib/wcc/contentful/store/factory.rb', line 17
      +
      +def options
      +  @options
      +end
      +
      +
      + + + +
      +

      + + #presetObject (readonly) + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +17
      +18
      +19
      +
      +
      # File 'lib/wcc/contentful/store/factory.rb', line 17
      +
      +def preset
      +  @preset
      +end
      +
      +
      + + + +
      +

      + + #storeObject + + + + + +

      +
      + +

      Set the base store instance.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +20
      +21
      +22
      +
      +
      # File 'lib/wcc/contentful/store/factory.rb', line 20
      +
      +def store
      +  @store
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .default_middlewareObject + + + + + +

      +
      + +

      The middleware that by default lives at the top of the middleware stack.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +175
      +176
      +177
      +178
      +179
      +
      +
      # File 'lib/wcc/contentful/store/factory.rb', line 175
      +
      +def default_middleware
      +  [
      +    [WCC::Contentful::Store::InstrumentationMiddleware]
      +  ].freeze
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #build(services = WCC::Contentful::Services.instance) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +74
      +75
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +
      +
      # File 'lib/wcc/contentful/store/factory.rb', line 64
      +
      +def build(services = WCC::Contentful::Services.instance)
      +  store_instance = build_store(services)
      +  options = {
      +    config: config,
      +    services: services
      +  }
      +  middleware.reverse
      +    .reduce(store_instance) do |memo, middleware_config|
      +      # May have added a middleware with `middleware << MyMiddleware.new`
      +      middleware_config = [middleware_config] unless middleware_config.is_a? Array
      +
      +      middleware, params, configure_proc = middleware_config
      +      middleware_options = options.merge((params || []).extract_options!)
      +      middleware = middleware.call(memo, *params, **middleware_options)
      +      services.inject_into(middleware, except: %i[store preview_store])
      +      middleware&.instance_exec(&configure_proc) if configure_proc
      +      middleware || memo
      +    end
      +end
      +
      +
      + +
      +

      + + #middlewareObject + + + + + +

      +
      + +

      An array of tuples that set up and configure a Store middleware.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +23
      +24
      +25
      +
      +
      # File 'lib/wcc/contentful/store/factory.rb', line 23
      +
      +def middleware
      +  @middleware ||= self.class.default_middleware.dup
      +end
      +
      +
      + +
      +

      + + #preset_customObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +120
      +121
      +122
      +
      +
      # File 'lib/wcc/contentful/store/factory.rb', line 120
      +
      +def preset_custom
      +  self.store = options.shift
      +end
      +
      +
      + +
      +

      + + #preset_directObject + + + + + +

      +
      + +

      Configures the default “direct” preset which passes everything through to Contentful CDN

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +116
      +117
      +118
      +
      +
      # File 'lib/wcc/contentful/store/factory.rb', line 116
      +
      +def preset_direct
      +  self.store = CDNAdapter.new(preview: options.include?(:preview))
      +end
      +
      +
      + +
      +

      + + #preset_eager_syncObject + + + + + +

      +
      + +

      Sets the “eager sync” preset using one of the preregistered stores like :postgres

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +100
      +101
      +102
      +103
      +104
      +
      +
      # File 'lib/wcc/contentful/store/factory.rb', line 100
      +
      +def preset_eager_sync
      +  store = options.shift || :memory
      +  store = SYNC_STORES[store]&.call(config, *options) if store.is_a?(Symbol)
      +  self.store = store
      +end
      +
      +
      + +
      +

      + + #preset_lazy_syncObject + + + + + +

      +
      + +

      Configures a “lazy sync” preset which caches direct lookups but hits Contentful for any missing information. The cache is kept up to date by the sync engine.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +108
      +109
      +110
      +111
      +112
      +
      +
      # File 'lib/wcc/contentful/store/factory.rb', line 108
      +
      +def preset_lazy_sync
      +  preset_direct
      +  use(WCC::Contentful::Middleware::Store::CachingMiddleware,
      +    ActiveSupport::Cache.lookup_store(*options))
      +end
      +
      +
      + +
      +

      + + #replace(middleware, *middleware_params, &block) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (ArgumentError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +
      +
      # File 'lib/wcc/contentful/store/factory.rb', line 49
      +
      +def replace(middleware, *middleware_params, &block)
      +  idx = self.middleware.find_index { |m| m[0] == middleware }
      +  raise ArgumentError, "Middleware #{middleware} not present" if idx.nil?
      +
      +  configure_proc = block_given? ? Proc.new(&block) : nil
      +  self.middleware[idx] = [middleware, middleware_params, configure_proc]
      +end
      +
      +
      + +
      +

      + + #unuse(middleware) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +57
      +58
      +59
      +60
      +61
      +62
      +
      +
      # File 'lib/wcc/contentful/store/factory.rb', line 57
      +
      +def unuse(middleware)
      +  idx = self.middleware.find_index { |m| m[0] == middleware }
      +  return if idx.nil?
      +
      +  self.middleware.delete_at idx
      +end
      +
      +
      + +
      +

      + + #use(middleware, *middleware_params, &block) ⇒ Object + + + + + +

      +
      + +

      Adds a middleware to the chain. Use a block here to configure the middleware after it has been created.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +44
      +45
      +46
      +47
      +
      +
      # File 'lib/wcc/contentful/store/factory.rb', line 44
      +
      +def use(middleware, *middleware_params, &block)
      +  configure_proc = block_given? ? Proc.new(&block) : nil
      +  self.middleware << [middleware, middleware_params, configure_proc]
      +end
      +
      +
      + +
      +

      + + #validate!Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +84
      +85
      +86
      +87
      +88
      +89
      +90
      +91
      +92
      +93
      +94
      +95
      +96
      +97
      +
      +
      # File 'lib/wcc/contentful/store/factory.rb', line 84
      +
      +def validate!
      +  unless preset.nil? || PRESETS.include?(preset)
      +    raise ArgumentError, "Please use one of #{PRESETS} instead of #{preset}"
      +  end
      +
      +  middleware.each do |m|
      +    next if m[0].respond_to?(:call)
      +
      +    raise ArgumentError, "The middleware '#{m[0]&.try(:name) || m[0]}' cannot be applied!  " \
      +                         'It must respond to :call'
      +  end
      +
      +  validate_store!(store)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Store/Instrumentation.html b/docs/1.3/wcc-contentful/WCC/Contentful/Store/Instrumentation.html new file mode 100644 index 00000000..0cc48624 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Store/Instrumentation.html @@ -0,0 +1,125 @@ + + + + + + + Module: WCC::Contentful::Store::Instrumentation + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC::Contentful::Store::Instrumentation + + + +

      +
      + + + + +
      +
      Extended by:
      +
      ActiveSupport::Concern
      +
      + + + + + + +
      +
      Included in:
      +
      InstrumentationMiddleware
      +
      + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/store/instrumentation.rb
      +
      + +
      + +
      +
      + + +
      +
      +
      + + +
      + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Store/InstrumentationMiddleware.html b/docs/1.3/wcc-contentful/WCC/Contentful/Store/InstrumentationMiddleware.html new file mode 100644 index 00000000..14ffb8e1 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Store/InstrumentationMiddleware.html @@ -0,0 +1,176 @@ + + + + + + + Class: WCC::Contentful::Store::InstrumentationMiddleware + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Store::InstrumentationMiddleware + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Middleware::Store, Instrumentation
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/store/instrumentation.rb
      +
      + +
      + +
      +
      + + +
      +
      +
      + + +
      + + +

      Constant Summary

      + +

      Constants included + from Interface

      +

      WCC::Contentful::Store::Interface::INTERFACE_METHODS

      + + + + +

      Instance Attribute Summary

      + +

      Attributes included from Middleware::Store

      +

      #store

      + + + + + + + + + + + + + + + + +

      Method Summary

      + +

      Methods included from Middleware::Store

      +

      #find, #find_all, #find_by, #has_select?, #resolve_includes, #resolve_link, #resolved_link?, #transform

      + + + + + + + + + + +

      Methods included from Interface

      +

      #find, #find_all, #find_by, #index, #index?

      + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Store/InstrumentationWrapper.html b/docs/1.3/wcc-contentful/WCC/Contentful/Store/InstrumentationWrapper.html new file mode 100644 index 00000000..ab66b532 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Store/InstrumentationWrapper.html @@ -0,0 +1,391 @@ + + + + + + + Module: WCC::Contentful::Store::InstrumentationWrapper + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC::Contentful::Store::InstrumentationWrapper + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/store/instrumentation.rb
      +
      + +
      + +
      +
      + + +
      +
      +
      + + +
      + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #find(key, **options) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +22
      +23
      +24
      +25
      +26
      +
      +
      # File 'lib/wcc/contentful/store/instrumentation.rb', line 22
      +
      +def find(key, **options)
      +  _instrument 'find', id: key, options: options do
      +    super
      +  end
      +end
      +
      +
      + +
      +

      + + #find_all(**params) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +40
      +41
      +42
      +43
      +44
      +
      +
      # File 'lib/wcc/contentful/store/instrumentation.rb', line 40
      +
      +def find_all(**params)
      +  # end happens when query is executed - todo.
      +  _instrument 'find_all', params.slice(:content_type, :options)
      +  super
      +end
      +
      +
      + +
      +

      + + #find_by(**params) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +34
      +35
      +36
      +37
      +38
      +
      +
      # File 'lib/wcc/contentful/store/instrumentation.rb', line 34
      +
      +def find_by(**params)
      +  _instrument 'find_by', params.slice(:content_type, :filter, :options) do
      +    super
      +  end
      +end
      +
      +
      + +
      +

      + + #index(json) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +28
      +29
      +30
      +31
      +32
      +
      +
      # File 'lib/wcc/contentful/store/instrumentation.rb', line 28
      +
      +def index(json)
      +  _instrument 'index', id: json.dig('sys', 'id') do
      +    super
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Store/Interface.html b/docs/1.3/wcc-contentful/WCC/Contentful/Store/Interface.html new file mode 100644 index 00000000..c5f5ccae --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Store/Interface.html @@ -0,0 +1,710 @@ + + + + + + + Module: WCC::Contentful::Store::Interface + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC::Contentful::Store::Interface + + + +

      +
      + + + + + + + + + +
      +
      Included in:
      +
      Middleware::Store, Base, CDNAdapter
      +
      + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/store/interface.rb
      +
      + +
      + +

      Overview

      +
      + +

      This module represents the common interface of all Store implementations. It is documentation ONLY and does not add functionality.

      + +

      This is distinct from WCC::Contentful::Store::Base, because certain helpers exposed publicly by that abstract class are not part of the actual interface and can change without a major version update. rubocop:disable Lint/UnusedMethodArgument

      + + +
      +
      +
      + + +
      + +

      + Constant Summary + collapse +

      + +
      + +
      INTERFACE_METHODS = +
      +
      + + +
      +
      +
      + + +
      +
      +
      WCC::Contentful::Store::Interface.instance_methods - Module.instance_methods
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #find(_id) ⇒ Object + + + + + +

      +
      +
      + This method is abstract. +
      +

      Subclasses should implement this at a minimum to provide data to the WCC::Contentful::Model API.

      +
      +
      + +

      Finds an entry by it's ID. The returned entry is a JSON hash sig String).returns(T.any(Entry, Asset))

      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (NotImplementedError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +40
      +41
      +42
      +
      +
      # File 'lib/wcc/contentful/store/interface.rb', line 40
      +
      +def find(_id)
      +  raise NotImplementedError, "#{self.class} does not implement #find"
      +end
      +
      +
      + +
      +

      + + #find_all(content_type:, options: nil) ⇒ Query + + + + + +

      +
      + +

      Finds all entries of the given content type. A content type is required.

      + +

      Subclasses may override this to provide their own query implementation,

      + +
      or else override #execute to run the query after it has been parsed.
      +
      + +

      sig +

      content_type: String,
      +filter: T.nilable(T::Hash[T.any(Symbol, String), T.untyped]),
      +options: T.nilable(T::Hash[T.any(Symbol), T.untyped]),
      +
      + +

      ).returns(WCC::Contentful::Store::Query::Interface)

      + + +
      +
      +
      +

      Parameters:

      +
        + +
      • + + content_type + + + (String) + + + + — +
        +

        The ID of the content type to search for.

        +
        + +
      • + +
      • + + options + + + (Hash) + + + (defaults to: nil) + + + — +
        +

        An optional set of additional parameters to the query defining for example include depth. Not all store implementations respect all options.

        +
        + +
      • + +
      + +

      Returns:

      +
        + +
      • + + + (Query) + + + + — +
        +

        A query object that exposes methods to apply filters. @see WCC::Contentful::Store::Query::Interface

        +
        + +
      • + +
      +

      Raises:

      +
        + +
      • + + + (NotImplementedError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +75
      +76
      +77
      +
      +
      # File 'lib/wcc/contentful/store/interface.rb', line 75
      +
      +def find_all(content_type:, options: nil)
      +  raise NotImplementedError, "#{self.class} does not implement #find_all"
      +end
      +
      +
      + +
      +

      + + #find_by(content_type:, filter: nil, options: nil) ⇒ Object + + + + + +

      +
      + +

      Finds the first entry matching the given filter. A content type is required.

      + +

      sig +

      content_type: String,
      +filter: T.nilable(T::Hash[T.any(Symbol, String), T.untyped]),
      +options: T.nilable(T::Hash[T.any(Symbol), T.untyped]),
      +
      + +

      ).returns(T.any(Entry, Asset))

      + + +
      +
      +
      +

      Parameters:

      +
        + +
      • + + content_type + + + (String) + + + + — +
        +

        The ID of the content type to search for.

        +
        + +
      • + +
      • + + filter + + + (Hash) + + + (defaults to: nil) + + + — +
        +

        A set of key-value pairs defining filter operations. See WCC::Contentful::Store::Base::Query

        +
        + +
      • + +
      • + + options + + + (Hash) + + + (defaults to: nil) + + + — +
        +

        An optional set of additional parameters to the query defining for example include depth. Not all store implementations respect all options.

        +
        + +
      • + +
      + +

      Raises:

      +
        + +
      • + + + (NotImplementedError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +56
      +57
      +58
      +
      +
      # File 'lib/wcc/contentful/store/interface.rb', line 56
      +
      +def find_by(content_type:, filter: nil, options: nil)
      +  raise NotImplementedError, "#{self.class} does not implement #find_by"
      +end
      +
      +
      + +
      +

      + + #index(_json) ⇒ Object + + + + + +

      +
      + +

      Processes a data point received via the Sync API. This can be a published entry or asset, or a 'DeletedEntry' or 'DeletedAsset'. The default implementation calls into #set and #delete to perform the appropriate operations in the store. sig T.any(Entry, Asset, DeletedEntry, DeletedAsset))

      + +
      .returns(T.any(Entry, Asset, nil))
      +
      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (NotImplementedError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +32
      +33
      +34
      +
      +
      # File 'lib/wcc/contentful/store/interface.rb', line 32
      +
      +def index(_json)
      +  raise NotImplementedError, "#{self.class} does not implement #index"
      +end
      +
      +
      + +
      +

      + + #index?Boolean + + + + + +

      +
      + +

      Returns true if this store can persist entries and assets which are retrieved from the sync API. sig WCC::Contentful::Store::Interface.abstractabstract.returns(Tabstract.returns(T::Boolean)

      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      +

      Raises:

      +
        + +
      • + + + (NotImplementedError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +22
      +23
      +24
      +
      +
      # File 'lib/wcc/contentful/store/interface.rb', line 22
      +
      +def index?
      +  raise NotImplementedError, "#{self.class} does not implement #index?"
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Store/MemoryStore.html b/docs/1.3/wcc-contentful/WCC/Contentful/Store/MemoryStore.html new file mode 100644 index 00000000..441d18a5 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Store/MemoryStore.html @@ -0,0 +1,652 @@ + + + + + + + Class: WCC::Contentful::Store::MemoryStore + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Store::MemoryStore + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/store/memory_store.rb
      +
      + +
      + +

      Overview

      +
      + +

      The MemoryStore is the most naiive store implementation and a good reference point for more useful implementations. It only implements equality queries and does not support querying through an association.

      + + +
      +
      +
      + + +
      + +

      + Constant Summary + collapse +

      + +
      + +
      SUPPORTED_OPS = +
      +
      + + +
      +
      +
      + + +
      +
      +
      %i[eq ne in nin].freeze
      + +
      + + + + + + +

      Constants included + from Interface

      +

      Interface::INTERFACE_METHODS

      + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + +

      Methods inherited from Base

      +

      #ensure_hash, #find_all, #find_by, #index, #index?

      + + + + + + + + + +

      Methods included from Interface

      +

      #find_all, #find_by, #index, #index?

      +
      +

      Constructor Details

      + +
      +

      + + #initializeMemoryStore + + + + + +

      +
      + +

      Returns a new instance of MemoryStore.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +13
      +14
      +15
      +
      +
      # File 'lib/wcc/contentful/store/memory_store.rb', line 10
      +
      +def initialize
      +  super
      +
      +  @mutex = Concurrent::ReentrantReadWriteLock.new
      +  @hash = {}
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #delete(key) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +27
      +28
      +29
      +30
      +31
      +
      +
      # File 'lib/wcc/contentful/store/memory_store.rb', line 27
      +
      +def delete(key)
      +  @mutex.with_write_lock do
      +    @hash.delete(key)
      +  end
      +end
      +
      +
      + +
      +

      + + #execute(query) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +
      +
      # File 'lib/wcc/contentful/store/memory_store.rb', line 45
      +
      +def execute(query)
      +  if bad_op = (query.conditions.map(&:op) - SUPPORTED_OPS).first
      +    raise ArgumentError, "Operator :#{bad_op} not supported"
      +  end
      +
      +  # Since @hash.values returns a new array, we only need to lock here
      +  relation = @mutex.with_read_lock { @hash.values }
      +
      +  # relation is an enumerable that we apply conditions to in the form of
      +  #  Enumerable#select and Enumerable#reject.
      +  relation =
      +    relation.lazy.reject do |v|
      +      value_content_type = v.try(:dig, 'sys', 'contentType', 'sys', 'id')
      +      if query.content_type == 'Asset'
      +        !value_content_type.nil?
      +      else
      +        value_content_type != query.content_type
      +      end
      +    end
      +
      +  # For each condition, we apply a new Enumerable#select with a block that
      +  # enforces the condition.
      +  query.conditions.reduce(relation) do |memo, condition|
      +    __send__("apply_#{condition.op}", memo, condition)
      +  end
      +end
      +
      +
      + +
      +

      + + #find(key, **_options) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +37
      +38
      +39
      +40
      +41
      +
      +
      # File 'lib/wcc/contentful/store/memory_store.rb', line 37
      +
      +def find(key, **_options)
      +  @mutex.with_read_lock do
      +    @hash[key]
      +  end
      +end
      +
      +
      + +
      +

      + + #keysObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +33
      +34
      +35
      +
      +
      # File 'lib/wcc/contentful/store/memory_store.rb', line 33
      +
      +def keys
      +  @mutex.with_read_lock { @hash.keys }
      +end
      +
      +
      + +
      +

      + + #set(key, value) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +
      +
      # File 'lib/wcc/contentful/store/memory_store.rb', line 17
      +
      +def set(key, value)
      +  value = value.deep_dup.freeze
      +  ensure_hash value
      +  @mutex.with_write_lock do
      +    old = @hash[key]
      +    @hash[key] = value
      +    old
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Store/PostgresStore.html b/docs/1.3/wcc-contentful/WCC/Contentful/Store/PostgresStore.html new file mode 100644 index 00000000..c237e997 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Store/PostgresStore.html @@ -0,0 +1,1319 @@ + + + + + + + Class: WCC::Contentful::Store::PostgresStore + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Store::PostgresStore + + + +

      +
      + +
      +
      Inherits:
      +
      + Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Instrumentation
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/store/postgres_store.rb
      +
      + +
      + +

      Overview

      +
      + +

      Implements the store interface where all Contentful entries are stored in a JSONB table.

      + + +
      +
      +
      + + +

      Defined Under Namespace

      +

      + + + + + Classes: Query + + +

      + + +

      + Constant Summary + collapse +

      + +
      + +
      @@schema_mutex = +
      +
      + +

      This is intentionally a class var so that all subclasses share the same mutex

      + + +
      +
      +
      + + +
      +
      +
      Mutex.new
      + +
      + + + + + + +

      Constants included + from Interface

      +

      Interface::INTERFACE_METHODS

      + + +

      Instance Attribute Summary collapse

      + + + + + + +

      Attributes included from Instrumentation

      +

      #_instrumentation

      + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + +

      Methods included from Instrumentation

      +

      #_instrumentation_event_prefix, instrument

      + + + + + + + + + + +

      Methods inherited from Base

      +

      #ensure_hash, #execute, #find_by, #index, #index?

      + + + + + + + + + +

      Methods included from Interface

      +

      #find_by, #index, #index?

      +
      +

      Constructor Details

      + +
      +

      + + #initialize(_config = nil, connection_options = nil, pool_options = nil) ⇒ PostgresStore + + + + + +

      +
      + +

      Returns a new instance of PostgresStore.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +
      +
      # File 'lib/wcc/contentful/store/postgres_store.rb', line 20
      +
      +def initialize(_config = nil, connection_options = nil, pool_options = nil)
      +  super()
      +  @schema_ensured = false
      +  connection_options ||= { dbname: 'postgres' }
      +  pool_options ||= {}
      +  @connection_pool = PostgresStore.build_connection_pool(connection_options, pool_options)
      +  @dirty = Concurrent::AtomicBoolean.new
      +  @mutex = Mutex.new
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #connection_poolObject (readonly) + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +17
      +18
      +19
      +
      +
      # File 'lib/wcc/contentful/store/postgres_store.rb', line 17
      +
      +def connection_pool
      +  @connection_pool
      +end
      +
      +
      + + + +
      +

      + + #loggerObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +18
      +19
      +20
      +
      +
      # File 'lib/wcc/contentful/store/postgres_store.rb', line 18
      +
      +def logger
      +  @logger
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .build_connection_pool(connection_options, pool_options) ⇒ Object + + + + + +

      +
      + +

      rubocop:disable Style/ClassVars

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +325
      +326
      +327
      +328
      +329
      +330
      +331
      +332
      +333
      +334
      +335
      +336
      +
      +
      # File 'lib/wcc/contentful/store/postgres_store.rb', line 325
      +
      +def build_connection_pool(connection_options, pool_options)
      +  ConnectionPool.new(pool_options) do
      +    PG.connect(connection_options).tap do |conn|
      +      unless schema_ensured?(conn)
      +        @@schema_mutex.synchronize do
      +          ensure_schema(conn) unless schema_ensured?(conn)
      +        end
      +      end
      +      prepare_statements(conn)
      +    end
      +  end
      +end
      +
      +
      + +
      +

      + + .ensure_schema(conn) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +349
      +350
      +351
      +352
      +353
      +354
      +355
      +356
      +357
      +358
      +359
      +360
      +361
      +362
      +
      +
      # File 'lib/wcc/contentful/store/postgres_store.rb', line 349
      +
      +def ensure_schema(conn)
      +  result =
      +    begin
      +      conn.exec('SELECT version FROM wcc_contentful_schema_version ' \
      +                'ORDER BY version DESC')
      +    rescue PG::UndefinedTable
      +      []
      +    end
      +  1.upto(EXPECTED_VERSION).each do |version_num|
      +    next if result.find { |row| row['version'].to_s == version_num.to_s }
      +
      +    conn.exec(File.read(File.join(__dir__, "postgres_store/schema_#{version_num}.sql")))
      +  end
      +end
      +
      +
      + +
      +

      + + .prepare_statements(conn) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +313
      +314
      +315
      +316
      +317
      +318
      +319
      +320
      +
      +
      # File 'lib/wcc/contentful/store/postgres_store.rb', line 313
      +
      +def prepare_statements(conn)
      +  conn.prepare('upsert_entry', 'SELECT * FROM fn_contentful_upsert_entry($1,$2,$3)')
      +  conn.prepare('select_entry', 'SELECT * FROM contentful_raw WHERE id = $1')
      +  conn.prepare('select_ids', 'SELECT id FROM contentful_raw')
      +  conn.prepare('delete_by_id', 'DELETE FROM contentful_raw WHERE id = $1 RETURNING *')
      +  conn.prepare('refresh_views_concurrently',
      +    'REFRESH MATERIALIZED VIEW CONCURRENTLY contentful_raw_includes_ids_jointable')
      +end
      +
      +
      + +
      +

      + + .schema_ensured?(conn) ⇒ Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +338
      +339
      +340
      +341
      +342
      +343
      +344
      +345
      +346
      +347
      +
      +
      # File 'lib/wcc/contentful/store/postgres_store.rb', line 338
      +
      +def schema_ensured?(conn)
      +  result = conn.exec('SELECT version FROM wcc_contentful_schema_version ' \
      +                     'ORDER BY version DESC LIMIT 1')
      +  return false if result.num_tuples == 0
      +
      +  result[0]['version'].to_i >= EXPECTED_VERSION
      +rescue PG::UndefinedTable
      +  # need to run v1 schema migration
      +  false
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #delete(key) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +83
      +84
      +85
      +
      +
      # File 'lib/wcc/contentful/store/postgres_store.rb', line 76
      +
      +def delete(key)
      +  result =
      +    _instrument 'delete_by_id', key: key do
      +      @connection_pool.with { |conn| conn.exec_prepared('delete_by_id', [key]) }
      +    end
      +
      +  return if result.num_tuples == 0
      +
      +  JSON.parse(result.getvalue(0, 1))
      +end
      +
      +
      + +
      +

      + + #exec_query(statement, params = []) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +107
      +108
      +109
      +110
      +111
      +112
      +113
      +114
      +115
      +116
      +117
      +118
      +119
      +120
      +121
      +122
      +123
      +124
      +125
      +126
      +
      +
      # File 'lib/wcc/contentful/store/postgres_store.rb', line 107
      +
      +def exec_query(statement, params = [])
      +  if @dirty.true?
      +    # Only one thread should call refresh_views_concurrently but all should wait for it to finish.
      +    @mutex.synchronize do
      +      # We have to check again b/c another thread may have gotten here first
      +      if @dirty.true?
      +        _instrument 'refresh_views' do
      +          @connection_pool.with { |conn| conn.exec_prepared('refresh_views_concurrently') }
      +        end
      +        # Mark that the views have been refreshed.
      +        @dirty.make_false
      +      end
      +    end
      +  end
      +
      +  logger&.debug("[PostgresStore] #{statement} #{params.inspect}")
      +  _instrument 'exec' do
      +    @connection_pool.with { |conn| conn.exec(statement, params) }
      +  end
      +end
      +
      +
      + +
      +

      + + #find(key, **_options) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +87
      +88
      +89
      +90
      +91
      +92
      +93
      +94
      +95
      +96
      +97
      +
      +
      # File 'lib/wcc/contentful/store/postgres_store.rb', line 87
      +
      +def find(key, **_options)
      +  result =
      +    _instrument 'select_entry', key: key do
      +      @connection_pool.with { |conn| conn.exec_prepared('select_entry', [key]) }
      +    end
      +  return if result.num_tuples == 0
      +
      +  JSON.parse(result.getvalue(0, 1))
      +rescue PG::ConnectionBad
      +  nil
      +end
      +
      +
      + +
      +

      + + #find_all(content_type:, options: nil) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +99
      +100
      +101
      +102
      +103
      +104
      +105
      +
      +
      # File 'lib/wcc/contentful/store/postgres_store.rb', line 99
      +
      +def find_all(content_type:, options: nil)
      +  Query.new(
      +    self,
      +    content_type: content_type,
      +    options: options
      +  )
      +end
      +
      +
      + +
      +

      + + #keysObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +63
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +74
      +
      +
      # File 'lib/wcc/contentful/store/postgres_store.rb', line 63
      +
      +def keys
      +  result =
      +    _instrument 'select_ids' do
      +      @connection_pool.with { |conn| conn.exec_prepared('select_ids') }
      +    end
      +
      +  arr = []
      +  result.each { |r| arr << r['id'].strip }
      +  arr
      +rescue PG::ConnectionBad
      +  []
      +end
      +
      +
      + +
      +

      + + #set(key, value) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +
      +
      # File 'lib/wcc/contentful/store/postgres_store.rb', line 30
      +
      +def set(key, value)
      +  ensure_hash value
      +
      +  result =
      +    _instrument 'upsert_entry' do
      +      @connection_pool.with do |conn|
      +        conn.exec_prepared('upsert_entry', [
      +                             key,
      +                             value.to_json,
      +                             quote_array(extract_links(value))
      +                           ])
      +      end
      +    end
      +
      +  previous_value =
      +    if result.num_tuples == 0
      +      nil
      +    else
      +      val = result.getvalue(0, 0)
      +      JSON.parse(val) if val
      +    end
      +
      +  if views_need_update?(value, previous_value)
      +    # Mark the views as needing to be refreshed, they will be refreshed on the next query.
      +    was_dirty = @dirty.make_true
      +    # Send out an instrumentation event if we are the thread that marked it dirty
      +    # (make_true returns true if the value changed)
      +    _instrument 'mark_dirty' if was_dirty
      +  end
      +
      +  previous_value
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Store/PostgresStore/Query.html b/docs/1.3/wcc-contentful/WCC/Contentful/Store/PostgresStore/Query.html new file mode 100644 index 00000000..adb5b4a6 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Store/PostgresStore/Query.html @@ -0,0 +1,439 @@ + + + + + + + Class: WCC::Contentful::Store::PostgresStore::Query + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Store::PostgresStore::Query + + + +

      +
      + +
      +
      Inherits:
      +
      + Query + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/store/postgres_store.rb
      +
      + +
      + +
      +
      + + +
      +
      +
      + + +
      + + +

      Constant Summary

      + +

      Constants inherited + from Query

      +

      Query::FALSE_VALUES, Query::RESERVED_NAMES

      + + + +

      Constants included + from Query::Interface

      +

      Query::Interface::OPERATORS

      + + + + +

      Instance Attribute Summary

      + +

      Attributes inherited from Query

      +

      #conditions, #content_type, #store

      + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + +

      Methods inherited from Query

      +

      #apply, #apply_operator, flatten_filter_hash, #initialize, known_locales, normalize_condition_path, op?, #to_enum

      + + + + + + + + + + +

      Methods included from Query::Interface

      +

      #apply, #eq

      + +
      +

      Constructor Details

      + +

      This class inherits a constructor from WCC::Contentful::Store::Query

      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #countObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +164
      +165
      +166
      +167
      +168
      +169
      +170
      +
      +
      # File 'lib/wcc/contentful/store/postgres_store.rb', line 164
      +
      +def count
      +  return @count if @count
      +
      +  statement, params = finalize_statement('SELECT count(*)')
      +  result = store.exec_query(statement, params)
      +  @count = result.getvalue(0, 0).to_i
      +end
      +
      +
      + +
      +

      + + #firstObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +172
      +173
      +174
      +175
      +176
      +177
      +178
      +179
      +180
      +181
      +182
      +183
      +184
      +185
      +186
      +187
      +
      +
      # File 'lib/wcc/contentful/store/postgres_store.rb', line 172
      +
      +def first
      +  return @first if @first
      +
      +  statement, params = finalize_statement('SELECT t.*', ' LIMIT 1', depth: @options[:include])
      +  result = store.exec_query(statement, params)
      +  return if result.num_tuples == 0
      +
      +  row = result.first
      +  entry = JSON.parse(row['data'])
      +
      +  if @options[:include] && @options[:include] > 0
      +    includes = decode_includes(row['includes'])
      +    entry = resolve_includes([entry, includes], @options[:include])
      +  end
      +  entry
      +end
      +
      +
      + +
      +

      + + #result_setObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +189
      +190
      +191
      +192
      +193
      +194
      +195
      +196
      +197
      +198
      +199
      +200
      +201
      +202
      +203
      +204
      +
      +
      # File 'lib/wcc/contentful/store/postgres_store.rb', line 189
      +
      +def result_set
      +  return @result_set if @result_set
      +
      +  statement, params = finalize_statement('SELECT t.*', depth: @options[:include])
      +  @result_set =
      +    store.exec_query(statement, params)
      +      .lazy.map do |row|
      +      entry = JSON.parse(row['data'])
      +      includes =
      +        (decode_includes(row['includes']) if @options[:include] && @options[:include] > 0)
      +
      +      [entry, includes]
      +    end
      +rescue PG::ConnectionBad
      +  []
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Store/Query.html b/docs/1.3/wcc-contentful/WCC/Contentful/Store/Query.html new file mode 100644 index 00000000..55254d2d --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Store/Query.html @@ -0,0 +1,1265 @@ + + + + + + + Class: WCC::Contentful::Store::Query + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Store::Query + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Enumerable, Interface
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/store/query.rb,
      + lib/wcc/contentful/store/query/interface.rb
      +
      +
      + +
      + +

      Overview

      +
      + +

      The default query object returned by Stores that extend WCC::Contentful::Store::Base. It exposes several chainable query methods to apply query filters. Enumerating the query executes it, caching the result.

      + + +
      +
      +
      + + +
      +

      Direct Known Subclasses

      +

      PostgresStore::Query

      +
      +

      Defined Under Namespace

      +

      + + + Modules: Interface + + + + Classes: Condition + + +

      + + +

      + Constant Summary + collapse +

      + +
      + +
      FALSE_VALUES = +
      +
      + + +
      +
      +
      + + +
      +
      +
      [
      +  false, 0,
      +  '0', :'0',
      +  'f', :f,
      +  'F', :F,
      +  'false', :false, # rubocop:disable Lint/BooleanSymbol
      +  'FALSE', :FALSE,
      +  'off', :off,
      +  'OFF', :OFF
      +].to_set.freeze
      + +
      RESERVED_NAMES = +
      +
      + + +
      +
      +
      + + +
      +
      +
      %w[fields sys].freeze
      + +
      + + + + + + +

      Constants included + from Interface

      +

      Interface::OPERATORS

      + + +

      Instance Attribute Summary collapse

      + + + + + + +

      + Class Method Summary + collapse +

      + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + + +

      Methods included from Interface

      +

      #eq

      + +
      +

      Constructor Details

      + +
      +

      + + #initialize(store, content_type:, conditions: nil, options: nil, **extra) ⇒ Query + + + + + +

      +
      + +

      Returns a new instance of Query.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +
      +
      # File 'lib/wcc/contentful/store/query.rb', line 29
      +
      +def initialize(store, content_type:, conditions: nil, options: nil, **extra)
      +  @store = store
      +  @content_type = content_type
      +  @conditions = conditions || []
      +  @options = options || {}
      +  @extra = extra
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #conditionsObject (readonly) + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +27
      +28
      +29
      +
      +
      # File 'lib/wcc/contentful/store/query.rb', line 27
      +
      +def conditions
      +  @conditions
      +end
      +
      +
      + + + +
      +

      + + #content_typeObject (readonly) + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +27
      +28
      +29
      +
      +
      # File 'lib/wcc/contentful/store/query.rb', line 27
      +
      +def content_type
      +  @content_type
      +end
      +
      +
      + + + +
      +

      + + #storeObject (readonly) + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +27
      +28
      +29
      +
      +
      # File 'lib/wcc/contentful/store/query.rb', line 27
      +
      +def store
      +  @store
      +end
      +
      +
      + +
      + + +
      +

      Class Method Details

      + + +
      +

      + + .flatten_filter_hash(hash, path = []) ⇒ Object + + + + + +

      +
      + +

      Turns a hash into a flat array of individual conditions, where each element can be passed as params to apply_operator

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +161
      +162
      +163
      +164
      +165
      +166
      +167
      +168
      +169
      +170
      +171
      +172
      +173
      +174
      +175
      +176
      +177
      +
      +
      # File 'lib/wcc/contentful/store/query.rb', line 161
      +
      +def flatten_filter_hash(hash, path = [])
      +  hash.flat_map do |(k, v)|
      +    k = k.to_s
      +    if k.include?('.')
      +      k, *rest = k.split('.')
      +      v = { rest.join('.') => v }
      +    end
      +
      +    if v.is_a? Hash
      +      flatten_filter_hash(v, path + [k])
      +    elsif op?(k)
      +      { path: path, op: k.to_sym, expected: v }
      +    else
      +      { path: path + [k], op: nil, expected: v }
      +    end
      +  end
      +end
      +
      +
      + +
      +

      + + .known_localesObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +179
      +180
      +181
      +
      +
      # File 'lib/wcc/contentful/store/query.rb', line 179
      +
      +def known_locales
      +  @known_locales = WCC::Contentful.locales.keys
      +end
      +
      +
      + +
      +

      + + .normalize_condition_path(path, context = nil) ⇒ Object + + + + + +

      +
      + +

      Takes a path array in non-normal form and inserts 'sys', 'fields', and the current locale as appropriate to normalize it. rubocop:disable Metrics/BlockNesting

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +187
      +188
      +189
      +190
      +191
      +192
      +193
      +194
      +195
      +196
      +197
      +198
      +199
      +200
      +201
      +202
      +203
      +204
      +205
      +206
      +207
      +208
      +209
      +210
      +211
      +212
      +213
      +214
      +215
      +216
      +217
      +218
      +219
      +220
      +221
      +222
      +223
      +224
      +225
      +226
      +227
      +228
      +229
      +230
      +231
      +232
      +233
      +234
      +
      +
      # File 'lib/wcc/contentful/store/query.rb', line 187
      +
      +def normalize_condition_path(path, context = nil)
      +  context_locale = context[:locale] if context.present?
      +  context_locale ||= 'en-US'
      +
      +  rev_path = path.reverse
      +  new_path = []
      +
      +  current_tuple = []
      +  current_locale_was_inferred = false
      +  until rev_path.empty? && current_tuple.empty?
      +    raise ArgumentError, "Query too complex: #{path.join('.')}" if new_path.length > 7
      +
      +    case current_tuple.length
      +    when 0
      +      # expect a locale
      +      current_tuple <<
      +        if known_locales.include?(rev_path[0])
      +          current_locale_was_inferred = false
      +          rev_path.shift
      +        else
      +          # infer locale
      +          current_locale_was_inferred = true
      +          context_locale
      +        end
      +    when 1
      +      # expect a path
      +      current_tuple << rev_path.shift
      +    when 2
      +      # expect 'sys' or 'fields'
      +      current_tuple <<
      +        if RESERVED_NAMES.include?(rev_path[0])
      +          rev_path.shift
      +        else
      +          # infer 'sys' or 'fields'
      +          current_tuple.last == 'id' ? 'sys' : 'fields'
      +        end
      +
      +      if current_tuple.last == 'sys' && current_locale_was_inferred
      +        # remove the inferred current locale
      +        current_tuple.shift
      +      end
      +      new_path << current_tuple
      +      current_tuple = []
      +    end
      +  end
      +
      +  new_path.flat_map { |x| x }.reverse.freeze
      +end
      +
      +
      + +
      +

      + + .op?(key) ⇒ Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +155
      +156
      +157
      +
      +
      # File 'lib/wcc/contentful/store/query.rb', line 155
      +
      +def op?(key)
      +  Interface::OPERATORS.include?(key.to_sym)
      +end
      +
      +
      + +
      + +
      +

      Instance Method Details

      + + +
      +

      + + #apply(filter, context = nil) ⇒ Object + + + + + +

      +
      + +

      Called with a filter object by Base#find_by in order to apply the filter. The filter in this case is a hash where the keys are paths and the values are expectations.

      + + +
      +
      +
      + + +

      See Also:

      + + +
      + + + + +
      +
      +
      +
      +96
      +97
      +98
      +99
      +100
      +
      +
      # File 'lib/wcc/contentful/store/query.rb', line 96
      +
      +def apply(filter, context = nil)
      +  self.class.flatten_filter_hash(filter).reduce(self) do |query, cond|
      +    query.apply_operator(cond[:op], cond[:path], cond[:expected], context)
      +  end
      +end
      +
      +
      + +
      +

      + + #apply_operator(operator, field, expected, context = nil) ⇒ Object + + + + + +

      +
      + +

      Returns a new chained Query that has a new condition. The new condition represents the WHERE comparison being applied here. The underlying store implementation translates this condition statement into an appropriate query against the datastore.

      + + +
      +
      +
      + +
      +

      Examples:

      + + +
      query = query.apply_operator(:gt, :timestamp, '2019-01-01', context)
      +# in a SQL based store, the query now contains a condition like:
      +#  WHERE table.'timestamp' > '2019-01-01'
      + +
      + +

      Raises:

      +
        + +
      • + + + (ArgumentError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +63
      +64
      +65
      +66
      +67
      +68
      +69
      +70
      +71
      +72
      +73
      +74
      +75
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +83
      +
      +
      # File 'lib/wcc/contentful/store/query.rb', line 63
      +
      +def apply_operator(operator, field, expected, context = nil)
      +  operator ||= expected.is_a?(Array) ? :in : :eq
      +  raise ArgumentError, "Operator #{operator} not supported" unless respond_to?(operator)
      +  raise ArgumentError, 'value cannot be nil (try using exists: false)' if expected.nil?
      +
      +  case operator
      +  when :in, :nin, :all
      +    expected = Array(expected)
      +  when :exists
      +    expected = !FALSE_VALUES.include?(expected)
      +  end
      +
      +  field = field.to_s if field.is_a? Symbol
      +  path = field.is_a?(Array) ? field : field.split('.')
      +
      +  path = self.class.normalize_condition_path(path, context)
      +
      +  _append_condition(
      +    Condition.new(path, operator, expected)
      +  )
      +end
      +
      +
      + +
      +

      + + #result_setObject + + + + + +

      +
      + +

      Override this to provide a result set from the Query object itself rather than from calling #execute in the store.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +104
      +105
      +106
      +
      +
      # File 'lib/wcc/contentful/store/query.rb', line 104
      +
      +def result_set
      +  @result_set ||= store.execute(self)
      +end
      +
      +
      + +
      +

      + + #to_enumObject + + + + + +

      +
      + +

      Executes the query against the store and memoizes the resulting enumerable.

      + +
      Subclasses can override this to provide a more efficient implementation.
      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +22
      +23
      +24
      +25
      +
      +
      # File 'lib/wcc/contentful/store/query.rb', line 22
      +
      +def to_enum
      +  @to_enum ||=
      +    result_set.lazy.map { |row| resolve_includes(row, @options[:include]) }
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Store/Query/Condition.html b/docs/1.3/wcc-contentful/WCC/Contentful/Store/Query/Condition.html new file mode 100644 index 00000000..badf6130 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Store/Query/Condition.html @@ -0,0 +1,276 @@ + + + + + + + Class: WCC::Contentful::Store::Query::Condition + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::Store::Query::Condition + + + +

      +
      + +
      +
      Inherits:
      +
      + Struct + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/store/query.rb
      +
      + +
      + +
      +
      + + +
      +
      +
      + + +
      + +

      + Constant Summary + collapse +

      + +
      + + +
      %w[id type linkType].freeze
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #path_tuplesObject + + + + + +

      +
      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +242
      +243
      +244
      +245
      +246
      +247
      +248
      +249
      +250
      +251
      +252
      +253
      +254
      +255
      +256
      +257
      +258
      +259
      +260
      +261
      +262
      +263
      +
      +
      # File 'lib/wcc/contentful/store/query.rb', line 242
      +
      +def path_tuples
      +  @path_tuples ||=
      +    [].tap do |arr|
      +      remaining = path.dup
      +      until remaining.empty?
      +        locale = nil
      +        link_sys = nil
      +        link_field = nil
      +
      +        sys_or_fields = remaining.shift
      +        field = remaining.shift
      +        locale = remaining.shift if sys_or_fields == 'fields'
      +
      +        if remaining[0] == 'sys' && LINK_KEYS.include?(remaining[1])
      +          link_sys = remaining.shift
      +          link_field = remaining.shift
      +        end
      +
      +        arr << [sys_or_fields, field, locale, link_sys, link_field].compact
      +      end
      +    end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Store/Query/Interface.html b/docs/1.3/wcc-contentful/WCC/Contentful/Store/Query/Interface.html new file mode 100644 index 00000000..266f051c --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Store/Query/Interface.html @@ -0,0 +1,356 @@ + + + + + + + Module: WCC::Contentful::Store::Query::Interface + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC::Contentful::Store::Query::Interface + + + +

      +
      + + + + + + +
      +
      Includes:
      +
      Enumerable
      +
      + + + + +
      +
      Included in:
      +
      Middleware::Store::DelegatingQuery, CDNAdapter::Query, WCC::Contentful::Store::Query
      +
      + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/store/query/interface.rb
      +
      + +
      + +

      Overview

      +
      + +

      This module represents the common interface of queries that must be returned by a store's #find_all implementation. It is documentation ONLY and does not add functionality.

      + +

      This is distinct from WCC::Contentful::Store::Query, because certain helpers exposed publicly by that abstract class are not part of the actual interface and can change without a major version update.

      + + +
      +
      +
      + + +
      + +

      + Constant Summary + collapse +

      + +
      + +
      OPERATORS = +
      +
      + +

      The set of operators that can be applied to a query. Not all stores implement all operators. At a bare minimum a store must implement #eq.

      + + +
      +
      +
      + + +
      +
      +
      %i[
      +  eq
      +  ne
      +  all
      +  in
      +  nin
      +  exists
      +  lt
      +  lte
      +  gt
      +  gte
      +  query
      +  match
      +].freeze
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #apply(_filter, _context = nil) ⇒ Object + + + + + +

      +
      + +

      Called with a filter object in order to apply the filter. The filter in this case is a hash where the keys are paths and the values are expectations.

      + +

      sig +

        field: T.any(T::String),
      +  expected: T.untyped,
      +  context: T.nilable(T::Hash[T.untyped, T.untyped])
      +).returns(T.self_type)
      +
      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (NotImplementedError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +59
      +60
      +61
      +
      +
      # File 'lib/wcc/contentful/store/query/interface.rb', line 59
      +
      +def apply(_filter, _context = nil)
      +  raise NotImplementedError, "#{self.class} does not implement #apply"
      +end
      +
      +
      + +
      +

      + + #eq(_field, _expected, _context = nil) ⇒ Object + + + + + +

      +
      + +

      Applies an equality condition to the query. The underlying store translates this into a '==' check.

      + +

      sig +

        field: T.any(T::String),
      +  expected: T.untyped,
      +  context: T.nilable(T::Hash[T.untyped, T.untyped])
      +).returns(T.self_type)
      +
      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (NotImplementedError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +46
      +47
      +48
      +
      +
      # File 'lib/wcc/contentful/store/query/interface.rb', line 46
      +
      +def eq(_field, _expected, _context = nil)
      +  raise NotImplementedError, "#{self.class} does not implement #eq"
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/SyncEngine.html b/docs/1.3/wcc-contentful/WCC/Contentful/SyncEngine.html new file mode 100644 index 00000000..bb10c5e7 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/SyncEngine.html @@ -0,0 +1,941 @@ + + + + + + + Class: WCC::Contentful::SyncEngine + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::SyncEngine + + + +

      +
      + +
      +
      Inherits:
      +
      + Object + +
        +
      • Object
      • + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      Wisper::Publisher
      +
      + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/sync_engine.rb
      +
      + +
      + +

      Overview

      +
      + +

      The SyncEngine is used to keep the currently configured store up to date using the Sync API. It is available on the WCC::Contentful::Services instance, and the application is responsible to periodically call #next in order to hit the sync API and update the store.

      + +

      If you have mounted the WCC::Contentful::Engine, AND the configured store is one that can be synced (i.e. it responds to `:index`), then the WCC::Contentful::WebhookController will call #next automatically anytime a webhook is received. Otherwise you should hook up to the Webhook events and call the sync engine via your initializer:

      + +
      WCC::Contentful::Events.subscribe(proc do |event|
      +  WCC::Contentful::Services.instance.sync_engine.next(up_to: event.dig('sys', 'id'))
      +end, with: :call)
      +
      + + +
      +
      +
      + + +

      Defined Under Namespace

      +

      + + + + + Classes: Job + + +

      + + + + +

      Instance Attribute Summary collapse

      +
        + +
      • + + + #client ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
        +

        Returns the value of attribute client.

        +
        + +
      • + + +
      • + + + #options ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
        +

        Returns the value of attribute options.

        +
        + +
      • + + +
      • + + + #store ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
        +

        Returns the value of attribute store.

        +
        + +
      • + + +
      + + + + + +

      + Instance Method Summary + collapse +

      + + + + + +
      +

      Constructor Details

      + +
      +

      + + #initialize(client: nil, store: nil, state: nil, **options) ⇒ SyncEngine + + + + + +

      +
      + +

      Returns a new instance of SyncEngine.

      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (ArgumentError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +
      +
      # File 'lib/wcc/contentful/sync_engine.rb', line 40
      +
      +def initialize(client: nil, store: nil, state: nil, **options)
      +  @options = {
      +    key: "sync:#{object_id}"
      +  }.merge!(options).freeze
      +
      +  @state_key = @options[:key] || "sync:#{object_id}"
      +  @client = client || WCC::Contentful::Services.instance.client
      +  @mutex = Mutex.new
      +
      +  if store
      +    unless %i[index index? find].all? { |m| store.respond_to?(m) }
      +      raise ArgumentError, ':store param must implement the Store interface'
      +    end
      +
      +    @store = store
      +  end
      +  if state
      +    @state = token_wrapper_factory(state)
      +    raise ArgumentError, ':state param must be a String or Hash' unless @state.is_a? Hash
      +    raise ArgumentError, ':state param must be of sys.type = "token"' unless @state.dig('sys', 'type') == 'token'
      +  end
      +  raise ArgumentError, 'either :state or :store must be provided' unless @state || @store
      +end
      +
      +
      + +
      + +
      +

      Instance Attribute Details

      + + + +
      +

      + + #clientObject (readonly) + + + + + +

      +
      + +

      Returns the value of attribute client.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +34
      +35
      +36
      +
      +
      # File 'lib/wcc/contentful/sync_engine.rb', line 34
      +
      +def client
      +  @client
      +end
      +
      +
      + + + +
      +

      + + #optionsObject (readonly) + + + + + +

      +
      + +

      Returns the value of attribute options.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +34
      +35
      +36
      +
      +
      # File 'lib/wcc/contentful/sync_engine.rb', line 34
      +
      +def options
      +  @options
      +end
      +
      +
      + + + +
      +

      + + #storeObject (readonly) + + + + + +

      +
      + +

      Returns the value of attribute store.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +34
      +35
      +36
      +
      +
      # File 'lib/wcc/contentful/sync_engine.rb', line 34
      +
      +def store
      +  @store
      +end
      +
      +
      + +
      + + +
      +

      Instance Method Details

      + + +
      +

      + + #emit_event(event) ⇒ Object + + + + + +

      +
      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (ArgumentError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +104
      +105
      +106
      +107
      +108
      +109
      +
      +
      # File 'lib/wcc/contentful/sync_engine.rb', line 104
      +
      +def emit_event(event)
      +  type = event.dig('sys', 'type')
      +  raise ArgumentError, "Unknown event type #{event}" unless type.present?
      +
      +  broadcast(type, event)
      +end
      +
      +
      + +
      +

      + + #emit_sync_complete(events) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +111
      +112
      +113
      +114
      +
      +
      # File 'lib/wcc/contentful/sync_engine.rb', line 111
      +
      +def emit_sync_complete(events)
      +  event = WCC::Contentful::Event::SyncComplete.new(events, source: self)
      +  broadcast('SyncComplete', event)
      +end
      +
      +
      + +
      +

      + + #next(up_to_id: nil) ⇒ Array + + + + + +

      +
      + +

      Gets the next increment of data from the Sync API. If the configured store responds to `:index`, that will be called with each item in the Sync response to update the store. If a block is passed, that block will be evaluated with each item in the response.

      + + +
      +
      +
      +

      Parameters:

      +
        + +
      • + + up_to_id + + + (String) + + + (defaults to: nil) + + + — +
        +

        An ID to look for in the response. The method returns true if the ID was found or no up_to_id was given, false if the ID did not come back.

        +
        + +
      • + +
      + +

      Returns:

      +
        + +
      • + + + (Array) + + + + — +
        +

        A `[Boolean, Integer]` tuple where the first value is whether the ID was found, and the second value is the number of items returned.

        +
        + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +73
      +74
      +75
      +76
      +77
      +78
      +79
      +80
      +81
      +82
      +83
      +84
      +85
      +86
      +87
      +88
      +89
      +90
      +91
      +92
      +93
      +94
      +95
      +96
      +97
      +98
      +99
      +100
      +101
      +102
      +
      +
      # File 'lib/wcc/contentful/sync_engine.rb', line 73
      +
      +def next(up_to_id: nil)
      +  id_found = up_to_id.nil?
      +  all_events = []
      +
      +  @mutex.synchronize do
      +    @state ||= read_state || token_wrapper_factory(nil)
      +    sync_token = @state['token']
      +
      +    next_sync_token =
      +      client.sync(sync_token: sync_token) do |item|
      +        id = item.dig('sys', 'id')
      +        id_found ||= id == up_to_id
      +
      +        store.index(item) if store&.index?
      +        event = WCC::Contentful::Event.from_raw(item, source: self)
      +        yield(event) if block_given?
      +        emit_event(event)
      +
      +        # Only keep the "sys" not the content in case we have a large space
      +        all_events << WCC::Contentful::Event.from_raw(item.slice('sys'), source: self)
      +      end
      +
      +    @state = @state.merge('token' => next_sync_token)
      +    write_state
      +  end
      +
      +  emit_sync_complete(all_events)
      +
      +  [id_found, all_events.length]
      +end
      +
      +
      + +
      +

      + + #should_sync?Boolean + + + + + +

      +
      + + +
      +
      +
      + +

      Returns:

      +
        + +
      • + + + (Boolean) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +36
      +37
      +38
      +
      +
      # File 'lib/wcc/contentful/sync_engine.rb', line 36
      +
      +def should_sync?
      +  store&.index?
      +end
      +
      +
      + +
      +

      + + #stateObject + + + + + +

      + + + + +
      +
      +
      +
      +30
      +31
      +32
      +
      +
      # File 'lib/wcc/contentful/sync_engine.rb', line 30
      +
      +def state
      +  (@state&.dup || token_wrapper_factory(nil)).freeze
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/SyncEngine/Job.html b/docs/1.3/wcc-contentful/WCC/Contentful/SyncEngine/Job.html new file mode 100644 index 00000000..89277b38 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/SyncEngine/Job.html @@ -0,0 +1,516 @@ + + + + + + + Class: WCC::Contentful::SyncEngine::Job + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::SyncEngine::Job + + + +

      +
      + +
      +
      Inherits:
      +
      + ActiveJob::Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/sync_engine.rb
      +
      + +
      + +

      Overview

      +
      + +

      This job uses the Contentful Sync API to update the configured store with the latest data from Contentful.

      + + +
      +
      +
      + + +
      + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #configurationObject + + + + + +

      + + + + +
      +
      +
      +
      +144
      +145
      +146
      +
      +
      # File 'lib/wcc/contentful/sync_engine.rb', line 144
      +
      +def configuration
      +  @configuration ||= WCC::Contentful.configuration
      +end
      +
      +
      + +
      +

      + + #perform(event = nil) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +152
      +153
      +154
      +155
      +156
      +157
      +158
      +159
      +160
      +161
      +162
      +
      +
      # File 'lib/wcc/contentful/sync_engine.rb', line 152
      +
      +def perform(event = nil)
      +  return unless services.sync_engine&.should_sync?
      +
      +  up_to_id = nil
      +  retry_count = 0
      +  if event
      +    up_to_id = event[:up_to_id] || event.dig('sys', 'id')
      +    retry_count = event[:retry_count] if event[:retry_count]
      +  end
      +  sync!(up_to_id: up_to_id, retry_count: retry_count)
      +end
      +
      +
      + +
      +

      + + #servicesObject + + + + + +

      + + + + +
      +
      +
      +
      +148
      +149
      +150
      +
      +
      # File 'lib/wcc/contentful/sync_engine.rb', line 148
      +
      +def services
      +  @services ||= WCC::Contentful::Services.instance
      +end
      +
      +
      + +
      +

      + + #sync!(up_to_id: nil, retry_count: 0) ⇒ Object + + + + + +

      +
      + +

      Calls the Contentful Sync API and updates the configured store with the returned data.

      + + +
      +
      +
      +

      Parameters:

      +
        + +
      • + + up_to_id + + + (String) + + + (defaults to: nil) + + + — +
        +

        An ID that we know has changed and should come back from the sync. If we don't find this ID in the sync data, then drop a job to try the sync again after a few minutes.

        +
        + +
      • + +
      + + +
      + + + + +
      +
      +
      +
      +172
      +173
      +174
      +175
      +176
      +177
      +178
      +179
      +180
      +181
      +182
      +183
      +184
      +185
      +186
      +187
      +188
      +189
      +190
      +191
      +192
      +193
      +
      +
      # File 'lib/wcc/contentful/sync_engine.rb', line 172
      +
      +def sync!(up_to_id: nil, retry_count: 0)
      +  id_found, count = services.sync_engine.next(up_to_id: up_to_id)
      +
      +  next_sync_token = services.sync_engine.state['token']
      +
      +  logger.info "Synced #{count} entries.  Next sync token:\n  #{next_sync_token}"
      +  unless id_found
      +    if retry_count >= configuration.sync_retry_limit
      +      logger.error "Unable to find item with id '#{up_to_id}' on the Sync API.  " \
      +                   "Abandoning after #{retry_count} retries."
      +    else
      +      wait = (2**retry_count) * configuration.sync_retry_wait.seconds
      +      logger.info "Unable to find item with id '#{up_to_id}' on the Sync API.  " \
      +                  "Retrying after #{wait.inspect} " \
      +                  "(#{configuration.sync_retry_limit - retry_count} retries remaining)"
      +
      +      self.class.set(wait: wait)
      +        .perform_later(up_to_id: up_to_id, retry_count: retry_count + 1)
      +    end
      +  end
      +  next_sync_token
      +end
      +
      +
      + +
      +

      + + #sync_later!(up_to_id: nil, wait: 10.seconds) ⇒ Object + + + + + +

      +
      + +

      Enqueues an ActiveJob job to invoke WCC::Contentful.sync! after a given amount of time.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +197
      +198
      +199
      +200
      +
      +
      # File 'lib/wcc/contentful/sync_engine.rb', line 197
      +
      +def sync_later!(up_to_id: nil, wait: 10.seconds)
      +  self.class.set(wait: wait)
      +    .perform_later(up_to_id: up_to_id)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/SyncError.html b/docs/1.3/wcc-contentful/WCC/Contentful/SyncError.html new file mode 100644 index 00000000..e3725674 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/SyncError.html @@ -0,0 +1,124 @@ + + + + + + + Exception: WCC::Contentful::SyncError + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Exception: WCC::Contentful::SyncError + + + +

      +
      + +
      +
      Inherits:
      +
      + StandardError + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/exceptions.rb
      +
      + +
      + + + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Test.html b/docs/1.3/wcc-contentful/WCC/Contentful/Test.html new file mode 100644 index 00000000..37c43770 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Test.html @@ -0,0 +1,115 @@ + + + + + + + Module: WCC::Contentful::Test + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC::Contentful::Test + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/test.rb
      +
      + +
      + +

      Defined Under Namespace

      +

      + + + Modules: Attributes, Double, Factory + + + + +

      + + + + + + + + + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Test/Attributes.html b/docs/1.3/wcc-contentful/WCC/Contentful/Test/Attributes.html new file mode 100644 index 00000000..36a03e83 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Test/Attributes.html @@ -0,0 +1,356 @@ + + + + + + + Module: WCC::Contentful::Test::Attributes + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC::Contentful::Test::Attributes + + + +

      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/test/attributes.rb
      +
      + +
      + + + +

      + Constant Summary + collapse +

      + +
      + +
      DEFAULTS = + +
      +
      {
      +  String: 'test',
      +  Int: 0,
      +  Float: 0.0,
      +  DateTime: Time.at(0).to_s,
      +  Boolean: false,
      +  Json: ->(_f) { {} },
      +  Coordinates: ->(_f) { {} },
      +  Asset: ->(f) {
      +           WCC::Contentful::Link.new(
      +             "fake-#{f.name}-#{SecureRandom.urlsafe_base64[1..6]}",
      +             :Asset
      +           ).raw
      +         },
      +  Link: ->(f) {
      +          WCC::Contentful::Link.new(
      +            "fake-#{f.name}-#{SecureRandom.urlsafe_base64[1..6]}",
      +            :Link
      +          ).raw
      +        }
      +}.freeze
      + +
      + + + + + + + + + +

      + Class Method Summary + collapse +

      + + + + + + +
      +

      Class Method Details

      + + +
      +

      + + .[](key) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +27
      +28
      +29
      +
      +
      # File 'lib/wcc/contentful/test/attributes.rb', line 27
      +
      +def [](key)
      +  DEFAULTS[key]
      +end
      +
      +
      + +
      +

      + + .default_value(field) ⇒ Object + + + + + +

      +
      + +

      Gets the default value for a contentful IndexedRepresentation::Field. This comes from the 'content_type_definition' of a contentful model class.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +
      +
      # File 'lib/wcc/contentful/test/attributes.rb', line 42
      +
      +def default_value(field)
      +  return [] if field.array
      +  return unless field.required
      +
      +  val = DEFAULTS[field.type]
      +  return val.call(field) if val.respond_to?(:call)
      +
      +  val
      +end
      +
      +
      + +
      +

      + + .defaults(const) ⇒ Object + + + + + +

      +
      + +

      Get a hash of default values for all attributes unique to the given Contentful model.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +33
      +34
      +35
      +36
      +37
      +
      +
      # File 'lib/wcc/contentful/test/attributes.rb', line 33
      +
      +def defaults(const)
      +  const.content_type_definition.fields.each_with_object({}) do |(name, f), h|
      +    h[name.to_sym] = h[name.underscore.to_sym] = default_value(f)
      +  end
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Test/Double.html b/docs/1.3/wcc-contentful/WCC/Contentful/Test/Double.html new file mode 100644 index 00000000..c035d151 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Test/Double.html @@ -0,0 +1,366 @@ + + + + + + + Module: WCC::Contentful::Test::Double + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC::Contentful::Test::Double + + + +

      +
      + + + + + + + + + +
      +
      Included in:
      +
      RSpec
      +
      + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/test/double.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #contentful_double(const, **attrs) ⇒ Object + + + + + +

      +
      + +

      Builds a rspec double of the Contentful model for the given content_type. All attributes that are known to be required fields on the content type will return a default value based on the field type.

      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (ArgumentError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +18
      +
      +
      # File 'lib/wcc/contentful/test/double.rb', line 10
      +
      +def contentful_double(const, **attrs)
      +  const = WCC::Contentful::Model.resolve_constant(const.to_s) unless const.respond_to?(:content_type_definition)
      +  attrs.symbolize_keys!
      +
      +  bad_attrs = attrs.reject { |a| const.instance_methods.include?(a) }
      +  raise ArgumentError, "Attribute(s) do not exist on #{const}: #{bad_attrs.keys}" if bad_attrs.any?
      +
      +  double(attrs[:name] || attrs[:id] || nil, defaults(const).merge(attrs))
      +end
      +
      +
      + +
      +

      + + #contentful_image_double(**attrs) ⇒ Object + + + + + +

      +
      + +

      Builds an rspec double of a Contentful image asset, including the file URL and details. These fields can be overridden.

      + + +
      +
      +
      + + +
      + + + + +
      +
      +
      +
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +41
      +42
      +43
      +44
      +45
      +46
      +47
      +48
      +49
      +50
      +51
      +52
      +53
      +54
      +55
      +56
      +57
      +58
      +59
      +60
      +61
      +62
      +63
      +64
      +65
      +66
      +67
      +
      +
      # File 'lib/wcc/contentful/test/double.rb', line 23
      +
      +def contentful_image_double(**attrs)
      +  attrs = {
      +    title: WCC::Contentful::Test::Attributes[:String],
      +    description: WCC::Contentful::Test::Attributes[:String],
      +    file: {
      +      url: '//images.ctfassets.net/7yx6/2rak/test.jpg',
      +      details: {
      +        image: {
      +          width: 0,
      +          height: 0
      +        }
      +      }
      +    }
      +  }.deep_merge!(attrs)
      +
      +  attrs[:file] = OpenStruct.new(attrs[:file]) if attrs[:file]
      +
      +  attrs[:raw] = {
      +    sys: {
      +      space: {
      +        sys: {
      +          type: 'Link',
      +          linkType: 'Space',
      +          id: ENV.fetch('CONTENTFUL_SPACE_ID', nil)
      +        }
      +      },
      +      id: SecureRandom.urlsafe_base64,
      +      type: 'Asset',
      +      createdAt: Time.now.to_s(:iso8601),
      +      updatedAt: Time.now.to_s(:iso8601),
      +      environment: {
      +        sys: {
      +          id: 'master',
      +          type: 'Link',
      +          linkType: 'Environment'
      +        }
      +      },
      +      revision: rand(100),
      +      locale: 'en-US'
      +    },
      +    fields: attrs.transform_values { |v| { 'en-US' => v } }
      +  }
      +
      +  double(attrs)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/Test/Factory.html b/docs/1.3/wcc-contentful/WCC/Contentful/Test/Factory.html new file mode 100644 index 00000000..d9d600d2 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/Test/Factory.html @@ -0,0 +1,265 @@ + + + + + + + Module: WCC::Contentful::Test::Factory + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Module: WCC::Contentful::Test::Factory + + + +

      +
      + + + + + + + + + +
      +
      Included in:
      +
      RSpec
      +
      + + + +
      +
      Defined in:
      +
      lib/wcc/contentful/test/factory.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #contentful_create(const, context = nil, **attrs) ⇒ Object + + + + + +

      +
      + +

      Builds a in-memory instance of the Contentful model for the given content_type. All attributes that are known to be required fields on the content type will return a default value based on the field type.

      + + +
      +
      +
      + +

      Raises:

      +
        + +
      • + + + (ArgumentError) + + + +
      • + +
      + +
      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +18
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +41
      +42
      +
      +
      # File 'lib/wcc/contentful/test/factory.rb', line 10
      +
      +def contentful_create(const, context = nil, **attrs)
      +  const = WCC::Contentful::Model.resolve_constant(const.to_s) unless const.respond_to?(:content_type_definition)
      +  attrs = attrs.transform_keys { |a| a.to_s.camelize(:lower) }
      +
      +  id = attrs.delete('id')
      +  sys = attrs.delete('sys')
      +  raw = attrs.delete('raw') || default_raw(const, id)
      +  bad_attrs = attrs.reject { |a| const.content_type_definition.fields.key?(a) }
      +  raise ArgumentError, "Attribute(s) do not exist on #{const}: #{bad_attrs.keys}" if bad_attrs.any?
      +
      +  raw['sys'].merge!(sys) if sys
      +
      +  attrs.each do |k, v|
      +    field = const.content_type_definition.fields[k]
      +
      +    raw_value = v
      +    raw_value = to_raw(v, field.type) if %i[Asset Link].include?(field.type)
      +    raw['fields'][field.name][raw.dig('sys', 'locale')] = raw_value
      +  end
      +
      +  instance = const.new(raw, context)
      +
      +  attrs.each do |k, v|
      +    field = const.content_type_definition.fields[k]
      +    next unless %i[Asset Link].include?(field.type)
      +
      +    unless field.array ? v.any? { |i| i.is_a?(String) } : v.is_a?(String)
      +      instance.instance_variable_set("@#{field.name}_resolved", v)
      +    end
      +  end
      +
      +  instance
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/WebhookController.html b/docs/1.3/wcc-contentful/WCC/Contentful/WebhookController.html new file mode 100644 index 00000000..314354d3 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/WebhookController.html @@ -0,0 +1,244 @@ + + + + + + + Class: WCC::Contentful::WebhookController + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::WebhookController + + + +

      +
      + +
      +
      Inherits:
      +
      + ApplicationController + +
        +
      • Object
      • + + + + + + + +
      + show all + +
      +
      + + + + + + +
      +
      Includes:
      +
      ServiceAccessors, Wisper::Publisher
      +
      + + + + + + +
      +
      Defined in:
      +
      app/controllers/wcc/contentful/webhook_controller.rb
      +
      + +
      + +

      Overview

      +
      + +

      The WebhookController is mounted by the WCC::Contentful::Engine to receive webhook events from Contentful. It passes these webhook events to the jobs configured in WCC::Contentful::Configuration#webhook_jobs

      + + +
      +
      +
      + + +
      + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + + + + + + + + + + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #receiveObject + + + + + +

      + + + + +
      +
      +
      +
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +31
      +32
      +
      +
      # File 'app/controllers/wcc/contentful/webhook_controller.rb', line 20
      +
      +def receive
      +  params.require('sys').require(%w[id type])
      +  params.permit('sys', 'fields')
      +  event = params.slice('sys', 'fields').permit!.to_h
      +
      +  return unless check_environment(event)
      +
      +  # Immediately update the store, we may update again later using SyncEngine::Job.
      +  store.index(event) if store.index?
      +
      +  event = WCC::Contentful::Event.from_raw(event, source: self)
      +  emit_event(event)
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/WCC/Contentful/WebhookEnableJob.html b/docs/1.3/wcc-contentful/WCC/Contentful/WebhookEnableJob.html new file mode 100644 index 00000000..508f37d5 --- /dev/null +++ b/docs/1.3/wcc-contentful/WCC/Contentful/WebhookEnableJob.html @@ -0,0 +1,299 @@ + + + + + + + Class: WCC::Contentful::WebhookEnableJob + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Class: WCC::Contentful::WebhookEnableJob + + + +

      +
      + +
      +
      Inherits:
      +
      + ActiveJob::Base + +
        +
      • Object
      • + + + + + +
      + show all + +
      +
      + + + + + + + + + + + +
      +
      Defined in:
      +
      app/jobs/wcc/contentful/webhook_enable_job.rb
      +
      + +
      + + + + + + + + + +

      + Instance Method Summary + collapse +

      + + + + + + + +
      +

      Instance Method Details

      + + +
      +

      + + #enable_webhook(client, receive_url:, webhook_username: nil, webhook_password: nil) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +19
      +20
      +21
      +22
      +23
      +24
      +25
      +26
      +27
      +28
      +29
      +30
      +31
      +32
      +33
      +34
      +35
      +36
      +37
      +38
      +39
      +40
      +41
      +42
      +43
      +
      +
      # File 'app/jobs/wcc/contentful/webhook_enable_job.rb', line 19
      +
      +def enable_webhook(client, receive_url:, webhook_username: nil, webhook_password: nil)
      +  webhook = client.webhook_definitions.items.find { |w| w['url'] == receive_url }
      +  logger.debug "existing webhook: #{webhook.inspect}" if webhook
      +  return if webhook
      +
      +  body = {
      +    'name' => 'WCC::Contentful webhook',
      +    'url' => receive_url,
      +    'topics' => [
      +      '*.publish',
      +      '*.unpublish'
      +    ],
      +    'filters' => webhook_filters
      +  }
      +  body['httpBasicUsername'] = webhook_username if webhook_username.present?
      +  body['httpBasicPassword'] = webhook_password if webhook_password.present?
      +
      +  begin
      +    resp = client.post_webhook_definition(body)
      +    logger.info "Created webhook: #{resp.raw.dig('sys', 'id')}"
      +  rescue WCC::Contentful::SimpleClient::ApiError => e
      +    logger.error "#{e.response.code}: #{e.response.raw}" if e.response
      +    raise
      +  end
      +end
      +
      +
      + +
      +

      + + #perform(args = {}) ⇒ Object + + + + + +

      + + + + +
      +
      +
      +
      +10
      +11
      +12
      +13
      +14
      +15
      +16
      +17
      +
      +
      # File 'app/jobs/wcc/contentful/webhook_enable_job.rb', line 10
      +
      +def perform(args = {})
      +  args = default_configuration.merge!(args)
      +
      +  client = WCC::Contentful::SimpleClient::Management.new(
      +    **args
      +  )
      +  enable_webhook(client, args.slice(:receive_url, :webhook_username, :webhook_password))
      +end
      +
      +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/_index.html b/docs/1.3/wcc-contentful/_index.html new file mode 100644 index 00000000..db634d6d --- /dev/null +++ b/docs/1.3/wcc-contentful/_index.html @@ -0,0 +1,873 @@ + + + + + + + Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
      + + +

      Documentation by YARD 0.9.28

      +
      +

      Alphabetic Index

      + +

      File Listing

      + + +
      +

      Namespace Listing A-Z

      + + + + + + + + +
      + + + + + +
        +
      • B
      • +
          + +
        • + Base + + (WCC::Contentful::Store) + +
        • + +
        • + Blockquote + + (WCC::Contentful::RichText) + +
        • + +
        +
      + + + + + + + + + + + +
        +
      • F
      • +
          + +
        • + Factory + + (WCC::Contentful::Store) + +
        • + +
        • + Factory + + (WCC::Contentful::Test) + +
        • + +
        • + Field + + (WCC::Contentful::IndexedRepresentation) + +
        • + +
        • + FrozenConfiguration + + (WCC::Contentful::Configuration) + +
        • + +
        +
      + + +
        +
      • H
      • +
          + +
        • + Helpers + + (WCC::Contentful) + +
        • + +
        +
      + + +
      + + + + + +
        +
      • J
      • +
          + +
        • + Job + + (WCC::Contentful::SyncEngine) + +
        • + +
        +
      + + +
        +
      • L
      • +
          + +
        • + Link + + (WCC::Contentful) + +
        • + +
        • + LinkVisitor + + (WCC::Contentful) + +
        • + +
        +
      + + + + + +
        +
      • N
      • +
          + +
        • + Node + + (WCC::Contentful::RichText) + +
        • + +
        • + NotFoundError + + (WCC::Contentful::SimpleClient) + +
        • + +
        +
      + + + + + +
        +
      • Q
      • +
          + +
        • + Query + + (WCC::Contentful::Store) + +
        • + +
        • + Query + + (WCC::Contentful::Store::CDNAdapter) + +
        • + +
        • + Query + + (WCC::Contentful::Store::PostgresStore) + +
        • + +
        +
      + + +
        +
      • R
      • +
          + +
        • + RSpec + + (WCC::Contentful) + +
        • + +
        • + RateLimitError + + (WCC::Contentful::SimpleClient) + +
        • + +
        • + Registry + + (WCC::Contentful::Event) + +
        • + +
        • + ResolveError + + (WCC::Contentful) + +
        • + +
        • + Response + + (WCC::Contentful::SimpleClient) + +
        • + +
        • + Response + + (WCC::Contentful::SimpleClient::TyphoeusAdapter) + +
        • + +
        • + RichText + + (WCC::Contentful) + +
        • + +
        +
      + + +
      + + + + + +
        +
      • T
      • +
          + +
        • + Test + + (WCC::Contentful) + +
        • + +
        • + Text + + (WCC::Contentful::RichText) + +
        • + +
        • + TyphoeusAdapter + + (WCC::Contentful::SimpleClient) + +
        • + +
        +
      + + +
        +
      • U
      • +
          + +
        • + UnauthorizedError + + (WCC::Contentful::SimpleClient) + +
        • + +
        • + Unknown + + (WCC::Contentful::Event) + +
        • + +
        • + Unknown + + (WCC::Contentful::RichText) + +
        • + +
        +
      + + + + +
      + +
      + +
      + + + +
      + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/class_list.html b/docs/1.3/wcc-contentful/class_list.html new file mode 100644 index 00000000..99187ea8 --- /dev/null +++ b/docs/1.3/wcc-contentful/class_list.html @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + Class List + + + +
      +
      +

      Class List

      + + + +
      + + +
      + + diff --git a/docs/1.3/wcc-contentful/css/common.css b/docs/1.3/wcc-contentful/css/common.css new file mode 100644 index 00000000..cf25c452 --- /dev/null +++ b/docs/1.3/wcc-contentful/css/common.css @@ -0,0 +1 @@ +/* Override this file with custom rules */ \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/css/full_list.css b/docs/1.3/wcc-contentful/css/full_list.css new file mode 100644 index 00000000..fa359824 --- /dev/null +++ b/docs/1.3/wcc-contentful/css/full_list.css @@ -0,0 +1,58 @@ +body { + margin: 0; + font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + font-size: 13px; + height: 101%; + overflow-x: hidden; + background: #fafafa; +} + +h1 { padding: 12px 10px; padding-bottom: 0; margin: 0; font-size: 1.4em; } +.clear { clear: both; } +.fixed_header { position: fixed; background: #fff; width: 100%; padding-bottom: 10px; margin-top: 0; top: 0; z-index: 9999; height: 70px; } +#search { position: absolute; right: 5px; top: 9px; padding-left: 24px; } +#content.insearch #search, #content.insearch #noresults { background: url(data:image/gif;base64,R0lGODlhEAAQAPYAAP///wAAAPr6+pKSkoiIiO7u7sjIyNjY2J6engAAAI6OjsbGxjIyMlJSUuzs7KamppSUlPLy8oKCghwcHLKysqSkpJqamvT09Pj4+KioqM7OzkRERAwMDGBgYN7e3ujo6Ly8vCoqKjY2NkZGRtTU1MTExDw8PE5OTj4+PkhISNDQ0MrKylpaWrS0tOrq6nBwcKysrLi4uLq6ul5eXlxcXGJiYoaGhuDg4H5+fvz8/KKiohgYGCwsLFZWVgQEBFBQUMzMzDg4OFhYWBoaGvDw8NbW1pycnOLi4ubm5kBAQKqqqiQkJCAgIK6urnJyckpKSjQ0NGpqatLS0sDAwCYmJnx8fEJCQlRUVAoKCggICLCwsOTk5ExMTPb29ra2tmZmZmhoaNzc3KCgoBISEiIiIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCAAAACwAAAAAEAAQAAAHaIAAgoMgIiYlg4kACxIaACEJCSiKggYMCRselwkpghGJBJEcFgsjJyoAGBmfggcNEx0flBiKDhQFlIoCCA+5lAORFb4AJIihCRbDxQAFChAXw9HSqb60iREZ1omqrIPdJCTe0SWI09GBACH5BAkIAAAALAAAAAAQABAAAAdrgACCgwc0NTeDiYozCQkvOTo9GTmDKy8aFy+NOBA7CTswgywJDTIuEjYFIY0JNYMtKTEFiRU8Pjwygy4ws4owPyCKwsMAJSTEgiQlgsbIAMrO0dKDGMTViREZ14kYGRGK38nHguHEJcvTyIEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDAggPg4iJAAMJCRUAJRIqiRGCBI0WQEEJJkWDERkYAAUKEBc4Po1GiKKJHkJDNEeKig4URLS0ICImJZAkuQAhjSi/wQyNKcGDCyMnk8u5rYrTgqDVghgZlYjcACTA1sslvtHRgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCQARAtOUoQRGRiFD0kJUYWZhUhKT1OLhR8wBaaFBzQ1NwAlkIszCQkvsbOHL7Y4q4IuEjaqq0ZQD5+GEEsJTDCMmIUhtgk1lo6QFUwJVDKLiYJNUd6/hoEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4uen4ICCA+IkIsDCQkVACWmhwSpFqAABQoQF6ALTkWFnYMrVlhWvIKTlSAiJiVVPqlGhJkhqShHV1lCW4cMqSkAR1ofiwsjJyqGgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCSMhREZGIYYGY2ElYebi56fhyWQniSKAKKfpaCLFlAPhl0gXYNGEwkhGYREUywag1wJwSkHNDU3D0kJYIMZQwk8MjPBLx9eXwuETVEyAC/BOKsuEjYFhoEAIfkECQgAAAAsAAAAABAAEAAAB2eAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4ueICImip6CIQkJKJ4kigynKaqKCyMnKqSEK05StgAGQRxPYZaENqccFgIID4KXmQBhXFkzDgOnFYLNgltaSAAEpxa7BQoQF4aBACH5BAkIAAAALAAAAAAQABAAAAdogACCg4SFggJiPUqCJSWGgkZjCUwZACQkgxGEXAmdT4UYGZqCGWQ+IjKGGIUwPzGPhAc0NTewhDOdL7Ykji+dOLuOLhI2BbaFETICx4MlQitdqoUsCQ2vhKGjglNfU0SWmILaj43M5oEAOwAAAAAAAAAAAA==) no-repeat center left; } +#full_list { padding: 0; list-style: none; margin-left: 0; margin-top: 80px; font-size: 1.1em; } +#full_list ul { padding: 0; } +#full_list li { padding: 0; margin: 0; list-style: none; } +#full_list li .item { padding: 5px 5px 5px 12px; } +#noresults { padding: 7px 12px; background: #fff; } +#content.insearch #noresults { margin-left: 7px; } +li.collapsed ul { display: none; } +li a.toggle { cursor: default; position: relative; left: -5px; top: 4px; text-indent: -999px; width: 10px; height: 9px; margin-left: -10px; display: block; float: left; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC) no-repeat bottom left; } +li.collapsed a.toggle { opacity: 0.5; cursor: default; background-position: top left; } +li { color: #888; cursor: pointer; } +li.deprecated { text-decoration: line-through; font-style: italic; } +li.odd { background: #f0f0f0; } +li.even { background: #fafafa; } +.item:hover { background: #ddd; } +li small:before { content: "("; } +li small:after { content: ")"; } +li small.search_info { display: none; } +a, a:visited { text-decoration: none; color: #05a; } +li.clicked > .item { background: #05a; color: #ccc; } +li.clicked > .item a, li.clicked > .item a:visited { color: #eee; } +li.clicked > .item a.toggle { opacity: 0.5; background-position: bottom right; } +li.collapsed.clicked a.toggle { background-position: top right; } +#search input { border: 1px solid #bbb; border-radius: 3px; } +#full_list_nav { margin-left: 10px; font-size: 0.9em; display: block; color: #aaa; } +#full_list_nav a, #nav a:visited { color: #358; } +#full_list_nav a:hover { background: transparent; color: #5af; } +#full_list_nav span:after { content: ' | '; } +#full_list_nav span:last-child:after { content: ''; } + +#content h1 { margin-top: 0; } +li { white-space: nowrap; cursor: normal; } +li small { display: block; font-size: 0.8em; } +li small:before { content: ""; } +li small:after { content: ""; } +li small.search_info { display: none; } +#search { width: 170px; position: static; margin: 3px; margin-left: 10px; font-size: 0.9em; color: #888; padding-left: 0; padding-right: 24px; } +#content.insearch #search { background-position: center right; } +#search input { width: 110px; } + +#full_list.insearch ul { display: block; } +#full_list.insearch .item { display: none; } +#full_list.insearch .found { display: block; padding-left: 11px !important; } +#full_list.insearch li a.toggle { display: none; } +#full_list.insearch li small.search_info { display: block; } diff --git a/docs/1.3/wcc-contentful/css/style.css b/docs/1.3/wcc-contentful/css/style.css new file mode 100644 index 00000000..eb0dbc86 --- /dev/null +++ b/docs/1.3/wcc-contentful/css/style.css @@ -0,0 +1,497 @@ +html { + width: 100%; + height: 100%; +} +body { + font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + font-size: 13px; + width: 100%; + margin: 0; + padding: 0; + display: flex; + display: -webkit-flex; + display: -ms-flexbox; +} + +#nav { + position: relative; + width: 100%; + height: 100%; + border: 0; + border-right: 1px dotted #eee; + overflow: auto; +} +.nav_wrap { + margin: 0; + padding: 0; + width: 20%; + height: 100%; + position: relative; + display: flex; + display: -webkit-flex; + display: -ms-flexbox; + flex-shrink: 0; + -webkit-flex-shrink: 0; + -ms-flex: 1 0; +} +#resizer { + position: absolute; + right: -5px; + top: 0; + width: 10px; + height: 100%; + cursor: col-resize; + z-index: 9999; +} +#main { + flex: 5 1; + -webkit-flex: 5 1; + -ms-flex: 5 1; + outline: none; + position: relative; + background: #fff; + padding: 1.2em; + padding-top: 0.2em; + box-sizing: border-box; +} + +@media (max-width: 920px) { + .nav_wrap { width: 100%; top: 0; right: 0; overflow: visible; position: absolute; } + #resizer { display: none; } + #nav { + z-index: 9999; + background: #fff; + display: none; + position: absolute; + top: 40px; + right: 12px; + width: 500px; + max-width: 80%; + height: 80%; + overflow-y: scroll; + border: 1px solid #999; + border-collapse: collapse; + box-shadow: -7px 5px 25px #aaa; + border-radius: 2px; + } +} + +@media (min-width: 920px) { + body { height: 100%; overflow: hidden; } + #main { height: 100%; overflow: auto; } + #search { display: none; } +} + +#main img { max-width: 100%; } +h1 { font-size: 25px; margin: 1em 0 0.5em; padding-top: 4px; border-top: 1px dotted #d5d5d5; } +h1.noborder { border-top: 0px; margin-top: 0; padding-top: 4px; } +h1.title { margin-bottom: 10px; } +h1.alphaindex { margin-top: 0; font-size: 22px; } +h2 { + padding: 0; + padding-bottom: 3px; + border-bottom: 1px #aaa solid; + font-size: 1.4em; + margin: 1.8em 0 0.5em; + position: relative; +} +h2 small { font-weight: normal; font-size: 0.7em; display: inline; position: absolute; right: 0; } +h2 small a { + display: block; + height: 20px; + border: 1px solid #aaa; + border-bottom: 0; + border-top-left-radius: 5px; + background: #f8f8f8; + position: relative; + padding: 2px 7px; +} +.clear { clear: both; } +.inline { display: inline; } +.inline p:first-child { display: inline; } +.docstring, .tags, #filecontents { font-size: 15px; line-height: 1.5145em; } +.docstring p > code, .docstring p > tt, .tags p > code, .tags p > tt { + color: #c7254e; background: #f9f2f4; padding: 2px 4px; font-size: 1em; + border-radius: 4px; +} +.docstring h1, .docstring h2, .docstring h3, .docstring h4 { padding: 0; border: 0; border-bottom: 1px dotted #bbb; } +.docstring h1 { font-size: 1.2em; } +.docstring h2 { font-size: 1.1em; } +.docstring h3, .docstring h4 { font-size: 1em; border-bottom: 0; padding-top: 10px; } +.summary_desc .object_link a, .docstring .object_link a { + font-family: monospace; font-size: 1.05em; + color: #05a; background: #EDF4FA; padding: 2px 4px; font-size: 1em; + border-radius: 4px; +} +.rdoc-term { padding-right: 25px; font-weight: bold; } +.rdoc-list p { margin: 0; padding: 0; margin-bottom: 4px; } +.summary_desc pre.code .object_link a, .docstring pre.code .object_link a { + padding: 0px; background: inherit; color: inherit; border-radius: inherit; +} + +/* style for */ +#filecontents table, .docstring table { border-collapse: collapse; } +#filecontents table th, #filecontents table td, +.docstring table th, .docstring table td { border: 1px solid #ccc; padding: 8px; padding-right: 17px; } +#filecontents table tr:nth-child(odd), +.docstring table tr:nth-child(odd) { background: #eee; } +#filecontents table tr:nth-child(even), +.docstring table tr:nth-child(even) { background: #fff; } +#filecontents table th, .docstring table th { background: #fff; } + +/* style for
        */ +#filecontents li > p, .docstring li > p { margin: 0px; } +#filecontents ul, .docstring ul { padding-left: 20px; } +/* style for
        */ +#filecontents dl, .docstring dl { border: 1px solid #ccc; } +#filecontents dt, .docstring dt { background: #ddd; font-weight: bold; padding: 3px 5px; } +#filecontents dd, .docstring dd { padding: 5px 0px; margin-left: 18px; } +#filecontents dd > p, .docstring dd > p { margin: 0px; } + +.note { + color: #222; + margin: 20px 0; + padding: 10px; + border: 1px solid #eee; + border-radius: 3px; + display: block; +} +.docstring .note { + border-left-color: #ccc; + border-left-width: 5px; +} +.note.todo { background: #ffffc5; border-color: #ececaa; } +.note.returns_void { background: #efefef; } +.note.deprecated { background: #ffe5e5; border-color: #e9dada; } +.note.title.deprecated { background: #ffe5e5; border-color: #e9dada; } +.note.private { background: #ffffc5; border-color: #ececaa; } +.note.title { padding: 3px 6px; font-size: 0.9em; font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; display: inline; } +.summary_signature + .note.title { margin-left: 7px; } +h1 .note.title { font-size: 0.5em; font-weight: normal; padding: 3px 5px; position: relative; top: -3px; text-transform: capitalize; } +.note.title { background: #efefef; } +.note.title.constructor { color: #fff; background: #6a98d6; border-color: #6689d6; } +.note.title.writeonly { color: #fff; background: #45a638; border-color: #2da31d; } +.note.title.readonly { color: #fff; background: #6a98d6; border-color: #6689d6; } +.note.title.private { background: #d5d5d5; border-color: #c5c5c5; } +.note.title.not_defined_here { background: transparent; border: none; font-style: italic; } +.discussion .note { margin-top: 6px; } +.discussion .note:first-child { margin-top: 0; } + +h3.inherited { + font-style: italic; + font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + font-weight: normal; + padding: 0; + margin: 0; + margin-top: 12px; + margin-bottom: 3px; + font-size: 13px; +} +p.inherited { + padding: 0; + margin: 0; + margin-left: 25px; +} + +.box_info dl { + margin: 0; + border: 0; + width: 100%; + font-size: 1em; + display: flex; + display: -webkit-flex; + display: -ms-flexbox; +} +.box_info dl dt { + flex-shrink: 0; + -webkit-flex-shrink: 1; + -ms-flex-shrink: 1; + width: 100px; + text-align: right; + font-weight: bold; + border: 1px solid #aaa; + border-width: 1px 0px 0px 1px; + padding: 6px 0; + padding-right: 10px; +} +.box_info dl dd { + flex-grow: 1; + -webkit-flex-grow: 1; + -ms-flex: 1; + max-width: 420px; + padding: 6px 0; + padding-right: 20px; + border: 1px solid #aaa; + border-width: 1px 1px 0 0; + overflow: hidden; + position: relative; +} +.box_info dl:last-child > * { + border-bottom: 1px solid #aaa; +} +.box_info dl:nth-child(odd) > * { background: #eee; } +.box_info dl:nth-child(even) > * { background: #fff; } +.box_info dl > * { margin: 0; } + +ul.toplevel { list-style: none; padding-left: 0; font-size: 1.1em; } +.index_inline_list { padding-left: 0; font-size: 1.1em; } + +.index_inline_list li { + list-style: none; + display: inline-block; + padding: 0 12px; + line-height: 30px; + margin-bottom: 5px; +} + +dl.constants { margin-left: 10px; } +dl.constants dt { font-weight: bold; font-size: 1.1em; margin-bottom: 5px; } +dl.constants.compact dt { display: inline-block; font-weight: normal } +dl.constants dd { width: 75%; white-space: pre; font-family: monospace; margin-bottom: 18px; } +dl.constants .docstring .note:first-child { margin-top: 5px; } + +.summary_desc { + margin-left: 32px; + display: block; + font-family: sans-serif; + font-size: 1.1em; + margin-top: 8px; + line-height: 1.5145em; + margin-bottom: 0.8em; +} +.summary_desc tt { font-size: 0.9em; } +dl.constants .note { padding: 2px 6px; padding-right: 12px; margin-top: 6px; } +dl.constants .docstring { margin-left: 32px; font-size: 0.9em; font-weight: normal; } +dl.constants .tags { padding-left: 32px; font-size: 0.9em; line-height: 0.8em; } +dl.constants .discussion *:first-child { margin-top: 0; } +dl.constants .discussion *:last-child { margin-bottom: 0; } + +.method_details { border-top: 1px dotted #ccc; margin-top: 25px; padding-top: 0; } +.method_details.first { border: 0; margin-top: 5px; } +.method_details.first h3.signature { margin-top: 1em; } +p.signature, h3.signature { + font-size: 1.1em; font-weight: normal; font-family: Monaco, Consolas, Courier, monospace; + padding: 6px 10px; margin-top: 1em; + background: #E8F4FF; border: 1px solid #d8d8e5; border-radius: 5px; +} +p.signature tt, +h3.signature tt { font-family: Monaco, Consolas, Courier, monospace; } +p.signature .overload, +h3.signature .overload { display: block; } +p.signature .extras, +h3.signature .extras { font-weight: normal; font-family: sans-serif; color: #444; font-size: 1em; } +p.signature .not_defined_here, +h3.signature .not_defined_here, +p.signature .aliases, +h3.signature .aliases { display: block; font-weight: normal; font-size: 0.9em; font-family: sans-serif; margin-top: 0px; color: #555; } +p.signature .aliases .names, +h3.signature .aliases .names { font-family: Monaco, Consolas, Courier, monospace; font-weight: bold; color: #000; font-size: 1.2em; } + +.tags .tag_title { font-size: 1.05em; margin-bottom: 0; font-weight: bold; } +.tags .tag_title tt { color: initial; padding: initial; background: initial; } +.tags ul { margin-top: 5px; padding-left: 30px; list-style: square; } +.tags ul li { margin-bottom: 3px; } +.tags ul .name { font-family: monospace; font-weight: bold; } +.tags ul .note { padding: 3px 6px; } +.tags { margin-bottom: 12px; } + +.tags .examples .tag_title { margin-bottom: 10px; font-weight: bold; } +.tags .examples .inline p { padding: 0; margin: 0; font-weight: bold; font-size: 1em; } +.tags .examples .inline p:before { content: "▸"; font-size: 1em; margin-right: 5px; } + +.tags .overload .overload_item { list-style: none; margin-bottom: 25px; } +.tags .overload .overload_item .signature { + padding: 2px 8px; + background: #F1F8FF; border: 1px solid #d8d8e5; border-radius: 3px; +} +.tags .overload .signature { margin-left: -15px; font-family: monospace; display: block; font-size: 1.1em; } +.tags .overload .docstring { margin-top: 15px; } + +.defines { display: none; } + +#method_missing_details .notice.this { position: relative; top: -8px; color: #888; padding: 0; margin: 0; } + +.showSource { font-size: 0.9em; } +.showSource a, .showSource a:visited { text-decoration: none; color: #666; } + +#content a, #content a:visited { text-decoration: none; color: #05a; } +#content a:hover { background: #ffffa5; } + +ul.summary { + list-style: none; + font-family: monospace; + font-size: 1em; + line-height: 1.5em; + padding-left: 0px; +} +ul.summary a, ul.summary a:visited { + text-decoration: none; font-size: 1.1em; +} +ul.summary li { margin-bottom: 5px; } +.summary_signature { padding: 4px 8px; background: #f8f8f8; border: 1px solid #f0f0f0; border-radius: 5px; } +.summary_signature:hover { background: #CFEBFF; border-color: #A4CCDA; cursor: pointer; } +.summary_signature.deprecated { background: #ffe5e5; border-color: #e9dada; } +ul.summary.compact li { display: inline-block; margin: 0px 5px 0px 0px; line-height: 2.6em;} +ul.summary.compact .summary_signature { padding: 5px 7px; padding-right: 4px; } +#content .summary_signature:hover a, +#content .summary_signature:hover a:visited { + background: transparent; + color: #049; +} + +p.inherited a { font-family: monospace; font-size: 0.9em; } +p.inherited { word-spacing: 5px; font-size: 1.2em; } + +p.children { font-size: 1.2em; } +p.children a { font-size: 0.9em; } +p.children strong { font-size: 0.8em; } +p.children strong.modules { padding-left: 5px; } + +ul.fullTree { display: none; padding-left: 0; list-style: none; margin-left: 0; margin-bottom: 10px; } +ul.fullTree ul { margin-left: 0; padding-left: 0; list-style: none; } +ul.fullTree li { text-align: center; padding-top: 18px; padding-bottom: 12px; background: url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAHtJREFUeNqMzrEJAkEURdGzuhgZbSoYWcAWoBVsB4JgZAGmphsZCZYzTQgWNCYrDN9RvMmHx+X916SUBFbo8CzD1idXrLErw1mQttgXtyrOcQ/Ny5p4Qh+2XqLYYazsPWNTiuMkRxa4vcV+evuNAUOLIx5+c2hyzv7hNQC67Q+/HHmlEwAAAABJRU5ErkJggg==) no-repeat top center; } +ul.fullTree li:first-child { padding-top: 0; background: transparent; } +ul.fullTree li:last-child { padding-bottom: 0; } +.showAll ul.fullTree { display: block; } +.showAll .inheritName { display: none; } + +#search { position: absolute; right: 12px; top: 0px; z-index: 9000; } +#search a { + display: block; float: left; + padding: 4px 8px; text-decoration: none; color: #05a; fill: #05a; + border: 1px solid #d8d8e5; + border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; + background: #F1F8FF; + box-shadow: -1px 1px 3px #ddd; +} +#search a:hover { background: #f5faff; color: #06b; fill: #06b; } +#search a.active { + background: #568; padding-bottom: 20px; color: #fff; fill: #fff; + border: 1px solid #457; + border-top-left-radius: 5px; border-top-right-radius: 5px; +} +#search a.inactive { color: #999; fill: #999; } +.inheritanceTree, .toggleDefines { + float: right; + border-left: 1px solid #aaa; + position: absolute; top: 0; right: 0; + height: 100%; + background: #f6f6f6; + padding: 5px; + min-width: 55px; + text-align: center; +} + +#menu { font-size: 1.3em; color: #bbb; } +#menu .title, #menu a { font-size: 0.7em; } +#menu .title a { font-size: 1em; } +#menu .title { color: #555; } +#menu a, #menu a:visited { color: #333; text-decoration: none; border-bottom: 1px dotted #bbd; } +#menu a:hover { color: #05a; } + +#footer { margin-top: 15px; border-top: 1px solid #ccc; text-align: center; padding: 7px 0; color: #999; } +#footer a, #footer a:visited { color: #444; text-decoration: none; border-bottom: 1px dotted #bbd; } +#footer a:hover { color: #05a; } + +#listing ul.alpha { font-size: 1.1em; } +#listing ul.alpha { margin: 0; padding: 0; padding-bottom: 10px; list-style: none; } +#listing ul.alpha li.letter { font-size: 1.4em; padding-bottom: 10px; } +#listing ul.alpha ul { margin: 0; padding-left: 15px; } +#listing ul small { color: #666; font-size: 0.7em; } + +li.r1 { background: #f0f0f0; } +li.r2 { background: #fafafa; } + +#content ul.summary li.deprecated .summary_signature a, +#content ul.summary li.deprecated .summary_signature a:visited { text-decoration: line-through; font-style: italic; } + +#toc { + position: relative; + float: right; + overflow-x: auto; + right: -3px; + margin-left: 20px; + margin-bottom: 20px; + padding: 20px; padding-right: 30px; + max-width: 300px; + z-index: 5000; + background: #fefefe; + border: 1px solid #ddd; + box-shadow: -2px 2px 6px #bbb; +} +#toc .title { margin: 0; } +#toc ol { padding-left: 1.8em; } +#toc li { font-size: 1.1em; line-height: 1.7em; } +#toc > ol > li { font-size: 1.1em; font-weight: bold; } +#toc ol > li > ol { font-size: 0.9em; } +#toc ol ol > li > ol { padding-left: 2.3em; } +#toc ol + li { margin-top: 0.3em; } +#toc.hidden { padding: 10px; background: #fefefe; box-shadow: none; } +#toc.hidden:hover { background: #fafafa; } +#filecontents h1 + #toc.nofloat { margin-top: 0; } +@media (max-width: 560px) { + #toc { + margin-left: 0; + margin-top: 16px; + float: none; + max-width: none; + } +} + +/* syntax highlighting */ +.source_code { display: none; padding: 3px 8px; border-left: 8px solid #ddd; margin-top: 5px; } +#filecontents pre.code, .docstring pre.code, .source_code pre { font-family: monospace; } +#filecontents pre.code, .docstring pre.code { display: block; } +.source_code .lines { padding-right: 12px; color: #555; text-align: right; } +#filecontents pre.code, .docstring pre.code, +.tags pre.example { + padding: 9px 14px; + margin-top: 4px; + border: 1px solid #e1e1e8; + background: #f7f7f9; + border-radius: 4px; + font-size: 1em; + overflow-x: auto; + line-height: 1.2em; +} +pre.code { color: #000; tab-size: 2; } +pre.code .info.file { color: #555; } +pre.code .val { color: #036A07; } +pre.code .tstring_content, +pre.code .heredoc_beg, pre.code .heredoc_end, +pre.code .qwords_beg, pre.code .qwords_end, pre.code .qwords_sep, +pre.code .words_beg, pre.code .words_end, pre.code .words_sep, +pre.code .qsymbols_beg, pre.code .qsymbols_end, pre.code .qsymbols_sep, +pre.code .symbols_beg, pre.code .symbols_end, pre.code .symbols_sep, +pre.code .tstring, pre.code .dstring { color: #036A07; } +pre.code .fid, pre.code .rubyid_new, pre.code .rubyid_to_s, +pre.code .rubyid_to_sym, pre.code .rubyid_to_f, +pre.code .dot + pre.code .id, +pre.code .rubyid_to_i pre.code .rubyid_each { color: #0085FF; } +pre.code .comment { color: #0066FF; } +pre.code .const, pre.code .constant { color: #585CF6; } +pre.code .label, +pre.code .symbol { color: #C5060B; } +pre.code .kw, +pre.code .rubyid_require, +pre.code .rubyid_extend, +pre.code .rubyid_include { color: #0000FF; } +pre.code .ivar { color: #318495; } +pre.code .gvar, +pre.code .rubyid_backref, +pre.code .rubyid_nth_ref { color: #6D79DE; } +pre.code .regexp, .dregexp { color: #036A07; } +pre.code a { border-bottom: 1px dotted #bbf; } +/* inline code */ +*:not(pre) > code { + padding: 1px 3px 1px 3px; + border: 1px solid #E1E1E8; + background: #F7F7F9; + border-radius: 4px; +} + +/* Color fix for links */ +#content .summary_desc pre.code .id > .object_link a, /* identifier */ +#content .docstring pre.code .id > .object_link a { color: #0085FF; } +#content .summary_desc pre.code .const > .object_link a, /* constant */ +#content .docstring pre.code .const > .object_link a { color: #585CF6; } diff --git a/docs/1.3/wcc-contentful/doc-static/wcc-contentful.png b/docs/1.3/wcc-contentful/doc-static/wcc-contentful.png new file mode 100644 index 00000000..906ff6a9 Binary files /dev/null and b/docs/1.3/wcc-contentful/doc-static/wcc-contentful.png differ diff --git a/docs/1.3/wcc-contentful/file.README.html b/docs/1.3/wcc-contentful/file.README.html new file mode 100644 index 00000000..5cf860a4 --- /dev/null +++ b/docs/1.3/wcc-contentful/file.README.html @@ -0,0 +1,706 @@ + + + + + + + File: README + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
        + + +

        Gem Version +Build Status +Coverage Status

        + +

        Full documentation: https://watermarkchurch.github.io/wcc-contentful/latest/wcc-contentful/

        + +

        WCC::Contentful

        + +

        An alternative to Contentful's contentful.rb ruby client, contentful_model, and contentful_rails gems all in one.

        + +

        Table of Contents:

        + +
          +
        1. Why?
        2. +
        3. Installation
        4. +
        5. Configuration
        6. +
        7. Usage + +
            +
          1. Model API
          2. +
          3. Store API
          4. +
          5. Direct CDN client
          6. +
          7. Accessing the APIs
          8. +
        8. +
        9. Architecture + +
            +
          1. Client Layer
          2. +
          3. Store Layer
          4. +
          5. Model Layer
          6. +
        10. +
        11. Test Helpers
        12. +
        13. Advanced Configuration Example
        14. +
        15. Connecting to Multiple Spaces
        16. +
        17. Development
        18. +
        19. Contributing
        20. +
        21. License
        22. +
        + +

        Why did you rewrite the Contentful ruby stack?

        + +

        We started working with Contentful almost 3 years ago. Since that time, Contentful's ruby stack has improved, but there are still a number of pain points that we feel we have addressed better with our gem. These are:

        + + + +

        Our gem no longer depends on any of the Contentful gems and interacts directly with the Contentful CDA and Content Management API over HTTPS.

        + +

        Low-level caching

        + +

        The wcc-contentful gem enables caching at two levels: the HTTP response using Faraday HTTP cache middleware, and at the Entry level using the Rails cache and the Sync API to keep it up to date. We've found these two cache layers to be very effective at reducing both round trip latency to the Content Delivery API, as well as reducing our monthly API request usage. (which reduces our overage charges. Hooray!)

        + +

        At the request/response level

        + +

        By default, the contentful.rb gem requires the HTTP library. While simple and straightforward to use, it is not as powerful for caching. We decided to make our client conform to the Faraday gem's API. If you prefer not to use Faraday, you can choose to supply your own HTTP adapter that "quacks like" Faraday (see the TyphoeusAdapter for one implementation).

        + +

        Using Faraday makes it easy to add Middleware. As an example, our flagship Rails app that powers watermark.org uses the following configuration in Production, which provides us with instrumentation through statsd, logging, and caching:

        + +
        config.connection = Faraday.new do |builder|
        +  builder.use :http_cache,
        +    shared_cache: false,
        +    store: ActiveSupport::Cache::MemoryStore.new(size: 512.megabytes),
        +    logger: Rails.logger,
        +    serializer: Marshal,
        +    instrumenter: ActiveSupport::Notifications
        +
        +  builder.use :gzip
        +  builder.response :logger, Rails.logger, headers: false, bodies: false if Rails.env.development?
        +  builder.request :instrumentation
        +  builder.adapter :typhoeus
        +end
        +
        + +

        At the Entry level

        + +

        Our stack has three layers, the middle layer being essentially a cache for individual Entry hashes parsed out of responses from the Delivery API. We were able to add a caching layer here which stores entries retrieved over the Sync API, and responds to queries with cached versions of local content when possible. We consider this to be our best innovation on the Contentful ruby stack.

        + +

        We have successfully created caching layers using Memcached, Postgres, and an in-memory hash. The architecture allows other caching implementations to be created fairly easily, and we have a set of rspec specs that can verify that a cache store behaves appropriately. For more information, see the documentation on the caching modes here.

        + +

        Better Rails Integration

        + +

        When we initially got started with the Contentful ruby models, we encountered one problem that was more frustrating than all others: If a field exists in the content model, but the particular entry we're working with does not have that field populated, then accessing that field raised a NoMethodError. This caused us to litter our code with if defined?(entry.my_field) which is bad practice. (Note: this has since been fixed in contentful.rb v2).

        + +

        We decided it was better to not rely on method_missing? (what contentful.rb does), and instead to use define_method in an initializer to generate the methods for our models. This has the advantage that calling .instance_methods on a model class includes all the fields present in the content model.

        + +

        We also took advantage of Rails' naming conventions to automatically infer the content type name based on the class name. Thus in our code, we have app/models/page.rb which defines class Page << WCC::Contentful::Model::Page, and is automatically linked to the page content type ID. (Note: this is overridable on a per-model basis)

        + +

        All our models are automatically generated at startup which improves response times at the expense of initialization time. In addition, our content model registry allows easy definition of custom models in your app/models directory to override fields. This plays nice with other gems like algoliasearch-rails, which allows you to declaratively manage your Algolia indexes. Another example from our flagship watermark.org:

        + +
        class Page < WCC::Contentful::Model::Page
        +  include AlgoliaSearch
        +
        +  algoliasearch(index_name: 'pages') do
        +    attribute(:title, :slug)
        +    ...
        +  end
        +
        + + + +

        Using the contentful_model gem, calling Page.all.load does not give you all Page entries if there are more than 100. To get the next page you must call .paginate on the response. By contrast, Page.find_all in the wcc-contentful gem gives you a Lazy Enumerator. As you iterate past the 100th entry, the enumerator will automatically fetch the next page. If you only enumerate 99 entries (say with .take(99)), then the second page will never be fetched.

        + +

        Similarly, if your Page references an asset, say hero_image, that field returns a Link object rather than the actual Asset. You must either predefine how many links you need using Page.load_children(3).all.load, or detect that hero_image is a Link like if @page.hero_image.is_a? Contentful::Link and then call .resolve on the link. We found all of that to be too cumbersome when we are down in a nested partial view template that may be invoked from multiple places.

        + +

        The wcc-contentful gem, by contrast, automatically resolves a link when accessing the associated attribute. So in our example above, wcc-contentful will always return a WCC::Contentful::Asset when calling @page.hero_image, even if it has to execute a query to cdn.contentful.com in order to fetch it.

        + +

        Warning: This can easily lead to you exhausting your Contentful API quota if you do not carefully tune your cache, which you should be doing anyways! The default settings will use the Rails cache to try to cache these resolutions, but you are ultimately responsible for how many queries you execute!

        + +

        Automatic webhook management

        + +

        The wcc-contentful gem, just like contentful_rails, provides an Engine to be mounted in your Rails routes file. Unlike contentful_rails, if you also configure wcc-contentful with a Contentful Management Token and a public app_url, then on startup the wcc-contentful engine will reach out to the Contentful Management API and ensure that a webhook is configured to point to your app. This is one less devops burden on you, and plays very nicely in with Heroku review apps.

        + +

        Installation

        + +

        Add this line to your application's Gemfile:

        + +
        gem 'wcc-contentful', require: 'wcc/contentful/rails'
        +
        + +

        If you're not using rails, exclude the require: parameter.

        + +
        gem 'wcc-contentful'
        +
        + +

        And then execute:

        + +
        $ bundle
        +
        + +

        Or install it yourself:

        + +
        $ gem install wcc-contentful
        +
        + +

        Configure

        + +

        Put this in an initializer:

        + +
        # config/initializers/wcc_contentful.rb
        +WCC::Contentful.configure do |config|
        +  config.access_token = <CONTENTFUL_ACCESS_TOKEN>
        +  config.space = <CONTENTFUL_SPACE_ID>
        +end
        +
        +WCC::Contentful.init!
        +
        + +

        All configuration options can be found in the rubydoc under +WCC::Contentful::Configuration

        + +

        Usage

        + +

        WCC::Contentful::Model API

        + +

        The WCC::Contentful::Model API exposes Contentful data as a set of dynamically +generated Ruby objects. These objects are based on the content types in your +Contentful space. All these objects are generated by WCC::Contentful.init!

        + +

        The following examples show how to use this API to find entries of the page +content type:

        + +
        # Find objects by id
        +WCC::Contentful::Model::Page.find('1E2ucWSdacxxf233sfa3')
        +# => #<WCC::Contentful::Model::Page:0x0000000005c71a78 @created_at=2018-04-16 18:41:17 UTC...>
        +
        +# Find objects by field
        +WCC::Contentful::Model::Page.find_by(slug: '/some-slug')
        +# => #<WCC::Contentful::Model::Page:0x0000000005c71a78 @created_at=2018-04-16 18:41:17 UTC...>
        +
        +# Use operators to filter by a field
        +# must use full notation for sys attributes (except ID)
        +WCC::Contentful::Model::Page.find_all('sys.created_at' => { lte: Date.today })
        +# => [#<WCC::Contentful::Model::Page:0x0000000005c71a78 @created_at=2018-04-16 18:41:17 UTC...>, ... ]
        +
        +# Nest queries to mimick joins
        +WCC::Contentful::Model::Page.find_by(subpages: { slug: '/some-slug' })
        +# => #<WCC::Contentful::Model::Page:0x0000000005c71a78 @created_at=2018-04-16 18:41:17 UTC...>
        +
        +# Pass the preview flag to use the preview client (must have set preview_token config param)
        +preview_redirect = WCC::Contentful::Model::Redirect.find_by({ slug: 'draft-redirect' }, preview: true)
        +# => #<WCC::Contentful::Model::Redirect:0x0000000005d879ad @created_at=2018-04-16 18:41:17 UTC...>
        +preview_redirect_object.href
        +# => 'http://www.somesite.com/slug-for-redirect'
        +
        + +

        See the WCC::Contentful::Model documentation for more details.

        + +

        Store API

        + +

        The Store layer is used by the Model API to access Contentful data in a raw form. +The Store layer returns entries as hashes parsed from JSON, conforming to the +object structure returned from the Contentful CDN.

        + +

        The following examples show how to use the Store API to retrieve raw data from +the store:

        + +
        store = WCC::Contentful::Services.instance.store
        +# => #<WCC::Contentful::Store::CDNAdapter:0x00007fb92a221498
        +
        +store.find('5FsqsbMECsM62e04U8sY4Y')
        +# => {"sys"=>
        +#  ...
        +# "fields"=>
        +# ...}
        +
        +store.find_by(content_type: 'page', filter: { slug: '/some-slug' })
        +# => {"sys"=>
        +#  ...
        +# "fields"=>
        +# ...}
        +
        +query = store.find_all(content_type: 'page').eq('group', 'some-group')
        +# => #<WCC::Contentful::Store::CDNAdapter::Query:0x00007fa3d40b84f0
        +query.first
        +# => {"sys"=>
        +#  ...
        +# "fields"=>
        +# ...}
        +query.result
        +# => #<Enumerator::Lazy: ...>
        +query.result.force
        +# => [{"sys"=> ...}, {"sys"=> ...}, ...]
        +
        + +

        See the WCC::Contentful::Store documentation for more details.

        + +

        Direct CDN API (SimpleClient)

        + +

        The SimpleClient is the bottom layer, and is used to get raw data directly from +the Contentful CDN. It handles response parsing and paging, but does not resolve +links or transform the result into a Model class.

        + +

        The following examples show how to use the SimpleClient to retrieve data directly +from the Contentful CDN:

        + +
        client = WCC::Contentful::Services.instance.client
        +# => #<WCC::Contentful::SimpleClient::Cdn:0x00007fa3cde89310
        +
        +response = client.entry('5FsqsbMECsM62e04U8sY4Y')
        +# => #<WCC::Contentful::SimpleClient::Response:0x00007fa3d103a4e0
        +response.body
        +# => "{\n  \"sys\": {\n ...
        +response.raw
        +# => {"sys"=>
        +#  ...
        +# "fields"=>
        +# ...}
        +
        +client.asset('5FsqsbMECsM62e04U8sY4Y').raw
        +# => {"sys"=>
        +#  ...
        +# "fields"=>
        +# ...}
        +
        +response = client.entries('fields.group' => 'some-group', 'limit' => 5)
        +# => #<WCC::Contentful::SimpleClient::Response:0x00007fa3d103a4e0
        +response.count
        +# => 99
        +response.first
        +# => {"sys"=>
        +#  ...
        +# "fields"=>
        +# ...}
        +response.items
        +=> #<Enumerator::Lazy: ...>
        +response.items.count  # Careful! This evaluates the lazy iterator and gets all pages
        +# => 99
        +
        +response.includes
        +# => {"4xNnFJ77egkSMEogE2yISa"=>
        +#   {"sys"=> ...}
        +#  "6Fwukxxkxa6qQCC04WCaqg"=>
        +#   {"sys"=> ...}
        +#   ...}
        +
        + +

        The client handles Paging automatically within the lazy iterator returned by #items. +This lazy iterator does not respect the limit param - that param is only passed +through to the API to set the page size. If you truly want a limited subset of +response items, use response.items.take(n)

        + +

        Entries included via the include parameter are made available on the #includes +field. This is a hash of <entry ID> => <raw entry> and makes it easy to grab +links. This hash is added to lazily as you enumerate the pages.

        + +

        See the WCC::Contentful::SimpleClient documentation for more details.

        + +

        Accessing the APIs within application code

        + +

        The Model API is best exposed by defining your own model classes in the app/models +directory which inherit from the WCC::Contentful models.

        + +
        # app/models/page.rb
        +class Page < WCC::Contentful::Model::Page
        +
        +  # You can add additional methods here
        +end
        +
        +# app/controllers/pages_controller.rb
        +class PagesController < ApplicationController
        +  def show
        +    @page = Page.find_by(slug: params[:slug])
        +    raise Exceptions::PageNotFoundError, params[:slug] unless @page
        +  end
        +end
        +
        + +

        The WCC::Contentful::Services singleton gives access to the other configured services. +You can also include the WCC::Contentful::ServiceAccessors concern to define these +services as attributes in a class.

        + +
        class MyJob < ApplicationJob
        +  include WCC::Contentful::ServiceAccessors
        +
        +  def perform
        +    Page.find(...)
        +
        +    store.find(...)
        +
        +    client.entries(...)
        +  end
        +end
        +
        + +

        Architecture

        + +

        wcc-contentful diagram

        + +

        From the bottom up:

        + +

        Client Layer

        + +

        The WCC::Contentful::SimpleClient provides methods to access the Contentful +Content Delivery API +through your favorite HTTP client gem. The SimpleClient expects +an Adapter that conforms to the Faraday interface.

        + +

        Creating a SimpleClient to connect using different credentials, or to connect +without setting up all the rest of WCC::Contentful, is easy:

        + +
        WCC::Contentful::SimpleClient::Cdn.new(
        +  # required
        +  access_token: 'xxxx',
        +  space: '1234',
        +  # optional
        +  environment: 'staging', # omit to use master
        +  default_locale: '*',
        +  rate_limit_wait_timeout: 10,
        +  instrumentation: ActiveSupport::Notifications,
        +  connection: Faraday.new { |builder| ... },
        +)
        +
        + +

        You can also create a WCC::Contentful::SimpleClient::Preview to talk to the +Preview API, or a WCC::Contentful::SimpleClient::Management to talk to the +Management API.

        + +

        Store Layer

        + +

        The Store Layer represents the data store where Contentful entries are kept for +querying. By default, WCC::Contentful.init! creates a WCC::Contentful::Store::CDNAdapter +which uses a WCC::Contentful::SimpleClient::Cdn instance to query entries from +the Contentful Content Delivery API. You can also query entries from another +source like Postgres or an in-memory hash if your data is small enough.

        + +

        You can also implement your own store if you want! The gem contains a suite of +RSpec shared examples that give you a baseline for implementing your own store. +In your RSpec suite:

        + +
        # frozen_string_literal: true
        +
        +require 'my_store'
        +require 'wcc/contentful/store/rspec_examples'
        +
        +RSpec.describe MyStore do
        +  it_behaves_like 'contentful store', {
        +    # Set which store features your store implements.  
        +    nested_queries: true,  # Does your store implement JOINs?
        +    include_param: true    # Does your store resolve links when given the :include option?
        +  }
        +
        + +

        The store is kept up-to-date by the WCC::Contentful::SyncEngine. The SyncEngine#next methodcalls the #index method on the configured store in order to update +it with the latest data via the Contentful Sync API. For example, +the WCC::Contentful::Store::MemoryStore uses this to update the hash with the +newest version of an entry, or delete an entry out of the hash.

        + +

        Store Middleware

        + +

        The store layer is made up of a base store (which implements WCC::Contentful::Store::Interface), +and optional middleware. The middleware +allows custom transformation of received entries via the #select and #transform +methods. To create your own middleware simply include WCC::Contentful::Middleware::Store +and implement those methods, then call use when configuring the store:

        + +
        config.store :direct do
        +  use MyMiddleware, param1: 'xxx'
        +end
        +
        + +

        The most useful middleware is the WCC::Contentful::Middleware::Store::CachingMiddleware, +which enables :lazy_sync mode (see WCC::Contentful::Configuration#store)

        + +

        Model Layer

        + +

        This is the global top layer where your Rails app looks up content similarly to +ActiveModel. The models are namespaced under the root class WCC::Contentful::Model. +Each model's implementation of .find, .find_by, and .find_all simply call +into the configured Store.

        + +

        The main benefit of the Model layer is lazy link resolution. When a model's +property is accessed, if that property is a link that has not been resolved +yet (for example using the include: n parameter on .find_by), the model +will automatically call #find on the store to resolve that linked entry.

        + +

        Note that this can easily result in lots of CDN calls to Contentful! To optimize +this you should use the include parameter and/or use a different store.

        + +

        Test Helpers

        + +

        To use the test helpers, include the following in your rails_helper.rb:

        + +
        require 'wcc/contentful/rspec'
        +
        + +

        This adds the following helpers to all your specs:

        + +
        ##
        +# Builds a in-memory instance of the Contentful model for the given content_type.
        +# All attributes that are known to be required fields on the content type
        +# will return a default value based on the field type.
        +instance = contentful_create('my-content-type', my_field: 'some-value')
        +# => #<WCC::Contentful::Model::MyContentType:0x0000000005c71a78 @created_at=2018-04-16 18:41:17 UTC...>
        +
        +instance.my_field
        +# => "some-value"
        +
        +instance.other_required_field
        +# => "default-value"
        +
        +instance.other_optional_field
        +# => nil
        +
        +instance.not_a_field
        +# NoMethodError: undefined method `not_a_field' for #<MyContentType:0x00007fbac81ee490>
        +
        +##
        +# Builds a rspec double of the Contentful model for the given content_type.
        +# All attributes that are known to be required fields on the content type
        +# will return a default value based on the field type.
        +dbl = contentful_double('my-content-type', my_field: 'other-value')
        +# => #<Double (anonymous)>
        +
        +dbl.my_field
        +# => "other-value"
        +
        +dbl.other_optional_field
        +# => nil
        +
        +dbl.not_a_field
        +# => #<Double (anonymous)> received unexpected message :not_a_field with (no args)
        +
        +##
        +# Builds out a fake Contentful entry for the given content type, and then
        +# stubs the Model API to return that content type for `.find` and `.find_by`
        +# query methods.
        +stubbed = contentful_stub('my-content-type', id: '1234', my_field: 'test')
        +
        +WCC::Contentful::Model.find('1234') == stubbed
        +# => true
        +
        +MyContentType.find('1234') == stubbed
        +# => true
        +
        +MyContentType.find_by(my_field: 'test') == stubbed
        +# => true
        +
        + +

        Advanced Configuration Example

        + +

        Here's an example containing all the configuration options, and a sample setup for +automatic deployment to Heroku. This is intended to make you aware of what is possible, +and not as a general recommendation of what your setup should look like.

        + +
        # config/initializers/wcc_contentful.rb
        +WCC::Contentful.configure do |config|
        +  config.access_token = ENV['CONTENTFUL_ACCESS_TOKEN']
        +  config.space = ENV['CONTENTFUL_SPACE_ID']
        +  config.environment = ENV['CONTENTFUL_ENVIRONMENT']
        +  config.preview_token = ENV['CONTENTFUL_PREVIEW_ACCESS_TOKEN']
        +
        +  # You may or may not want to provide this to your production server...
        +  config.management_token = ENV['CONTENTFUL_MANAGEMENT_TOKEN'] unless Rails.env.production?
        +
        +  config.app_url = "https://#{ENV['HOSTNAME']}"
        +  config.webhook_username = 'my-app-webhook'
        +  config.webhook_password = Rails.application.secrets.webhook_password
        +  config.webhook_jobs << MyOnWebhookJob
        +
        +  config.store = :lazy_sync, Rails.cache if Rails.env.production?
        +  # config.store = MyCustomStore.new
        +
        +  # Use a custom Faraday connection
        +  config.connection = Faraday.new do |builder|
        +    f.request :retry
        +    f.request MyFaradayRequestAdapter.new
        +    ...
        +  end
        +  # OR implement some adapter like this to use another HTTP client
        +  config.connection = MyNetHttpAdapter.new
        +
        +  config.update_schema_file = :never
        +end
        +
        +WCC::Contentful.init!
        +
        + +

        For Heroku:

        + +
        # Procfile
        +web: bundle exec rails s
        +worker: bundle exec sidekiq
        +release: bin/release
        +
        + +
        # bin/release
        +#!/bin/sh
        +
        +set -e
        +
        +echo "Migrating database..."
        +bin/rake db:migrate
        +
        +echo "Migrating contentful..."
        +migrations_to_be_run=$( ... ) # somehow figure this out
        +node_modules/.bin/contentful-migration \
        +    -s $CONTENTFUL_SPACE_ID -a $CONTENTFUL_MANAGEMENT_TOKEN \
        +    -y -p "$migrations_to_be_run"
        +
        +echo "Updating schema file..."
        +rake wcc_contentful:download_schema
        +
        + +

        All configuration options can be found in the rubydoc under +WCC::Contentful::Configuration

        + +

        Connecting to multiple spaces or environments

        + +

        When initializing the WCC::Contentful gem using WCC::Contentful.init!, the gem will by default connect to the single +Contentful space that you specify in the WCC::Contentful.configure step. However the gem is also capable of connecting +to multiple spaces within the same ruby process! You just have to create and initialize a namespace.

        + +

        The WCC::Contentful::ModelAPI concern makes this straightforward. Start by creating your Namespace +and including the concern:

        + +
        # app/models/my_second_space.rb
        +class MySecondSpace
        +  include WCC::Contentful::ModelAPI
        +end
        +
        +# app/models/other_page.rb
        +class OtherPage < MySecondSpace::Page
        +end
        +
        + +

        Then configure it in an initializer:

        + +
        # config/initializers/my_second_space.rb
        +MySecondSpace.configure do |config|
        +  # Make sure to point to a different schema file from your first space!
        +  config.schema_file = Rails.root.join('db/second-contentful-schema.json')
        +
        +  config.access_token = ENV['SECOND_CONTENTFUL_ACCESS_TOKEN']
        +  config.preview_token = ENV['SECOND_CONTENTFUL_PREVIEW_ACCESS_TOKEN']
        +  config.space = ENV['SECOND_CONTENTFUL_SPACE_ID']
        +  config.environment = ENV['CONTENTFUL_ENVIRONMENT']
        +end
        +
        + +

        Finally, use it:

        + +
        OtherPage.find('1234')
        +# GET https://cdn.contentful.com/spaces/other-space/environments/other-env/entries/1234
        +# => #<OtherPage:0x0000000005c71a78 @created_at=2018-04-16 18:41:17 UTC...>
        +
        +Page.find('1234')
        +# GET https://cdn.contentful.com/spaces/first-space/environments/first-env/entries/1234
        +# => #<Page:0x0000000001271b70 @created_at=2018-04-15 12:02:14 UTC...>
        +
        + +

        The ModelAPI defines a second stack of services that you can access for lower level connections:

        + +
        store = MySecondSpace.services.store
        +# => #<WCC::Contentful::Store::CDNAdapter:0x00007f888edac118
        +client = MySecondSpace.services.client
        +# => #<WCC::Contentful::SimpleClient::Cdn:0x00007f88942a8888
        +preview_client = MySecondSpace.services.preview_client
        +# => #<WCC::Contentful::SimpleClient::Preview:0x00007f888ccafa00
        +sync_engine = MySecondSpace.services.sync_engine
        +# => #<WCC::Contentful::SyncEngine:0x00007f88960b6b40
        +
        + +

        Note that the above services are not accessible on WCC::Contentful::Services.instance +or via the WCC::Contentful::ServiceAccessors.

        + +

        Using a sync store with a second space

        + +

        If you use something other than the CDNAdapter with your second space, you will +need to find a way to trigger MySecondSpace.services.sync_engine.next to keep +it up-to-date. The WCC::Contentful::Engine will only manage the global SyncEngine +configured by the global WCC::Contentful.configure.

        + +

        The easiest way to do this is to set up your own Rails route to respond to Contentful +webhooks and then configure the second Contentful space to send webhooks to this route. +You could also do this by triggering it periodically in a background job using +Sidekiq and sidekiq-scheduler.

        + +

        Development

        + +

        After checking out the repo, run bin/setup to install dependencies. Then, run bundle exec rspec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

        + +

        Contributing

        + +

        Bug reports and pull requests are welcome on GitHub at https://github.com/watermarkchurch/wcc-contentful.

        + +

        The developers at Watermark Community Church have pledged to govern their interactions with each other, with their clients, and with the larger wcc-contentful user community in accordance with the "instruments of good works" from chapter 4 of The Rule of St. Benedict (hereafter: "The Rule"). This code of ethics has proven its mettle in thousands of diverse communities for over 1,500 years, and has served as a baseline for many civil law codes since the time of Charlemagne.

        + +

        See the full Code of Ethics

        + +

        License

        + +

        The gem is available as open source under the terms of the MIT License.

        +
        + + + +
        + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/file_list.html b/docs/1.3/wcc-contentful/file_list.html new file mode 100644 index 00000000..2b6df404 --- /dev/null +++ b/docs/1.3/wcc-contentful/file_list.html @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + File List + + + +
        +
        +

        File List

        + + + +
        + + +
        + + diff --git a/docs/1.3/wcc-contentful/frames.html b/docs/1.3/wcc-contentful/frames.html new file mode 100644 index 00000000..a65e9365 --- /dev/null +++ b/docs/1.3/wcc-contentful/frames.html @@ -0,0 +1,17 @@ + + + + + Documentation by YARD 0.9.28 + + + + diff --git a/docs/1.3/wcc-contentful/index.html b/docs/1.3/wcc-contentful/index.html new file mode 100644 index 00000000..628448d6 --- /dev/null +++ b/docs/1.3/wcc-contentful/index.html @@ -0,0 +1,706 @@ + + + + + + + File: README + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
        + + +

        Gem Version +Build Status +Coverage Status

        + +

        Full documentation: https://watermarkchurch.github.io/wcc-contentful/latest/wcc-contentful/

        + +

        WCC::Contentful

        + +

        An alternative to Contentful's contentful.rb ruby client, contentful_model, and contentful_rails gems all in one.

        + +

        Table of Contents:

        + +
          +
        1. Why?
        2. +
        3. Installation
        4. +
        5. Configuration
        6. +
        7. Usage + +
            +
          1. Model API
          2. +
          3. Store API
          4. +
          5. Direct CDN client
          6. +
          7. Accessing the APIs
          8. +
        8. +
        9. Architecture + +
            +
          1. Client Layer
          2. +
          3. Store Layer
          4. +
          5. Model Layer
          6. +
        10. +
        11. Test Helpers
        12. +
        13. Advanced Configuration Example
        14. +
        15. Connecting to Multiple Spaces
        16. +
        17. Development
        18. +
        19. Contributing
        20. +
        21. License
        22. +
        + +

        Why did you rewrite the Contentful ruby stack?

        + +

        We started working with Contentful almost 3 years ago. Since that time, Contentful's ruby stack has improved, but there are still a number of pain points that we feel we have addressed better with our gem. These are:

        + + + +

        Our gem no longer depends on any of the Contentful gems and interacts directly with the Contentful CDA and Content Management API over HTTPS.

        + +

        Low-level caching

        + +

        The wcc-contentful gem enables caching at two levels: the HTTP response using Faraday HTTP cache middleware, and at the Entry level using the Rails cache and the Sync API to keep it up to date. We've found these two cache layers to be very effective at reducing both round trip latency to the Content Delivery API, as well as reducing our monthly API request usage. (which reduces our overage charges. Hooray!)

        + +

        At the request/response level

        + +

        By default, the contentful.rb gem requires the HTTP library. While simple and straightforward to use, it is not as powerful for caching. We decided to make our client conform to the Faraday gem's API. If you prefer not to use Faraday, you can choose to supply your own HTTP adapter that "quacks like" Faraday (see the TyphoeusAdapter for one implementation).

        + +

        Using Faraday makes it easy to add Middleware. As an example, our flagship Rails app that powers watermark.org uses the following configuration in Production, which provides us with instrumentation through statsd, logging, and caching:

        + +
        config.connection = Faraday.new do |builder|
        +  builder.use :http_cache,
        +    shared_cache: false,
        +    store: ActiveSupport::Cache::MemoryStore.new(size: 512.megabytes),
        +    logger: Rails.logger,
        +    serializer: Marshal,
        +    instrumenter: ActiveSupport::Notifications
        +
        +  builder.use :gzip
        +  builder.response :logger, Rails.logger, headers: false, bodies: false if Rails.env.development?
        +  builder.request :instrumentation
        +  builder.adapter :typhoeus
        +end
        +
        + +

        At the Entry level

        + +

        Our stack has three layers, the middle layer being essentially a cache for individual Entry hashes parsed out of responses from the Delivery API. We were able to add a caching layer here which stores entries retrieved over the Sync API, and responds to queries with cached versions of local content when possible. We consider this to be our best innovation on the Contentful ruby stack.

        + +

        We have successfully created caching layers using Memcached, Postgres, and an in-memory hash. The architecture allows other caching implementations to be created fairly easily, and we have a set of rspec specs that can verify that a cache store behaves appropriately. For more information, see the documentation on the caching modes here.

        + +

        Better Rails Integration

        + +

        When we initially got started with the Contentful ruby models, we encountered one problem that was more frustrating than all others: If a field exists in the content model, but the particular entry we're working with does not have that field populated, then accessing that field raised a NoMethodError. This caused us to litter our code with if defined?(entry.my_field) which is bad practice. (Note: this has since been fixed in contentful.rb v2).

        + +

        We decided it was better to not rely on method_missing? (what contentful.rb does), and instead to use define_method in an initializer to generate the methods for our models. This has the advantage that calling .instance_methods on a model class includes all the fields present in the content model.

        + +

        We also took advantage of Rails' naming conventions to automatically infer the content type name based on the class name. Thus in our code, we have app/models/page.rb which defines class Page << WCC::Contentful::Model::Page, and is automatically linked to the page content type ID. (Note: this is overridable on a per-model basis)

        + +

        All our models are automatically generated at startup which improves response times at the expense of initialization time. In addition, our content model registry allows easy definition of custom models in your app/models directory to override fields. This plays nice with other gems like algoliasearch-rails, which allows you to declaratively manage your Algolia indexes. Another example from our flagship watermark.org:

        + +
        class Page < WCC::Contentful::Model::Page
        +  include AlgoliaSearch
        +
        +  algoliasearch(index_name: 'pages') do
        +    attribute(:title, :slug)
        +    ...
        +  end
        +
        + + + +

        Using the contentful_model gem, calling Page.all.load does not give you all Page entries if there are more than 100. To get the next page you must call .paginate on the response. By contrast, Page.find_all in the wcc-contentful gem gives you a Lazy Enumerator. As you iterate past the 100th entry, the enumerator will automatically fetch the next page. If you only enumerate 99 entries (say with .take(99)), then the second page will never be fetched.

        + +

        Similarly, if your Page references an asset, say hero_image, that field returns a Link object rather than the actual Asset. You must either predefine how many links you need using Page.load_children(3).all.load, or detect that hero_image is a Link like if @page.hero_image.is_a? Contentful::Link and then call .resolve on the link. We found all of that to be too cumbersome when we are down in a nested partial view template that may be invoked from multiple places.

        + +

        The wcc-contentful gem, by contrast, automatically resolves a link when accessing the associated attribute. So in our example above, wcc-contentful will always return a WCC::Contentful::Asset when calling @page.hero_image, even if it has to execute a query to cdn.contentful.com in order to fetch it.

        + +

        Warning: This can easily lead to you exhausting your Contentful API quota if you do not carefully tune your cache, which you should be doing anyways! The default settings will use the Rails cache to try to cache these resolutions, but you are ultimately responsible for how many queries you execute!

        + +

        Automatic webhook management

        + +

        The wcc-contentful gem, just like contentful_rails, provides an Engine to be mounted in your Rails routes file. Unlike contentful_rails, if you also configure wcc-contentful with a Contentful Management Token and a public app_url, then on startup the wcc-contentful engine will reach out to the Contentful Management API and ensure that a webhook is configured to point to your app. This is one less devops burden on you, and plays very nicely in with Heroku review apps.

        + +

        Installation

        + +

        Add this line to your application's Gemfile:

        + +
        gem 'wcc-contentful', require: 'wcc/contentful/rails'
        +
        + +

        If you're not using rails, exclude the require: parameter.

        + +
        gem 'wcc-contentful'
        +
        + +

        And then execute:

        + +
        $ bundle
        +
        + +

        Or install it yourself:

        + +
        $ gem install wcc-contentful
        +
        + +

        Configure

        + +

        Put this in an initializer:

        + +
        # config/initializers/wcc_contentful.rb
        +WCC::Contentful.configure do |config|
        +  config.access_token = <CONTENTFUL_ACCESS_TOKEN>
        +  config.space = <CONTENTFUL_SPACE_ID>
        +end
        +
        +WCC::Contentful.init!
        +
        + +

        All configuration options can be found in the rubydoc under +WCC::Contentful::Configuration

        + +

        Usage

        + +

        WCC::Contentful::Model API

        + +

        The WCC::Contentful::Model API exposes Contentful data as a set of dynamically +generated Ruby objects. These objects are based on the content types in your +Contentful space. All these objects are generated by WCC::Contentful.init!

        + +

        The following examples show how to use this API to find entries of the page +content type:

        + +
        # Find objects by id
        +WCC::Contentful::Model::Page.find('1E2ucWSdacxxf233sfa3')
        +# => #<WCC::Contentful::Model::Page:0x0000000005c71a78 @created_at=2018-04-16 18:41:17 UTC...>
        +
        +# Find objects by field
        +WCC::Contentful::Model::Page.find_by(slug: '/some-slug')
        +# => #<WCC::Contentful::Model::Page:0x0000000005c71a78 @created_at=2018-04-16 18:41:17 UTC...>
        +
        +# Use operators to filter by a field
        +# must use full notation for sys attributes (except ID)
        +WCC::Contentful::Model::Page.find_all('sys.created_at' => { lte: Date.today })
        +# => [#<WCC::Contentful::Model::Page:0x0000000005c71a78 @created_at=2018-04-16 18:41:17 UTC...>, ... ]
        +
        +# Nest queries to mimick joins
        +WCC::Contentful::Model::Page.find_by(subpages: { slug: '/some-slug' })
        +# => #<WCC::Contentful::Model::Page:0x0000000005c71a78 @created_at=2018-04-16 18:41:17 UTC...>
        +
        +# Pass the preview flag to use the preview client (must have set preview_token config param)
        +preview_redirect = WCC::Contentful::Model::Redirect.find_by({ slug: 'draft-redirect' }, preview: true)
        +# => #<WCC::Contentful::Model::Redirect:0x0000000005d879ad @created_at=2018-04-16 18:41:17 UTC...>
        +preview_redirect_object.href
        +# => 'http://www.somesite.com/slug-for-redirect'
        +
        + +

        See the WCC::Contentful::Model documentation for more details.

        + +

        Store API

        + +

        The Store layer is used by the Model API to access Contentful data in a raw form. +The Store layer returns entries as hashes parsed from JSON, conforming to the +object structure returned from the Contentful CDN.

        + +

        The following examples show how to use the Store API to retrieve raw data from +the store:

        + +
        store = WCC::Contentful::Services.instance.store
        +# => #<WCC::Contentful::Store::CDNAdapter:0x00007fb92a221498
        +
        +store.find('5FsqsbMECsM62e04U8sY4Y')
        +# => {"sys"=>
        +#  ...
        +# "fields"=>
        +# ...}
        +
        +store.find_by(content_type: 'page', filter: { slug: '/some-slug' })
        +# => {"sys"=>
        +#  ...
        +# "fields"=>
        +# ...}
        +
        +query = store.find_all(content_type: 'page').eq('group', 'some-group')
        +# => #<WCC::Contentful::Store::CDNAdapter::Query:0x00007fa3d40b84f0
        +query.first
        +# => {"sys"=>
        +#  ...
        +# "fields"=>
        +# ...}
        +query.result
        +# => #<Enumerator::Lazy: ...>
        +query.result.force
        +# => [{"sys"=> ...}, {"sys"=> ...}, ...]
        +
        + +

        See the WCC::Contentful::Store documentation for more details.

        + +

        Direct CDN API (SimpleClient)

        + +

        The SimpleClient is the bottom layer, and is used to get raw data directly from +the Contentful CDN. It handles response parsing and paging, but does not resolve +links or transform the result into a Model class.

        + +

        The following examples show how to use the SimpleClient to retrieve data directly +from the Contentful CDN:

        + +
        client = WCC::Contentful::Services.instance.client
        +# => #<WCC::Contentful::SimpleClient::Cdn:0x00007fa3cde89310
        +
        +response = client.entry('5FsqsbMECsM62e04U8sY4Y')
        +# => #<WCC::Contentful::SimpleClient::Response:0x00007fa3d103a4e0
        +response.body
        +# => "{\n  \"sys\": {\n ...
        +response.raw
        +# => {"sys"=>
        +#  ...
        +# "fields"=>
        +# ...}
        +
        +client.asset('5FsqsbMECsM62e04U8sY4Y').raw
        +# => {"sys"=>
        +#  ...
        +# "fields"=>
        +# ...}
        +
        +response = client.entries('fields.group' => 'some-group', 'limit' => 5)
        +# => #<WCC::Contentful::SimpleClient::Response:0x00007fa3d103a4e0
        +response.count
        +# => 99
        +response.first
        +# => {"sys"=>
        +#  ...
        +# "fields"=>
        +# ...}
        +response.items
        +=> #<Enumerator::Lazy: ...>
        +response.items.count  # Careful! This evaluates the lazy iterator and gets all pages
        +# => 99
        +
        +response.includes
        +# => {"4xNnFJ77egkSMEogE2yISa"=>
        +#   {"sys"=> ...}
        +#  "6Fwukxxkxa6qQCC04WCaqg"=>
        +#   {"sys"=> ...}
        +#   ...}
        +
        + +

        The client handles Paging automatically within the lazy iterator returned by #items. +This lazy iterator does not respect the limit param - that param is only passed +through to the API to set the page size. If you truly want a limited subset of +response items, use response.items.take(n)

        + +

        Entries included via the include parameter are made available on the #includes +field. This is a hash of <entry ID> => <raw entry> and makes it easy to grab +links. This hash is added to lazily as you enumerate the pages.

        + +

        See the WCC::Contentful::SimpleClient documentation for more details.

        + +

        Accessing the APIs within application code

        + +

        The Model API is best exposed by defining your own model classes in the app/models +directory which inherit from the WCC::Contentful models.

        + +
        # app/models/page.rb
        +class Page < WCC::Contentful::Model::Page
        +
        +  # You can add additional methods here
        +end
        +
        +# app/controllers/pages_controller.rb
        +class PagesController < ApplicationController
        +  def show
        +    @page = Page.find_by(slug: params[:slug])
        +    raise Exceptions::PageNotFoundError, params[:slug] unless @page
        +  end
        +end
        +
        + +

        The WCC::Contentful::Services singleton gives access to the other configured services. +You can also include the WCC::Contentful::ServiceAccessors concern to define these +services as attributes in a class.

        + +
        class MyJob < ApplicationJob
        +  include WCC::Contentful::ServiceAccessors
        +
        +  def perform
        +    Page.find(...)
        +
        +    store.find(...)
        +
        +    client.entries(...)
        +  end
        +end
        +
        + +

        Architecture

        + +

        wcc-contentful diagram

        + +

        From the bottom up:

        + +

        Client Layer

        + +

        The WCC::Contentful::SimpleClient provides methods to access the Contentful +Content Delivery API +through your favorite HTTP client gem. The SimpleClient expects +an Adapter that conforms to the Faraday interface.

        + +

        Creating a SimpleClient to connect using different credentials, or to connect +without setting up all the rest of WCC::Contentful, is easy:

        + +
        WCC::Contentful::SimpleClient::Cdn.new(
        +  # required
        +  access_token: 'xxxx',
        +  space: '1234',
        +  # optional
        +  environment: 'staging', # omit to use master
        +  default_locale: '*',
        +  rate_limit_wait_timeout: 10,
        +  instrumentation: ActiveSupport::Notifications,
        +  connection: Faraday.new { |builder| ... },
        +)
        +
        + +

        You can also create a WCC::Contentful::SimpleClient::Preview to talk to the +Preview API, or a WCC::Contentful::SimpleClient::Management to talk to the +Management API.

        + +

        Store Layer

        + +

        The Store Layer represents the data store where Contentful entries are kept for +querying. By default, WCC::Contentful.init! creates a WCC::Contentful::Store::CDNAdapter +which uses a WCC::Contentful::SimpleClient::Cdn instance to query entries from +the Contentful Content Delivery API. You can also query entries from another +source like Postgres or an in-memory hash if your data is small enough.

        + +

        You can also implement your own store if you want! The gem contains a suite of +RSpec shared examples that give you a baseline for implementing your own store. +In your RSpec suite:

        + +
        # frozen_string_literal: true
        +
        +require 'my_store'
        +require 'wcc/contentful/store/rspec_examples'
        +
        +RSpec.describe MyStore do
        +  it_behaves_like 'contentful store', {
        +    # Set which store features your store implements.  
        +    nested_queries: true,  # Does your store implement JOINs?
        +    include_param: true    # Does your store resolve links when given the :include option?
        +  }
        +
        + +

        The store is kept up-to-date by the WCC::Contentful::SyncEngine. The SyncEngine#next methodcalls the #index method on the configured store in order to update +it with the latest data via the Contentful Sync API. For example, +the WCC::Contentful::Store::MemoryStore uses this to update the hash with the +newest version of an entry, or delete an entry out of the hash.

        + +

        Store Middleware

        + +

        The store layer is made up of a base store (which implements WCC::Contentful::Store::Interface), +and optional middleware. The middleware +allows custom transformation of received entries via the #select and #transform +methods. To create your own middleware simply include WCC::Contentful::Middleware::Store +and implement those methods, then call use when configuring the store:

        + +
        config.store :direct do
        +  use MyMiddleware, param1: 'xxx'
        +end
        +
        + +

        The most useful middleware is the WCC::Contentful::Middleware::Store::CachingMiddleware, +which enables :lazy_sync mode (see WCC::Contentful::Configuration#store)

        + +

        Model Layer

        + +

        This is the global top layer where your Rails app looks up content similarly to +ActiveModel. The models are namespaced under the root class WCC::Contentful::Model. +Each model's implementation of .find, .find_by, and .find_all simply call +into the configured Store.

        + +

        The main benefit of the Model layer is lazy link resolution. When a model's +property is accessed, if that property is a link that has not been resolved +yet (for example using the include: n parameter on .find_by), the model +will automatically call #find on the store to resolve that linked entry.

        + +

        Note that this can easily result in lots of CDN calls to Contentful! To optimize +this you should use the include parameter and/or use a different store.

        + +

        Test Helpers

        + +

        To use the test helpers, include the following in your rails_helper.rb:

        + +
        require 'wcc/contentful/rspec'
        +
        + +

        This adds the following helpers to all your specs:

        + +
        ##
        +# Builds a in-memory instance of the Contentful model for the given content_type.
        +# All attributes that are known to be required fields on the content type
        +# will return a default value based on the field type.
        +instance = contentful_create('my-content-type', my_field: 'some-value')
        +# => #<WCC::Contentful::Model::MyContentType:0x0000000005c71a78 @created_at=2018-04-16 18:41:17 UTC...>
        +
        +instance.my_field
        +# => "some-value"
        +
        +instance.other_required_field
        +# => "default-value"
        +
        +instance.other_optional_field
        +# => nil
        +
        +instance.not_a_field
        +# NoMethodError: undefined method `not_a_field' for #<MyContentType:0x00007fbac81ee490>
        +
        +##
        +# Builds a rspec double of the Contentful model for the given content_type.
        +# All attributes that are known to be required fields on the content type
        +# will return a default value based on the field type.
        +dbl = contentful_double('my-content-type', my_field: 'other-value')
        +# => #<Double (anonymous)>
        +
        +dbl.my_field
        +# => "other-value"
        +
        +dbl.other_optional_field
        +# => nil
        +
        +dbl.not_a_field
        +# => #<Double (anonymous)> received unexpected message :not_a_field with (no args)
        +
        +##
        +# Builds out a fake Contentful entry for the given content type, and then
        +# stubs the Model API to return that content type for `.find` and `.find_by`
        +# query methods.
        +stubbed = contentful_stub('my-content-type', id: '1234', my_field: 'test')
        +
        +WCC::Contentful::Model.find('1234') == stubbed
        +# => true
        +
        +MyContentType.find('1234') == stubbed
        +# => true
        +
        +MyContentType.find_by(my_field: 'test') == stubbed
        +# => true
        +
        + +

        Advanced Configuration Example

        + +

        Here's an example containing all the configuration options, and a sample setup for +automatic deployment to Heroku. This is intended to make you aware of what is possible, +and not as a general recommendation of what your setup should look like.

        + +
        # config/initializers/wcc_contentful.rb
        +WCC::Contentful.configure do |config|
        +  config.access_token = ENV['CONTENTFUL_ACCESS_TOKEN']
        +  config.space = ENV['CONTENTFUL_SPACE_ID']
        +  config.environment = ENV['CONTENTFUL_ENVIRONMENT']
        +  config.preview_token = ENV['CONTENTFUL_PREVIEW_ACCESS_TOKEN']
        +
        +  # You may or may not want to provide this to your production server...
        +  config.management_token = ENV['CONTENTFUL_MANAGEMENT_TOKEN'] unless Rails.env.production?
        +
        +  config.app_url = "https://#{ENV['HOSTNAME']}"
        +  config.webhook_username = 'my-app-webhook'
        +  config.webhook_password = Rails.application.secrets.webhook_password
        +  config.webhook_jobs << MyOnWebhookJob
        +
        +  config.store = :lazy_sync, Rails.cache if Rails.env.production?
        +  # config.store = MyCustomStore.new
        +
        +  # Use a custom Faraday connection
        +  config.connection = Faraday.new do |builder|
        +    f.request :retry
        +    f.request MyFaradayRequestAdapter.new
        +    ...
        +  end
        +  # OR implement some adapter like this to use another HTTP client
        +  config.connection = MyNetHttpAdapter.new
        +
        +  config.update_schema_file = :never
        +end
        +
        +WCC::Contentful.init!
        +
        + +

        For Heroku:

        + +
        # Procfile
        +web: bundle exec rails s
        +worker: bundle exec sidekiq
        +release: bin/release
        +
        + +
        # bin/release
        +#!/bin/sh
        +
        +set -e
        +
        +echo "Migrating database..."
        +bin/rake db:migrate
        +
        +echo "Migrating contentful..."
        +migrations_to_be_run=$( ... ) # somehow figure this out
        +node_modules/.bin/contentful-migration \
        +    -s $CONTENTFUL_SPACE_ID -a $CONTENTFUL_MANAGEMENT_TOKEN \
        +    -y -p "$migrations_to_be_run"
        +
        +echo "Updating schema file..."
        +rake wcc_contentful:download_schema
        +
        + +

        All configuration options can be found in the rubydoc under +WCC::Contentful::Configuration

        + +

        Connecting to multiple spaces or environments

        + +

        When initializing the WCC::Contentful gem using WCC::Contentful.init!, the gem will by default connect to the single +Contentful space that you specify in the WCC::Contentful.configure step. However the gem is also capable of connecting +to multiple spaces within the same ruby process! You just have to create and initialize a namespace.

        + +

        The WCC::Contentful::ModelAPI concern makes this straightforward. Start by creating your Namespace +and including the concern:

        + +
        # app/models/my_second_space.rb
        +class MySecondSpace
        +  include WCC::Contentful::ModelAPI
        +end
        +
        +# app/models/other_page.rb
        +class OtherPage < MySecondSpace::Page
        +end
        +
        + +

        Then configure it in an initializer:

        + +
        # config/initializers/my_second_space.rb
        +MySecondSpace.configure do |config|
        +  # Make sure to point to a different schema file from your first space!
        +  config.schema_file = Rails.root.join('db/second-contentful-schema.json')
        +
        +  config.access_token = ENV['SECOND_CONTENTFUL_ACCESS_TOKEN']
        +  config.preview_token = ENV['SECOND_CONTENTFUL_PREVIEW_ACCESS_TOKEN']
        +  config.space = ENV['SECOND_CONTENTFUL_SPACE_ID']
        +  config.environment = ENV['CONTENTFUL_ENVIRONMENT']
        +end
        +
        + +

        Finally, use it:

        + +
        OtherPage.find('1234')
        +# GET https://cdn.contentful.com/spaces/other-space/environments/other-env/entries/1234
        +# => #<OtherPage:0x0000000005c71a78 @created_at=2018-04-16 18:41:17 UTC...>
        +
        +Page.find('1234')
        +# GET https://cdn.contentful.com/spaces/first-space/environments/first-env/entries/1234
        +# => #<Page:0x0000000001271b70 @created_at=2018-04-15 12:02:14 UTC...>
        +
        + +

        The ModelAPI defines a second stack of services that you can access for lower level connections:

        + +
        store = MySecondSpace.services.store
        +# => #<WCC::Contentful::Store::CDNAdapter:0x00007f888edac118
        +client = MySecondSpace.services.client
        +# => #<WCC::Contentful::SimpleClient::Cdn:0x00007f88942a8888
        +preview_client = MySecondSpace.services.preview_client
        +# => #<WCC::Contentful::SimpleClient::Preview:0x00007f888ccafa00
        +sync_engine = MySecondSpace.services.sync_engine
        +# => #<WCC::Contentful::SyncEngine:0x00007f88960b6b40
        +
        + +

        Note that the above services are not accessible on WCC::Contentful::Services.instance +or via the WCC::Contentful::ServiceAccessors.

        + +

        Using a sync store with a second space

        + +

        If you use something other than the CDNAdapter with your second space, you will +need to find a way to trigger MySecondSpace.services.sync_engine.next to keep +it up-to-date. The WCC::Contentful::Engine will only manage the global SyncEngine +configured by the global WCC::Contentful.configure.

        + +

        The easiest way to do this is to set up your own Rails route to respond to Contentful +webhooks and then configure the second Contentful space to send webhooks to this route. +You could also do this by triggering it periodically in a background job using +Sidekiq and sidekiq-scheduler.

        + +

        Development

        + +

        After checking out the repo, run bin/setup to install dependencies. Then, run bundle exec rspec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

        + +

        Contributing

        + +

        Bug reports and pull requests are welcome on GitHub at https://github.com/watermarkchurch/wcc-contentful.

        + +

        The developers at Watermark Community Church have pledged to govern their interactions with each other, with their clients, and with the larger wcc-contentful user community in accordance with the "instruments of good works" from chapter 4 of The Rule of St. Benedict (hereafter: "The Rule"). This code of ethics has proven its mettle in thousands of diverse communities for over 1,500 years, and has served as a baseline for many civil law codes since the time of Charlemagne.

        + +

        See the full Code of Ethics

        + +

        License

        + +

        The gem is available as open source under the terms of the MIT License.

        +
        + + + +
        + + \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/js/app.js b/docs/1.3/wcc-contentful/js/app.js new file mode 100644 index 00000000..8d067fe3 --- /dev/null +++ b/docs/1.3/wcc-contentful/js/app.js @@ -0,0 +1,314 @@ +(function() { + +var localStorage = {}, sessionStorage = {}; +try { localStorage = window.localStorage; } catch (e) { } +try { sessionStorage = window.sessionStorage; } catch (e) { } + +function createSourceLinks() { + $('.method_details_list .source_code'). + before("[View source]"); + $('.toggleSource').toggle(function() { + $(this).parent().nextAll('.source_code').slideDown(100); + $(this).text("Hide source"); + }, + function() { + $(this).parent().nextAll('.source_code').slideUp(100); + $(this).text("View source"); + }); +} + +function createDefineLinks() { + var tHeight = 0; + $('.defines').after(" more..."); + $('.toggleDefines').toggle(function() { + tHeight = $(this).parent().prev().height(); + $(this).prev().css('display', 'inline'); + $(this).parent().prev().height($(this).parent().height()); + $(this).text("(less)"); + }, + function() { + $(this).prev().hide(); + $(this).parent().prev().height(tHeight); + $(this).text("more..."); + }); +} + +function createFullTreeLinks() { + var tHeight = 0; + $('.inheritanceTree').toggle(function() { + tHeight = $(this).parent().prev().height(); + $(this).parent().toggleClass('showAll'); + $(this).text("(hide)"); + $(this).parent().prev().height($(this).parent().height()); + }, + function() { + $(this).parent().toggleClass('showAll'); + $(this).parent().prev().height(tHeight); + $(this).text("show all"); + }); +} + +function searchFrameButtons() { + $('.full_list_link').click(function() { + toggleSearchFrame(this, $(this).attr('href')); + return false; + }); + window.addEventListener('message', function(e) { + if (e.data === 'navEscape') { + $('#nav').slideUp(100); + $('#search a').removeClass('active inactive'); + $(window).focus(); + } + }); + + $(window).resize(function() { + if ($('#search:visible').length === 0) { + $('#nav').removeAttr('style'); + $('#search a').removeClass('active inactive'); + $(window).focus(); + } + }); +} + +function toggleSearchFrame(id, link) { + var frame = $('#nav'); + $('#search a').removeClass('active').addClass('inactive'); + if (frame.attr('src') === link && frame.css('display') !== "none") { + frame.slideUp(100); + $('#search a').removeClass('active inactive'); + } + else { + $(id).addClass('active').removeClass('inactive'); + if (frame.attr('src') !== link) frame.attr('src', link); + frame.slideDown(100); + } +} + +function linkSummaries() { + $('.summary_signature').click(function() { + document.location = $(this).find('a').attr('href'); + }); +} + +function summaryToggle() { + $('.summary_toggle').click(function(e) { + e.preventDefault(); + localStorage.summaryCollapsed = $(this).text(); + $('.summary_toggle').each(function() { + $(this).text($(this).text() == "collapse" ? "expand" : "collapse"); + var next = $(this).parent().parent().nextAll('ul.summary').first(); + if (next.hasClass('compact')) { + next.toggle(); + next.nextAll('ul.summary').first().toggle(); + } + else if (next.hasClass('summary')) { + var list = $('
          '); + list.html(next.html()); + list.find('.summary_desc, .note').remove(); + list.find('a').each(function() { + $(this).html($(this).find('strong').html()); + $(this).parent().html($(this)[0].outerHTML); + }); + next.before(list); + next.toggle(); + } + }); + return false; + }); + if (localStorage.summaryCollapsed == "collapse") { + $('.summary_toggle').first().click(); + } else { localStorage.summaryCollapsed = "expand"; } +} + +function constantSummaryToggle() { + $('.constants_summary_toggle').click(function(e) { + e.preventDefault(); + localStorage.summaryCollapsed = $(this).text(); + $('.constants_summary_toggle').each(function() { + $(this).text($(this).text() == "collapse" ? "expand" : "collapse"); + var next = $(this).parent().parent().nextAll('dl.constants').first(); + if (next.hasClass('compact')) { + next.toggle(); + next.nextAll('dl.constants').first().toggle(); + } + else if (next.hasClass('constants')) { + var list = $('
          '); + list.html(next.html()); + list.find('dt').each(function() { + $(this).addClass('summary_signature'); + $(this).text( $(this).text().split('=')[0]); + if ($(this).has(".deprecated").length) { + $(this).addClass('deprecated'); + }; + }); + // Add the value of the constant as "Tooltip" to the summary object + list.find('pre.code').each(function() { + console.log($(this).parent()); + var dt_element = $(this).parent().prev(); + var tooltip = $(this).text(); + if (dt_element.hasClass("deprecated")) { + tooltip = 'Deprecated. ' + tooltip; + }; + dt_element.attr('title', tooltip); + }); + list.find('.docstring, .tags, dd').remove(); + next.before(list); + next.toggle(); + } + }); + return false; + }); + if (localStorage.summaryCollapsed == "collapse") { + $('.constants_summary_toggle').first().click(); + } else { localStorage.summaryCollapsed = "expand"; } +} + +function generateTOC() { + if ($('#filecontents').length === 0) return; + var _toc = $('
            '); + var show = false; + var toc = _toc; + var counter = 0; + var tags = ['h2', 'h3', 'h4', 'h5', 'h6']; + var i; + var curli; + if ($('#filecontents h1').length > 1) tags.unshift('h1'); + for (i = 0; i < tags.length; i++) { tags[i] = '#filecontents ' + tags[i]; } + var lastTag = parseInt(tags[0][1], 10); + $(tags.join(', ')).each(function() { + if ($(this).parents('.method_details .docstring').length != 0) return; + if (this.id == "filecontents") return; + show = true; + var thisTag = parseInt(this.tagName[1], 10); + if (this.id.length === 0) { + var proposedId = $(this).attr('toc-id'); + if (typeof(proposedId) != "undefined") this.id = proposedId; + else { + var proposedId = $(this).text().replace(/[^a-z0-9-]/ig, '_'); + if ($('#' + proposedId).length > 0) { proposedId += counter; counter++; } + this.id = proposedId; + } + } + if (thisTag > lastTag) { + for (i = 0; i < thisTag - lastTag; i++) { + if ( typeof(curli) == "undefined" ) { + curli = $('
          1. '); + toc.append(curli); + } + toc = $('
              '); + curli.append(toc); + curli = undefined; + } + } + if (thisTag < lastTag) { + for (i = 0; i < lastTag - thisTag; i++) { + toc = toc.parent(); + toc = toc.parent(); + } + } + var title = $(this).attr('toc-title'); + if (typeof(title) == "undefined") title = $(this).text(); + curli =$('
            1. ' + title + '
            2. '); + toc.append(curli); + lastTag = thisTag; + }); + if (!show) return; + html = ''; + $('#content').prepend(html); + $('#toc').append(_toc); + $('#toc .hide_toc').toggle(function() { + $('#toc .top').slideUp('fast'); + $('#toc').toggleClass('hidden'); + $('#toc .title small').toggle(); + }, function() { + $('#toc .top').slideDown('fast'); + $('#toc').toggleClass('hidden'); + $('#toc .title small').toggle(); + }); +} + +function navResizeFn(e) { + if (e.which !== 1) { + navResizeFnStop(); + return; + } + + sessionStorage.navWidth = e.pageX.toString(); + $('.nav_wrap').css('width', e.pageX); + $('.nav_wrap').css('-ms-flex', 'inherit'); +} + +function navResizeFnStop() { + $(window).unbind('mousemove', navResizeFn); + window.removeEventListener('message', navMessageFn, false); +} + +function navMessageFn(e) { + if (e.data.action === 'mousemove') navResizeFn(e.data.event); + if (e.data.action === 'mouseup') navResizeFnStop(); +} + +function navResizer() { + $('#resizer').mousedown(function(e) { + e.preventDefault(); + $(window).mousemove(navResizeFn); + window.addEventListener('message', navMessageFn, false); + }); + $(window).mouseup(navResizeFnStop); + + if (sessionStorage.navWidth) { + navResizeFn({which: 1, pageX: parseInt(sessionStorage.navWidth, 10)}); + } +} + +function navExpander() { + var done = false, timer = setTimeout(postMessage, 500); + function postMessage() { + if (done) return; + clearTimeout(timer); + var opts = { action: 'expand', path: pathId }; + document.getElementById('nav').contentWindow.postMessage(opts, '*'); + done = true; + } + + window.addEventListener('message', function(event) { + if (event.data === 'navReady') postMessage(); + return false; + }, false); +} + +function mainFocus() { + var hash = window.location.hash; + if (hash !== '' && $(hash)[0]) { + $(hash)[0].scrollIntoView(); + } + + setTimeout(function() { $('#main').focus(); }, 10); +} + +function navigationChange() { + // This works around the broken anchor navigation with the YARD template. + window.onpopstate = function() { + var hash = window.location.hash; + if (hash !== '' && $(hash)[0]) { + $(hash)[0].scrollIntoView(); + } + }; +} + +$(document).ready(function() { + navResizer(); + navExpander(); + createSourceLinks(); + createDefineLinks(); + createFullTreeLinks(); + searchFrameButtons(); + linkSummaries(); + summaryToggle(); + constantSummaryToggle(); + generateTOC(); + mainFocus(); + navigationChange(); +}); + +})(); diff --git a/docs/1.3/wcc-contentful/js/full_list.js b/docs/1.3/wcc-contentful/js/full_list.js new file mode 100644 index 00000000..59069c5e --- /dev/null +++ b/docs/1.3/wcc-contentful/js/full_list.js @@ -0,0 +1,216 @@ +(function() { + +var $clicked = $(null); +var searchTimeout = null; +var searchCache = []; +var caseSensitiveMatch = false; +var ignoreKeyCodeMin = 8; +var ignoreKeyCodeMax = 46; +var commandKey = 91; + +RegExp.escape = function(text) { + return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); +} + +function escapeShortcut() { + $(document).keydown(function(evt) { + if (evt.which == 27) { + window.parent.postMessage('navEscape', '*'); + } + }); +} + +function navResizer() { + $(window).mousemove(function(e) { + window.parent.postMessage({ + action: 'mousemove', event: {pageX: e.pageX, which: e.which} + }, '*'); + }).mouseup(function(e) { + window.parent.postMessage({action: 'mouseup'}, '*'); + }); + window.parent.postMessage("navReady", "*"); +} + +function clearSearchTimeout() { + clearTimeout(searchTimeout); + searchTimeout = null; +} + +function enableLinks() { + // load the target page in the parent window + $('#full_list li').on('click', function(evt) { + $('#full_list li').removeClass('clicked'); + $clicked = $(this); + $clicked.addClass('clicked'); + evt.stopPropagation(); + + if (evt.target.tagName === 'A') return true; + + var elem = $clicked.find('> .item .object_link a')[0]; + var e = evt.originalEvent; + var newEvent = new MouseEvent(evt.originalEvent.type); + newEvent.initMouseEvent(e.type, e.canBubble, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget); + elem.dispatchEvent(newEvent); + evt.preventDefault(); + return false; + }); +} + +function enableToggles() { + // show/hide nested classes on toggle click + $('#full_list a.toggle').on('click', function(evt) { + evt.stopPropagation(); + evt.preventDefault(); + $(this).parent().parent().toggleClass('collapsed'); + highlight(); + }); +} + +function populateSearchCache() { + $('#full_list li .item').each(function() { + var $node = $(this); + var $link = $node.find('.object_link a'); + if ($link.length > 0) { + searchCache.push({ + node: $node, + link: $link, + name: $link.text(), + fullName: $link.attr('title').split(' ')[0] + }); + } + }); +} + +function enableSearch() { + $('#search input').keyup(function(event) { + if (ignoredKeyPress(event)) return; + if (this.value === "") { + clearSearch(); + } else { + performSearch(this.value); + } + }); + + $('#full_list').after(""); +} + +function ignoredKeyPress(event) { + if ( + (event.keyCode > ignoreKeyCodeMin && event.keyCode < ignoreKeyCodeMax) || + (event.keyCode == commandKey) + ) { + return true; + } else { + return false; + } +} + +function clearSearch() { + clearSearchTimeout(); + $('#full_list .found').removeClass('found').each(function() { + var $link = $(this).find('.object_link a'); + $link.text($link.text()); + }); + $('#full_list, #content').removeClass('insearch'); + $clicked.parents().removeClass('collapsed'); + highlight(); +} + +function performSearch(searchString) { + clearSearchTimeout(); + $('#full_list, #content').addClass('insearch'); + $('#noresults').text('').hide(); + partialSearch(searchString, 0); +} + +function partialSearch(searchString, offset) { + var lastRowClass = ''; + var i = null; + for (i = offset; i < Math.min(offset + 50, searchCache.length); i++) { + var item = searchCache[i]; + var searchName = (searchString.indexOf('::') != -1 ? item.fullName : item.name); + var matchString = buildMatchString(searchString); + var matchRegexp = new RegExp(matchString, caseSensitiveMatch ? "" : "i"); + if (searchName.match(matchRegexp) == null) { + item.node.removeClass('found'); + item.link.text(item.link.text()); + } + else { + item.node.addClass('found'); + item.node.removeClass(lastRowClass).addClass(lastRowClass == 'r1' ? 'r2' : 'r1'); + lastRowClass = item.node.hasClass('r1') ? 'r1' : 'r2'; + item.link.html(item.name.replace(matchRegexp, "$&")); + } + } + if(i == searchCache.length) { + searchDone(); + } else { + searchTimeout = setTimeout(function() { + partialSearch(searchString, i); + }, 0); + } +} + +function searchDone() { + searchTimeout = null; + highlight(); + if ($('#full_list li:visible').size() === 0) { + $('#noresults').text('No results were found.').hide().fadeIn(); + } else { + $('#noresults').text('').hide(); + } + $('#content').removeClass('insearch'); +} + +function buildMatchString(searchString, event) { + caseSensitiveMatch = searchString.match(/[A-Z]/) != null; + var regexSearchString = RegExp.escape(searchString); + if (caseSensitiveMatch) { + regexSearchString += "|" + + $.map(searchString.split(''), function(e) { return RegExp.escape(e); }). + join('.+?'); + } + return regexSearchString; +} + +function highlight() { + $('#full_list li:visible').each(function(n) { + $(this).removeClass('even odd').addClass(n % 2 == 0 ? 'odd' : 'even'); + }); +} + +/** + * Expands the tree to the target element and its immediate + * children. + */ +function expandTo(path) { + var $target = $(document.getElementById('object_' + path)); + $target.addClass('clicked'); + $target.removeClass('collapsed'); + $target.parentsUntil('#full_list', 'li').removeClass('collapsed'); + if($target[0]) { + window.scrollTo(window.scrollX, $target.offset().top - 250); + highlight(); + } +} + +function windowEvents(event) { + var msg = event.data; + if (msg.action === "expand") { + expandTo(msg.path); + } + return false; +} + +window.addEventListener("message", windowEvents, false); + +$(document).ready(function() { + escapeShortcut(); + navResizer(); + enableLinks(); + enableToggles(); + populateSearchCache(); + enableSearch(); +}); + +})(); diff --git a/docs/1.3/wcc-contentful/js/jquery.js b/docs/1.3/wcc-contentful/js/jquery.js new file mode 100644 index 00000000..198b3ff0 --- /dev/null +++ b/docs/1.3/wcc-contentful/js/jquery.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.1 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
        a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
        "+""+"
        ",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
        t
        ",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
        ",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; +f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

        ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
        ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
        ","
        "],thead:[1,"","
        "],tr:[2,"","
        "],td:[3,"","
        "],col:[2,"","
        "],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
        ","
        "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() +{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
        ").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/docs/1.3/wcc-contentful/method_list.html b/docs/1.3/wcc-contentful/method_list.html new file mode 100644 index 00000000..45f6bd77 --- /dev/null +++ b/docs/1.3/wcc-contentful/method_list.html @@ -0,0 +1,2851 @@ + + + + + + + + + + + + + + + + + + Method List + + + +
        +
        +

        Method List

        + + + +
        + +
          + + +
        • +
          + #== + WCC::Contentful::IndexedRepresentation::Field +
          +
        • + + +
        • +
          + #== + WCC::Contentful::IndexedRepresentation::ContentType +
          +
        • + + +
        • +
          + #== + WCC::Contentful::IndexedRepresentation +
          +
        • + + +
        • +
          + [] + WCC::Contentful::SimpleClient::ApiError +
          +
        • + + +
        • +
          + [] + WCC::Contentful::Test::Attributes +
          +
        • + + +
        • +
          + #[]= + WCC::Contentful::IndexedRepresentation +
          +
        • + + +
        • +
          + #_instrumentation + WCC::Contentful::Instrumentation +
          +
        • + + +
        • +
          + #_instrumentation_event_prefix + WCC::Contentful::Instrumentation +
          +
        • + + +
        • +
          + #access_token + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #api_url + WCC::Contentful::SimpleClient +
          +
        • + + +
        • +
          + #app_url + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #apply + WCC::Contentful::Store::Query::Interface +
          +
        • + + +
        • +
          + #apply + WCC::Contentful::Store::Query +
          +
        • + + +
        • +
          + #apply + WCC::Contentful::Store::CDNAdapter::Query +
          +
        • + + +
        • +
          + #apply + WCC::Contentful::Middleware::Store::DelegatingQuery +
          +
        • + + +
        • +
          + #apply_operator + WCC::Contentful::Store::Query +
          +
        • + + +
        • +
          + #apply_operator + WCC::Contentful::Middleware::Store::DelegatingQuery +
          +
        • + + +
        • +
          + #apply_operator + WCC::Contentful::Store::CDNAdapter::Query +
          +
        • + + +
        • +
          + #assert_ok! + WCC::Contentful::SimpleClient::Response +
          +
        • + + +
        • +
          + #asset + WCC::Contentful::Event::DeletedAsset +
          +
        • + + +
        • +
          + #asset + WCC::Contentful::Event::Asset +
          +
        • + + +
        • +
          + #asset + WCC::Contentful::SimpleClient::Cdn +
          +
        • + + +
        • +
          + #assets + WCC::Contentful::SimpleClient::Cdn +
          +
        • + + +
        • +
          + #attributes + WCC::Contentful::ActiveRecordShim +
          +
        • + + +
        • +
          + #body + WCC::Contentful::SimpleClient::Response +
          +
        • + + +
        • +
          + #build + WCC::Contentful::Store::Factory +
          +
        • + + +
        • +
          + build_connection_pool + WCC::Contentful::Store::PostgresStore +
          +
        • + + +
        • +
          + #build_models + WCC::Contentful::ModelBuilder +
          +
        • + + +
        • +
          + #cache_key + WCC::Contentful::ActiveRecordShim +
          +
        • + + +
        • +
          + #cache_key_with_version + WCC::Contentful::ActiveRecordShim +
          +
        • + + +
        • +
          + #cache_key_without_version + WCC::Contentful::ActiveRecordShim +
          +
        • + + +
        • +
          + #cache_version + WCC::Contentful::ActiveRecordShim +
          +
        • + + +
        • +
          + call + WCC::Contentful::DownloadsSchema +
          +
        • + + +
        • +
          + #call + WCC::Contentful::DownloadsSchema +
          +
        • + + +
        • +
          + #client + WCC::Contentful::SyncEngine +
          +
        • + + +
        • +
          + #client + WCC::Contentful::Services +
          +
        • + + +
        • +
          + #client + WCC::Contentful::Store::CDNAdapter +
          +
        • + + +
        • +
          + #client + WCC::Contentful::SimpleClient::Response +
          +
        • + + +
        • +
          + #client_type + WCC::Contentful::SimpleClient::Cdn +
          +
        • + + +
        • +
          + #client_type + WCC::Contentful::SimpleClient::Preview +
          +
        • + + +
        • +
          + #client_type + WCC::Contentful::SimpleClient::Management +
          +
        • + + +
        • +
          + #conditions + WCC::Contentful::Store::Query +
          +
        • + + +
        • +
          + #config + WCC::Contentful::Store::Factory +
          +
        • + + +
        • +
          + #configuration + WCC::Contentful::SyncEngine::Job +
          +
        • + + +
        • +
          + #configuration + WCC::Contentful::Services +
          +
        • + + +
        • +
          + configuration + WCC::Contentful +
          +
        • + + +
        • +
          + configure + WCC::Contentful +
          +
        • + + +
        • +
          + #connection + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #connection_options + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #connection_pool + WCC::Contentful::Store::PostgresStore +
          +
        • + + +
        • +
          + const_missing + WCC::Contentful::Model +
          +
        • + + +
        • +
          + #constant_from_content_type + WCC::Contentful::Helpers +
          +
        • + + +
        • +
          + #content + WCC::Contentful::RichText::Blockquote +
          +
        • + + +
        • +
          + #content + WCC::Contentful::RichText::Unknown +
          +
        • + + +
        • +
          + #content + WCC::Contentful::RichText::Document +
          +
        • + + +
        • +
          + #content + WCC::Contentful::RichText::Paragraph +
          +
        • + + +
        • +
          + #content + WCC::Contentful::RichText::EmbeddedAssetBlock +
          +
        • + + +
        • +
          + #content + WCC::Contentful::RichText::EmbeddedEntryBlock +
          +
        • + + +
        • +
          + #content + WCC::Contentful::RichText::EmbeddedEntryInline +
          +
        • + + +
        • +
          + #content_type + WCC::Contentful::Event::Asset +
          +
        • + + +
        • +
          + #content_type + WCC::Contentful::Event::DeletedEntry +
          +
        • + + +
        • +
          + #content_type + WCC::Contentful::Event::DeletedAsset +
          +
        • + + +
        • +
          + #content_type + WCC::Contentful::Store::Query +
          +
        • + + +
        • +
          + #content_type + WCC::Contentful::SimpleClient::Management +
          +
        • + + +
        • +
          + #content_type + WCC::Contentful::Event::Entry +
          +
        • + + +
        • +
          + #content_type_from_constant + WCC::Contentful::Helpers +
          +
        • + + +
        • +
          + #content_type_from_raw + WCC::Contentful::Helpers +
          +
        • + + +
        • +
          + #content_types + WCC::Contentful::SimpleClient::Cdn +
          +
        • + + +
        • +
          + #content_types + WCC::Contentful::SimpleClient::Management +
          +
        • + + +
        • +
          + #content_types + WCC::Contentful::DownloadsSchema +
          +
        • + + +
        • +
          + #contentful_create + WCC::Contentful::Test::Factory +
          +
        • + + +
        • +
          + #contentful_double + WCC::Contentful::Test::Double +
          +
        • + + +
        • +
          + #contentful_image_double + WCC::Contentful::Test::Double +
          +
        • + + +
        • +
          + #contentful_stub + WCC::Contentful::RSpec +
          +
        • + + +
        • +
          + #count + WCC::Contentful::SimpleClient::SyncResponse +
          +
        • + + +
        • +
          + #count + WCC::Contentful::Store::PostgresStore::Query +
          +
        • + + +
        • +
          + #count + WCC::Contentful::SimpleClient::Response +
          +
        • + + +
        • +
          + #count + WCC::Contentful::Middleware::Store::DelegatingQuery +
          +
        • + + +
        • +
          + #create_asset_type + WCC::Contentful::ContentTypeIndexer +
          +
        • + + +
        • +
          + #create_type + WCC::Contentful::ContentTypeIndexer +
          +
        • + + +
        • +
          + #data + WCC::Contentful::RichText::EmbeddedAssetBlock +
          +
        • + + +
        • +
          + #data + WCC::Contentful::RichText::EmbeddedEntryInline +
          +
        • + + +
        • +
          + #data + WCC::Contentful::RichText::Blockquote +
          +
        • + + +
        • +
          + #data + WCC::Contentful::RichText::Paragraph +
          +
        • + + +
        • +
          + #data + WCC::Contentful::RichText::Unknown +
          +
        • + + +
        • +
          + #data + WCC::Contentful::RichText::Document +
          +
        • + + +
        • +
          + #data + WCC::Contentful::RichText::Text +
          +
        • + + +
        • +
          + #data + WCC::Contentful::RichText::EmbeddedEntryBlock +
          +
        • + + +
        • +
          + #deep_dup + WCC::Contentful::IndexedRepresentation +
          +
        • + + +
        • +
          + #deep_dup + WCC::Contentful::IndexedRepresentation::ContentType +
          +
        • + + +
        • +
          + #default_locale + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + default_middleware + WCC::Contentful::Store::Factory +
          +
        • + + +
        • +
          + default_value + WCC::Contentful::Test::Attributes +
          +
        • + + +
        • +
          + defaults + WCC::Contentful::Test::Attributes +
          +
        • + + +
        • +
          + #delete + WCC::Contentful::Store::Base +
          +
        • + + +
        • +
          + #delete + WCC::Contentful::Store::PostgresStore +
          +
        • + + +
        • +
          + #delete + WCC::Contentful::Store::MemoryStore +
          +
        • + + +
        • +
          + #deleted_at + WCC::Contentful::Event::DeletedAsset +
          +
        • + + +
        • +
          + #deleted_at + WCC::Contentful::Event::DeletedEntry +
          +
        • + + +
        • +
          + #depth + WCC::Contentful::LinkVisitor +
          +
        • + + +
        • +
          + #each + WCC::Contentful::SimpleClient::PaginatingEnumerable +
          +
        • + + +
        • +
          + #each + WCC::Contentful::LinkVisitor +
          +
        • + + +
        • +
          + #each_page + WCC::Contentful::SimpleClient::SyncResponse +
          +
        • + + +
        • +
          + #each_page + WCC::Contentful::SimpleClient::Response +
          +
        • + + +
        • +
          + #editor_interface + WCC::Contentful::SimpleClient::Management +
          +
        • + + +
        • +
          + #editor_interfaces + WCC::Contentful::DownloadsSchema +
          +
        • + + +
        • +
          + #emit_event + WCC::Contentful::SyncEngine +
          +
        • + + +
        • +
          + #emit_sync_complete + WCC::Contentful::SyncEngine +
          +
        • + + +
        • +
          + #enable_webhook + WCC::Contentful::WebhookEnableJob +
          +
        • + + +
        • +
          + #ensure_hash + WCC::Contentful::Store::Base +
          +
        • + + +
        • +
          + ensure_schema + WCC::Contentful::Store::PostgresStore +
          +
        • + + +
        • +
          + #entries + WCC::Contentful::SimpleClient::Cdn +
          +
        • + + +
        • +
          + #entry + WCC::Contentful::LinkVisitor +
          +
        • + + +
        • +
          + #entry + WCC::Contentful::SimpleClient::Cdn +
          +
        • + + +
        • +
          + #entry + WCC::Contentful::Event::DeletedEntry +
          +
        • + + +
        • +
          + #entry + WCC::Contentful::Event::Entry +
          +
        • + + +
        • +
          + #environment + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #eq + WCC::Contentful::Store::Query::Interface +
          +
        • + + +
        • +
          + #error_message + WCC::Contentful::SimpleClient::Response +
          +
        • + + +
        • +
          + #exec_query + WCC::Contentful::Store::PostgresStore +
          +
        • + + +
        • +
          + #execute + WCC::Contentful::Store::MemoryStore +
          +
        • + + +
        • +
          + #execute + WCC::Contentful::Store::Base +
          +
        • + + +
        • +
          + #expires_in + WCC::Contentful::Middleware::Store::CachingMiddleware +
          +
        • + + +
        • +
          + #fields + WCC::Contentful::LinkVisitor +
          +
        • + + +
        • +
          + #find + WCC::Contentful::Middleware::Store::CachingMiddleware +
          +
        • + + +
        • +
          + #find + WCC::Contentful::Store::CDNAdapter +
          +
        • + + +
        • +
          + #find + WCC::Contentful::Middleware::Store +
          +
        • + + +
        • +
          + #find + WCC::Contentful::Store::InstrumentationWrapper +
          +
        • + + +
        • +
          + #find + WCC::Contentful::ModelSingletonMethods +
          +
        • + + +
        • +
          + #find + WCC::Contentful::Store::Interface +
          +
        • + + +
        • +
          + #find + WCC::Contentful::Store::PostgresStore +
          +
        • + + +
        • +
          + #find + WCC::Contentful::Store::MemoryStore +
          +
        • + + +
        • +
          + #find_all + WCC::Contentful::Middleware::Store +
          +
        • + + +
        • +
          + #find_all + WCC::Contentful::Store::InstrumentationWrapper +
          +
        • + + +
        • +
          + #find_all + WCC::Contentful::ModelSingletonMethods +
          +
        • + + +
        • +
          + #find_all + WCC::Contentful::Store::PostgresStore +
          +
        • + + +
        • +
          + #find_all + WCC::Contentful::Store::Interface +
          +
        • + + +
        • +
          + #find_all + WCC::Contentful::Store::Base +
          +
        • + + +
        • +
          + #find_all + WCC::Contentful::Store::CDNAdapter +
          +
        • + + +
        • +
          + #find_by + WCC::Contentful::ModelSingletonMethods +
          +
        • + + +
        • +
          + #find_by + WCC::Contentful::Middleware::Store::CachingMiddleware +
          +
        • + + +
        • +
          + #find_by + WCC::Contentful::Store::Interface +
          +
        • + + +
        • +
          + #find_by + WCC::Contentful::Store::CDNAdapter +
          +
        • + + +
        • +
          + #find_by + WCC::Contentful::Store::Base +
          +
        • + + +
        • +
          + #find_by + WCC::Contentful::Store::InstrumentationWrapper +
          +
        • + + +
        • +
          + #find_by + WCC::Contentful::Middleware::Store +
          +
        • + + +
        • +
          + #first + WCC::Contentful::Store::PostgresStore::Query +
          +
        • + + +
        • +
          + #first + WCC::Contentful::SimpleClient::Response +
          +
        • + + +
        • +
          + flatten_filter_hash + WCC::Contentful::Store::Query +
          +
        • + + +
        • +
          + #freeze + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + from_json + WCC::Contentful::IndexedRepresentation +
          +
        • + + +
        • +
          + from_json_schema + WCC::Contentful::ContentTypeIndexer +
          +
        • + + +
        • +
          + from_raw + WCC::Contentful::Event +
          +
        • + + +
        • +
          + #frozen? + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #frozen? + WCC::Contentful::Configuration::FrozenConfiguration +
          +
        • + + +
        • +
          + #get + WCC::Contentful::Event::Registry +
          +
        • + + +
        • +
          + #get + WCC::Contentful::SimpleClient +
          +
        • + + +
        • +
          + #get + WCC::Contentful::SimpleClient::TyphoeusAdapter +
          +
        • + + +
        • +
          + #has_select? + WCC::Contentful::Middleware::Store +
          +
        • + + +
        • +
          + #id + WCC::Contentful::Link +
          +
        • + + +
        • +
          + #id + WCC::Contentful::CircularReferenceError +
          +
        • + + +
        • +
          + #includes + WCC::Contentful::SimpleClient::Response +
          +
        • + + +
        • +
          + #index + WCC::Contentful::ContentTypeIndexer +
          +
        • + + +
        • +
          + #index + WCC::Contentful::Store::CDNAdapter +
          +
        • + + +
        • +
          + #index + WCC::Contentful::Store::InstrumentationWrapper +
          +
        • + + +
        • +
          + #index + WCC::Contentful::Store::Base +
          +
        • + + +
        • +
          + #index + WCC::Contentful::Middleware::Store::CachingMiddleware +
          +
        • + + +
        • +
          + #index + WCC::Contentful::Store::Interface +
          +
        • + + +
        • +
          + #index? + WCC::Contentful::Store::Base +
          +
        • + + +
        • +
          + #index? + WCC::Contentful::Store::Interface +
          +
        • + + +
        • +
          + #index? + WCC::Contentful::Middleware::Store::CachingMiddleware +
          +
        • + + +
        • +
          + #index? + WCC::Contentful::Store::CDNAdapter +
          +
        • + + +
        • +
          + #inherited + WCC::Contentful::ModelSingletonMethods +
          +
        • + + +
        • +
          + init! + WCC::Contentful +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::Store::PostgresStore +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::Services +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::CircularReferenceError +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::Store::Query +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::SyncEngine +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::LinkVisitor +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::Configuration::FrozenConfiguration +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::ModelBuilder +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::SimpleClient +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::Store::Factory +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::DownloadsSchema +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::Middleware::Store::DelegatingQuery +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::SimpleClient::Cdn +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::Store::CDNAdapter +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::Store::CDNAdapter::Query +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::Store::MemoryStore +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::ContentTypeIndexer +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::SimpleClient::Preview +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::IndexedRepresentation +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::IndexedRepresentation::ContentType +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::IndexedRepresentation::Field +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::SimpleClient::Response +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::SimpleClient::SyncResponse +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::SimpleClient::PaginatingEnumerable +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::SimpleClient::ApiError +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::ModelSingletonMethods::ModelQuery +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::SimpleClient::Management +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::Middleware::Store::CachingMiddleware +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::Events +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::Event::SyncComplete +
          +
        • + + +
        • +
          + #initialize + WCC::Contentful::Link +
          +
        • + + +
        • +
          + initialized + WCC::Contentful +
          +
        • + + +
        • +
          + #inject_into + WCC::Contentful::Services +
          +
        • + + +
        • +
          + instance + WCC::Contentful::Services +
          +
        • + + +
        • +
          + instance + WCC::Contentful::Events +
          +
        • + + +
        • +
          + instrument + WCC::Contentful::Instrumentation +
          +
        • + + +
        • +
          + #instrumentation + WCC::Contentful::Services +
          +
        • + + +
        • +
          + #instrumentation_adapter + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #items + WCC::Contentful::Event::SyncComplete +
          +
        • + + +
        • +
          + #items + WCC::Contentful::SimpleClient::Response +
          +
        • + + +
        • +
          + #keys + WCC::Contentful::Store::PostgresStore +
          +
        • + + +
        • +
          + #keys + WCC::Contentful::RichText::Node +
          +
        • + + +
        • +
          + #keys + WCC::Contentful::Store::MemoryStore +
          +
        • + + +
        • +
          + #klass + WCC::Contentful::ModelSingletonMethods::ModelQuery +
          +
        • + + +
        • +
          + known_locales + WCC::Contentful::Store::Query +
          +
        • + + +
        • +
          + #link_type + WCC::Contentful::Link +
          +
        • + + +
        • +
          + load + WCC::Contentful::ContentTypeIndexer +
          +
        • + + +
        • +
          + load_adapter + WCC::Contentful::SimpleClient +
          +
        • + + +
        • +
          + locales + WCC::Contentful +
          +
        • + + +
        • +
          + logger + WCC::Contentful +
          +
        • + + +
        • +
          + #logger + WCC::Contentful::Services +
          +
        • + + +
        • +
          + #logger + WCC::Contentful::Store::PostgresStore +
          +
        • + + +
        • +
          + #logger + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #management_client + WCC::Contentful::Services +
          +
        • + + +
        • +
          + #management_token + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #map! + WCC::Contentful::LinkVisitor +
          +
        • + + +
        • +
          + #marks + WCC::Contentful::RichText::Text +
          +
        • + + +
        • +
          + #master? + WCC::Contentful::Configuration::FrozenConfiguration +
          +
        • + + +
        • +
          + #master? + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #message + WCC::Contentful::CircularReferenceError +
          +
        • + + +
        • +
          + #middleware + WCC::Contentful::Middleware::Store::DelegatingQuery +
          +
        • + + +
        • +
          + #middleware + WCC::Contentful::Store::Factory +
          +
        • + + +
        • +
          + #namespace + WCC::Contentful::ModelBuilder +
          +
        • + + +
        • +
          + #needs_update? + WCC::Contentful::DownloadsSchema +
          +
        • + + +
        • +
          + #nested_conditions + WCC::Contentful::Store::CDNAdapter::Query +
          +
        • + + +
        • +
          + #next + WCC::Contentful::SyncEngine +
          +
        • + + +
        • +
          + #next_page + WCC::Contentful::SimpleClient::Response +
          +
        • + + +
        • +
          + #next_page + WCC::Contentful::SimpleClient::SyncResponse +
          +
        • + + +
        • +
          + #next_page? + WCC::Contentful::SimpleClient::Response +
          +
        • + + +
        • +
          + #next_page? + WCC::Contentful::SimpleClient::SyncResponse +
          +
        • + + +
        • +
          + #next_sync_token + WCC::Contentful::SimpleClient::SyncResponse +
          +
        • + + +
        • +
          + #nodeType + WCC::Contentful::RichText::Text +
          +
        • + + +
        • +
          + #nodeType + WCC::Contentful::RichText::Blockquote +
          +
        • + + +
        • +
          + #nodeType + WCC::Contentful::RichText::Paragraph +
          +
        • + + +
        • +
          + #nodeType + WCC::Contentful::RichText::EmbeddedEntryBlock +
          +
        • + + +
        • +
          + #nodeType + WCC::Contentful::RichText::EmbeddedEntryInline +
          +
        • + + +
        • +
          + #nodeType + WCC::Contentful::RichText::Unknown +
          +
        • + + +
        • +
          + #nodeType + WCC::Contentful::RichText::Document +
          +
        • + + +
        • +
          + #nodeType + WCC::Contentful::RichText::EmbeddedAssetBlock +
          +
        • + + +
        • +
          + normalize_condition_path + WCC::Contentful::Store::Query +
          +
        • + + +
        • +
          + op? + WCC::Contentful::Store::Query +
          +
        • + + +
        • +
          + #options + WCC::Contentful::Middleware::Store::DelegatingQuery +
          +
        • + + +
        • +
          + #options + WCC::Contentful::SyncEngine +
          +
        • + + +
        • +
          + #options + WCC::Contentful::Store::Factory +
          +
        • + + +
        • +
          + #options + WCC::Contentful::ModelSingletonMethods::ModelQuery +
          +
        • + + +
        • +
          + #page_items + WCC::Contentful::SimpleClient::Response +
          +
        • + + +
        • +
          + parse_sync_token + WCC::Contentful::SimpleClient::SyncResponse +
          +
        • + + +
        • +
          + #path_tuples + WCC::Contentful::Store::Query::Condition +
          +
        • + + +
        • +
          + #perform + WCC::Contentful::SyncEngine::Job +
          +
        • + + +
        • +
          + #perform + WCC::Contentful::WebhookEnableJob +
          +
        • + + +
        • +
          + #post + WCC::Contentful::SimpleClient::TyphoeusAdapter +
          +
        • + + +
        • +
          + #post + WCC::Contentful::SimpleClient::Management +
          +
        • + + +
        • +
          + #post_webhook_definition + WCC::Contentful::SimpleClient::Management +
          +
        • + + +
        • +
          + prepare_statements + WCC::Contentful::Store::PostgresStore +
          +
        • + + +
        • +
          + #preset + WCC::Contentful::Store::Factory +
          +
        • + + +
        • +
          + #preset_custom + WCC::Contentful::Store::Factory +
          +
        • + + +
        • +
          + #preset_direct + WCC::Contentful::Store::Factory +
          +
        • + + +
        • +
          + #preset_eager_sync + WCC::Contentful::Store::Factory +
          +
        • + + +
        • +
          + #preset_lazy_sync + WCC::Contentful::Store::Factory +
          +
        • + + +
        • +
          + #preview_client + WCC::Contentful::Services +
          +
        • + + +
        • +
          + #preview_store + WCC::Contentful::Services +
          +
        • + + +
        • +
          + #preview_token + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #raw + WCC::Contentful::SimpleClient::TyphoeusAdapter::Response +
          +
        • + + +
        • +
          + #raw + WCC::Contentful::Link +
          +
        • + + +
        • +
          + #raw + WCC::Contentful::SimpleClient::Response +
          +
        • + + +
        • +
          + #raw_response + WCC::Contentful::SimpleClient::Response +
          +
        • + + +
        • +
          + #rebroadcast + WCC::Contentful::Events +
          +
        • + + +
        • +
          + #receive + WCC::Contentful::WebhookController +
          +
        • + + +
        • +
          + #register + WCC::Contentful::Event::Registry +
          +
        • + + +
        • +
          + #replace + WCC::Contentful::Store::Factory +
          +
        • + + +
        • +
          + #request + WCC::Contentful::SimpleClient::Response +
          +
        • + + +
        • +
          + #resolve + WCC::Contentful::ModelMethods +
          +
        • + + +
        • +
          + #resolve_includes + WCC::Contentful::Middleware::Store +
          +
        • + + +
        • +
          + #resolve_link + WCC::Contentful::Middleware::Store +
          +
        • + + +
        • +
          + #resolved? + WCC::Contentful::ModelMethods +
          +
        • + + +
        • +
          + #resolved_link? + WCC::Contentful::Middleware::Store +
          +
        • + + +
        • +
          + #response + WCC::Contentful::SimpleClient::ApiError +
          +
        • + + +
        • +
          + #result_set + WCC::Contentful::Store::PostgresStore::Query +
          +
        • + + +
        • +
          + #result_set + WCC::Contentful::Store::Query +
          +
        • + + +
        • +
          + schema_ensured? + WCC::Contentful::Store::PostgresStore +
          +
        • + + +
        • +
          + #schema_file + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #services + WCC::Contentful::SyncEngine::Job +
          +
        • + + +
        • +
          + #set + WCC::Contentful::Store::Base +
          +
        • + + +
        • +
          + #set + WCC::Contentful::Store::MemoryStore +
          +
        • + + +
        • +
          + #set + WCC::Contentful::Store::PostgresStore +
          +
        • + + +
        • +
          + #shared_prefix + WCC::Contentful::Helpers +
          +
        • + + +
        • +
          + #should_sync? + WCC::Contentful::SyncEngine +
          +
        • + + +
        • +
          + #skip + WCC::Contentful::SimpleClient::Response +
          +
        • + + +
        • +
          + #source + WCC::Contentful::Event::SyncComplete +
          +
        • + + +
        • +
          + #space + WCC::Contentful::SimpleClient +
          +
        • + + +
        • +
          + #space + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #stack + WCC::Contentful::CircularReferenceError +
          +
        • + + +
        • +
          + #state + WCC::Contentful::SyncEngine +
          +
        • + + +
        • +
          + #status + WCC::Contentful::SimpleClient::TyphoeusAdapter::Response +
          +
        • + + +
        • +
          + #store + WCC::Contentful::Store::Factory +
          +
        • + + +
        • +
          + #store + WCC::Contentful::Services +
          +
        • + + +
        • +
          + #store + WCC::Contentful::Store::Query +
          +
        • + + +
        • +
          + #store + WCC::Contentful::SyncEngine +
          +
        • + + +
        • +
          + #store + WCC::Contentful::Middleware::Store +
          +
        • + + +
        • +
          + #store + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #store= + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #store_factory + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #sync + WCC::Contentful::SimpleClient::Cdn +
          +
        • + + +
        • +
          + #sync! + WCC::Contentful::SyncEngine::Job +
          +
        • + + +
        • +
          + #sync_engine + WCC::Contentful::Services +
          +
        • + + +
        • +
          + #sync_later! + WCC::Contentful::SyncEngine::Job +
          +
        • + + +
        • +
          + #sync_retry_limit + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #sync_retry_wait + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #sys + WCC::Contentful::Event::SyncComplete +
          +
        • + + +
        • +
          + #to_enum + WCC::Contentful::Middleware::Store::DelegatingQuery +
          +
        • + + +
        • +
          + #to_enum + WCC::Contentful::Store::Query +
          +
        • + + +
        • +
          + #to_enum + WCC::Contentful::ModelSingletonMethods::ModelQuery +
          +
        • + + +
        • +
          + #to_enum + WCC::Contentful::Store::CDNAdapter::Query +
          +
        • + + +
        • +
          + #to_h + WCC::Contentful::Event::SyncComplete +
          +
        • + + +
        • +
          + #to_h + WCC::Contentful::ModelMethods +
          +
        • + + +
        • +
          + #to_json + WCC::Contentful::IndexedRepresentation +
          +
        • + + +
        • +
          + tokenize + WCC::Contentful::RichText +
          +
        • + + +
        • +
          + #total + WCC::Contentful::SimpleClient::Response +
          +
        • + + +
        • +
          + #transform + WCC::Contentful::Middleware::Store +
          +
        • + + +
        • +
          + #type= + WCC::Contentful::IndexedRepresentation::Field +
          +
        • + + +
        • +
          + types + WCC::Contentful +
          +
        • + + +
        • +
          + #types + WCC::Contentful::ContentTypeIndexer +
          +
        • + + +
        • +
          + #unuse + WCC::Contentful::Store::Factory +
          +
        • + + +
        • +
          + #update! + WCC::Contentful::DownloadsSchema +
          +
        • + + +
        • +
          + #update_schema_file + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #use + WCC::Contentful::Store::Factory +
          +
        • + + +
        • +
          + #validate! + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #validate! + WCC::Contentful::Store::Factory +
          +
        • + + +
        • +
          + #value + WCC::Contentful::RichText::Text +
          +
        • + + +
        • +
          + #webhook_definitions + WCC::Contentful::SimpleClient::Management +
          +
        • + + +
        • +
          + #webhook_jobs + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #webhook_password + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #webhook_username + WCC::Contentful::Configuration +
          +
        • + + +
        • +
          + #wrapped_query + WCC::Contentful::ModelSingletonMethods::ModelQuery +
          +
        • + + +
        • +
          + #wrapped_query + WCC::Contentful::Middleware::Store::DelegatingQuery +
          +
        • + + + +
        +
        + + diff --git a/docs/1.3/wcc-contentful/top-level-namespace.html b/docs/1.3/wcc-contentful/top-level-namespace.html new file mode 100644 index 00000000..d920436e --- /dev/null +++ b/docs/1.3/wcc-contentful/top-level-namespace.html @@ -0,0 +1,110 @@ + + + + + + + Top Level Namespace + + — Documentation by YARD 0.9.28 + + + + + + + + + + + + + + + + + + + +
        + + +

        Top Level Namespace + + + +

        +
        + + + + + + + + + + + +
        + +

        Defined Under Namespace

        +

        + + + Modules: WCC + + + + +

        + + + + + + + + + +
        + + + +
        + + \ No newline at end of file diff --git a/docs/latest b/docs/latest index b9093fb1..2cc0e544 120000 --- a/docs/latest +++ b/docs/latest @@ -1 +1 @@ -./1.2 \ No newline at end of file +./1.3 \ No newline at end of file