FM

/home/u523506497/domains/mymelon.in/public_html/info/wp-includes/js UP

/**
 * @output wp-includes/js/customize-views.js
 */

(function( $, wp, _ ) {

	if ( ! wp || ! wp.customize ) { return; }
	var api = wp.customize;

	/**
	 * wp.customize.HeaderTool.CurrentView
	 *
	 * Displays the currently selected header image, or a placeholder in lack
	 * thereof.
	 *
	 * Instantiate with model wp.customize.HeaderTool.currentHeader.
	 *
	 * @memberOf wp.customize.HeaderTool
	 * @alias wp.customize.HeaderTool.CurrentView
	 *
	 * @constructor
	 * @augments wp.Backbone.View
	 */
	api.HeaderTool.CurrentView = wp.Backbone.View.extend(/** @lends wp.customize.HeaderTool.CurrentView.prototype */{
		template: wp.template('header-current'),

		initialize: function() {
			this.listenTo(this.model, 'change', this.render);
			this.render();
		},

		render: function() {
			this.$el.html(this.template(this.model.toJSON()));
			this.setButtons();
			return this;
		},

		setButtons: function() {
			var elements = $('#customize-control-header_image .actions .remove');
			var addButton = $('#customize-control-header_image .actions .new');

			if (this.model.get('choice')) {
				elements.show();
				addButton.removeClass('upload-button');
			} else {
				elements.hide();
				addButton.addClass('upload-button');
			}
		}
	});


	/**
	 * wp.customize.HeaderTool.ChoiceView
	 *
	 * Represents a choosable header image, be it user-uploaded,
	 * theme-suggested or a special Randomize choice.
	 *
	 * Takes a wp.customize.HeaderTool.ImageModel.
	 *
	 * Manually changes model wp.customize.HeaderTool.currentHeader via the
	 * `select` method.
	 *
	 * @memberOf wp.customize.HeaderTool
	 * @alias wp.customize.HeaderTool.ChoiceView
	 *
	 * @constructor
	 * @augments wp.Backbone.View
	 */
	api.HeaderTool.ChoiceView = wp.Backbone.View.extend(/** @lends wp.customize.HeaderTool.ChoiceView.prototype */{
		template: wp.template('header-choice'),

		className: 'header-view',

		events: {
			'click .choice,.random': 'select',
			'click .close': 'removeImage'
		},

		initialize: function() {
			var properties = [
				this.model.get('header').url,
				this.model.get('choice')
			];

			this.listenTo(this.model, 'change:selected', this.toggleSelected);

			if (_.contains(properties, api.get().header_image)) {
				api.HeaderTool.currentHeader.set(this.extendedModel());
			}
		},

		render: function() {
			this.$el.html(this.template(this.extendedModel()));

			this.toggleSelected();
			return this;
		},

		toggleSelected: function() {
			this.$el.toggleClass('selected', this.model.get('selected'));
		},

		extendedModel: function() {
			var c = this.model.get('collection');
			return _.extend(this.model.toJSON(), {
				type: c.type
			});
		},

		select: function() {
			this.preventJump();
			this.model.save();
			api.HeaderTool.currentHeader.set(this.extendedModel());
		},

		preventJump: function() {
			var container = $('.wp-full-overlay-sidebar-content'),
				scroll = container.scrollTop();

			_.defer(function() {
				container.scrollTop(scroll);
			});
		},

		removeImage: function(e) {
			e.stopPropagation();
			this.model.destroy();
			this.remove();
		}
	});


	/**
	 * wp.customize.HeaderTool.ChoiceListView
	 *
	 * A container for ChoiceViews. These choices should be of one same type:
	 * user-uploaded headers or theme-defined ones.
	 *
	 * Takes a wp.customize.HeaderTool.ChoiceList.
	 *
	 * @memberOf wp.customize.HeaderTool
	 * @alias wp.customize.HeaderTool.ChoiceListView
	 *
	 * @constructor
	 * @augments wp.Backbone.View
	 */
	api.HeaderTool.ChoiceListView = wp.Backbone.View.extend(/** @lends wp.customize.HeaderTool.ChoiceListView.prototype */{
		initialize: function() {
			this.listenTo(this.collection, 'add', this.addOne);
			this.listenTo(this.collection, 'remove', this.render);
			this.listenTo(this.collection, 'sort', this.render);
			this.listenTo(this.collection, 'change', this.toggleList);
			this.render();
		},

		render: function() {
			this.$el.empty();
			this.collection.each(this.addOne, this);
			this.toggleList();
		},

		addOne: function(choice) {
			var view;
			choice.set({ collection: this.collection });
			view = new api.HeaderTool.ChoiceView({ model: choice });
			this.$el.append(view.render().el);
		},

		toggleList: function() {
			var title = this.$el.parents().prev('.customize-control-title'),
				randomButton = this.$el.find('.random').parent();
			if (this.collection.shouldHideTitle()) {
				title.add(randomButton).hide();
			} else {
				title.add(randomButton).show();
			}
		}
	});


	/**
	 * wp.customize.HeaderTool.CombinedList
	 *
	 * Aggregates wp.customize.HeaderTool.ChoiceList collections (or any
	 * Backbone object, really) and acts as a bus to feed them events.
	 *
	 * @memberOf wp.customize.HeaderTool
	 * @alias wp.customize.HeaderTool.CombinedList
	 *
	 * @constructor
	 * @augments wp.Backbone.View
	 */
	api.HeaderTool.CombinedList = wp.Backbone.View.extend(/** @lends wp.customize.HeaderTool.CombinedList.prototype */{
		initialize: function(collections) {
			this.collections = collections;
			this.on('all', this.propagate, this);
		},
		propagate: function(event, arg) {
			_.each(this.collections, function(collection) {
				collection.trigger(event, arg);
			});
		}
	});

})( jQuery, window.wp, _ );
admin-bar.js10549V
admin-bar.min.js3487V
api-request.js3324V
api-request.min.js1023V
autosave.js22476V
autosave.min.js5807V
backbone.js80436V
backbone.min.js24314V
clipboard.js26807V
clipboard.min.js9009V
codemirror-
colorpicker.js29083V
colorpicker.min.js16498V
comment-reply.js12383V
comment-reply.min.js2950V
crop-
customize-base.js25822V
customize-base.min.js7852V
customize-loader.js7903V
customize-loader.min.js3551V
customize-models.js6821V
customize-models.min.js3681V
customize-preview-nav-menus.js15024V
customize-preview-nav-menus.min.js5033V
customize-preview-widgets.js23253V
customize-preview-widgets.min.js7820V
customize-preview.js28597V
customize-preview.min.js11011V
customize-selective-refresh.js33335V
customize-selective-refresh.min.js10693V
customize-views.js5222V
customize-views.min.js2567V
dist-
heartbeat.js24052V
heartbeat.min.js5947V
hoverIntent.js7225V
hoverIntent.min.js1499V
hoverintent-js.min.js1718V
imagesloaded.min.js5520V
imgareaselect-
jcrop-
jquery-
json2.js31V
json2.min.js35V
masonry.min.js24138V
mce-view.js25849V
mce-view.min.js9770V
media-audiovideo.js24717V
media-audiovideo.min.js12049V
media-editor.js29460V
media-editor.min.js11092V
media-grid.js27752V
media-grid.min.js13686V
media-models.js44085V
media-models.min.js13338V
media-views.js273089V
media-views.min.js110741V
mediaelement-
plupload-
quicktags.js22601V
quicktags.min.js11132V
shortcode.js10758V
shortcode.min.js2643V
swfobject.js0V
swfobject.min.js35V
swfupload-
thickbox-
tinymce-
tw-sack.js4970V
tw-sack.min.js3288V
twemoji.js37180V
twemoji.min.js19848V
underscore.js68873V
underscore.min.js19012V
utils.js4665V
utils.min.js1864V
wp-ajax-response.js3903V
wp-ajax-response.min.js2571V
wp-api.js46994V
wp-api.min.js14682V
wp-auth-check.js4444V
wp-auth-check.min.js1689V
wp-backbone.js15241V
wp-backbone.min.js3039V
wp-custom-header.js10465V
wp-custom-header.min.js4442V
wp-embed-template.js6779V
wp-embed-template.min.js3174V
wp-embed.js3214V
wp-embed.min.js1251V
wp-emoji-loader.js13357V
wp-emoji-loader.min.js2977V
wp-emoji-release.min.js22752V
wp-emoji.js8792V
wp-emoji.min.js2855V
wp-list-revisions.js970V
wp-list-revisions.min.js597V
wp-lists.js25315V
wp-lists.min.js7521V
wp-pointer.js10233V
wp-pointer.min.js3621V
wp-sanitize.js1622V
wp-sanitize.min.js402V
wp-tooltip.js1846V
wp-tooltip.min.js643V
wp-util.js4689V
wp-util.min.js1431V
wpdialog.js569V
wpdialog.min.js281V
wplink.js21240V
wplink.min.js11317V
zxcvbn-async.js821V
zxcvbn-async.min.js351V
zxcvbn.min.js822237V
Blog - Page 289 of 508 - My Melon - Digital Marketing & Creative Agency
Skip to content Skip to footer