PageSourceSearch

https://members.betteryourself365.com/wp-content/plugins/vc-super-…/js/min/admin-min.js?ver=1.3

js betteryourself365.com collected 2026-10-04 06:24:19 UTC 18,949 bytes, 1 lines download raw bytes

1var CCImageView=wp.media.View.extend({template:wp.template("ccimage-search"),className:"attachments-browser",events:{"click .attachments":"imageSelected","keyup #media-search-input":"searchChanged","change #ccimage-provider-filters":"filterChanged","change #ccimage-license-filters":"filterChanged","click li:not(.downloaded) .ccimage-download-label, li:not(.downloaded) .ccimage-download":"downloadClicked","wheel .attachments":"scrolled"},initialize:function(){this._prevSearch=null,this.$window=jQuery(window),this.resizeEvent="resize.media-modal-columns",this._downloading=[],this._scrollBottomSearching=!1,this._currentPage=1,_.bindAll(this,"setColumns"),this.on("ready",this.bindEvents),this.controller.on("open",this.setColumns),this.controller.on("open",this.focusSearch.bind(this)),_.defer(this.setColumns,this)},bindEvents:function(){this.$window.off(this.resizeEvent).on(this.resizeEvent,_.debounce(this.setColumns,50))},focusSearch:function(){this.$el.find("#media-search-input").focus()},render:function(){return this.$el.html(this.template()),this.$el.find(".media-button-insert").css("opacity","0"),this.bindEvents(),this},setColumns:function(){var e=this.$el.width();e&&(this.columns=Math.min(Math.round(e/200),12)||1,this.$el.closest(".media-frame-content").attr("data-columns",this.columns))},getLi:function(e){for(var t=e;"LI"!==t.tagName&&"HTML"!==t.tagName;)t=t.parentNode;return"HTML"===t.tagName?null:t},search:function(e){this._appendSearchResultsBound||(this._appendSearchResultsBound=this.appendSearchResult.bind(this)),this._doneSearchingBound||(this._doneSearchingBound=this.doneSearching.bind(this)),clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(function(){var t=this.$el.find("#media-search-input").val().trim();if(this._prevSearch!==t&&t||e){this._prevSearch=t,this.$el.find(".spinner").addClass("is-active"),this.clearSearchResults(),this._scrollBottomSearching=!0,this._currentPage=1;var i=this.$el.find("#ccimage-provider-filters").val(),a=this.$el.find("#ccimage-license-filters").val();CCImageSearch.search(t,this._appendSearchResultsBound,this._doneSearchingBound,this._currentPage,i,a)}}.bind(this),700)},scrolled:function(){if(!this._scrollBottomSearching&&this.$el.find(".attachments li").length){var e=this.$el.find(".attachments");if(e[0].scrollHeight-e.scrollTop()===e.outerHeight()){this._currentPage++,this._scrollBottomSearching=!0;var t=this.$el.find("#media-search-input").val().trim();this.$el.find(".spinner").addClass("is-active");var i=this.$el.find("#ccimage-provider-filters").val(),a=this.$el.find("#ccimage-license-filters").val();CCImageSearch.search(t,this._appendSearchResultsBound,this._doneSearchingBound,this._currentPage,i,a)}}},searchChanged:function(){this.search()},filterChanged:function(){this.search(!0)},appendSearchResult:function(e){if(e.sizes.length){e.orientation="landscape",e.sizes[0].height>e.sizes[0].width&&(e.orientation="portrait"),e.preview="";var t=this.$el.width();t?t/=this.columns:t=300;for(var i=9999,a=9999,s="",r=0;r<e.sizes.length;r++)"landscape"===e.orientation&&e.sizes[r].height>=t-150&&e.sizes[r].height<i?(e.preview=e.sizes[r].url,i=e.sizes[r].height):"portrait"===e.orientation&&e.sizes[r].width>=t-150&&e.sizes[r].width<i&&(e.preview=e.sizes[r].url,i=e.sizes[r].width),"landscape"===e.orientation&&e.sizes[r].height<a?(s=e.sizes[r].url,a=e.sizes[r].height):"portrait"===e.orientation&&e.sizes[r].width<a&&(s=e.sizes[r].url,a=e.sizes[r].width);e.preview||(e.preview=s);var n=jQuery('<li tabindex="0" role="checkbox" aria-checked="false" class="attachment save-ready">');n.attr("aria-label",e.title),n.html(wp.template("ccimage-search-result")(e)),n.data("ccimage",e),this.$el.find(".attachments").append(n)}},doneSearching:function(){this.$el.find(".spinner").removeClass("is-active"),this._scrollBottomSearching=!1},clearSearchResults:function(){this.$el.find("ul.attachments").html("")},imageSelected:function(e){this.$el.find(".details").removeClass("details");var t=this.getLi(e.target);return t?(t.classList.toggle("details"),t.blur(),void this.showSelectedDetails()):void e.target.blur()}
1,showSelectedDetails:function(){var e=this.getLi(this.$el.find("li.details")[0]),t=this.$el.find(".ccimage-details"),i=jQuery;if(!e)return void t.css("display","none");t.css("display","");var a=i(e).data("ccimage");t.find(".preview").attr("src",a.preview),t.find(".provider span").html(i("<a></a>").attr("href",a.provider_link).text(a.provider_name).attr("target","_ccimage")),t.find(".title span").text(a.title?a.title:"–"),t.find(".date span").text(a.date?a.date:"–"),a.user?t.find(".owner span").html(i("<a></a>").attr("href",a.user_link).text(a.user).attr("target","_ccimage")):t.find(".owner span").html("–"),a.license&&a.license_link?t.find(".license span").html(i("<a></a>").attr("href",a.license_link).text(a.license).attr("target","_ccimage")):a.license?t.find(".license span").html(a.license):t.find(".license span").html("–"),t.find(".sizes span").html("");for(var s=0;s<a.sizes.length;s++){var r=a.sizes[s].width+"x"+a.sizes[s].height;t.find(".sizes span").append("<br>"),t.find(".sizes span").append(i("<a></a>").attr("href",a.sizes[s].url).text(r).attr("target","_ccimage"))}},downloadClicked:function(e){var t=this.getLi(e.target);t&&this.downloadImage(t,jQuery(t).data("ccimage"))},downloadImage:function(e,t){var i=new XMLHttpRequest;i.onload=function(){i.status>=200&&i.status<400&&(jQuery(e).removeClass("downloading").addClass("downloaded"),this.updateMediaManager(JSON.parse(i.response),t))}.bind(this),i.onerror=function(){jQuery(e).removeClass("downloading")}.bind(this);var a=new FormData;a.append("action","ccimage_download_image"),a.append("nonce",CCImageParams.nonce),a.append("data",JSON.stringify(t)),jQuery(e).addClass("downloading"),i.open("POST",CCImageParams.ajax_url),i.send(a)},basename:function(e){return e.split(/[\\\/]/).pop()},updateMediaManager:function(e,t){var i;i="undefined"!=typeof wp.media.frame.state().get("library")?wp.media.frame.state().get("library"):wp.media.frame.library;var a=new wp.media.model.Attachment,s={full:{height:e.sizes_data.height,orientation:t.orientation,url:e.attachment_url,width:e.sizes_data.width}};"undefined"!=typeof e.sizes_data.sizes.large&&(s.large={height:e.sizes_data.sizes.large.height,orientation:t.orientation,url:e.attachment_url.replace(this.basename(e.attachment_url),"")+e.sizes_data.sizes.large.file,width:e.sizes_data.sizes.large.width}),"undefined"!=typeof e.sizes_data.sizes.medium&&(s.medium={height:e.sizes_data.sizes.medium.height,orientation:t.orientation,url:e.attachment_url.replace(this.basename(e.attachment_url),"")+e.sizes_data.sizes.medium.file,width:e.sizes_data.sizes.medium.width}),"undefined"!=typeof e.sizes_data.sizes.thumbnail&&(s.thumbnail={height:e.sizes_data.sizes.thumbnail.height,orientation:t.orientation,url:e.attachment_url.replace(this.basename(e.attachment_url),"")+e.sizes_data.sizes.thumbnail.file,width:e.sizes_data.sizes.thumbnail.width});var r={"delete":e.delete_nonce,edit:e.edit_nonce,update:e.update_nonce};a.id=e.id,a.attributes.alt="",a.attributes.author="0",a.attributes.caption=e.attachment_data.post_excerpt,a.attributes.compat=e.compat_fields,a.attributes.date=new Date,a.attributes.dateFormatted=["January","February","March","April","May","June","July","August","September","October","November","December"][(new Date).getMonth()]+" "+(new Date).getDate()+", "+(new Date).getFullYear(),a.attributes.description="",a.attributes.editLink=CCImageParams.admin_post_url+"?post="+e.id+"&action=edit",a.attributes.filename=this.basename(e.attachment_url),a.attributes.height=e.sizes_data.height,a.attributes.icon=CCImageParams.media_default_url,a.attributes.id=e.id,a.attributes.link=e.attachment_link,a.attributes.menuOrder=0,a.attributes.mime=e.attachment_data.post_mime_type,a.attributes.modified=new Date,a.attributes.name=e.attachment_data.post_name,a.attributes.nonces=r,a.attributes.orientation=t.orientation,a.attributes.sizes=s,a.attributes.status="inherit",a.attributes.subtype=this.basename(e.attachment_data.post_mime_type),a.attributes.title=e.attachment_data.post_title,a.attributes.type="image",a.attributes.uploadedTo=0,a.attributes.url=e.attachment_url,a.attributes.width=e.sizes_data.width,i.models.unshift(a),i.reset(i.models)}});!function(){var e=wp.media.view.MediaFrame.Select.prototype.browseRouter;wp.media.view.MediaFrame.Select.prototype.browseRouter=function(t){e.call(this,t),t.set({ccsearch:{text:CCImageParams.tab_title,priority:100}})}}(),function(){var e=wp.media.view.MediaFrame.Select.prototype.bindHandlers;wp.media.view.MediaFrame.Select.prototype.bindHandlers=function(){e.call(this),this.on("content:create:ccsearch",this.ccsearchContent,this)},wp.media.view.MediaFrame.Select.prototype.ccsearchContent=function(e){this.$el.removeClass("hide-toolbar"),this.$el.addClass("ccimage-search-active"),e.view=new CCImageView({controller:this})}}(),CCImageSearch={providers:{flickr:{api:"https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=28b31ed922d1780134dbfb2928d8ef55&text={keyword}&sort=interestingness-desc&content_type=&license={license}&extras=date_taken%2C+license%2C+owner_name%2C+url_sq%2C+url_t%2C+url_s%2C+url_m%2C+url_l%2C+url_o%2C+url_q%2C+description&per_page={per_page}&page={page}&format=json",formURL:function(e){var t=this.api;return t=t.replace(/\{keyword\}/,e.keyword),t=t.replace(/\{per_page\}/,e.per_page),t=t.replace(/\{page\}/,e.page),t="noncommercial"===e.license?t.replace(/\{license\}/,"1,2,3,4,5,6,7"):"noattribution"===e.license?t.replace(/\{license\}/,"7"):t.replace(/\{license\}/,"4,5,6,7")},onload:function(e,t){e=e.replace(/^jsonFlickrApi\(/,""),e=e.replace(/\)$/,"");for(var i=JSON.parse(e),a=0;a<i.photos.photo.length;a++){var s=i.photos.photo[a],r={provider:"flickr",provider_name:"Flickr",provider_link:"http://flickr.com",user:s.ownername,user_link:"https://www.flickr.com/people/"+s.owner,date:s.datetaken,title:s.title,url:"https://www.flickr.com/photos/"+s.owner+"/"+s.id,badges:[],sizes:[]};
1"1"===s.license?(r.license="Creative Commons Attribution-NonCommercial-ShareAlike",r.license_link="http://creativecommons.org/licenses/by-nc-sa/2.0/",r.license_shortname="CC BY-NC-SA",r.badges.push("attribution"),r.badges.push("noncommercial")):"2"===s.license?(r.license="Creative Commons Attribution-NonCommercial",r.license_link="http://creativecommons.org/licenses/by-nc/2.0/",r.license_shortname="CC BY-NC",r.badges.push("attribution"),r.badges.push("noncommercial")):"3"===s.license?(r.license="Creative Commons Attribution-NonCommercial-NoDerivs",r.license_link="http://creativecommons.org/licenses/by-nc-nd/2.0/",r.license_shortname="CC BY-NC-ND",r.badges.push("attribution"),r.badges.push("noncommercial")):"4"===s.license?(r.license="Creative Commons Attribution",r.license_link="http://creativecommons.org/licenses/by/2.0/",r.license_shortname="CC BY",r.badges.push("attribution")):"5"===s.license?(r.license="Creative Commons Attribution-ShareAlike",r.license_link="http://creativecommons.org/licenses/by-sa/2.0/",r.license_shortname="CC BY-SA",r.badges.push("attribution")):"6"===s.license?(r.license="Creative Commons Attribution-NoDerivs",r.license_link="http://creativecommons.org/licenses/by-nd/2.0/",r.license_shortname="CC BY-ND",r.badges.push("attribution")):"7"===s.license?(r.license="No known copyright restrictions",r.license_link="http://flickr.com/commons/usage/",r.license_shortname="CC0",r.badges.push("zero")):"8"===s.license&&(r.license="United States Government Work",r.license_link="http://www.usa.gov/copyright.shtml",r.license_shortname="U.S. Gov't Work",r.badges.push("warning")),s.url_s&&r.sizes.push({url:s.url_s,width:parseInt(s.width_s,10),height:parseInt(s.height_s,10)}),s.url_m&&r.sizes.push({url:s.url_m,width:parseInt(s.width_m,10),height:parseInt(s.height_m,10)}),s.url_l&&r.sizes.push({url:s.url_l,width:parseInt(s.width_l,10),height:parseInt(s.height_l,10)}),s.url_o&&r.sizes.push({url:s.url_o,width:parseInt(s.width_o,10),height:parseInt(s.height_o,10)}),t(r)}}},pixabay:{api:"https://pixabay.com/api/?key=281886-58afb50cd9c4019517ce11b78&q={keyword}&image_type=photo&response_group=high_resolution&per_page={per_page}&page={page}",formURL:function(e){var t=this.api;return t=t.replace(/\{keyword\}/,e.keyword),t=t.replace(/\{per_page\}/,e.per_page),t=t.replace(/\{page\}/,e.page)},onload:function(e,t){for(var i=JSON.parse(e),a=0;a<i.hits.length;a++){var s=i.hits[a],r={provider:"pixabay",provider_name:"Pixabay",provider_link:"http://pixabay.com",user:s.user,user_link:"https://pixabay.com/users/"+s.user+"-"+s.user_id,license:"Creative Commons CC0 / Public Domain",license_link:"https://creativecommons.org/publicdomain/zero/1.0/",license_shortname:"CC BY-NC-SA",badges:[],sizes:[]};s.previewURL&&r.sizes.push({url:s.previewURL,width:parseInt(s.previewWidth,10),height:parseInt(s.previewHeight,10)}),s.webformatURL&&r.sizes.push({url:s.webformatURL,width:parseInt(s.webformatWidth,10),height:parseInt(s.webformatHeight,10)}),s.imageWidth&&r.sizes.push({url:s.imageURL,width:parseInt(s.imageWidth,10),height:parseInt(s.imageHeight,10)}),t(r)}}},pexels:{api:"https://api.pexels.com/v1/search?query={keyword}&page={page}&per_page={per_page}",formURL:function(e){var t=this.api;return t=t.replace(/\{keyword\}/,e.keyword),t=t.replace(/\{per_page\}/,e.per_page),t=t.replace(/\{page\}/,e.page)},beforeSend:function(e){e.setRequestHeader("Authorization","563492ad6f91700001000001171c76baf7464a2c5d1e1d7364e8988c")},onload:function(e,t){for(var i=JSON.parse(e),a=0;a<i.photos.length;a++){var s=i.photos[a],r={provider:"pexels",provider_name:"Pexels",provider_link:"https://pexels.com",user:s.photographer,user_link:"https://www.pexels.com/u/"+s.photographer,url:s.url,license:"Creative Commons CC0 / Public Domain",license_link:"https://creativecommons.org/publicdomain/zero/1.0/",license_shortname:"CC0",badges:[],sizes:[]};s.src.original&&r.sizes.push({url:s.src.original,width:parseInt(s.width,10),height:parseInt(s.height,10)});var n,o,l;n=parseInt(s.width,10),l=parseInt(s.height,10),s.src.large&&(o=1920,r.sizes.push({url:s.src.large,width:o,height:parseInt(l/n*o,10)})),s.src.medium&&(o=1920,r.sizes.push({url:s.src.medium,width:o,height:parseInt(l/n*o,10)})),s.src.small&&(o=640,r.sizes.push({url:s.src.small,width:o,height:parseInt(l/n*o,10)})),s.src.tiny&&(o=280,r.sizes.push({url:s.src.tiny,width:o,height:parseInt(l/n*o,10)})),t(r)}}},unsplash:{api:"https://api.unsplash.com/photos/search/?query={keyword}&page={page}&per_page={per_page}&client_id=de51b385a471a43d29e61fe8d25968b299e4f8d3758004df152786cae3898a2c",formURL:function(e){var t=this.api;return t=t.replace(/\{keyword\}/,e.keyword),t=t.replace(/\{per_page\}/,e.per_page),t=t.replace(/\{page\}/,e.page)},onload:function(e,t){for(var i=JSON.parse(e),a=0;a<i.length;a++){var s=i[a],r={provider:"unsplash",provider_name:"Unsplash",provider_link:"http://unsplash.com",user:s.user.n
1ame,user_link:s.user.links.html,url:s.links.html,date:s.created_at,license:"Creative Commons CC0 / Public Domain",license_link:"https://creativecommons.org/publicdomain/zero/1.0/",license_shortname:"CC0",badges:[],sizes:[]};s.urls.raw&&r.sizes.push({url:s.urls.raw,width:parseInt(s.width,10),height:parseInt(s.height,10)});var n,o,l;n=parseInt(s.width,10),l=parseInt(s.height,10),s.urls.regular&&(o=parseInt(s.urls.regular.match(/w=(\d+)/)[1],10),r.sizes.push({url:s.urls.regular,width:o,height:parseInt(l/n*o,10)})),s.urls.small&&(o=parseInt(s.urls.small.match(/w=(\d+)/)[1],10),r.sizes.push({url:s.urls.small,width:o,height:parseInt(l/n*o,10)})),s.urls.thumb&&(o=parseInt(s.urls.thumb.match(/w=(\d+)/)[1],10),r.sizes.push({url:s.urls.thumb,width:o,height:parseInt(l/n*o,10)})),t(r)}}},giphy:{api:"https://api.giphy.com/v1/gifs/search?q={keyword}&limit={per_page}&offset={offset}&api_key=d3ML1IkhgUlWvlja",formURL:function(e){var t=this.api;return t=t.replace(/\{keyword\}/,e.keyword),t=t.replace(/\{per_page\}/,e.per_page),t=t.replace(/\{offset\}/,e.page*e.per_page)},onSelect:function(e){if(0===e.find(".ccimage-powered-by-giphy").length){var t=jQuery("<IMG>");t.attr("src",CCImageParams.plugin_url+"cc_image_search/images/powered-by-giphy.png").addClass("ccimage-powered-by-giphy"),e.find(".thumbnail").after(t)}},onSelectCleanup:function(e){e.find(".ccimage-powered-by-giphy").length&&e.find(".ccimage-powered-by-giphy").remove()},onload:function(e,t){for(var i=JSON.parse(e),a=0;a<i.data.length;a++){var s=i.data[a],r={provider:"giphy",provider_name:"Giphy",provider_link:"http://giphy.com",date:s.import_datetime,user:s.username,user_link:s.source||s.url,url:s.url,title:s.slug.replace(/\-\w+$/,"").replace(/\-/g," "),attribution:'Powered by <a href="http://giphy.com">Giphy</a>',license:"Giphy",license_link:"http://giphy.com/terms",license_shortname:"Giphy",badges:["attribution"],sizes:[]};s.user&&(r.user=s.user.display_name,r.user_link=s.user.profile_url),s.images.fixed_height_downsampled&&r.sizes.push({url:s.images.fixed_height_downsampled.url,width:parseInt(s.images.fixed_height_downsampled.width,10),height:parseInt(s.images.fixed_height_downsampled.height,10)}),s.images.original&&r.sizes.push({url:s.images.original.url,width:parseInt(s.images.original.width,10),height:parseInt(s.images.original.height,10)}),t(r)}}}},_searchesDone:0,_numProviders:0,search:function(e,t,i,a,s,r){if(this._searchesDone=0,this._numProviders=0,!(a>5))for(var n in this.providers)this.providers.hasOwnProperty(n)&&(s&&n!==s||(this._numProviders++,function(t,i,a,s,r){var n=t.formURL({keyword:e,license:r,per_page:50,page:a}),o=new XMLHttpRequest;o.onload=function(){o.status>=200&&o.status<400&&t.onload(o.response,i),this._searchesDone++,this._searchesDone===this._numProviders&&s()}.bind(this),o.onerror=function(){this._searchesDone++,this._searchesDone===this._numProviders&&s()}.bind(this),o.open("GET",n),"undefined"!=typeof t.beforeSend&&t.beforeSend(o),o.send()}.bind(this)(this.providers[n],t,a,i,r)))}},jQuery(document).ready(function(e){if(wp.media.featuredImage&&wp.media.featuredImage.select&&!function(){var t=wp.media.featuredImage.select;wp.media.featuredImage.select=function(){t.call(this);var i=this.get("selection").single();if(i.attributes.caption&&i.attributes.filename.match(/^ccimage-/))if(e("#content").is(":visible"))e("#content").val(e("#content").val()+"\n\n"+i.attributes.caption);else if(tinyMCE&&tinyMCE.activeEditor){var a=tinyMCE.activeEditor.getContent();tinyMCE.execCommand("mceSetContent",!1,a+"<p>"+i.attributes.caption+"</p>")}}}(),e("body").on("click",".media-menu-item",function(){e(this).text().indexOf(CCImageParams.tab_title)!==-1?e(".media-button-insert").css("opacity","0"):e(".media-button-insert").css("opacity","1")}),wp.media){var t=e("body");wp.media.view.Modal.prototype.on("open",function(){var i=t.find(".media-button-insert");e(".media-menu-item").each(function(){e(this).hasClass("active")&&e(this).text().indexOf(CCImageParams.tab_title)!=-1&&i.css("opacity","0")})})}});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.