CoreFiles by mySites.guru
embed.js37 lines, 859 bytes, from wordpress-4.2-beta4.zip
Raw History Compare with 4.2-beta3
md5
9ef66f70b82474b364ee8b7200cbc03d
sha1
1284021bd47b5808e25618d5d40cc5e5d58396f0
sha256
78773d9d9610cd91fa1cbb93b54a7889f5dad9a7c714e168c398f5fd8966be3d
/*globals wp, _ */

/**
 * wp.media.view.Toolbar.Embed
 *
 * @class
 * @augments wp.media.view.Toolbar.Select
 * @augments wp.media.view.Toolbar
 * @augments wp.media.View
 * @augments wp.Backbone.View
 * @augments Backbone.View
 */
var Select = wp.media.view.Toolbar.Select,
	l10n = wp.media.view.l10n,
	Embed;

Embed = Select.extend({
	initialize: function() {
		_.defaults( this.options, {
			text: l10n.insertIntoPost,
			requires: false
		});
		// Call 'initialize' directly on the parent class.
		Select.prototype.initialize.apply( this, arguments );
	},

	refresh: function() {
		var url = this.controller.state().props.get('url');
		this.get('select').model.set( 'disabled', ! url || url === 'http://' );
		/**
		 * call 'refresh' directly on the parent class
		 */
		Select.prototype.refresh.apply( this, arguments );
	}
});

module.exports = Embed;

No other release has this exact content. See every version of this file.