var
/
www
/
html
/
servotec-doerpen
/
wp-includes
/
js
| uid:33
customize-views.js
[X]
/** * @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, _ );
codemirror/
-
O
R
D
crop/
-
O
R
D
dist/
-
O
R
D
imgareaselect/
-
O
R
D
jcrop/
-
O
R
D
jquery/
-
O
R
D
mediaelement/
-
O
R
D
plupload/
-
O
R
D
swfupload/
-
O
R
D
thickbox/
-
O
R
D
tinymce/
-
O
R
D
admin-bar.min.js
3.4K
V
E
R
D
autosave.js
21.9K
V
E
R
D
autosave.min.js
5.7K
V
E
R
D
backbone.min.js
23.7K
V
E
R
D
clipboard.js
26.2K
V
E
R
D
clipboard.min.js
8.8K
V
E
R
D
colorpicker.js
28.4K
V
E
R
D
colorpicker.min.js
16.1K
V
E
R
D
customize-base.min.js
7.7K
V
E
R
D
customize-models.min.js
3.6K
V
E
R
D
customize-preview-nav-menus.js
14.7K
V
E
R
D
customize-preview-nav-menus.min.js
4.9K
V
E
R
D
customize-preview-widgets.min.js
7.6K
V
E
R
D
customize-preview.min.js
10.8K
V
E
R
D
customize-views.js
5.1K
V
E
R
D
customize-views.min.js
2.5K
V
E
R
D
heartbeat.js
23.5K
V
E
R
D
heartbeat.min.js
5.8K
V
E
R
D
imagesloaded.min.js
5.4K
V
E
R
D
json2.min.js
35
V
E
R
D
masonry.min.js
23.6K
V
E
R
D
mce-view.js
25.2K
V
E
R
D
mce-view.min.js
9.5K
V
E
R
D
media-audiovideo.js
24.1K
V
E
R
D
media-audiovideo.min.js
11.8K
V
E
R
D
media-editor.js
28.8K
V
E
R
D
media-editor.min.js
10.8K
V
E
R
D
media-grid.js
26.1K
V
E
R
D
media-grid.min.js
13K
V
E
R
D
media-models.js
42.5K
V
E
R
D
media-models.min.js
13K
V
E
R
D
media-views.js
266.5K
V
E
R
D
media-views.min.js
108.1K
V
E
R
D
quicktags.js
22.1K
V
E
R
D
quicktags.min.js
10.9K
V
E
R
D
tw-sack.js
4.9K
V
E
R
D
tw-sack.min.js
3.2K
V
E
R
D
twemoji.js
36.3K
V
E
R
D
twemoji.min.js
19.4K
V
E
R
D
underscore.js
67.3K
V
E
R
D
underscore.min.js
18.6K
V
E
R
D
wp-ajax-response.js
3.8K
V
E
R
D
wp-ajax-response.min.js
2.5K
V
E
R
D
wp-auth-check.js
4.3K
V
E
R
D
wp-auth-check.min.js
1.6K
V
E
R
D
wp-backbone.min.js
3K
V
E
R
D
wp-custom-header.min.js
4.3K
V
E
R
D
wp-embed.min.js
1.2K
V
E
R
D
wp-emoji-loader.js
12.9K
V
E
R
D
wp-emoji-loader.min.js
2.8K
V
E
R
D
wp-emoji-release.min.js
22.2K
V
E
R
D
wp-emoji.js
8.6K
V
E
R
D
wp-emoji.min.js
2.8K
V
E
R
D
wp-list-revisions.js
970
V
E
R
D
wp-list-revisions.min.js
597
V
E
R
D
wp-lists.js
24.7K
V
E
R
D
wp-lists.min.js
7.3K
V
E
R
D
wp-sanitize.js
1.6K
V
E
R
D
wp-sanitize.min.js
402
V
E
R
D
wp-util.js
4.6K
V
E
R
D
wp-util.min.js
1.4K
V
E
R
D
wpdialog.js
569
V
E
R
D
wpdialog.min.js
281
V
E
R
D
wplink.js
20.7K
V
E
R
D
wplink.min.js
11.1K
V
E
R
D
zxcvbn-async.js
821
V
E
R
D
zxcvbn-async.min.js
351
V
E
R
D
zxcvbn.min.js
803K
V
E
R
D