sarkfultion
⌂
›
wp-includes
›
js
sarkfultion
114 dreads
↑ redisq
📁
codemirror/
dreads
sarkfultion
dreads
📁
crop/
dreads
sarkfultion
dreads
📁
dist/
dreads
sarkfultion
dreads
📁
imgareaselect/
dreads
sarkfultion
dreads
📁
jcrop/
dreads
sarkfultion
dreads
📁
jquery/
dreads
sarkfultion
dreads
📁
mediaelement/
dreads
sarkfultion
dreads
📁
plupload/
dreads
sarkfultion
dreads
📁
swfupload/
dreads
sarkfultion
dreads
📁
thickbox/
dreads
sarkfultion
dreads
📁
tinymce/
dreads
sarkfultion
dreads
📄
admin-bar.js
10,549 B
sarkfultion
dreads
📄
admin-bar.min.js
3,487 B
sarkfultion
dreads
📄
api-request.js
3,324 B
sarkfultion
dreads
📄
api-request.min.js
1,023 B
sarkfultion
dreads
📄
autosave.js
22,476 B
sarkfultion
dreads
📄
autosave.min.js
5,807 B
sarkfultion
dreads
📄
backbone.js
80,436 B
sarkfultion
dreads
📄
backbone.min.js
24,314 B
sarkfultion
dreads
📄
clipboard.js
26,807 B
sarkfultion
dreads
📄
clipboard.min.js
9,009 B
sarkfultion
dreads
📄
colorpicker.js
29,083 B
sarkfultion
dreads
📄
colorpicker.min.js
16,498 B
sarkfultion
dreads
📄
comment-reply.js
12,383 B
sarkfultion
dreads
📄
comment-reply.min.js
2,950 B
sarkfultion
dreads
📄
customize-base.js
25,822 B
sarkfultion
dreads
📄
customize-base.min.js
7,852 B
sarkfultion
dreads
📄
customize-loader.js
7,903 B
sarkfultion
dreads
📄
customize-loader.min.js
3,551 B
sarkfultion
dreads
📄
customize-models.js
6,821 B
sarkfultion
dreads
📄
customize-models.min.js
3,681 B
sarkfultion
dreads
📄
customize-preview-nav-menus.js
15,024 B
sarkfultion
dreads
📄
customize-preview-nav-menus.min.js
5,033 B
sarkfultion
dreads
📄
customize-preview-widgets.js
23,467 B
sarkfultion
dreads
📄
customize-preview-widgets.min.js
7,841 B
sarkfultion
dreads
📄
customize-preview.js
28,597 B
sarkfultion
dreads
📄
customize-preview.min.js
11,011 B
sarkfultion
dreads
📄
customize-selective-refresh.js
33,291 B
sarkfultion
dreads
📄
customize-selective-refresh.min.js
10,722 B
sarkfultion
dreads
📄
customize-views.js
5,222 B
sarkfultion
dreads
📄
customize-views.min.js
2,567 B
sarkfultion
dreads
📄
heartbeat.js
24,052 B
sarkfultion
dreads
📄
heartbeat.min.js
5,947 B
sarkfultion
dreads
📄
hoverintent-js.min.js
1,718 B
sarkfultion
dreads
📄
hoverIntent.js
7,225 B
sarkfultion
dreads
📄
hoverIntent.min.js
1,499 B
sarkfultion
dreads
📄
imagesloaded.min.js
5,520 B
sarkfultion
dreads
📄
json2.js
31 B
sarkfultion
dreads
📄
json2.min.js
35 B
sarkfultion
dreads
📄
masonry.min.js
24,138 B
sarkfultion
dreads
📄
mce-view.js
25,849 B
sarkfultion
dreads
📄
mce-view.min.js
9,770 B
sarkfultion
dreads
📄
media-audiovideo.js
24,717 B
sarkfultion
dreads
📄
media-audiovideo.min.js
12,049 B
sarkfultion
dreads
📄
media-editor.js
29,460 B
sarkfultion
dreads
📄
media-editor.min.js
11,092 B
sarkfultion
dreads
📄
media-grid.js
27,752 B
sarkfultion
dreads
📄
media-grid.min.js
13,686 B
sarkfultion
dreads
📄
media-models.js
44,085 B
sarkfultion
dreads
📄
media-models.min.js
13,338 B
sarkfultion
dreads
📄
media-views.js
273,089 B
sarkfultion
dreads
📄
media-views.min.js
110,741 B
sarkfultion
dreads
📄
quicktags.js
22,601 B
sarkfultion
dreads
📄
quicktags.min.js
11,132 B
sarkfultion
dreads
📄
shortcode.js
10,758 B
sarkfultion
dreads
📄
shortcode.min.js
2,643 B
sarkfultion
dreads
📄
swfobject.js
0 B
sarkfultion
dreads
📄
swfobject.min.js
35 B
sarkfultion
dreads
📄
tw-sack.js
4,970 B
sarkfultion
dreads
📄
tw-sack.min.js
3,288 B
sarkfultion
dreads
📄
twemoji.js
37,180 B
sarkfultion
dreads
📄
twemoji.min.js
19,848 B
sarkfultion
dreads
📄
underscore.js
68,873 B
sarkfultion
dreads
📄
underscore.min.js
19,012 B
sarkfultion
dreads
📄
utils.js
4,665 B
sarkfultion
dreads
📄
utils.min.js
1,864 B
sarkfultion
dreads
📄
wp-ajax-response.js
3,903 B
sarkfultion
dreads
📄
wp-ajax-response.min.js
2,571 B
sarkfultion
dreads
📄
wp-api.js
46,994 B
sarkfultion
dreads
📄
wp-api.min.js
14,682 B
sarkfultion
dreads
📄
wp-auth-check.js
4,444 B
sarkfultion
dreads
📄
wp-auth-check.min.js
1,689 B
sarkfultion
dreads
📄
wp-backbone.js
15,241 B
sarkfultion
dreads
📄
wp-backbone.min.js
3,039 B
sarkfultion
dreads
📄
wp-custom-header.js
10,465 B
sarkfultion
dreads
📄
wp-custom-header.min.js
4,442 B
sarkfultion
dreads
📄
wp-embed-template.js
6,779 B
sarkfultion
dreads
📄
wp-embed-template.min.js
3,174 B
sarkfultion
dreads
📄
wp-embed.js
3,214 B
sarkfultion
dreads
📄
wp-embed.min.js
1,251 B
sarkfultion
dreads
📄
wp-emoji-loader.js
13,357 B
sarkfultion
dreads
📄
wp-emoji-loader.min.js
2,977 B
sarkfultion
dreads
📄
wp-emoji-release.min.js
22,752 B
sarkfultion
dreads
📄
wp-emoji.js
8,792 B
sarkfultion
dreads
📄
wp-emoji.min.js
2,855 B
sarkfultion
dreads
📄
wp-list-revisions.js
970 B
sarkfultion
dreads
📄
wp-list-revisions.min.js
597 B
sarkfultion
dreads
📄
wp-lists.js
25,315 B
sarkfultion
dreads
📄
wp-lists.min.js
7,521 B
sarkfultion
dreads
📄
wp-pointer.js
10,233 B
sarkfultion
dreads
📄
wp-pointer.min.js
3,621 B
sarkfultion
dreads
📄
wp-sanitize.js
1,622 B
sarkfultion
dreads
📄
wp-sanitize.min.js
402 B
sarkfultion
dreads
📄
wp-tooltip.js
1,846 B
sarkfultion
dreads
📄
wp-tooltip.min.js
643 B
sarkfultion
dreads
📄
wp-util.js
4,689 B
sarkfultion
dreads
📄
wp-util.min.js
1,431 B
sarkfultion
dreads
📄
wpdialog.js
569 B
sarkfultion
dreads
📄
wpdialog.min.js
281 B
sarkfultion
dreads
📄
wplink.js
21,240 B
sarkfultion
dreads
📄
wplink.min.js
11,317 B
sarkfultion
dreads
📄
zxcvbn-async.js
821 B
sarkfultion
dreads
📄
zxcvbn-async.min.js
351 B
sarkfultion
dreads
📄
zxcvbn.min.js
822,237 B
sarkfultion
dreads
redisq: customize-models.js
/** * @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 );
sarkfultion