<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[12280] sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js: Theme Directory: Bump Theme Pattern Preview cachebuster.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/12280">12280</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/12280","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>dd32</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2022-11-28 01:48:57 +0000 (Mon, 28 Nov 2022)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Theme Directory: Bump Theme Pattern Preview cachebuster.
See <a href="http://meta.trac.wordpress.org/changeset/19619">r19619</a>-dotorg, https://wordpress.slack.com/archives/C02RP4Y3K/p1669593760040609</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesjsthemejs">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesjsthememinjs">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.min.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesjsthemejs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js 2022-11-27 22:32:48 UTC (rev 12279)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js 2022-11-28 01:48:57 UTC (rev 12280)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -981,7 +981,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> var newEl = $( '<div class="wporg-screenshot-preview-js"></div>' )
</span><span class="cx" style="display: block; padding: 0 10px"> .attr( 'data-link', value.link )
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- .attr( 'data-preview-link', value.preview_link + '&v=' + self.get( 'version' ) + '-betaV2' )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .attr( 'data-preview-link', value.preview_link + '&v=' + self.get( 'version' ) + '-betaV3' )
</ins><span class="cx" style="display: block; padding: 0 10px"> .attr( 'data-caption', _wpThemeSettings.l10n.pattern_caption_template.replace( '%s', value.title ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $container.append( newEl );
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesjsthememinjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.min.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.min.js 2022-11-27 22:32:48 UTC (rev 12279)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.min.js 2022-11-28 01:48:57 UTC (rev 12280)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1 +1 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-window.wp=window.wp||{},function(o){var s,n=wp.themes=wp.themes||{};n.data=_wpThemeSettings,s=n.data.l10n,_.extend(n,{model:{},view:{},routes:{},router:{},template:wp.template}),n.utils={title:function(e,t){var i=n.data.settings.title.default;"author"===t?i=n.data.settings.title.author:"tags"===t||"browse"===t?i=n.data.settings.title.tax:"search"===t?i=n.data.settings.title.search:"theme"===t?i=n.data.settings.title.theme:"404"===t||"notfound"===t?i=n.data.settings.title.notfound:("home"===t||"home"===e&&void 0===t)&&(i=n.data.settings.title.home);e=o("<div/>").html(i.replace("%s",o("<div/>").text(e).html())).text();document.title!==e&&e.length&&(document.title=e)}},n.Model=Backbone.Model.extend({initialize:function(){var e;th
is.set({id:this.get("slug")||this.get("id")}),this.has("sections")&&(e=this.get("sections").description,this.set({description:e}))}}),n.view.Appearance=wp.Backbone.View.extend({el:"#themes .theme-browser",window:o(window),page:0,loadMore:o(".js-load-more-themes"),initialize:function(e){this.SearchView=e.SearchView||n.view.Search,this.loadMoreThemes=this.loadMoreThemes.bind(this),this.loadMore.bind("click",this.loadMoreThemes)},render:function(){this.view=new n.view.Themes({collection:this.collection,parent:this}),this.search(),this.view.render(),this.$el.find(".themes").remove(),this.$el.append(this.view.el).addClass("rendered")},searchContainer:"",search:function(){var e=new this.SearchView({collection:this.collection,parent:this});e.render(),this.searchContainer.append(o.parseHTML('<label class="screen-reader-text" for="wp-filter-search-input">'+s.s
earch+"</label>")).append(e.el)},loadMoreThemes:function(){this.trigger("theme:loadMore")}}),n.Collection=Backbone.Collection.extend({model:n.Model,terms:"",queries:[],currentQuery:{page:1,request:{}},count:!1,loadingThemes:!1,doSearch:function(e){this.terms!==e&&(this.terms=e,0<this.terms.length&&this.search(this.terms),""===this.terms&&this.reset(n.data.themes),this.trigger("themes:update"))},search:function(t){var i,e,s,r,a;this.reset(n.data.themes,{silent:!0}),t=(t=t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")).replace(/ /g,")(?=.*"),i=new RegExp("^(?=.*"+t+").+","i"),0===(e=this.filter(function(e){return s=e.get("name").replace(/(<([^>]+)>)/gi,""),r=e.get("description").replace(/(<([^>]+)>)/gi,""),a=e.get("author").replace(/(<([^>]+)>)/gi,""),a=_.union([s,e.get
("id"),r,a,e.get("tags")]),i.test(e.get("author"))&&2<t.length&&e.set("displayAuthor",!0),i.test(a)})).length?this.trigger("query:empty"):o("body").removeClass("no-results"),this.reset(e)},paginate:function(e){var t=this;return e=e||0,t=_(t.rest(n.data.settings.postsPerPage*e)),t=_(t.first(n.data.settings.postsPerPage))},query:function(t){var e,i,s,r=this.queries,a=this;if(this.currentQuery.request=t,e=_.find(r,function(e){return _.isEqual(e.request,t)}),(i=_.has(t,"page"))||(this.currentQuery.page=1),e||i){if(i)return this.apiCall(t,i).done(function(e){a.add(e.themes),a.trigger("themes:rerender"),a.trigger("query:success",e.info.results),a.loadingThemes=!1}).fail(function(){a.trigger("query:fail")});0===e.themes.length?a.trigger("query:empty"):o("body").removeClass("no-results"),_.isNumber(e.total)&&(this.count=e.tota
l),this.reset(e.themes),e.total||(this.count=this.length),this.trigger("themes:update"),this.trigger("query:success",this.count)}else this.apiCall(t).done(function(e){e.themes&&(a.reset(e.themes),s=e.info.results,r.push({themes:e.themes,request:t,total:s})),a.trigger("themes:update"),a.trigger("query:success",s),e.themes&&0===e.themes.length&&a.trigger("query:empty")}).fail(function(){a.trigger("query:fail")})},apiCall:function(e,t){var i,s=n.data.settings.apiEndpoint,e=_.extend({per_page:n.data.settings.postsPerPage,locale:n.data.settings.locale,fields:{description:!0,sections:!1,tested:!0,requires:!0,downloaded:!1,downloadlink:!0,last_updated:!0,homepage:!0,theme_url:!0,parent:!0,tags:!0,rating:!0,ratings:!0,num_ratings:!0,extended_author:!0,photon_screenshots:!0,active_installs:!0,requires_php:!0}},e);return"api.wordpress.org"===new URL(s).hostname&&(e={action:"query_themes&
quot;,request:e}),i={type:"GET",url:s,jsonp:"callback",dataType:"jsonp",data:e,beforeSend:function(){t||o("body").addClass("loading-content").removeClass("no-results")}},o.Deferred(function(t){o.ajax(i).done(function(e){t.resolveWith(this,[e])}).fail(function(){t.rejectWith(this,arguments)})}).promise()}}),n.view.Theme=wp.Backbone.View.extend({className:"theme",state:"grid",html:wp.themes.template("theme"),events:{click:"expand",keydown:"expand",touchend:"expand",keyup:"addFocus",touchmove:"preventExpand"},touchDrag:!1,render:function(){var e=this.model.toJSON();e.permalink=n.data.settings.path+n.router.baseUrl(e.slug),e.path=n.data.settings.path,this.$el.html(this.html(e)).attr({tabindex:0,"aria-describedby":e.id+"-action "+e.id+"-name"})},addFocus:function(){var e=o(":focus").hasClass("theme")?
o(":focus"):o(":focus").parents(".theme");o(".theme.focus").removeClass("focus"),e.addClass("focus")},expand:function(e){if(!(!0===(e=e||window.event).metaKey|e.ctrlKey&&"click"===e.type||"keydown"===e.type&&13!==e.which&&32!==e.which))return!0===this.touchDrag?this.touchDrag=!1:void(o(e.target).is(".theme-actions a")||(n.focusedTheme=this.$el,this.trigger("theme:expand",this.model.cid),e.preventDefault()))},preventExpand:function(){this.touchDrag=!0}}),n.view.Details=wp.Backbone.View.extend({className:"theme-overlay",events:{click:"collapse","click .left":"previousTheme","click .right":"nextTheme","click .screenshot":"preview","click .theme-actions .button-secondary":"preview","keydown .theme-actions .button-secondary":"preview","touchen
d .theme-actions .button-secondary":"preview","click .favorite":"favourite_toggle","click #theme-patterns-grid-js .wporg-screenshot-card":"preview","click .wporg-horizontal-slider-js .wporg-screenshot-card":"thumbnailPreview","keydown .wporg-horizontal-slider-js .wporg-screenshot-card":"thumbnailPreview"},html:n.template("theme-single"),render:function(){var e=this.model.toJSON(),t=new Date;t.setUTCFullYear(e.last_updated.substring(0,4),e.last_updated.substring(5,7)-1,e.last_updated.substring(8,10)),e.last_updated=t.toLocaleDateString(s.locale,{day:"numeric",month:"long",year:"numeric"}),e.is_outdated=t.setYear(t.getYear()+1902).valueOf()<(new Date).valueOf(),e.tags=_.map(e.tags,function(e,t){e=s.tags[t]||e;return'<a href="'+n.data.settings.path+n.router.baseUrl("tags/"+t)+'">'+e+"</a>"}).join(", &quo
t;),e.path=n.data.settings.path,e.active_installs<10?e.active_installs=s.active_installs_less_than_10:1e6<=e.active_installs?e.active_installs=s.active_installs_1_million:e.active_installs=e.active_installs.toLocaleString()+"+",e.show_favorites=!!n.data.settings.favorites.user,e.is_favorited=-1!==n.data.settings.favorites.themes.indexOf(e.slug),e.current_user=n.data.settings.favorites.user,this.$el.html(this.html(e)),this.navigation(),this.screenshotCheck(this.$el),this.containFocus(this.$el),this.renderDownloadsGraph(),this.renderPatterns(),this.renderStyleVariations()},favourite_toggle:function(){var e=this.$el.find(".favorite"),t=!e.hasClass("favorited"),i=this.model.get("slug");e.toggleClass("favorited"),t?n.data.settings.favorites.themes.push(i):-1<(i=n.data.settings.favorites.themes.indexOf(i))&&delete n.data.settings.favorites.themes[i];t={type:"GET",url:n.data.settings.favorites.api,jsonp:"call
back",dataType:"jsonp",data:{action:t?"add-favorite":"remove-favorite",theme:this.model.get("slug"),_wpnonce:n.data.settings.favorites.nonce}};o.ajax(t).done(function(e){void 0!==e.error&&"not_logged_in"===e.error&&(n.data.settings.favorites.themes=[],n.data.settings.favorites.user="")})},preview:function(e){var t,i,s=this,r=this.model.attributes.preview_url,a=document.activeElement;if(!0===this.touchDrag)return this.touchDrag=!1;o(e.target).hasClass("button-primary")||"keydown"===e.type&&13!==e.which&&32!==e.which||"keydown"===e.type&&13!==e.which&&o(":focus").hasClass("button")||((e=e||window.event).preventDefault(),n.focusedTheme=this.$el,(e=o(e.target).closest("a")[0])&&e.classList.contains("wporg-screenshot-card")&&(this.model.attributes.preview_url=e.href.replace("&preview
","")),(i=new n.view.Preview({model:this.model})).render(),this.setNavButtonsState(),n.data.settings.isMobile?i.$el.addClass("wp-full-overlay collapsed"):i.$el.addClass("wp-full-overlay expanded"),o(".theme-install-overlay").append(i.el),this.listenTo(i,"theme:next",function(){return this.trigger("theme:next"),t=s.model,_.isUndefined(s.current)||(t=s.current),s.current=s.model.collection.at(s.model.collection.indexOf(t)+1),_.isUndefined(s.current)?(s.options.parent.parent.trigger("theme:end"),s.current=t):(i.model=s.current,i.render(),this.setNavButtonsState(),void o(".next-theme").focus())}).listenTo(i,"theme:previous",function(){this.trigger("theme:previous"),t=s.model,0!==s.model.collection.indexOf(s.current)&&(_.isUndefined(s.current)||(t=s.current),s.current=s.model.collection.at(s.model.collection.indexOf(t)-1),_.isUndefined(s.current)||(i.model=s.current,i.render()
,this.setNavButtonsState(),o(".previous-theme").focus()))}),this.listenTo(i,"preview:close",function(){s.model.attributes.preview_url=r,s.current=s.model,a&&a.focus()}))},thumbnailPreview:function(e){var t,i,s,r,a;"keydown"===e.type&&13!==e.which&&32!==e.which||(e.preventDefault(),"a"!==(t=o(e.target)).prop("tagName").toLowerCase()&&(t=o(t.parent("a")[0])),i=o(".screenshot"),s="wporg-screenshot-card__active",r="wporg-thumbnail-screenshot-preview-js",a="style-variation",(e=o(".wporg-horizontal-slider-js .wporg-screenshot-card")).attr("aria-selected",!1),t.attr("aria-selected",!0),0===e.index(t)?(i.find("picture").show(),i.removeClass(a),o("."+r).remove()):(e=o('<div class="'+r+'" role="tabpanel"></div>').attr("data-link",t.attr("href")).attr("data-p
review-link",t.attr("href")+"&v="+this.model.attributes.version+"-betaV2").attr("data-caption",_wpThemeSettings.l10n.pattern_caption_template.replace("%s",t.find("img").attr("alt"))).attr("data-height",i.height()+"px").attr("data-aspect-ratio",.75).attr("data-query-string","?vpw=1200&vph=900").attr("id",t.attr("aria-controls")),i.find("picture").hide(),i.addClass(a),o("."+r).remove(),i.append(e),window.__wporg_screenshot_preview_render&&window.__wporg_screenshot_preview_render(r)),o("."+s).removeClass(s),t.addClass(s),this.model.attributes.preview_url=t.attr("href"))},setNavButtonsState:function(){var e=o(".theme-install-overlay"),t=_.isUndefined(this.current)?this.model:this.current;0===this.model.collection.indexOf(t)&&e.find(".previous-theme").addClass(&q
uot;disabled"),_.isUndefined(this.model.collection.at(this.model.collection.indexOf(t)+1))&&e.find(".next-theme").addClass("disabled")},containFocus:function(t){var e=window.event;void 0!==e&&1!==o(e.target).closest(".theme").length||_.delay(function(){o(".theme-wrap a.button-primary:visible").focus()},500),t.on("keydown.wp-themes",function(e){9===e.which&&o(e.target).is("button.close")&&e.shiftKey&&(t.find(".theme-tags a:last-child").focus(),e.preventDefault())})},collapse:function(e){var t,i,s,r=this,a={};1!==n.data.themes.length&&(e=e||window.event,!o(e.target).is(".close")&&27!==e.keyCode||(o("body").addClass("closing-overlay"),r.unmountReactAssets(),this.$el.fadeOut(1,function(){o("body").removeClass("closing-overlay"),r.closeOverlay(),t=document.body.scrollTop,(s=n.Collection.prototype.currentQuery.
request.author)?(n.router.navigate(n.router.baseUrl("author/"+s)),n.utils.title(s,"author")):(s=n.Collection.prototype.currentQuery.request.search)?(n.router.navigate(n.router.baseUrl(n.router.searchPath+s)),n.utils.title(s,"search")):(i=n.view.Installer.prototype.filtersChecked())?(n.router.navigate(n.router.baseUrl("tags/"+i.join("+"))),n.utils.title(_.each(i,function(e,t){i[t]=o('label[for="filter-id-'+e+'"]').text()})[0],"tags")):(s=o(".filter-links .current"))&&(s.length||(s=o('.filter-links [data-sort="'+n.data.settings.browseDefault+'"]'),a={trigger:!0}),n.data.settings.browseDefault===s.data("sort")?(n.router.navigate(n.router.baseUrl("/"),a),n.utils.title("home")):(n.router.navigate(n.router.baseUrl(n.router.browsePath+s.data("sort")),a),n.utils.title(s.text(),"browse"))),document.body.scrollTop=t,n.focusedTheme&&n.focus
edTheme.focus()})))},renderDownloadsGraph:function(){var t=this;o.getJSON("https://api.wordpress.org/stats/themes/1.0/downloads.php?slug="+t.model.get("id")+"&limit=260&callback=?",function(e){google.charts.setOnLoadCallback(function(){var i=new google.visualization.DataTable,s=0;i.addColumn("string",_wpThemeSettings.l10n.date),i.addColumn("number",_wpThemeSettings.l10n.downloads),o.each(e,function(e,t){i.addRow(),i.setValue(s,0,new Date(e).toLocaleDateString()),i.setValue(s,1,Number(t)),s++}),new google.visualization.ColumnChart(document.getElementById("theme-download-stats-"+t.model.get("id"))).draw(i,{colors:["#253578"],legend:{position:"none"},titlePosition:"in",axisTitlesPosition:"in",chartArea:{height:280,left:35,width:"98%"},hAxis:{textStyle:{color:"black",fontSize:9}},vAxis:{format:"###,###",textPosition:"out",viewWindo
wMode:"explicit",viewWindow:{min:0}},bar:{groupWidth:100<i.getNumberOfRows()?"100%":null},height:350})})})},renderPatterns:function(){var e={type:"GET",url:"https://wp-themes.com/"+this.model.get("slug")+"/?rest_route=/wporg-patterns/v1/patterns"},s=this.model;function r(i,e){o.each(e,function(e,t){t=o('<div class="wporg-screenshot-preview-js"></div>').attr("data-link",t.link).attr("data-preview-link",t.preview_link+"&v="+s.get("version")+"-betaV2").attr("data-caption",_wpThemeSettings.l10n.pattern_caption_template.replace("%s",t.title));i.append(t)}),window.__wporg_screenshot_preview_render&&window.__wporg_screenshot_preview_render()}o.ajax(e).done(function(e){var t=o("#theme-patterns-grid-js"),i=o("#theme-patterns-button-js"),s=JSON.parse(e);s.length&&(o("#theme-patterns-js").sho
w(),e=s.slice(0,9),r(t,e),9<s.length&&(i.show(),i.on("click",function(e){e.preventDefault();e=s.slice(9);r(t,e),t.find(".wporg-screenshot-card")[9].focus(),i.hide()})))})},renderStyleVariations:function(){var e={type:"GET",url:"https://wp-themes.com/"+this.model.get("slug")+"/?rest_route=/wporg-styles/v1/variations"},s=this.model;o.ajax(e).done(function(e){var i,t=o(".wporg-horizontal-slider-js"),e=JSON.parse(e);e.length&&(i=[],o.each(e,function(e,t){i.push({title:t.title,link:t.link,previewLink:t.preview_link+"&v="+s.get("version")+"-betaV1.1.2",caption:_wpThemeSettings.l10n.style_variation_caption_template.replace("%s",t.title)})}),t.attr("data-items",JSON.stringify(i)),t.attr("data-title",_wpThemeSettings.l10n.style_variations_title),window.__wporg_horizontal_slider_render&&window.__wporg_horizontal_slider_render())})},un
mountReactAssets:function(){ReactDOM&&ReactDOM.unmountComponentAtNode&&(o(".wporg-horizontal-slider-js").each(function(){ReactDOM.unmountComponentAtNode(this)}),o(".wporg-screenshot-preview-js").each(function(){ReactDOM.unmountComponentAtNode(this)}),o(".wporg-thumbnail-screenshot-preview-js").each(function(){ReactDOM.unmountComponentAtNode(this)}))},navigation:function(){this.model.cid===this.model.collection.at(0).cid&&this.$el.find(".left").addClass("disabled"),this.model.cid===this.model.collection.at(this.model.collection.length-1).cid&&this.$el.find(".right").addClass("disabled")},closeOverlay:function(){o("body").removeClass("modal-open"),this.remove(),this.unbind(),this.trigger("theme:collapse")},nextTheme:function(){return this.trigger("theme:next",this.model.cid),!1},previousTheme:function(){return this.trigger("theme:previous&q
uot;,this.model.cid),!1},screenshotCheck:function(e){(new Image).src=e.find(".screenshot img").attr("src")}}),n.view.Preview=n.view.Details.extend({className:"wp-full-overlay expanded",el:".theme-install-overlay",events:{"click .close-full-overlay":"close","click .collapse-sidebar":"collapse","click .previous-theme":"previousTheme","click .next-theme":"nextTheme","click .wp-full-overlay-footer .devices button":"devicePreview",keyup:"keyEvent"},html:n.template("theme-preview"),render:function(){var e=this.model.toJSON();this.$el.html(this.html(e)),n.router.navigate(n.router.baseUrl(n.router.themePath+this.model.get("id"))),this.$el.fadeIn(200,function(){o("body").addClass("theme-installer-active full-overlay-active"),o(".close-full-overlay").focus()}),n.activeDevicePreview&&this.
setDevicePreview(n.activeDevicePreview)},close:function(){return this.$el.fadeOut(200,function(){o("body").removeClass("theme-installer-active full-overlay-active"),n.focusedTheme&&n.focusedTheme.focus()}),this.trigger("preview:close"),this.undelegateEvents(),this.unbind(),n.router.navigate(n.router.baseUrl(n.router.themePath+this.model.get("id"))),!1},collapse:function(){return this.$el.toggleClass("collapsed"),n.data.settings.isMobile?this.$el.removeClass("expanded"):this.$el.toggleClass("expanded"),!1},devicePreview:function(e){return this.setDevicePreview(e.target.dataset.device)},setDevicePreview:function(e){var t=this.$el.find(".wp-full-overlay-footer");return t.find(".active").removeClass("active"),t.find("."+e).addClass("active"),this.$el.find(".wp-full-overlay-main iframe").removeClass(n.activeDevicePreview).addClass(e),n.activeDevicePrev
iew=e,!1},keyEvent:function(){return 27===event.keyCode&&(this.undelegateEvents(),this.close()),39===event.keyCode&&_.once(this.nextTheme()),37===event.keyCode&&this.previousTheme(),!1}}),n.view.Themes=wp.Backbone.View.extend({className:"themes",$overlay:o("div.theme-overlay"),index:0,count:o(".wp-filter .theme-count"),initialize:function(e){var t=this;this.parent=e.parent,this.setView("grid"),this.listenTo(t.collection,"themes:update",function(){t.parent.page=0,t.render(this)}),this.listenTo(t.collection,"query:success",function(e){_.isNumber(e)?t.count.text(e.toLocaleString()):t.count.text(t.collection.length.toLocaleString())}),this.listenTo(t.collection,"query:empty",function(){o("body").addClass("no-results")}),this.listenTo(this.parent,"theme:loadMore",function(){t.renderThemes(t.parent.page)}),this.listenTo(t.collection,"themes:rerender",functi
on(){t.renderThemes(t.parent.page)}),this.listenTo(this.parent,"theme:close",function(){t.overlay&&t.overlay.closeOverlay()}),o("body").on("keyup",function(e){t.overlay&&(39===e.keyCode&&t.overlay.nextTheme(),37===e.keyCode&&t.overlay.previousTheme(),27===e.keyCode&&t.overlay.collapse(e))})},render:function(){this.$el.empty(),1===n.data.themes.length&&(this.singleTheme=new n.view.Details({model:this.collection.models[0]}),this.singleTheme.render(),this.$el.addClass("single-theme"),this.$el.append(this.singleTheme.el)),0<this.options.collection.size()&&this.renderThemes(this.parent.page),this.count.text(this.collection.count||this.collection.length)},renderThemes:function(e){var t=this;t.instance=t.collection.paginate(e),0!==t.instance.size()?(1<=e&&o(".add-new-theme").remove(),t.instance.each(function(e){t.theme=new n.view.Theme({model:e,parent:t}),t.theme.render()
,t.$el.append(t.theme.el),t.listenTo(t.theme,"theme:expand",t.expand,t)}),this.parent.page++):this.parent.trigger("theme:end")},setView:function(e){return e},expand:function(e){var t=this;this.model=t.collection.get(e),_.isUndefined(this.model)||(n.router.navigate(n.router.baseUrl(n.router.themePath+this.model.id)),n.utils.title(this.model.attributes.name,"theme"),this.setView("detail"),o("body").addClass("modal-open"),this.overlay=new n.view.Details({model:t.model}),this.overlay.render(),this.$overlay.html(this.overlay.el),this.listenTo(this.overlay,"theme:next",function(){t.next([t.model.cid]),o(".theme-header").find(".right").focus()}).listenTo(this.overlay,"theme:previous",function(){t.previous([t.model.cid]),o(".theme-header").find(".left").focus()}))},next:function(e){var e=this.collection.get(e[0]),e=this.collection.at(this.collection.indexOf(e)+1);void 0!==
e&&this.theme.trigger("theme:expand",e.cid)},previous:function(e){var e=this.collection.get(e[0]),e=this.collection.at(this.collection.indexOf(e)-1);void 0!==e&&this.theme.trigger("theme:expand",e.cid)}}),n.view.Search=wp.Backbone.View.extend({tagName:"input",className:"wp-filter-search",id:"wp-filter-search-input",searching:!1,attributes:{placeholder:s.searchPlaceholder,type:"search"},events:{keyup:"search",search:"search"},initialize:function(e){this.parent=e.parent,this.listenTo(this.parent,"theme:close",function(){this.searching=!1})},search:function(e){("keyup"!==e.type||9!==e.which&&16!==e.which)&&(this.collection=this.options.parent.view.collection,"keyup"===e.type&&27===e.which&&(e.target.value=""),_.debounce(_.bind(this.doSearch,this),300)(e.target.value))},doSearch:_.debounce(function(e){var t={};n.view.Inst
aller.prototype.clearFilters(jQuery.Event("click")),"author:"===(t.search=e).substring(0,7)&&(t.search="",t.author=e.slice(7)),"tag:"===e.substring(0,4)&&(t.search="",t.tag=[e.slice(4)]),o(".filter-links li > a.current").removeClass("current"),o("body").removeClass("show-filters filters-applied"),e?(n.utils.title(e,"search"),n.router.navigate(n.router.baseUrl(n.router.searchPath+e),{replace:!0})):(delete t.search,t.browse=n.data.settings.browseDefault,n.utils.title("home"),n.router.navigate(n.router.baseUrl("/"),{replace:!0})),this.collection.query(t)},300)}),n.view.Installer=n.view.Appearance.extend({el:"#themes",events:{"click .filter-links li > a":"onSort","click .theme-filter":"onFilter","click .drawer-toggle":"moreFilters","click .filter-drawer .apply-filters"
:"applyFilters",'click .filter-group [type="checkbox"]':"addFilter","click .filter-drawer .clear-filters":"clearFilters","click .filtered-by":"backToFilters"},activeClass:"current",searchContainer:o(".wp-filter .search-form"),initialize:function(){n.view.Appearance.prototype.initialize.apply(this,arguments),this.sortValues=o(".filter-links li > a").map(function(){return o(this).data("sort")}).get()},render:function(){var i=this;this.search(),this.collection=new n.Collection,this.listenTo(this,"theme:end",function(){i.collection.loadingThemes||o("body").hasClass("modal-open")||i.collection.length<n.data.settings.postsPerPage||(i.collection.loadingThemes=!0,i.collection.currentQuery.page++,_.extend(i.collection.currentQuery.request,{page:i.collection.currentQuery.page}),i.collection.query(i.collection.currentQuery.request))}),this.listenTo(t
his.collection,"query:success",function(e){var t;o("body").removeClass("loading-content"),o(".theme-browser").find("div.error").remove(),1<i.page&&(t=1+(i.page-1)*n.data.settings.postsPerPage,this.$el.find(".theme:nth-child("+t+")").focus()),(e=!_.isNumber(e)?i.collection.count:e)<=i.collection.length?i.loadMore.hide():i.loadMore.show()}),this.listenTo(this.collection,"query:fail",function(){o("body").removeClass("loading-content"),o(".theme-browser").find("div.error").remove(),o(".theme-browser").find("div.themes").before('<div class="error"><p>'+s.error+"</p></div>")}),this.view&&this.view.remove(),this.view=new n.view.Themes({collection:this.collection,parent:this}),this.page=0,this.$el.find(".themes").remove(),this.view.render(),this.$el.find(".theme-browser&quo
t;).append(this.view.el).addClass("rendered")},browse:function(e){"favorites"===e?this.collection.query({browse:e,user:n.data.settings.favorites.user}):this.collection.query({browse:e})},onSort:function(e){var t=o(e.target),i=t.data("sort");e.preventDefault(),i||!t.data("tag")?(o("body").removeClass("filters-applied show-filters"),t.hasClass(this.activeClass)||(this.sort(i),n.data.settings.browseDefault===i?n.router.navigate(n.router.baseUrl("/")):n.router.navigate(n.router.baseUrl(n.router.browsePath+i)))):n.router.trigger("route:tag",t.data("tag"))},sort:function(e){var t=this,i=!1;-1!==_.indexOf(this.sortValues,e)&&(i=o('.filter-links [data-sort="'+e+'"]')),t.clearSearch(),_.each(o(".filter-group").find(":checkbox").filter(":checked"),function(e){return o(e).prop("checked",!1),t.filtersChecked()}),o(".filter-links li > a, .the
me-filter").removeClass(this.activeClass),i&&i.length?(i.addClass(this.activeClass),n.data.settings.browseDefault===e?n.utils.title("home"):n.utils.title(i.text(),"browse"),this.browse(e)):n.utils.title("404","notfound")},onFilter:function(e){var t=o(e.target),e=t.data("filter");t.hasClass(this.activeClass)||(o(".filter-links li > a, .theme-section").removeClass(this.activeClass),t.addClass(this.activeClass),e&&(e=_.union([e,this.filtersChecked()]),this.collection.query({tag:[e]})))},addFilter:function(){this.filtersChecked()},applyFilters:function(e){var t,i=[],s=this.filtersChecked(),r={tag:s},a=o(".filtered-by .tags");e&&e.preventDefault(),s&&(o("body").addClass("filters-applied"),o(".filter-links li > a.current").removeClass("current"),a.empty(),_.each(s,function(e){t=o('label[for="filter-id-'+e+'"]').text(),i.push(t),
a.append('<span class="tag">'+t+"</span>"),o('.filter-links li > a[data-tag="'+e+'"]').addClass("current")}),n.router.navigate(n.router.baseUrl("tags/"+s.join("+"))),n.utils.title(i[0],"tags"),this.collection.query(r))},filtersChecked:function(){var e=o(".filter-group").find(":checkbox").filter(":checked"),t=o(".filter-drawer"),i=[];return _.each(e,function(e){i.push(o(e).prop("value"))}),0===i.length?(t.find(".apply-filters").prop("disabled",!0).find("span").text(""),t.find(".clear-filters").hide(),o("body").removeClass("filters-applied"),!1):(t.find(".apply-filters").prop("disabled",!1).find("span").text(i.length),t.find(".clear-filters").css("display","inline-block"),i)},moreFilters:function(e){return e.preventDefault()
,o("body").hasClass("filters-applied")?this.backToFilters():o("body").hasClass("show-filters")&&this.filtersChecked()?this.addFilter():(this.clearSearch(),void o("body").toggleClass("show-filters"))},clearFilters:function(e){var t=o(".filter-group").find(":checkbox"),i=this;e.preventDefault(),_.each(t.filter(":checked"),function(e){return o(e).prop("checked",!1),i.filtersChecked()})},backToFilters:function(e){e&&e.preventDefault(),o("body").removeClass("filters-applied")},clearSearch:function(){o("#wp-filter-search-input").val("")}}),n.Router=Backbone.Router.extend({routes:{"browse/:sort(/page/:page)(/)":"sort","tags/:tag(/page/:page)(/)":"tag","search/:query(/page/:page)(/)":"search","author/:author(/page/:page)(/)":"author",":slug(/)":&quo
t;preview","":"sort"},baseUrl:function(e){return"/"===e?e="/#":0!==e.length&&(e+="/"),e},themePath:"",browsePath:"browse/",searchPath:"search/",search:function(e){o(".wp-filter-search").val(e)},navigate:function(){Backbone.history._hasPushState&&Backbone.Router.prototype.navigate.apply(this,arguments)}}),n.History=Backbone.History.extend({getFragment:function(){return Backbone.History.prototype.getFragment.apply(this,arguments).replace(/\?.*/,"")}}),n.Run={init:function(){this.view=new n.view.Installer({section:n.data.settings.browseDefault,SearchView:n.view.Search}),Backbone.history=new n.History,this.render()},render:function(){this.view.render(),this.routes(),Backbone.history.start({root:n.data.settings.path,pushState:!0,hashChange:!1})},routes:function(){var i=this,s={};n.router=new n.Router,n.router.on("route:preview",function(e){i.view.collection.q
ueries.push(n.data.query),s.theme=e,i.view.collection.query(s),i.view.view.expand(e)}),n.router.on("route:sort",function(e,t){t&&n.router.navigate("browse/"+e+"/",{replace:!0}),i.view.collection.queries.push(n.data.query),e=e||n.data.settings.browseDefault,i.view.sort(e),i.view.trigger("theme:close")}),n.router.on("route:search",function(e,t){t&&n.router.navigate("search/"+e+"/",{replace:!0}),i.view.collection.queries.push(n.data.query),o(".wp-filter-search").focus().trigger("keyup"),i.view.trigger("theme:close")}),n.router.on("route:tag",function(e,t){t&&n.router.navigate("tags/"+e+"/",{replace:!0}),i.view.collection.queries.push(n.data.query),_.each(e.split("+"),function(e){e=e.toLowerCase().replace(/[^a-z-]/g,""),o("#filter-id-"+e).prop("checked",!0)}),o("body").removeClass("
;show-filters").addClass("show-filters"),i.view.applyFilters(),i.view.trigger("theme:close")}),n.router.on("route:author",function(e,t){t&&n.router.navigate("author/"+e+"/",{replace:!0}),i.view.collection.queries.push(n.data.query),s.author=e,i.view.collection.query(s),n.utils.title(e,"author"),i.view.trigger("theme:close")})}},o(function(){n.Run.init()})}(jQuery),google.charts.load("current",{packages:["corechart"]});
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+window.wp=window.wp||{},function(o){var s,n=wp.themes=wp.themes||{};n.data=_wpThemeSettings,s=n.data.l10n,_.extend(n,{model:{},view:{},routes:{},router:{},template:wp.template}),n.utils={title:function(e,t){var i=n.data.settings.title.default,t=("author"===t?i=n.data.settings.title.author:"tags"===t||"browse"===t?i=n.data.settings.title.tax:"search"===t?i=n.data.settings.title.search:"theme"===t?i=n.data.settings.title.theme:"404"===t||"notfound"===t?i=n.data.settings.title.notfound:("home"===t||"home"===e&&void 0===t)&&(i=n.data.settings.title.home),o("<div/>").html(i.replace("%s",o("<div/>").text(e).html())).text());document.title!==t&&t.length&&(document.title=t)}},n.Model=Backbone.Model.extend({initialize:function(){var e;
this.set({id:this.get("slug")||this.get("id")}),this.has("sections")&&(e=this.get("sections").description,this.set({description:e}))}}),n.view.Appearance=wp.Backbone.View.extend({el:"#themes .theme-browser",window:o(window),page:0,loadMore:o(".js-load-more-themes"),initialize:function(e){this.SearchView=e.SearchView||n.view.Search,this.loadMoreThemes=this.loadMoreThemes.bind(this),this.loadMore.bind("click",this.loadMoreThemes)},render:function(){this.view=new n.view.Themes({collection:this.collection,parent:this}),this.search(),this.view.render(),this.$el.find(".themes").remove(),this.$el.append(this.view.el).addClass("rendered")},searchContainer:"",search:function(){var e=new this.SearchView({collection:this.collection,parent:this});e.render(),this.searchContainer.append(o.parseHTML('<label class="screen-reader-text" for="wp-filter-search-input">'+s
.search+"</label>")).append(e.el)},loadMoreThemes:function(){this.trigger("theme:loadMore")}}),n.Collection=Backbone.Collection.extend({model:n.Model,terms:"",queries:[],currentQuery:{page:1,request:{}},count:!1,loadingThemes:!1,doSearch:function(e){this.terms!==e&&(this.terms=e,0<this.terms.length&&this.search(this.terms),""===this.terms&&this.reset(n.data.themes),this.trigger("themes:update"))},search:function(t){var i,e,s,r,a;this.reset(n.data.themes,{silent:!0}),t=(t=t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")).replace(/ /g,")(?=.*"),i=new RegExp("^(?=.*"+t+").+","i"),0===(e=this.filter(function(e){return s=e.get("name").replace(/(<([^>]+)>)/gi,""),r=e.get("description").replace(/(<([^>]+)>)/gi,""),a=e.get("author").replace(/(<([^>]+)>)/gi,""),s=_.union([s,e.g
et("id"),r,a,e.get("tags")]),i.test(e.get("author"))&&2<t.length&&e.set("displayAuthor",!0),i.test(s)})).length?this.trigger("query:empty"):o("body").removeClass("no-results"),this.reset(e)},paginate:function(e){var t=this;return e=e||0,t=_(t.rest(n.data.settings.postsPerPage*e)),t=_(t.first(n.data.settings.postsPerPage))},query:function(t){var e,i,s,r=this.queries,a=this;if(this.currentQuery.request=t,e=_.find(r,function(e){return _.isEqual(e.request,t)}),(i=_.has(t,"page"))||(this.currentQuery.page=1),e||i){if(i)return this.apiCall(t,i).done(function(e){a.add(e.themes),a.trigger("themes:rerender"),a.trigger("query:success",e.info.results),a.loadingThemes=!1}).fail(function(){a.trigger("query:fail")});0===e.themes.length?a.trigger("query:empty"):o("body").removeClass("no-results"),_.isNumber(e.total)&&(this.count=e.to
tal),this.reset(e.themes),e.total||(this.count=this.length),this.trigger("themes:update"),this.trigger("query:success",this.count)}else this.apiCall(t).done(function(e){e.themes&&(a.reset(e.themes),s=e.info.results,r.push({themes:e.themes,request:t,total:s})),a.trigger("themes:update"),a.trigger("query:success",s),e.themes&&0===e.themes.length&&a.trigger("query:empty")}).fail(function(){a.trigger("query:fail")})},apiCall:function(e,t){var i,s=n.data.settings.apiEndpoint,e=_.extend({per_page:n.data.settings.postsPerPage,locale:n.data.settings.locale,fields:{description:!0,sections:!1,tested:!0,requires:!0,downloaded:!1,downloadlink:!0,last_updated:!0,homepage:!0,theme_url:!0,parent:!0,tags:!0,rating:!0,ratings:!0,num_ratings:!0,extended_author:!0,photon_screenshots:!0,active_installs:!0,requires_php:!0}},e);return"api.wordpress.org"===new URL(s).hostname&&(e={action:"query_theme
s",request:e}),i={type:"GET",url:s,jsonp:"callback",dataType:"jsonp",data:e,beforeSend:function(){t||o("body").addClass("loading-content").removeClass("no-results")}},o.Deferred(function(t){o.ajax(i).done(function(e){t.resolveWith(this,[e])}).fail(function(){t.rejectWith(this,arguments)})}).promise()}}),n.view.Theme=wp.Backbone.View.extend({className:"theme",state:"grid",html:wp.themes.template("theme"),events:{click:"expand",keydown:"expand",touchend:"expand",keyup:"addFocus",touchmove:"preventExpand"},touchDrag:!1,render:function(){var e=this.model.toJSON();e.permalink=n.data.settings.path+n.router.baseUrl(e.slug),e.path=n.data.settings.path,this.$el.html(this.html(e)).attr({tabindex:0,"aria-describedby":e.id+"-action "+e.id+"-name"})},addFocus:function(){var e=o(":focus").hasClass("theme"
)?o(":focus"):o(":focus").parents(".theme");o(".theme.focus").removeClass("focus"),e.addClass("focus")},expand:function(e){if(!(!0===(e=e||window.event).metaKey|e.ctrlKey&&"click"===e.type||"keydown"===e.type&&13!==e.which&&32!==e.which))return!0===this.touchDrag?this.touchDrag=!1:void(o(e.target).is(".theme-actions a")||(n.focusedTheme=this.$el,this.trigger("theme:expand",this.model.cid),e.preventDefault()))},preventExpand:function(){this.touchDrag=!0}}),n.view.Details=wp.Backbone.View.extend({className:"theme-overlay",events:{click:"collapse","click .left":"previousTheme","click .right":"nextTheme","click .screenshot":"preview","click .theme-actions .button-secondary":"preview","keydown .theme-actions .button-secondary":"preview","touch
end .theme-actions .button-secondary":"preview","click .favorite":"favourite_toggle","click #theme-patterns-grid-js .wporg-screenshot-card":"preview","click .wporg-horizontal-slider-js .wporg-screenshot-card":"thumbnailPreview","keydown .wporg-horizontal-slider-js .wporg-screenshot-card":"thumbnailPreview"},html:n.template("theme-single"),render:function(){var e=this.model.toJSON(),t=new Date;t.setUTCFullYear(e.last_updated.substring(0,4),e.last_updated.substring(5,7)-1,e.last_updated.substring(8,10)),e.last_updated=t.toLocaleDateString(s.locale,{day:"numeric",month:"long",year:"numeric"}),e.is_outdated=t.setYear(t.getYear()+1902).valueOf()<(new Date).valueOf(),e.tags=_.map(e.tags,function(e,t){e=s.tags[t]||e;return'<a href="'+n.data.settings.path+n.router.baseUrl("tags/"+t)+'">'+e+"</a>"}).join(", &q
uot;),e.path=n.data.settings.path,e.active_installs<10?e.active_installs=s.active_installs_less_than_10:1e6<=e.active_installs?e.active_installs=s.active_installs_1_million:e.active_installs=e.active_installs.toLocaleString()+"+",e.show_favorites=!!n.data.settings.favorites.user,e.is_favorited=-1!==n.data.settings.favorites.themes.indexOf(e.slug),e.current_user=n.data.settings.favorites.user,this.$el.html(this.html(e)),this.navigation(),this.screenshotCheck(this.$el),this.containFocus(this.$el),this.renderDownloadsGraph(),this.renderPatterns(),this.renderStyleVariations()},favourite_toggle:function(){var e=this.$el.find(".favorite"),t=!e.hasClass("favorited"),i=this.model.get("slug"),i=(e.toggleClass("favorited"),t?n.data.settings.favorites.themes.push(i):-1<(e=n.data.settings.favorites.themes.indexOf(i))&&delete n.data.settings.favorites.themes[e],{type:"GET",url:n.data.settings.favorites.api,jsonp:"c
allback",dataType:"jsonp",data:{action:t?"add-favorite":"remove-favorite",theme:this.model.get("slug"),_wpnonce:n.data.settings.favorites.nonce}});o.ajax(i).done(function(e){void 0!==e.error&&"not_logged_in"===e.error&&(n.data.settings.favorites.themes=[],n.data.settings.favorites.user="")})},preview:function(e){var t,i,s=this,r=this.model.attributes.preview_url,a=document.activeElement;if(!0===this.touchDrag)return this.touchDrag=!1;o(e.target).hasClass("button-primary")||"keydown"===e.type&&13!==e.which&&32!==e.which||"keydown"===e.type&&13!==e.which&&o(":focus").hasClass("button")||((e=e||window.event).preventDefault(),n.focusedTheme=this.$el,(e=o(e.target).closest("a")[0])&&e.classList.contains("wporg-screenshot-card")&&(this.model.attributes.preview_url=e.href.replace("&pre
view","")),(i=new n.view.Preview({model:this.model})).render(),this.setNavButtonsState(),n.data.settings.isMobile?i.$el.addClass("wp-full-overlay collapsed"):i.$el.addClass("wp-full-overlay expanded"),o(".theme-install-overlay").append(i.el),this.listenTo(i,"theme:next",function(){if(this.trigger("theme:next"),t=s.model,_.isUndefined(s.current)||(t=s.current),s.current=s.model.collection.at(s.model.collection.indexOf(t)+1),_.isUndefined(s.current))return s.options.parent.parent.trigger("theme:end"),s.current=t;i.model=s.current,i.render(),this.setNavButtonsState(),o(".next-theme").focus()}).listenTo(i,"theme:previous",function(){this.trigger("theme:previous"),t=s.model,0!==s.model.collection.indexOf(s.current)&&(_.isUndefined(s.current)||(t=s.current),s.current=s.model.collection.at(s.model.collection.indexOf(t)-1),_.isUndefined(s.current)||(i.model=s.current,i.render(),t
his.setNavButtonsState(),o(".previous-theme").focus()))}),this.listenTo(i,"preview:close",function(){s.model.attributes.preview_url=r,s.current=s.model,a&&a.focus()}))},thumbnailPreview:function(e){var t,i,s,r,a;"keydown"===e.type&&13!==e.which&&32!==e.which||(e.preventDefault(),"a"!==(e=o(e.target)).prop("tagName").toLowerCase()&&(e=o(e.parent("a")[0])),t=o(".screenshot"),i="wporg-screenshot-card__active",s="wporg-thumbnail-screenshot-preview-js",r="style-variation",(a=o(".wporg-horizontal-slider-js .wporg-screenshot-card")).attr("aria-selected",!1),e.attr("aria-selected",!0),0===a.index(e)?(t.find("picture").show(),t.removeClass(r),o("."+s).remove()):(a=o('<div class="'+s+'" role="tabpanel"></div>').attr("data-link",e.attr("href")).attr("data-pre
view-link",e.attr("href")+"&v="+this.model.attributes.version+"-betaV2").attr("data-caption",_wpThemeSettings.l10n.pattern_caption_template.replace("%s",e.find("img").attr("alt"))).attr("data-height",t.height()+"px").attr("data-aspect-ratio",.75).attr("data-query-string","?vpw=1200&vph=900").attr("id",e.attr("aria-controls")),t.find("picture").hide(),t.addClass(r),o("."+s).remove(),t.append(a),window.__wporg_screenshot_preview_render&&window.__wporg_screenshot_preview_render(s)),o("."+i).removeClass(i),e.addClass(i),this.model.attributes.preview_url=e.attr("href"))},setNavButtonsState:function(){var e=o(".theme-install-overlay"),t=_.isUndefined(this.current)?this.model:this.current;0===this.model.collection.indexOf(t)&&e.find(".previous-theme").addClass(&quo
t;disabled"),_.isUndefined(this.model.collection.at(this.model.collection.indexOf(t)+1))&&e.find(".next-theme").addClass("disabled")},containFocus:function(t){var e=window.event;void 0!==e&&1!==o(e.target).closest(".theme").length||_.delay(function(){o(".theme-wrap a.button-primary:visible").focus()},500),t.on("keydown.wp-themes",function(e){9===e.which&&o(e.target).is("button.close")&&e.shiftKey&&(t.find(".theme-tags a:last-child").focus(),e.preventDefault())})},collapse:function(e){var t,i,s,r=this,a={};1!==n.data.themes.length&&(e=e||window.event,!o(e.target).is(".close")&&27!==e.keyCode||(o("body").addClass("closing-overlay"),r.unmountReactAssets(),this.$el.fadeOut(1,function(){o("body").removeClass("closing-overlay"),r.closeOverlay(),t=document.body.scrollTop,(s=n.Collection.prototype.currentQuery.re
quest.author)?(n.router.navigate(n.router.baseUrl("author/"+s)),n.utils.title(s,"author")):(s=n.Collection.prototype.currentQuery.request.search)?(n.router.navigate(n.router.baseUrl(n.router.searchPath+s)),n.utils.title(s,"search")):(i=n.view.Installer.prototype.filtersChecked())?(n.router.navigate(n.router.baseUrl("tags/"+i.join("+"))),n.utils.title(_.each(i,function(e,t){i[t]=o('label[for="filter-id-'+e+'"]').text()})[0],"tags")):(s=o(".filter-links .current"))&&(s.length||(s=o('.filter-links [data-sort="'+n.data.settings.browseDefault+'"]'),a={trigger:!0}),n.data.settings.browseDefault===s.data("sort")?(n.router.navigate(n.router.baseUrl("/"),a),n.utils.title("home")):(n.router.navigate(n.router.baseUrl(n.router.browsePath+s.data("sort")),a),n.utils.title(s.text(),"browse"))),document.body.scrollTop=t,n.focusedTheme&&n.focused
Theme.focus()})))},renderDownloadsGraph:function(){var t=this;o.getJSON("https://api.wordpress.org/stats/themes/1.0/downloads.php?slug="+t.model.get("id")+"&limit=260&callback=?",function(e){google.charts.setOnLoadCallback(function(){var i=new google.visualization.DataTable,s=0;i.addColumn("string",_wpThemeSettings.l10n.date),i.addColumn("number",_wpThemeSettings.l10n.downloads),o.each(e,function(e,t){i.addRow(),i.setValue(s,0,new Date(e).toLocaleDateString()),i.setValue(s,1,Number(t)),s++}),new google.visualization.ColumnChart(document.getElementById("theme-download-stats-"+t.model.get("id"))).draw(i,{colors:["#253578"],legend:{position:"none"},titlePosition:"in",axisTitlesPosition:"in",chartArea:{height:280,left:35,width:"98%"},hAxis:{textStyle:{color:"black",fontSize:9}},vAxis:{format:"###,###",textPosition:"out",viewWindowM
ode:"explicit",viewWindow:{min:0}},bar:{groupWidth:100<i.getNumberOfRows()?"100%":null},height:350})})})},renderPatterns:function(){var e={type:"GET",url:"https://wp-themes.com/"+this.model.get("slug")+"/?rest_route=/wporg-patterns/v1/patterns"},s=this.model;function r(i,e){o.each(e,function(e,t){t=o('<div class="wporg-screenshot-preview-js"></div>').attr("data-link",t.link).attr("data-preview-link",t.preview_link+"&v="+s.get("version")+"-betaV3").attr("data-caption",_wpThemeSettings.l10n.pattern_caption_template.replace("%s",t.title));i.append(t)}),window.__wporg_screenshot_preview_render&&window.__wporg_screenshot_preview_render()}o.ajax(e).done(function(e){var t=o("#theme-patterns-grid-js"),i=o("#theme-patterns-button-js"),s=JSON.parse(e);s.length&&(o("#theme-patterns-js").show(
),e=s.slice(0,9),r(t,e),9<s.length&&(i.show(),i.on("click",function(e){e.preventDefault();e=s.slice(9);r(t,e),t.find(".wporg-screenshot-card")[9].focus(),i.hide()})))})},renderStyleVariations:function(){var e={type:"GET",url:"https://wp-themes.com/"+this.model.get("slug")+"/?rest_route=/wporg-styles/v1/variations"},s=this.model;o.ajax(e).done(function(e){var i,t=o(".wporg-horizontal-slider-js"),e=JSON.parse(e);e.length&&(i=[],o.each(e,function(e,t){i.push({title:t.title,link:t.link,previewLink:t.preview_link+"&v="+s.get("version")+"-betaV1.1.2",caption:_wpThemeSettings.l10n.style_variation_caption_template.replace("%s",t.title)})}),e=i,t.attr("data-items",JSON.stringify(e)),t.attr("data-title",_wpThemeSettings.l10n.style_variations_title),window.__wporg_horizontal_slider_render&&window.__wporg_horizontal_slider_render())})},
unmountReactAssets:function(){ReactDOM&&ReactDOM.unmountComponentAtNode&&(o(".wporg-horizontal-slider-js").each(function(){ReactDOM.unmountComponentAtNode(this)}),o(".wporg-screenshot-preview-js").each(function(){ReactDOM.unmountComponentAtNode(this)}),o(".wporg-thumbnail-screenshot-preview-js").each(function(){ReactDOM.unmountComponentAtNode(this)}))},navigation:function(){this.model.cid===this.model.collection.at(0).cid&&this.$el.find(".left").addClass("disabled"),this.model.cid===this.model.collection.at(this.model.collection.length-1).cid&&this.$el.find(".right").addClass("disabled")},closeOverlay:function(){o("body").removeClass("modal-open"),this.remove(),this.unbind(),this.trigger("theme:collapse")},nextTheme:function(){return this.trigger("theme:next",this.model.cid),!1},previousTheme:function(){return this.trigger("theme:previous
",this.model.cid),!1},screenshotCheck:function(e){(new Image).src=e.find(".screenshot img").attr("src")}}),n.view.Preview=n.view.Details.extend({className:"wp-full-overlay expanded",el:".theme-install-overlay",events:{"click .close-full-overlay":"close","click .collapse-sidebar":"collapse","click .previous-theme":"previousTheme","click .next-theme":"nextTheme","click .wp-full-overlay-footer .devices button":"devicePreview",keyup:"keyEvent"},html:n.template("theme-preview"),render:function(){var e=this.model.toJSON();this.$el.html(this.html(e)),n.router.navigate(n.router.baseUrl(n.router.themePath+this.model.get("id"))),this.$el.fadeIn(200,function(){o("body").addClass("theme-installer-active full-overlay-active"),o(".close-full-overlay").focus()}),n.activeDevicePreview&&thi
s.setDevicePreview(n.activeDevicePreview)},close:function(){return this.$el.fadeOut(200,function(){o("body").removeClass("theme-installer-active full-overlay-active"),n.focusedTheme&&n.focusedTheme.focus()}),this.trigger("preview:close"),this.undelegateEvents(),this.unbind(),n.router.navigate(n.router.baseUrl(n.router.themePath+this.model.get("id"))),!1},collapse:function(){return this.$el.toggleClass("collapsed"),n.data.settings.isMobile?this.$el.removeClass("expanded"):this.$el.toggleClass("expanded"),!1},devicePreview:function(e){return this.setDevicePreview(e.target.dataset.device)},setDevicePreview:function(e){var t=this.$el.find(".wp-full-overlay-footer");return t.find(".active").removeClass("active"),t.find("."+e).addClass("active"),this.$el.find(".wp-full-overlay-main iframe").removeClass(n.activeDevicePreview).addClass(e),n.activeDevicePr
eview=e,!1},keyEvent:function(){return 27===event.keyCode&&(this.undelegateEvents(),this.close()),39===event.keyCode&&_.once(this.nextTheme()),37===event.keyCode&&this.previousTheme(),!1}}),n.view.Themes=wp.Backbone.View.extend({className:"themes",$overlay:o("div.theme-overlay"),index:0,count:o(".wp-filter .theme-count"),initialize:function(e){var t=this;this.parent=e.parent,this.setView("grid"),this.listenTo(t.collection,"themes:update",function(){t.parent.page=0,t.render(this)}),this.listenTo(t.collection,"query:success",function(e){_.isNumber(e)?t.count.text(e.toLocaleString()):t.count.text(t.collection.length.toLocaleString())}),this.listenTo(t.collection,"query:empty",function(){o("body").addClass("no-results")}),this.listenTo(this.parent,"theme:loadMore",function(){t.renderThemes(t.parent.page)}),this.listenTo(t.collection,"themes:rerender",func
tion(){t.renderThemes(t.parent.page)}),this.listenTo(this.parent,"theme:close",function(){t.overlay&&t.overlay.closeOverlay()}),o("body").on("keyup",function(e){t.overlay&&(39===e.keyCode&&t.overlay.nextTheme(),37===e.keyCode&&t.overlay.previousTheme(),27===e.keyCode&&t.overlay.collapse(e))})},render:function(){this.$el.empty(),1===n.data.themes.length&&(this.singleTheme=new n.view.Details({model:this.collection.models[0]}),this.singleTheme.render(),this.$el.addClass("single-theme"),this.$el.append(this.singleTheme.el)),0<this.options.collection.size()&&this.renderThemes(this.parent.page),this.count.text(this.collection.count||this.collection.length)},renderThemes:function(e){var t=this;t.instance=t.collection.paginate(e),0===t.instance.size()?this.parent.trigger("theme:end"):(1<=e&&o(".add-new-theme").remove(),t.instance.each(function(e){t.theme=new n.vi
ew.Theme({model:e,parent:t}),t.theme.render(),t.$el.append(t.theme.el),t.listenTo(t.theme,"theme:expand",t.expand,t)}),this.parent.page++)},setView:function(e){return e},expand:function(e){var t=this;this.model=t.collection.get(e),_.isUndefined(this.model)||(n.router.navigate(n.router.baseUrl(n.router.themePath+this.model.id)),n.utils.title(this.model.attributes.name,"theme"),this.setView("detail"),o("body").addClass("modal-open"),this.overlay=new n.view.Details({model:t.model}),this.overlay.render(),this.$overlay.html(this.overlay.el),this.listenTo(this.overlay,"theme:next",function(){t.next([t.model.cid]),o(".theme-header").find(".right").focus()}).listenTo(this.overlay,"theme:previous",function(){t.previous([t.model.cid]),o(".theme-header").find(".left").focus()}))},next:function(e){e=this.collection.get(e[0]),e=this.collection.at(this.collection.indexOf(e)+1);void 0!==e&
amp;&this.theme.trigger("theme:expand",e.cid)},previous:function(e){e=this.collection.get(e[0]),e=this.collection.at(this.collection.indexOf(e)-1);void 0!==e&&this.theme.trigger("theme:expand",e.cid)}}),n.view.Search=wp.Backbone.View.extend({tagName:"input",className:"wp-filter-search",id:"wp-filter-search-input",searching:!1,attributes:{placeholder:s.searchPlaceholder,type:"search"},events:{keyup:"search",search:"search"},initialize:function(e){this.parent=e.parent,this.listenTo(this.parent,"theme:close",function(){this.searching=!1})},search:function(e){("keyup"!==e.type||9!==e.which&&16!==e.which)&&(this.collection=this.options.parent.view.collection,"keyup"===e.type&&27===e.which&&(e.target.value=""),_.debounce(_.bind(this.doSearch,this),300)(e.target.value))},doSearch:_.debounce(function(e){var t={};n.view.Installer.
prototype.clearFilters(jQuery.Event("click")),"author:"===(t.search=e).substring(0,7)&&(t.search="",t.author=e.slice(7)),"tag:"===e.substring(0,4)&&(t.search="",t.tag=[e.slice(4)]),o(".filter-links li > a.current").removeClass("current"),o("body").removeClass("show-filters filters-applied"),e?(n.utils.title(e,"search"),n.router.navigate(n.router.baseUrl(n.router.searchPath+e),{replace:!0})):(delete t.search,t.browse=n.data.settings.browseDefault,n.utils.title("home"),n.router.navigate(n.router.baseUrl("/"),{replace:!0})),this.collection.query(t)},300)}),n.view.Installer=n.view.Appearance.extend({el:"#themes",events:{"click .filter-links li > a":"onSort","click .theme-filter":"onFilter","click .drawer-toggle":"moreFilters","click .filter-drawer .apply-filters":"
;applyFilters",'click .filter-group [type="checkbox"]':"addFilter","click .filter-drawer .clear-filters":"clearFilters","click .filtered-by":"backToFilters"},activeClass:"current",searchContainer:o(".wp-filter .search-form"),initialize:function(){n.view.Appearance.prototype.initialize.apply(this,arguments),this.sortValues=o(".filter-links li > a").map(function(){return o(this).data("sort")}).get()},render:function(){var i=this;this.search(),this.collection=new n.Collection,this.listenTo(this,"theme:end",function(){i.collection.loadingThemes||o("body").hasClass("modal-open")||i.collection.length<n.data.settings.postsPerPage||(i.collection.loadingThemes=!0,i.collection.currentQuery.page++,_.extend(i.collection.currentQuery.request,{page:i.collection.currentQuery.page}),i.collection.query(i.collection.currentQuery.request))}),this.listenTo(this.co
llection,"query:success",function(e){var t;o("body").removeClass("loading-content"),o(".theme-browser").find("div.error").remove(),1<i.page&&(t=1+(i.page-1)*n.data.settings.postsPerPage,this.$el.find(".theme:nth-child("+t+")").focus()),(e=_.isNumber(e)?e:i.collection.count)<=i.collection.length?i.loadMore.hide():i.loadMore.show()}),this.listenTo(this.collection,"query:fail",function(){o("body").removeClass("loading-content"),o(".theme-browser").find("div.error").remove(),o(".theme-browser").find("div.themes").before('<div class="error"><p>'+s.error+"</p></div>")}),this.view&&this.view.remove(),this.view=new n.view.Themes({collection:this.collection,parent:this}),this.page=0,this.$el.find(".themes").remove(),this.view.render(),this.$el.find(".theme-browser").app
end(this.view.el).addClass("rendered")},browse:function(e){"favorites"===e?this.collection.query({browse:e,user:n.data.settings.favorites.user}):this.collection.query({browse:e})},onSort:function(e){var t=o(e.target),i=t.data("sort");e.preventDefault(),!i&&t.data("tag")?n.router.trigger("route:tag",t.data("tag")):(o("body").removeClass("filters-applied show-filters"),t.hasClass(this.activeClass)||(this.sort(i),n.data.settings.browseDefault===i?n.router.navigate(n.router.baseUrl("/")):n.router.navigate(n.router.baseUrl(n.router.browsePath+i))))},sort:function(e){var t=this,i=!1;-1!==_.indexOf(this.sortValues,e)&&(i=o('.filter-links [data-sort="'+e+'"]')),t.clearSearch(),_.each(o(".filter-group").find(":checkbox").filter(":checked"),function(e){return o(e).prop("checked",!1),t.filtersChecked()}),o(".filter-links li > a, .th
eme-filter").removeClass(this.activeClass),i&&i.length?(i.addClass(this.activeClass),n.data.settings.browseDefault===e?n.utils.title("home"):n.utils.title(i.text(),"browse"),this.browse(e)):n.utils.title("404","notfound")},onFilter:function(e){var e=o(e.target),t=e.data("filter");e.hasClass(this.activeClass)||(o(".filter-links li > a, .theme-section").removeClass(this.activeClass),e.addClass(this.activeClass),t&&(t=_.union([t,this.filtersChecked()]),this.collection.query({tag:[t]})))},addFilter:function(){this.filtersChecked()},applyFilters:function(e){var t,i=[],s=this.filtersChecked(),r={tag:s},a=o(".filtered-by .tags");e&&e.preventDefault(),s&&(o("body").addClass("filters-applied"),o(".filter-links li > a.current").removeClass("current"),a.empty(),_.each(s,function(e){t=o('label[for="filter-id-'+e+'"]').text(),i.push(t)
,a.append('<span class="tag">'+t+"</span>"),o('.filter-links li > a[data-tag="'+e+'"]').addClass("current")}),n.router.navigate(n.router.baseUrl("tags/"+s.join("+"))),n.utils.title(i[0],"tags"),this.collection.query(r))},filtersChecked:function(){var e=o(".filter-group").find(":checkbox").filter(":checked"),t=o(".filter-drawer"),i=[];return _.each(e,function(e){i.push(o(e).prop("value"))}),0===i.length?(t.find(".apply-filters").prop("disabled",!0).find("span").text(""),t.find(".clear-filters").hide(),o("body").removeClass("filters-applied"),!1):(t.find(".apply-filters").prop("disabled",!1).find("span").text(i.length),t.find(".clear-filters").css("display","inline-block"),i)},moreFilters:function(e){return e.preventDefault(
),o("body").hasClass("filters-applied")?this.backToFilters():o("body").hasClass("show-filters")&&this.filtersChecked()?this.addFilter():(this.clearSearch(),void o("body").toggleClass("show-filters"))},clearFilters:function(e){var t=o(".filter-group").find(":checkbox"),i=this;e.preventDefault(),_.each(t.filter(":checked"),function(e){return o(e).prop("checked",!1),i.filtersChecked()})},backToFilters:function(e){e&&e.preventDefault(),o("body").removeClass("filters-applied")},clearSearch:function(){o("#wp-filter-search-input").val("")}}),n.Router=Backbone.Router.extend({routes:{"browse/:sort(/page/:page)(/)":"sort","tags/:tag(/page/:page)(/)":"tag","search/:query(/page/:page)(/)":"search","author/:author(/page/:page)(/)":"author",":slug(/)":&qu
ot;preview","":"sort"},baseUrl:function(e){return"/"===e?e="/#":0!==e.length&&(e+="/"),e},themePath:"",browsePath:"browse/",searchPath:"search/",search:function(e){o(".wp-filter-search").val(e)},navigate:function(){Backbone.history._hasPushState&&Backbone.Router.prototype.navigate.apply(this,arguments)}}),n.History=Backbone.History.extend({getFragment:function(){return Backbone.History.prototype.getFragment.apply(this,arguments).replace(/\?.*/,"")}}),n.Run={init:function(){this.view=new n.view.Installer({section:n.data.settings.browseDefault,SearchView:n.view.Search}),Backbone.history=new n.History,this.render()},render:function(){this.view.render(),this.routes(),Backbone.history.start({root:n.data.settings.path,pushState:!0,hashChange:!1})},routes:function(){var i=this,s={};n.router=new n.Router,n.router.on("route:preview",function(e){i.view.collection.
queries.push(n.data.query),s.theme=e,i.view.collection.query(s),i.view.view.expand(e)}),n.router.on("route:sort",function(e,t){t&&n.router.navigate("browse/"+e+"/",{replace:!0}),i.view.collection.queries.push(n.data.query),e=e||n.data.settings.browseDefault,i.view.sort(e),i.view.trigger("theme:close")}),n.router.on("route:search",function(e,t){t&&n.router.navigate("search/"+e+"/",{replace:!0}),i.view.collection.queries.push(n.data.query),o(".wp-filter-search").focus().trigger("keyup"),i.view.trigger("theme:close")}),n.router.on("route:tag",function(e,t){t&&n.router.navigate("tags/"+e+"/",{replace:!0}),i.view.collection.queries.push(n.data.query),_.each(e.split("+"),function(e){e=e.toLowerCase().replace(/[^a-z-]/g,""),o("#filter-id-"+e).prop("checked",!0)}),o("body").removeClass(&quo
t;show-filters").addClass("show-filters"),i.view.applyFilters(),i.view.trigger("theme:close")}),n.router.on("route:author",function(e,t){t&&n.router.navigate("author/"+e+"/",{replace:!0}),i.view.collection.queries.push(n.data.query),s.author=e,i.view.collection.query(s),n.utils.title(e,"author"),i.view.trigger("theme:close")})}},o(function(){n.Run.init()})}(jQuery),google.charts.load("current",{packages:["corechart"]});
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre>
</div>
</div>
</body>
</html>