forked from cloudinary/js-transformation-builder-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.min.js
1 lines (1 loc) · 12 KB
/
template.min.js
1
!function(t,e){e(function(){e("table").not(".table,.ignore").addClass("table table-striped")})}(window.TEMPLATE_OPTIONS,jQuery),function(t,l){l(function(){t.collapseSymbols&&(l("dt.collapsible-symbol").each(function(t,e){var n=l(e),i=n.hasClass("expanded"),a=l("<span/>",{class:"pull-right toggle-icon glyphicon glyphicon-chevron-"+(i?"up":"down")});n.find("h1,h2,h3,h4,h5").first().append(a)}).on("click",function(t){var e=l(t.target);if(!e.is("a")&&0==e.closest("a").length&&!e.is(".checkbox,.checkbox-inline")&&0==e.closest(".checkbox,.checkbox-inline").length){t.preventDefault();var n=l(this),i=n.find(".toggle-icon"),a=!n.hasClass("expanded"),o=n.next("dd.symbol-details"),s=o.find("div.symbol-details-inner"),r=o.outerHeight();a?(i.removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-up"),r+=s.outerHeight(),n.add(o).addClass("expanded"),o.addClass("transition").css("max-height",r)):(i.removeClass("glyphicon-chevron-up").addClass("glyphicon-chevron-down"),n.add(o).removeClass("expanded"),o.removeClass("transition").css("max-height",r),setTimeout(function(){o.addClass("transition").css("max-height",0)},10))}}),l("dd.collapsible-symbol").on("transitionEnd webkitTransitionEnd transitionend oTransitionEnd msTransitionEnd",function(){var t=l(this);t.hasClass("expanded")&&t.css("max-height",9999)}))})}(window.TEMPLATE_OPTIONS,jQuery),function(t,e,c){function n(t){if(!(this instanceof n))return new n(t);this.enabled=!!t,this._items={all:[],h1:[],h2:[],h3:[],h4:[]},this._last={h1:null,h2:null,h3:null,h4:null}}n.prototype._setLast=function(t){switch(t.tag){case"h1":this._last={h1:t,h2:null,h3:null,h4:null};break;case"h2":this._last.h2=t,this._last.h3=this._last.h4=null;break;case"h3":this._last.h3=t,this._last.h4=null;break;case"h4":this._last.h4=t}},n.prototype._getParent=function(t){for(var e="h"+(t.tag.substr(1)-1),n=this._last[e];!n;)if(e="h"+(e.substr(1)-1),n=this._last[e],-1===c.inArray(e,["h1","h2","h3","h4"])){n=null;break}return n},n.prototype.parse=function(){var n=this;c(".main-content").find("h1,h2,h3,h4").each(function(){var t=c(this),e=t.attr("id");e||(e=n.slugify(t.text()),t.attr("id",e)),t.addClass("anchored").append(n.$anchorLink(e)),n.enabled&&n.add(t)})},n.prototype.$anchorLink=function(t){return c("<a/>",{class:"anchor-link",href:"#"+t}).append(c("<i/>",{class:"glyphicon glyphicon-link"}))},n.prototype.slugify=function(t){t=(t=t.replace(/^\s+|\s+$/g,"")).toLowerCase();for(var e="àáäâèéëêìíïîòóöôùúüûñç·/_,:;",n=0,i=e.length;n<i;n++)t=t.replace(new RegExp(e.charAt(n),"g"),"aaaaeeeeiiiioooouuuunc------".charAt(n));return t=t.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")},n.prototype.getHTML=function(t){var e=t.clone().find(".anchor-link,.signature-returns,.signature-type,.toggle-icon").remove().end().get(0).innerHTML;return e?e.replace(/<a(.*?)>|<(\/)a>/g,"<$2span$1>"):t.text()},n.prototype.any=function(){return 0<this._items.all.length},n.prototype.add=function(t){var e={id:t.prop("id"),$header:t,header:t.get(0),tag:t.prop("tagName").toLowerCase(),dd:t.closest("dt").next("dd").get(0),html:this.getHTML(t),children:[]};if(this._items.all.push(e),this._items[e.tag].push(e),this._setLast(e),"h1"!=e.tag){var n=this._getParent(e);n&&n.children&&n.children.push(e)}return e},n.prototype.items=function(){return this._items.h1.length?this._items.h1:this._items.h2.length?this._items.h2:this._items.h3.length?this._items.h3:this._items.h4.length?this._items.h4:[]},n.prototype.$nav=function(t){var e=c("<ul/>",{class:"nav"});t||(t=this.items(),e.addClass("toc-nav"));for(var n=0,i=t.length;n<i;n++){var a=t[n].$header.clone().removeClass("anchored").prop("className").split(" ");a.push("toc-"+t[n].tag),t[n].$li=c("<li/>",{class:a.join(" ")}),t[n].$li.append(c("<a/>",{href:"#"+t[n].id}).html(t[n].html)),t[n].children.length&&t[n].$li.append(this.$nav(t[n].children)),e.append(t[n].$li)}return e},n.prototype.scrollspy=function(){var s=this,r=c(".toc"),l=r.parent();c(window).on("scroll.toc",function(){var t=l.offset().top-60<c(window).scrollTop();r.toggleClass("affix",t);for(var e=null,n=0,i=s._items.all.length;n<i;n++){var a=s._items.all[n],o=a.header.getBoundingClientRect();if(a.dd&&(o=a.dd.getBoundingClientRect()),60<=o.bottom&&0<=o.left){e=a;break}}null!=e&&(r.find(".active").removeClass("active"),e.$li.parents("li").addBack().addClass("active"))}).triggerHandler("scroll.toc")},n.prototype.$backToTop=function(){return c("<span/>",{class:"back-to-top",text:"Back to top"}).on("click",function(t){t.preventDefault(),window.history?history.replaceState(null,document.title,location.pathname+location.search):location.hash="",c(window).triggerHandler("hashchange")})},n.prototype.init=function(){c("nav.toc").append(this.$nav()).append(this.$backToTop()),this.scrollspy()},n.prototype.fixColumns=function(){c(".main-content").removeClass("col-md-9").addClass("col-md-12"),c(".side-content").remove()},n.prototype.offsetScroll=function(i){c(window).on("hashchange",function(){var t,e=location.hash.substr(1),n=0;0<e.length&&(t=c('a[name="'+e+'"],[id="'+e+'"]').first()).length&&(n=t.offset().top-i),c(window).scrollTop(n)}).triggerHandler("hashchange"),c("a").on("click",function(t){this.hostname===location.hostname&&this.pathname===location.pathname&&(t.preventDefault(),window.history?history.replaceState(null,document.title,location.pathname+location.search+this.hash):location.hash=this.hash,c(window).triggerHandler("hashchange"))})},c(function(){var t=new n(e);t.parse(),t.enabled&&t.any()?t.init():t.fixColumns(),t.offsetScroll(60)})}(window.TEMPLATE_OPTIONS,window.DOCLET_TOC_ENABLED,jQuery),function(t,e,n){function i(){if(!(this instanceof i))return new i;this.$toggleInherited=n(),this.$togglePublic=n(),this.$toggleProtected=n(),this.$togglePrivate=n(),this.inherited=!1,this.public=!1,this.protected=!1,this.private=!1}n.extend(i.prototype,{init:function(){var t=this;t.$toggleInherited=n(".access-filter .toggle-inherited").on("change",{self:t},t.onInheritedChanged),t.setInherited(),t.$togglePublic=n(".access-filter .toggle-public").on("change",{self:t},t.onPublicChanged),t.setPublic(),t.$toggleProtected=n(".access-filter .toggle-protected").on("change",{self:t},t.onProtectedChanged),t.setProtected(),t.$togglePrivate=n(".access-filter .toggle-private").on("change",{self:t},t.onPrivateChanged),t.setPrivate()},setInherited:function(){var t=this;if(0<t.$toggleInherited.length){t.inherited=t.$toggleInherited.prop("checked");var e=n(".symbol-title.inherited,.symbol-details.inherited,li.inherited");t.inherited&&!t.public&&(e=e.not(".public")),t.inherited&&!t.protected&&(e=e.not(".protected")),t.inherited&&!t.private&&(e=e.not(".private")),(e=e.add(e.filter(".symbol-title").prev("hr"))).toggle(t.inherited),t.$toggleInherited.closest(".checkbox-inline").toggleClass("checked",t.inherited)}},setPublic:function(){var t=this;if(0<t.$togglePublic.length){t.public=t.$togglePublic.prop("checked");var e=n(".symbol-title.public,.symbol-details.public,li.public");t.inherited||(e=e.not(".inherited")),(e=e.add(e.filter(".symbol-title").prev("hr"))).toggle(t.public),t.$togglePublic.closest(".checkbox-inline").toggleClass("checked",t.public)}},setProtected:function(){var t=this;if(0<t.$toggleProtected.length){t.protected=t.$toggleProtected.prop("checked");var e=n(".symbol-title.protected,.symbol-details.protected,li.protected");t.inherited||(e=e.not(".inherited")),(e=e.add(e.filter(".symbol-title").prev("hr"))).toggle(t.protected),t.$toggleProtected.closest(".checkbox-inline").toggleClass("checked",t.protected)}},setPrivate:function(){var t=this;if(0<t.$togglePrivate.length){t.private=t.$togglePrivate.prop("checked");var e=n(".symbol-title.private,.symbol-details.private,li.private");t.inherited||(e=e.not(".inherited")),(e=e.add(e.filter(".symbol-title").prev("hr"))).toggle(t.private),t.$togglePrivate.closest(".checkbox-inline").toggleClass("checked",t.private)}},onInheritedChanged:function(t){t.data.self.setInherited()},onPublicChanged:function(t){t.data.self.setPublic()},onProtectedChanged:function(t){t.data.self.setProtected()},onPrivateChanged:function(t){t.data.self.setPrivate()}}),n(function(){e&&(new i).init()})}(window.TEMPLATE_OPTIONS,window.DOCLET_AFILTER_ENABLED,jQuery),function(t,s){function e(){if(!(this instanceof e))return new e;this.index={},this.store={},this.loaded=!1}function n(){if(!(this instanceof n))return new n;this.db=new e,this.$input=s("#lunr-search-input").on("keyup",{self:this},this.onKeyup),this.$submit=s("#lunr-search-submit").on("click",{self:this},this.onClick),this.$modal=s("#lunr-search-modal"),this.$body=s("#lunr-search-body"),this.$footer=s("#lunr-search-footer"),this.$pagination=s(),this.limit=5}if(e.prototype.load=function(){var e=this;return s.get("js/lunr-data.json").then(function(t){e.store=t.store,e.index=lunr.Index.load(t.index),e.loaded=!0})},e.prototype.loadEmbed=function(){this.store=window.lunrData.store,this.index=lunr.Index.load(window.lunrData.index),this.loaded=!0},e.prototype.search=function(e){var n=this;return s.Deferred(function(t){n.loaded?t.resolve(n._search(e)):window.useLunrData?(n.loadEmbed(),t.resolve(n._search(e))):n.load().then(function(){t.resolve(n._search(e))},t.reject)})},e.prototype._search=function(t){var n=this,i=[],e=this.index.search(t);return s.each(e,function(t,e){i.push(n.store[e.ref])}),i},n.prototype.$createPagination=function(t){if(t<=1)return s();for(var e=s("<ul/>",{class:"pagination pagination-sm pull-left"}),n=0;n<t;n++){var i=s("<a/>",{href:"#lunr-search-result-page-"+n,text:n+1}).on("click",{self:this},this.onPaginationClick),a=s("<li/>").append(i);0==n&&a.addClass("active"),e.append(a)}return e},n.prototype.onPaginationClick=function(t){t.preventDefault();var e=t.data.self,n=s(this),i=n.attr("href");e.$body.find(".lunr-search-results-page").removeClass("active"),e.$body.find(i).addClass("active"),e.$pagination.find("li").removeClass("active"),n.closest("li").addClass("active")},n.prototype.start=function(t){var a=this;return this.db.search(t).then(function(t){var n=[],i=-1;s.each(t,function(t,e){t%a.limit==0&&(i=n.push([])-1),n[i].push(e)}),a.$body.empty(),s.each(n,function(t,e){var o=s("<ul/>",{class:"lunr-search-results-page",id:"lunr-search-result-page-"+t});0==t&&o.addClass("active"),s.each(e,function(t,e){var n=e.kind;"function"===n&&(n="method");var i=s("<li/>"),a=s("<a/>",{href:e.id,class:"lunr-search-result-title"}).html(e.title).prepend(s("<span/>",{class:"lunr-search-result-kind",text:e.kind+": "}));i.append(a),i.append(s("<p/>",{class:"lunr-search-result-url"}).text(a.prop("href"))),i.append(s("<p/>",{class:"lunr-search-result-summary"}).text(e.summary)),o.append(i)}),a.$body.append(o)}),a.$pagination.length&&a.$pagination.remove(),a.$pagination=a.$createPagination(n.length),a.$footer.prepend(a.$pagination),a.$modal.modal({show:!0})})},n.prototype.onKeyup=function(t){13===t.keyCode&&(t.preventDefault(),t.data.self.start(t.data.self.$input.val()))},n.prototype.onClick=function(t){t.preventDefault(),t.data.self.start(t.data.self.$input.val())},window.LunrSearch=n,"http"!==location.protocol.substr(0,4)){var i=document.createElement("script");i.type="text/javascript",i.src="js/lunr-data.js",document.body.appendChild(i),window.useLunrData=!0}s(function(){window.lunrSearch=new n})}(window.TEMPLATE_OPTIONS,jQuery),function(t,o){o(function(){o("button.code-run").on("click",function(t){var e=o(this),a=e.parent("p").next("textarea");0==a.length&&(a=o("<textarea/>",{class:"form-control dummy-console",rows:5}).insertAfter(e.parent("p")));var n=e.prev('input[type="hidden"]').val(),i=function(t,e){var n=Array.prototype.slice.call(arguments),i=a.val();o.each(n,function(t,e){0<t&&(i+=", "),i+=JSON.stringify(e)}),i+="\n",a.val(i)};new Function("console",n)({info:i,error:i,warn:i,log:i})})})}(window.TEMPLATE_OPTIONS,jQuery),function(t){var e,n,i,a,o;t.analytics&&t.analytics.ua&&t.analytics.domain&&(e=window,n=document,i="ga",e.GoogleAnalyticsObject=i,e.ga=e.ga||function(){(e.ga.q=e.ga.q||[]).push(arguments)},e.ga.l=1*new Date,a=n.createElement("script"),o=n.getElementsByTagName("script")[0],a.async=1,a.src="//www.google-analytics.com/analytics.js",o.parentNode.insertBefore(a,o),ga("create",t.analytics.ua,t.analytics.domain),ga("send","pageview"))}(window.TEMPLATE_OPTIONS);