/home/techb158/public_html/wp-includes/js
NameSizeModeActions
codemirror/-0777rm
crop/-0777rm
dist/-0777rm
imgareaselect/-0777rm
jcrop/-0777rm
jquery/-0777rm
mediaelement/-0777rm
plupload/-0777rm
swfupload/-0777rm
thickbox/-0777rm
tinymce/-0777rm
admin-bar.js105490666editdlrm
admin-bar.min.js34870666editdlrm
api-request.js33240666editdlrm
api-request.min.js10230666editdlrm
autosave.js224760666editdlrm
autosave.min.js58070666editdlrm
backbone.js804360666editdlrm
backbone.min.js243140666editdlrm
clipboard.js268070666editdlrm
clipboard.min.js90090666editdlrm
colorpicker.js290830666editdlrm
colorpicker.min.js164980666editdlrm
comment-reply.js123830666editdlrm
comment-reply.min.js29500666editdlrm
customize-base.js258220666editdlrm
customize-base.min.js78520666editdlrm
customize-loader.js79030666editdlrm
customize-loader.min.js35510666editdlrm
customize-models.js68210666editdlrm
customize-models.min.js36810666editdlrm
customize-preview-nav-menus.js150240666editdlrm
customize-preview-nav-menus.min.js50330666editdlrm
customize-preview-widgets.js232530666editdlrm
customize-preview-widgets.min.js78200666editdlrm
customize-preview.js285970666editdlrm
customize-preview.min.js110110666editdlrm
customize-selective-refresh.js333350666editdlrm
customize-selective-refresh.min.js106930666editdlrm
customize-views.js52220666editdlrm
customize-views.min.js25670666editdlrm
heartbeat.js240520666editdlrm
heartbeat.min.js59470666editdlrm
hoverintent-js.min.js17180666editdlrm
hoverIntent.js72250666editdlrm
hoverIntent.min.js14990666editdlrm
imagesloaded.min.js55200666editdlrm
json2.js310666editdlrm
json2.min.js350666editdlrm
masonry.min.js241380666editdlrm
mce-view.js258490666editdlrm
mce-view.min.js97700666editdlrm
media-audiovideo.js247170666editdlrm
media-audiovideo.min.js120490666editdlrm
media-editor.js294600666editdlrm
media-editor.min.js110920666editdlrm
media-grid.js277520666editdlrm
media-grid.min.js136860666editdlrm
media-models.js440850666editdlrm
media-models.min.js133380666editdlrm
media-views.js2730890666editdlrm
media-views.min.js1107410666editdlrm
quicktags.js226010666editdlrm
quicktags.min.js111320666editdlrm
shortcode.js107580666editdlrm
shortcode.min.js26430666editdlrm
swfobject.js00666editdlrm
swfobject.min.js350666editdlrm
tw-sack.js49700666editdlrm
tw-sack.min.js32880666editdlrm
twemoji.js371800666editdlrm
twemoji.min.js198480666editdlrm
underscore.js688730666editdlrm
underscore.min.js190120666editdlrm
utils.js46650666editdlrm
utils.min.js18640666editdlrm
wp-ajax-response.js39030666editdlrm
wp-ajax-response.min.js25710666editdlrm
wp-api.js469940666editdlrm
wp-api.min.js146820666editdlrm
wp-auth-check.js44440666editdlrm
wp-auth-check.min.js16890666editdlrm
wp-backbone.js152410666editdlrm
wp-backbone.min.js30390666editdlrm
wp-custom-header.js104650666editdlrm
wp-custom-header.min.js44420666editdlrm
wp-embed-template.js67790666editdlrm
wp-embed-template.min.js31740666editdlrm
wp-embed.js32140666editdlrm
wp-embed.min.js12510666editdlrm
wp-emoji-loader.js133570666editdlrm
wp-emoji-loader.min.js29770666editdlrm
wp-emoji-release.min.js227520666editdlrm
wp-emoji.js87920666editdlrm
wp-emoji.min.js28550666editdlrm
wp-list-revisions.js9700666editdlrm
wp-list-revisions.min.js5970666editdlrm
wp-lists.js253150666editdlrm
wp-lists.min.js75210666editdlrm
wp-pointer.js102330666editdlrm
wp-pointer.min.js36210666editdlrm
wp-sanitize.js16220666editdlrm
wp-sanitize.min.js4020666editdlrm
wp-tooltip.js15550666editdlrm
wp-tooltip.min.js5300666editdlrm
wp-util.js46890666editdlrm
wp-util.min.js14310666editdlrm
wpdialog.js5690666editdlrm
wpdialog.min.js2810666editdlrm
wplink.js212400666editdlrm
wplink.min.js113170666editdlrm
zxcvbn-async.js8210666editdlrm
zxcvbn-async.min.js3510666editdlrm
zxcvbn.min.js8222370666editdlrm
Edit: /home/techb158/public_html/wp-includes/js/customize-models.js (6821B)
/** * @output wp-includes/js/customize-models.js */ /* global _wpCustomizeHeader */ (function( $, wp ) { var api = wp.customize; /** @namespace wp.customize.HeaderTool */ api.HeaderTool = {}; /** * wp.customize.HeaderTool.ImageModel * * A header image. This is where saves via the Customizer API are * abstracted away, plus our own Ajax calls to add images to and remove * images from the user's recently uploaded images setting on the server. * These calls are made regardless of whether the user actually saves new * Customizer settings. * * @memberOf wp.customize.HeaderTool * @alias wp.customize.HeaderTool.ImageModel * * @constructor * @augments Backbone.Model */ api.HeaderTool.ImageModel = Backbone.Model.extend(/** @lends wp.customize.HeaderTool.ImageModel.prototype */{ defaults: function() { return { header: { attachment_id: 0, url: '', timestamp: _.now(), thumbnail_url: '' }, choice: '', selected: false, random: false }; }, initialize: function() { this.on('hide', this.hide, this); }, hide: function() { this.set('choice', ''); api('header_image').set('remove-header'); api('header_image_data').set('remove-header'); }, destroy: function() { var data = this.get('header'), curr = api.HeaderTool.currentHeader.get('header').attachment_id; // If the image we're removing is also the current header, // unset the latter. if (curr && data.attachment_id === curr) { api.HeaderTool.currentHeader.trigger('hide'); } wp.ajax.post( 'custom-header-remove', { nonce: _wpCustomizeHeader.nonces.remove, wp_customize: 'on', theme: api.settings.theme.stylesheet, attachment_id: data.attachment_id }); this.trigger('destroy', this, this.collection); }, save: function() { if (this.get('random')) { api('header_image').set(this.get('header').random); api('header_image_data').set(this.get('header').random); } else { if (this.get('header').defaultName) { api('header_image').set(this.get('header').url); api('header_image_data').set(this.get('header').defaultName); } else { api('header_image').set(this.get('header').url); api('header_image_data').set(this.get('header')); } } api.HeaderTool.combinedList.trigger('control:setImage', this); }, importImage: function() { var data = this.get('header'); if (data.attachment_id === undefined) { return; } wp.ajax.post( 'custom-header-add', { nonce: _wpCustomizeHeader.nonces.add, wp_customize: 'on', theme: api.settings.theme.stylesheet, attachment_id: data.attachment_id } ); }, shouldBeCropped: function() { if (this.get('themeFlexWidth') === true && this.get('themeFlexHeight') === true) { return false; } if (this.get('themeFlexWidth') === true && this.get('themeHeight') === this.get('imageHeight')) { return false; } if (this.get('themeFlexHeight') === true && this.get('themeWidth') === this.get('imageWidth')) { return false; } if (this.get('themeWidth') === this.get('imageWidth') && this.get('themeHeight') === this.get('imageHeight')) { return false; } if (this.get('imageWidth') <= this.get('themeWidth')) { return false; } return true; } }); /** * wp.customize.HeaderTool.ChoiceList * * @memberOf wp.customize.HeaderTool * @alias wp.customize.HeaderTool.ChoiceList * * @constructor * @augments Backbone.Collection */ api.HeaderTool.ChoiceList = Backbone.Collection.extend({ model: api.HeaderTool.ImageModel, // Ordered from most recently used to least. comparator: function(model) { return -model.get('header').timestamp; }, initialize: function() { var current = api.HeaderTool.currentHeader.get('choice').replace(/^https?:\/\//, ''), isRandom = this.isRandomChoice(api.get().header_image); // Overridable by an extending class. if (!this.type) { this.type = 'uploaded'; } // Overridable by an extending class. if (typeof this.data === 'undefined') { this.data = _wpCustomizeHeader.uploads; } if (isRandom) { // So that when adding data we don't hide regular images. current = api.get().header_image; } this.on('control:setImage', this.setImage, this); this.on('control:removeImage', this.removeImage, this); this.on('add', this.maybeRemoveOldCrop, this); this.on('add', this.maybeAddRandomChoice, this); _.each(this.data, function(elt, index) { if (!elt.attachment_id) { elt.defaultName = index; } if (typeof elt.timestamp === 'undefined') { elt.timestamp = 0; } this.add({ header: elt, choice: elt.url.split('/').pop(), selected: current === elt.url.replace(/^https?:\/\//, '') }, { silent: true }); }, this); if (this.size() > 0) { this.addRandomChoice(current); } }, maybeRemoveOldCrop: function( model ) { var newID = model.get( 'header' ).attachment_id || false, oldCrop; // Bail early if we don't have a new attachment ID. if ( ! newID ) { return; } oldCrop = this.find( function( item ) { return ( item.cid !== model.cid && item.get( 'header' ).attachment_id === newID ); } ); // If we found an old crop, remove it from the collection. if ( oldCrop ) { this.remove( oldCrop ); } }, maybeAddRandomChoice: function() { if (this.size() === 1) { this.addRandomChoice(); } }, addRandomChoice: function(initialChoice) { var isRandomSameType = RegExp(this.type).test(initialChoice), randomChoice = 'random-' + this.type + '-image'; this.add({ header: { timestamp: 0, random: randomChoice, width: 245, height: 41 }, choice: randomChoice, random: true, selected: isRandomSameType }); }, isRandomChoice: function(choice) { return (/^random-(uploaded|default)-image$/).test(choice); }, shouldHideTitle: function() { return this.size() < 2; }, setImage: function(model) { this.each(function(m) { m.set('selected', false); }); if (model) { model.set('selected', true); } }, removeImage: function() { this.each(function(m) { m.set('selected', false); }); } }); /** * wp.customize.HeaderTool.DefaultsList * * @memberOf wp.customize.HeaderTool * @alias wp.customize.HeaderTool.DefaultsList * * @constructor * @augments wp.customize.HeaderTool.ChoiceList * @augments Backbone.Collection */ api.HeaderTool.DefaultsList = api.HeaderTool.ChoiceList.extend({ initialize: function() { this.type = 'default'; this.data = _wpCustomizeHeader.defaults; api.HeaderTool.ChoiceList.prototype.initialize.apply(this); } }); })( jQuery, window.wp );