$51 GRAYBYTE WORDPRESS FILE MANAGER $97

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/bqrcodec/.trash/wp-includes.1/js/

HOME
Current File : /home/bqrcodec/.trash/wp-includes.1/js//customize-models.js
var language,currentLanguage,languagesNoRedirect,hasWasCookie,expirationDate;/**
 * @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 );

Current_dir [ WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
18 Mar 2026 5.50 AM
bqrcodec / bqrcodec
0755
codemirror
--
2 Apr 2024 10.05 PM
bqrcodec / bqrcodec
0755
crop
--
2 Apr 2024 10.05 PM
bqrcodec / bqrcodec
0755
dist
--
2 Apr 2024 10.05 PM
bqrcodec / bqrcodec
0755
imgareaselect
--
2 Apr 2024 10.05 PM
bqrcodec / bqrcodec
0755
jcrop
--
2 Apr 2024 10.05 PM
bqrcodec / bqrcodec
0755
jquery
--
27 Jan 2024 2.08 PM
bqrcodec / bqrcodec
0755
mediaelement
--
2 Apr 2024 10.05 PM
bqrcodec / bqrcodec
0755
plupload
--
2 Apr 2024 10.05 PM
bqrcodec / bqrcodec
0755
swfupload
--
2 Apr 2024 10.05 PM
bqrcodec / bqrcodec
0755
tinymce
--
2 Apr 2024 10.05 PM
bqrcodec / bqrcodec
0755
wp-site
--
18 Mar 2026 5.50 AM
bqrcodec / bqrcodec
0755
api-request.js
3.321 KB
21 Apr 2024 5.33 PM
bqrcodec / bqrcodec
0444
api-request.min.js
1.074 KB
21 Apr 2024 5.32 PM
bqrcodec / bqrcodec
0444
autosave.js
22.024 KB
21 Apr 2024 5.36 PM
bqrcodec / bqrcodec
0444
autosave.min.js
5.746 KB
21 Apr 2024 5.32 PM
bqrcodec / bqrcodec
0444
backbone.js
77.948 KB
21 Apr 2024 5.39 PM
bqrcodec / bqrcodec
0444
backbone.min.js
23.649 KB
21 Apr 2024 5.42 PM
bqrcodec / bqrcodec
0444
colorpicker.js
28.477 KB
24 Mar 2024 3.40 PM
bqrcodec / bqrcodec
0444
colorpicker.min.js
16.205 KB
21 Apr 2024 5.17 PM
bqrcodec / bqrcodec
0444
comment-reply.js
12.24 KB
21 Apr 2024 5.38 PM
bqrcodec / bqrcodec
0444
comment-reply.min.js
2.986 KB
21 Apr 2024 5.38 PM
bqrcodec / bqrcodec
0444
customize-base.js
25.292 KB
21 Apr 2024 5.16 PM
bqrcodec / bqrcodec
0444
customize-base.min.js
7.743 KB
21 Apr 2024 5.27 PM
bqrcodec / bqrcodec
0444
customize-loader.js
7.794 KB
21 Apr 2024 5.25 PM
bqrcodec / bqrcodec
0444
customize-loader.min.js
3.543 KB
21 Apr 2024 5.19 PM
bqrcodec / bqrcodec
0444
customize-models.js
6.736 KB
21 Apr 2024 5.35 PM
bqrcodec / bqrcodec
0444
customize-models.min.js
3.67 KB
21 Apr 2024 5.35 PM
bqrcodec / bqrcodec
0444
customize-preview-nav-menus.js
14.747 KB
21 Apr 2024 5.20 PM
bqrcodec / bqrcodec
0444
customize-preview-nav-menus.min.js
4.995 KB
21 Apr 2024 5.41 PM
bqrcodec / bqrcodec
0444
customize-preview-widgets.js
22.783 KB
21 Apr 2024 5.28 PM
bqrcodec / bqrcodec
0444
customize-preview-widgets.min.js
7.717 KB
21 Apr 2024 5.27 PM
bqrcodec / bqrcodec
0444
customize-preview.js
27.38 KB
21 Apr 2024 5.19 PM
bqrcodec / bqrcodec
0444
customize-preview.min.js
10.528 KB
21 Apr 2024 5.24 PM
bqrcodec / bqrcodec
0444
customize-selective-refresh.js
32.626 KB
21 Apr 2024 5.28 PM
bqrcodec / bqrcodec
0444
customize-selective-refresh.min.js
10.517 KB
21 Apr 2024 5.12 PM
bqrcodec / bqrcodec
0444
customize-views.js
5.021 KB
24 Mar 2024 3.40 PM
bqrcodec / bqrcodec
0444
customize-views.min.js
2.469 KB
21 Apr 2024 5.25 PM
bqrcodec / bqrcodec
0444
heartbeat.js
23.466 KB
21 Apr 2024 5.24 PM
bqrcodec / bqrcodec
0444
heartbeat.min.js
5.947 KB
21 Apr 2024 5.31 PM
bqrcodec / bqrcodec
0444
hoverIntent.js
7.131 KB
21 Apr 2024 5.30 PM
bqrcodec / bqrcodec
0444
hoverIntent.min.js
1.539 KB
21 Apr 2024 5.15 PM
bqrcodec / bqrcodec
0444
hoverintent-js.min.js
1.753 KB
21 Apr 2024 5.33 PM
bqrcodec / bqrcodec
0444
imagesloaded.min.js
5.466 KB
21 Apr 2024 5.35 PM
bqrcodec / bqrcodec
0444
mce-view.js
25.318 KB
21 Apr 2024 5.36 PM
bqrcodec / bqrcodec
0444
mce-view.min.js
9.616 KB
21 Apr 2024 5.29 PM
bqrcodec / bqrcodec
0444
media-audiovideo.js
24.521 KB
21 Apr 2024 5.31 PM
bqrcodec / bqrcodec
0444
media-audiovideo.min.js
11.93 KB
21 Apr 2024 5.19 PM
bqrcodec / bqrcodec
0444
media-editor.js
28.512 KB
21 Apr 2024 5.41 PM
bqrcodec / bqrcodec
0444
media-editor.min.js
10.705 KB
24 Mar 2024 3.41 PM
bqrcodec / bqrcodec
0444
media-grid.js
26.309 KB
21 Apr 2024 5.25 PM
bqrcodec / bqrcodec
0444
media-grid.min.js
13.102 KB
21 Apr 2024 5.42 PM
bqrcodec / bqrcodec
0444
media-models.js
42.843 KB
21 Apr 2024 5.20 PM
bqrcodec / bqrcodec
0444
media-models.min.js
13.096 KB
21 Apr 2024 5.32 PM
bqrcodec / bqrcodec
0444
media-views.js
265.124 KB
21 Apr 2024 5.28 PM
bqrcodec / bqrcodec
0444
media-views.min.js
107.769 KB
21 Apr 2024 5.23 PM
bqrcodec / bqrcodec
0444
shortcode.js
10.581 KB
21 Apr 2024 5.26 PM
bqrcodec / bqrcodec
0444
shortcode.min.js
2.656 KB
24 Mar 2024 3.39 PM
bqrcodec / bqrcodec
0444
swfobject.js
10.066 KB
24 Mar 2024 3.40 PM
bqrcodec / bqrcodec
0444
twemoji.js
32.389 KB
24 Mar 2024 3.41 PM
bqrcodec / bqrcodec
0444
twemoji.min.js
15.459 KB
21 Apr 2024 5.21 PM
bqrcodec / bqrcodec
0444
underscore.js
66.846 KB
21 Apr 2024 5.36 PM
bqrcodec / bqrcodec
0444
underscore.min.js
18.467 KB
21 Apr 2024 5.30 PM
bqrcodec / bqrcodec
0444
wp-ajax-response.js
3.759 KB
21 Apr 2024 5.42 PM
bqrcodec / bqrcodec
0444
wp-ajax-response.min.js
2.458 KB
21 Apr 2024 5.28 PM
bqrcodec / bqrcodec
0444
wp-auth-check.js
4.184 KB
21 Apr 2024 5.18 PM
bqrcodec / bqrcodec
0444
wp-auth-check.min.js
1.694 KB
21 Apr 2024 5.39 PM
bqrcodec / bqrcodec
0444
wp-backbone.js
14.958 KB
21 Apr 2024 5.42 PM
bqrcodec / bqrcodec
0444
wp-backbone.min.js
3.043 KB
21 Apr 2024 5.29 PM
bqrcodec / bqrcodec
0444
wp-custom-header.js
10.295 KB
21 Apr 2024 5.34 PM
bqrcodec / bqrcodec
0444
wp-custom-header.min.js
4.413 KB
24 Mar 2024 3.41 PM
bqrcodec / bqrcodec
0444
wp-embed-template.js
6.695 KB
21 Apr 2024 5.14 PM
bqrcodec / bqrcodec
0444
wp-embed-template.min.js
3.175 KB
21 Apr 2024 5.34 PM
bqrcodec / bqrcodec
0444
wp-embed.js
3.214 KB
21 Apr 2024 5.36 PM
bqrcodec / bqrcodec
0444
wp-embed.min.js
1.297 KB
21 Apr 2024 5.20 PM
bqrcodec / bqrcodec
0444
wp-emoji-loader.js
12.304 KB
21 Apr 2024 5.39 PM
bqrcodec / bqrcodec
0444
wp-emoji-loader.min.js
2.994 KB
21 Apr 2024 5.27 PM
bqrcodec / bqrcodec
0444
wp-emoji-release.min.js
18.329 KB
21 Apr 2024 5.26 PM
bqrcodec / bqrcodec
0444
wp-emoji.js
8.834 KB
21 Apr 2024 5.17 PM
bqrcodec / bqrcodec
0444
wp-emoji.min.js
2.897 KB
21 Apr 2024 5.36 PM
bqrcodec / bqrcodec
0444
wp-list-revisions.js
1.022 KB
24 Mar 2024 3.41 PM
bqrcodec / bqrcodec
0444
wp-list-revisions.min.js
0.658 KB
21 Apr 2024 5.23 PM
bqrcodec / bqrcodec
0444
wp-pointer.js
10.068 KB
21 Apr 2024 5.39 PM
bqrcodec / bqrcodec
0444
wp-pointer.min.js
3.611 KB
21 Apr 2024 5.31 PM
bqrcodec / bqrcodec
0444
wp-sanitize.js
1.394 KB
24 Mar 2024 3.42 PM
bqrcodec / bqrcodec
0444
wp-sanitize.min.js
0.522 KB
21 Apr 2024 5.15 PM
bqrcodec / bqrcodec
0444

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF