/**
* @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, _ );
| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| codemirror/ | 2026-02-23 19:41 | 1.23 MB | 76129f60960:kunden | dxwrx-rx-r | |
| crop/ | 2026-02-23 19:41 | 19.54 KB | 76129f60960:kunden | dxwrx-rx-r | |
| dist/ | 2026-02-23 19:41 | 21.58 MB | 76129f60960:kunden | dxwrx-rx-r | |
| imgareaselect/ | 2026-02-23 19:41 | 48.39 KB | 76129f60960:kunden | dxwrx-rx-r | |
| jcrop/ | 2026-02-23 19:41 | 24.39 KB | 76129f60960:kunden | dxwrx-rx-r | |
| jquery/ | 2026-02-23 19:41 | 1.24 MB | 76129f60960:kunden | dxwrx-rx-r | |
| mediaelement/ | 2026-02-23 19:41 | 704.4 KB | 76129f60960:kunden | dxwrx-rx-r | |
| plupload/ | 2026-02-23 19:41 | 479.45 KB | 76129f60960:kunden | dxwrx-rx-r | |
| swfupload/ | 2026-02-23 19:41 | 0 B | 76129f60960:kunden | dxwrx-rx-r | |
| thickbox/ | 2026-02-23 19:41 | 30.6 KB | 76129f60960:kunden | dxwrx-rx-r | |
| tinymce/ | 2026-02-23 19:41 | 2.72 MB | 76129f60960:kunden | dxwrx-rx-r | |
| admin-bar.js | 2026-02-23 19:41 | 10.3 KB | 76129f60960:kunden | -xw-x----- | |
| admin-bar.min.js | 2026-02-23 19:41 | 3.41 KB | 76129f60960:kunden | -xw-x----- | |
| api-request.js | 2026-02-23 19:41 | 3.25 KB | 76129f60960:kunden | -xw-x----- | |
| api-request.min.js | 2026-02-23 19:41 | 1023 B | 76129f60960:kunden | -xw-x----- | |
| autosave.js | 2026-02-23 19:41 | 21.95 KB | 76129f60960:kunden | -xw-x----- | |
| autosave.min.js | 2026-02-23 19:41 | 5.67 KB | 76129f60960:kunden | -xw-x----- | |
| backbone.js | 2026-02-23 19:41 | 78.51 KB | 76129f60960:kunden | -xw-x----- | |
| backbone.min.js | 2026-02-23 19:41 | 23.73 KB | 76129f60960:kunden | -xw-x----- | |
| clipboard.js | 2026-02-23 19:41 | 26.18 KB | 76129f60960:kunden | -xw-x----- | |
| clipboard.min.js | 2026-02-23 19:41 | 8.8 KB | 76129f60960:kunden | -xw-x----- | |
| colorpicker.js | 2026-02-23 19:41 | 28.4 KB | 76129f60960:kunden | -xw-x----- | |
| colorpicker.min.js | 2026-02-23 19:41 | 16.11 KB | 76129f60960:kunden | -xw-x----- | |
| comment-reply.js | 2026-02-23 19:41 | 12.22 KB | 76129f60960:kunden | -xw-x----- | |
| comment-reply.min.js | 2026-02-23 19:41 | 2.96 KB | 76129f60960:kunden | -xw-x----- | |
| customize-base.js | 2026-02-23 19:41 | 25.22 KB | 76129f60960:kunden | -xw-x----- | |
| customize-base.min.js | 2026-02-23 19:41 | 7.67 KB | 76129f60960:kunden | -xw-x----- | |
| customize-loader.js | 2026-02-23 19:41 | 7.72 KB | 76129f60960:kunden | -xw-x----- | |
| customize-loader.min.js | 2026-02-23 19:41 | 3.47 KB | 76129f60960:kunden | -xw-x----- | |
| customize-models.js | 2026-02-23 19:41 | 6.66 KB | 76129f60960:kunden | -xw-x----- | |
| customize-models.min.js | 2026-02-23 19:41 | 3.59 KB | 76129f60960:kunden | -xw-x----- | |
| customize-preview-nav-menus.js | 2026-02-23 19:41 | 14.67 KB | 76129f60960:kunden | -xw-x----- | |
| customize-preview-nav-menus.min.js | 2026-02-23 19:41 | 4.92 KB | 76129f60960:kunden | -xw-x----- | |
| customize-preview-widgets.js | 2026-02-23 19:41 | 22.71 KB | 76129f60960:kunden | -xw-x----- | |
| customize-preview-widgets.min.js | 2026-02-23 19:41 | 7.64 KB | 76129f60960:kunden | -xw-x----- | |
| customize-preview.js | 2026-02-23 19:41 | 27.93 KB | 76129f60960:kunden | -xw-x----- | |
| customize-preview.min.js | 2026-02-23 19:41 | 10.75 KB | 76129f60960:kunden | -xw-x----- | |
| customize-selective-refresh.js | 2026-02-23 19:41 | 32.55 KB | 76129f60960:kunden | -xw-x----- | |
| customize-selective-refresh.min.js | 2026-02-23 19:41 | 10.44 KB | 76129f60960:kunden | -xw-x----- | |
| customize-views.js | 2026-02-23 19:41 | 5.1 KB | 76129f60960:kunden | -xw-x----- | |
| customize-views.min.js | 2026-02-23 19:41 | 2.51 KB | 76129f60960:kunden | -xw-x----- | |
| heartbeat.js | 2026-02-23 19:41 | 23.49 KB | 76129f60960:kunden | -xw-x----- | |
| heartbeat.min.js | 2026-02-23 19:41 | 5.81 KB | 76129f60960:kunden | -xw-x----- | |
| hoverIntent.js | 2026-02-23 19:41 | 7.06 KB | 76129f60960:kunden | -xw-x----- | |
| hoverIntent.min.js | 2026-02-23 19:41 | 1.46 KB | 76129f60960:kunden | -xw-x----- | |
| hoverintent-js.min.js | 2026-02-23 19:41 | 1.68 KB | 76129f60960:kunden | -xw-x----- | |
| imagesloaded.min.js | 2026-02-23 19:41 | 5.39 KB | 76129f60960:kunden | -xw-x----- | |
| json2.js | 2026-02-23 19:41 | 31 B | 76129f60960:kunden | -xw-x----- | |
| json2.min.js | 2026-02-23 19:41 | 35 B | 76129f60960:kunden | -xw-x----- | |
| masonry.min.js | 2026-02-23 19:41 | 23.57 KB | 76129f60960:kunden | -xw-x----- | |
| mce-view.js | 2026-02-23 19:41 | 25.24 KB | 76129f60960:kunden | -xw-x----- | |
| mce-view.min.js | 2026-02-23 19:41 | 9.54 KB | 76129f60960:kunden | -xw-x----- | |
| media-audiovideo.js | 2026-02-23 19:41 | 24.24 KB | 76129f60960:kunden | -xw-x----- | |
| media-audiovideo.min.js | 2026-02-23 19:41 | 11.77 KB | 76129f60960:kunden | -xw-x----- | |
| media-editor.js | 2026-02-23 19:41 | 28.44 KB | 76129f60960:kunden | -xw-x----- | |
| media-editor.min.js | 2026-02-23 19:41 | 10.63 KB | 76129f60960:kunden | -xw-x----- | |
| media-grid.js | 2026-02-23 19:41 | 26.15 KB | 76129f60960:kunden | -xw-x----- | |
| media-grid.min.js | 2026-02-23 19:41 | 12.98 KB | 76129f60960:kunden | -xw-x----- | |
| media-models.js | 2026-02-23 19:41 | 42.58 KB | 76129f60960:kunden | -xw-x----- | |
| media-models.min.js | 2026-02-23 19:41 | 12.97 KB | 76129f60960:kunden | -xw-x----- | |
| media-views.js | 2026-02-23 19:41 | 266.99 KB | 76129f60960:kunden | -xw-x----- | |
| media-views.min.js | 2026-02-23 19:41 | 108.18 KB | 76129f60960:kunden | -xw-x----- | |
| quicktags.js | 2026-02-23 19:41 | 22.07 KB | 76129f60960:kunden | -xw-x----- | |
| quicktags.min.js | 2026-02-23 19:41 | 10.87 KB | 76129f60960:kunden | -xw-x----- | |
| shortcode.js | 2026-02-23 19:41 | 10.51 KB | 76129f60960:kunden | -xw-x----- | |
| shortcode.min.js | 2026-02-23 19:41 | 2.58 KB | 76129f60960:kunden | -xw-x----- | |
| swfobject.js | 2026-02-23 19:41 | 0 B | 76129f60960:kunden | -xw-x----- | |
| swfobject.min.js | 2026-02-23 19:41 | 35 B | 76129f60960:kunden | -xw-x----- | |
| tw-sack.js | 2026-02-23 19:41 | 4.85 KB | 76129f60960:kunden | -xw-x----- | |
| tw-sack.min.js | 2026-02-23 19:41 | 3.21 KB | 76129f60960:kunden | -xw-x----- | |
| twemoji.js | 2026-02-23 19:41 | 36.32 KB | 76129f60960:kunden | -xw-x----- | |
| twemoji.min.js | 2026-02-23 19:41 | 19.39 KB | 76129f60960:kunden | -xw-x----- | |
| underscore.js | 2026-02-23 19:41 | 67.12 KB | 76129f60960:kunden | -xw-x----- | |
| underscore.min.js | 2026-02-23 19:41 | 18.46 KB | 76129f60960:kunden | -xw-x----- | |
| utils.js | 2026-02-23 19:41 | 4.56 KB | 76129f60960:kunden | -xw-x----- | |
| utils.min.js | 2026-02-23 19:41 | 1.82 KB | 76129f60960:kunden | -xw-x----- | |
| wp-ajax-response.js | 2026-02-23 19:41 | 3.81 KB | 76129f60960:kunden | -xw-x----- | |
| wp-ajax-response.min.js | 2026-02-23 19:41 | 2.51 KB | 76129f60960:kunden | -xw-x----- | |
| wp-api.js | 2026-02-23 19:41 | 45.88 KB | 76129f60960:kunden | -xw-x----- | |
| wp-api.min.js | 2026-02-23 19:41 | 14.34 KB | 76129f60960:kunden | -xw-x----- | |
| wp-auth-check.js | 2026-02-23 19:41 | 4.11 KB | 76129f60960:kunden | -xw-x----- | |
| wp-auth-check.min.js | 2026-02-23 19:41 | 1.62 KB | 76129f60960:kunden | -xw-x----- | |
| wp-backbone.js | 2026-02-23 19:41 | 14.88 KB | 76129f60960:kunden | -xw-x----- | |
| wp-backbone.min.js | 2026-02-23 19:41 | 2.97 KB | 76129f60960:kunden | -xw-x----- | |
| wp-custom-header.js | 2026-02-23 19:41 | 10.22 KB | 76129f60960:kunden | -xw-x----- | |
| wp-custom-header.min.js | 2026-02-23 19:41 | 4.34 KB | 76129f60960:kunden | -xw-x----- | |
| wp-embed-template.js | 2026-02-23 19:41 | 6.62 KB | 76129f60960:kunden | -xw-x----- | |
| wp-embed-template.min.js | 2026-02-23 19:41 | 3.1 KB | 76129f60960:kunden | -xw-x----- | |
| wp-embed.js | 2026-02-23 19:41 | 3.14 KB | 76129f60960:kunden | -xw-x----- | |
| wp-embed.min.js | 2026-02-23 19:41 | 1.22 KB | 76129f60960:kunden | -xw-x----- | |
| wp-emoji-loader.js | 2026-02-23 19:41 | 12.89 KB | 76129f60960:kunden | -xw-x----- | |
| wp-emoji-loader.min.js | 2026-02-23 19:41 | 2.82 KB | 76129f60960:kunden | -xw-x----- | |
| wp-emoji-release.min.js | 2026-02-23 19:41 | 22.23 KB | 76129f60960:kunden | -xw-x----- | |
| wp-emoji.js | 2026-02-23 19:41 | 8.59 KB | 76129f60960:kunden | -xw-x----- | |
| wp-emoji.min.js | 2026-02-23 19:41 | 2.79 KB | 76129f60960:kunden | -xw-x----- | |
| wp-list-revisions.js | 2026-02-23 19:41 | 970 B | 76129f60960:kunden | -xw-x----- | |
| wp-list-revisions.min.js | 2026-02-23 19:41 | 597 B | 76129f60960:kunden | -xw-x----- | |
| wp-lists.js | 2026-02-23 19:41 | 24.72 KB | 76129f60960:kunden | -xw-x----- | |
| wp-lists.min.js | 2026-02-23 19:41 | 7.34 KB | 76129f60960:kunden | -xw-x----- | |
| wp-pointer.js | 2026-02-23 19:41 | 9.99 KB | 76129f60960:kunden | -xw-x----- | |
| wp-pointer.min.js | 2026-02-23 19:41 | 3.54 KB | 76129f60960:kunden | -xw-x----- | |
| wp-sanitize.js | 2026-02-23 19:41 | 1.3 KB | 76129f60960:kunden | -xw-x----- | |
| wp-sanitize.min.js | 2026-02-23 19:41 | 444 B | 76129f60960:kunden | -xw-x----- | |
| wp-util.js | 2026-02-23 19:41 | 4.57 KB | 76129f60960:kunden | -xw-x----- | |
| wp-util.min.js | 2026-02-23 19:41 | 1.39 KB | 76129f60960:kunden | -xw-x----- | |
| wpdialog.js | 2026-02-23 19:41 | 569 B | 76129f60960:kunden | -xw-x----- | |
| wpdialog.min.js | 2026-02-23 19:41 | 281 B | 76129f60960:kunden | -xw-x----- | |
| wplink.js | 2026-02-23 19:41 | 20.74 KB | 76129f60960:kunden | -xw-x----- | |
| wplink.min.js | 2026-02-23 19:41 | 11.05 KB | 76129f60960:kunden | -xw-x----- | |
| zxcvbn-async.js | 2026-02-23 19:41 | 821 B | 76129f60960:kunden | -xw-x----- | |
| zxcvbn-async.min.js | 2026-02-23 19:41 | 351 B | 76129f60960:kunden | -xw-x----- | |
| zxcvbn.min.js | 2026-02-23 19:41 | 802.97 KB | 76129f60960:kunden | -xw-x----- | |