PHP 8.1.33
Preview: customize-views.js Size: 4.95 KB
/home/jambtst2015/public_html/cccng.org/wp-includes/js/customize-views.js

/**
 * @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');
			if (this.model.get('choice')) {
				elements.show();
			} else {
				elements.hide();
			}
		}
	});


	/**
	 * 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, _ );

Directory Contents

Dirs: 12 × Files: 102

Name Size Perms Modified Actions
.hm DIR
- drwxr-xr-x 2024-12-30 07:14:41
Edit Download
- drwxr-xr-x 2024-12-30 07:14:41
Edit Download
crop DIR
- drwxr-xr-x 2024-12-30 07:14:41
Edit Download
dist DIR
- drwxr-xr-x 2025-10-08 17:06:32
Edit Download
- drwxr-xr-x 2024-12-30 07:14:41
Edit Download
jcrop DIR
- drwxr-xr-x 2024-12-30 07:14:41
Edit Download
jquery DIR
- drwxr-xr-x 2024-12-30 07:14:41
Edit Download
- drwxr-xr-x 2024-12-30 07:14:41
Edit Download
plupload DIR
- drwxr-xr-x 2024-12-30 07:14:41
Edit Download
swfupload DIR
- drwxr-xr-x 2024-12-30 07:14:41
Edit Download
thickbox DIR
- drwxr-xr-x 2024-12-30 07:14:41
Edit Download
tinymce DIR
- drwxr-xr-x 2024-12-30 07:14:41
Edit Download
10.30 KB lrw-r--r-- 2024-05-12 03:58:08
Edit Download
3.41 KB lrw-r--r-- 2024-05-12 03:58:08
Edit Download
3.25 KB lrw-r--r-- 2020-12-01 14:14:06
Edit Download
1023 B lrw-r--r-- 2022-04-09 05:37:18
Edit Download
21.95 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
5.67 KB lrw-r--r-- 2023-02-03 03:06:32
Edit Download
78.51 KB lrw-r--r-- 2024-12-17 21:37:28
Edit Download
23.73 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
26.18 KB lrw-r--r-- 2022-10-05 01:25:24
Edit Download
8.80 KB lrw-r--r-- 2024-06-27 23:21:44
Edit Download
28.40 KB lrw-r--r-- 2012-11-18 01:41:30
Edit Download
16.11 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
12.22 KB lrw-r--r-- 2024-12-17 21:37:28
Edit Download
2.96 KB lrw-r--r-- 2024-12-17 21:37:28
Edit Download
25.22 KB lrw-r--r-- 2023-05-20 19:49:24
Edit Download
7.67 KB lrw-r--r-- 2023-02-03 03:06:32
Edit Download
7.72 KB lrw-r--r-- 2024-04-13 03:17:14
Edit Download
3.47 KB lrw-r--r-- 2023-02-03 03:06:32
Edit Download
6.66 KB lrw-r--r-- 2020-06-25 22:13:08
Edit Download
3.59 KB lrw-r--r-- 2023-02-03 03:06:32
Edit Download
14.67 KB lrw-r--r-- 2020-07-28 09:05:02
Edit Download
4.92 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
22.71 KB lrw-r--r-- 2020-06-20 22:28:10
Edit Download
7.64 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
27.30 KB lrw-r--r-- 2020-07-28 09:05:02
Edit Download
10.45 KB lrw-r--r-- 2023-02-03 03:06:32
Edit Download
32.55 KB lrw-r--r-- 2024-04-13 03:17:14
Edit Download
10.44 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
4.95 KB lrw-r--r-- 2018-06-28 12:00:16
Edit Download
2.39 KB lrw-r--r-- 2021-01-07 01:59:24
Edit Download
2.21 KB lrw-r--r-- 2024-04-09 06:44:14
Edit Download
23.49 KB lrw-r--r-- 2024-12-17 21:37:28
Edit Download
5.81 KB lrw-r--r-- 2024-12-17 21:37:28
Edit Download
1.68 KB lrw-r--r-- 2019-12-10 11:33:02
Edit Download
7.06 KB lrw-r--r-- 2022-01-04 01:33:18
Edit Download
1.46 KB lrw-r--r-- 2024-06-27 23:21:44
Edit Download
5.39 KB lrw-r--r-- 2023-08-12 03:48:26
Edit Download
17.99 KB lrw-r--r-- 2015-10-06 23:32:26
Edit Download
3.07 KB lrw-r--r-- 2024-06-27 23:21:44
Edit Download
23.57 KB lrw-r--r-- 2020-06-14 04:23:28
Edit Download
25.24 KB lrw-r--r-- 2023-10-10 07:01:28
Edit Download
9.54 KB lrw-r--r-- 2024-06-27 23:21:44
Edit Download
24.24 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
11.77 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
28.44 KB lrw-r--r-- 2020-07-28 09:05:02
Edit Download
10.63 KB lrw-r--r-- 2023-02-03 03:06:32
Edit Download
26.03 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
12.95 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
42.58 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
12.97 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
266.92 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
108.12 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
2.08 KB lrw-r--r-- 2024-04-09 06:44:14
Edit Download
22.07 KB lrw-r--r-- 2021-09-09 08:59:58
Edit Download
10.87 KB lrw-r--r-- 2023-02-03 03:06:32
Edit Download
10.51 KB lrw-r--r-- 2020-01-29 11:15:18
Edit Download
2.58 KB lrw-r--r-- 2022-09-24 05:25:30
Edit Download
9.99 KB lrw-r--r-- 2012-04-18 08:39:30
Edit Download
4.85 KB lrw-r--r-- 2012-08-23 09:34:18
Edit Download
3.21 KB lrw-r--r-- 2022-04-09 05:37:18
Edit Download
32.67 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
15.93 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
67.12 KB lrw-r--r-- 2024-12-17 21:37:28
Edit Download
18.46 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
4.56 KB lrw-r--r-- 2020-01-29 11:15:18
Edit Download
1.82 KB lrw-r--r-- 2022-09-24 05:25:30
Edit Download
3.81 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
2.51 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
45.88 KB lrw-r--r-- 2023-01-10 20:00:14
Edit Download
14.34 KB lrw-r--r-- 2024-06-27 23:21:44
Edit Download
4.11 KB lrw-r--r-- 2021-03-19 04:31:04
Edit Download
1.62 KB lrw-r--r-- 2021-03-19 04:31:04
Edit Download
14.88 KB lrw-r--r-- 2024-04-13 03:17:14
Edit Download
2.97 KB lrw-r--r-- 2022-04-09 05:37:18
Edit Download
10.22 KB lrw-r--r-- 2021-04-10 22:10:06
Edit Download
4.34 KB lrw-r--r-- 2023-02-03 03:06:32
Edit Download
6.62 KB lrw-r--r-- 2021-11-11 13:19:18
Edit Download
3.10 KB lrw-r--r-- 2024-06-27 23:21:44
Edit Download
3.14 KB lrw-r--r-- 2023-08-11 05:19:18
Edit Download
1.22 KB lrw-r--r-- 2024-06-27 23:21:44
Edit Download
13.68 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
3.02 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
18.80 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
8.76 KB lrw-r--r-- 2023-02-02 11:23:26
Edit Download
2.82 KB lrw-r--r-- 2023-02-02 11:23:26
Edit Download
970 B lrw-r--r-- 2018-06-28 12:00:16
Edit Download
597 B lrw-r--r-- 2021-01-07 01:59:24
Edit Download
24.72 KB lrw-r--r-- 2023-06-25 00:02:20
Edit Download
7.34 KB lrw-r--r-- 2023-06-25 00:02:20
Edit Download
9.99 KB lrw-r--r-- 2021-02-17 06:55:04
Edit Download
3.54 KB lrw-r--r-- 2022-04-09 05:37:18
Edit Download
1.31 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
458 B lrw-r--r-- 2022-04-09 05:37:18
Edit Download
4.57 KB lrw-r--r-- 2022-09-20 13:22:10
Edit Download
1.39 KB lrw-r--r-- 2022-09-20 13:22:10
Edit Download
569 B lrw-r--r-- 2023-01-25 07:43:12
Edit Download
281 B lrw-r--r-- 2023-01-25 07:43:12
Edit Download
20.74 KB lrw-r--r-- 2025-10-08 17:06:31
Edit Download
11.05 KB lrw-r--r-- 2024-12-17 21:37:28
Edit Download
821 B lrw-r--r-- 2018-06-28 12:00:16
Edit Download
351 B lrw-r--r-- 2021-02-24 03:15:20
Edit Download
802.97 KB lrw-r--r-- 2019-10-26 09:47:08
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).