CoreFiles by mySites.guru
embed.js37 lines, 855 bytes, from wordpress-4.2-beta2.zip
Raw History Compare with 4.2-beta1
md5
6d7b7231827f44de3ba71cb699dce57d
sha1
db83446b817ee6d086761007913340c31bb24648
sha256
7f01263eab646d57c6386208c0f2fef5e837c7268110b0d6f9068301b19277c1
/*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 = require( './select.js' ),
	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;

The same content is in 3 releases, WordPress 4.2-beta1 to 4.2-beta3. See them all, or every version of this file.