Index: Gruntfile.js
===================================================================
--- Gruntfile.js	(revision 31383)
+++ Gruntfile.js	(working copy)
@@ -123,8 +123,7 @@
 					'src/wp-includes/js/media/views.js' : [ SOURCE_DIR + 'wp-includes/js/media/views.manifest.js' ],
 					'src/wp-includes/js/media/audio-video.js' : [ SOURCE_DIR + 'wp-includes/js/media/audio-video.manifest.js' ],
 					'src/wp-includes/js/media/grid.js' : [ SOURCE_DIR + 'wp-includes/js/media/grid.manifest.js' ]
-				},
-				options: { debug: true }
+				}
 			}
 		},
 		sass: {
@@ -235,6 +234,18 @@
 					'!twenty{fourteen,fifteen}/js/html5.js'
 				]
 			},
+			media: {
+				options: {
+					browserify: true
+				},
+				expand: true,
+				cwd: SOURCE_DIR,
+				src: [
+					'wp-includes/js/media/**/*.js',
+					'!wp-includes/js/media/*.js',
+					'wp-includes/js/media/*.manifest.js'
+				]
+			},
 			core: {
 				expand: true,
 				cwd: SOURCE_DIR,
@@ -507,7 +518,13 @@
 	grunt.registerTask('colors', ['sass:colors', 'autoprefixer:colors']);
 
 	// JSHint task.
-	grunt.registerTask('jshint:corejs', ['jshint:grunt', 'jshint:tests', 'jshint:themes', 'jshint:core']);
+	grunt.registerTask( 'jshint:corejs', [
+		'jshint:grunt',
+		'jshint:tests',
+		'jshint:themes',
+		'jshint:core',
+		'jshint:media'
+	] );
 
 	// Pre-commit task.
 	grunt.registerTask('precommit', 'Runs front-end dev/test tasks in preparation for a commit.',
Index: src/wp-includes/js/media/audio-video.js
===================================================================
--- src/wp-includes/js/media/audio-video.js	(revision 31383)
+++ src/wp-includes/js/media/audio-video.js	(working copy)
@@ -1,231 +1,221 @@
 (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
-/* global wp, _wpMediaViewsL10n, _wpmejsSettings, MediaElementPlayer */
+var media = wp.media,
+	baseSettings = window._wpmejsSettings || {},
+	l10n = window._wpMediaViewsL10n || {};
 
-(function(_) {
-	var media = wp.media,
-		baseSettings = {},
-		l10n = typeof _wpMediaViewsL10n === 'undefined' ? {} : _wpMediaViewsL10n;
+/**
+ * @mixin
+ */
+wp.media.mixin = {
+	mejsSettings: baseSettings,
 
-	if ( ! _.isUndefined( window._wpmejsSettings ) ) {
-		baseSettings = _wpmejsSettings;
-	}
+	removeAllPlayers: function() {
+		var p;
+
+		if ( window.mejs && window.mejs.players ) {
+			for ( p in window.mejs.players ) {
+				window.mejs.players[p].pause();
+				this.removePlayer( window.mejs.players[p] );
+			}
+		}
+	},
 
 	/**
-	 * @mixin
+	 * Override the MediaElement method for removing a player.
+	 *	MediaElement tries to pull the audio/video tag out of
+	 *	its container and re-add it to the DOM.
 	 */
-	wp.media.mixin = {
-		mejsSettings: baseSettings,
+	removePlayer: function(t) {
+		var featureIndex, feature;
 
-		removeAllPlayers: function() {
-			var p;
+		if ( ! t.options ) {
+			return;
+		}
 
-			if ( window.mejs && window.mejs.players ) {
-				for ( p in window.mejs.players ) {
-					window.mejs.players[p].pause();
-					this.removePlayer( window.mejs.players[p] );
-				}
+		// invoke features cleanup
+		for ( featureIndex in t.options.features ) {
+			feature = t.options.features[featureIndex];
+			if ( t['clean' + feature] ) {
+				try {
+					t['clean' + feature](t);
+				} catch (e) {}
 			}
-		},
+		}
 
-		/**
-		 * Override the MediaElement method for removing a player.
-		 *	MediaElement tries to pull the audio/video tag out of
-		 *	its container and re-add it to the DOM.
-		 */
-		removePlayer: function(t) {
-			var featureIndex, feature;
+		if ( ! t.isDynamic ) {
+			t.$node.remove();
+		}
 
-			if ( ! t.options ) {
-				return;
-			}
+		if ( 'native' !== t.media.pluginType ) {
+			t.media.remove();
+		}
 
-			// invoke features cleanup
-			for ( featureIndex in t.options.features ) {
-				feature = t.options.features[featureIndex];
-				if ( t['clean' + feature] ) {
-					try {
-						t['clean' + feature](t);
-					} catch (e) {}
-				}
-			}
+		delete window.mejs.players[t.id];
 
-			if ( ! t.isDynamic ) {
-				t.$node.remove();
-			}
+		t.container.remove();
+		t.globalUnbind();
+		delete t.node.player;
+	},
 
-			if ( 'native' !== t.media.pluginType ) {
-				t.media.remove();
-			}
+	/**
+	 * Allows any class that has set 'player' to a MediaElementPlayer
+	 *  instance to remove the player when listening to events.
+	 *
+	 *  Examples: modal closes, shortcode properties are removed, etc.
+	 */
+	unsetPlayers : function() {
+		if ( this.players && this.players.length ) {
+			_.each( this.players, function (player) {
+				player.pause();
+				wp.media.mixin.removePlayer( player );
+			} );
+			this.players = [];
+		}
+	}
+};
 
-			delete window.mejs.players[t.id];
+/**
+ * Autowire "collection"-type shortcodes
+ */
+wp.media.playlist = new wp.media.collection({
+	tag: 'playlist',
+	editTitle : l10n.editPlaylistTitle,
+	defaults : {
+		id: wp.media.view.settings.post.id,
+		style: 'light',
+		tracklist: true,
+		tracknumbers: true,
+		images: true,
+		artists: true,
+		type: 'audio'
+	}
+});
 
-			t.container.remove();
-			t.globalUnbind();
-			delete t.node.player;
-		},
+/**
+ * Shortcode modeling for audio
+ *  `edit()` prepares the shortcode for the media modal
+ *  `shortcode()` builds the new shortcode after update
+ *
+ * @namespace
+ */
+wp.media.audio = {
+	coerce : wp.media.coerce,
 
-		/**
-		 * Allows any class that has set 'player' to a MediaElementPlayer
-		 *  instance to remove the player when listening to events.
-		 *
-		 *  Examples: modal closes, shortcode properties are removed, etc.
-		 */
-		unsetPlayers : function() {
-			if ( this.players && this.players.length ) {
-				_.each( this.players, function (player) {
-					player.pause();
-					wp.media.mixin.removePlayer( player );
-				} );
-				this.players = [];
-			}
-		}
-	};
+	defaults : {
+		id : wp.media.view.settings.post.id,
+		src : '',
+		loop : false,
+		autoplay : false,
+		preload : 'none',
+		width : 400
+	},
 
-	/**
-	 * Autowire "collection"-type shortcodes
-	 */
-	wp.media.playlist = new wp.media.collection({
-		tag: 'playlist',
-		editTitle : l10n.editPlaylistTitle,
-		defaults : {
-			id: wp.media.view.settings.post.id,
-			style: 'light',
-			tracklist: true,
-			tracknumbers: true,
-			images: true,
-			artists: true,
-			type: 'audio'
-		}
-	});
-
-	/**
-	 * Shortcode modeling for audio
-	 *  `edit()` prepares the shortcode for the media modal
-	 *  `shortcode()` builds the new shortcode after update
-	 *
-	 * @namespace
-	 */
-	wp.media.audio = {
-		coerce : wp.media.coerce,
-
-		defaults : {
-			id : wp.media.view.settings.post.id,
-			src : '',
-			loop : false,
-			autoplay : false,
-			preload : 'none',
-			width : 400
-		},
-
-		edit : function( data ) {
-			var frame, shortcode = wp.shortcode.next( 'audio', data ).shortcode;
-
-			frame = wp.media({
-				frame: 'audio',
-				state: 'audio-details',
-				metadata: _.defaults( shortcode.attrs.named, this.defaults )
-			});
+	edit : function( data ) {
+		var frame, shortcode = wp.shortcode.next( 'audio', data ).shortcode;
 
-			return frame;
-		},
+		frame = wp.media({
+			frame: 'audio',
+			state: 'audio-details',
+			metadata: _.defaults( shortcode.attrs.named, this.defaults )
+		});
 
-		shortcode : function( model ) {
-			var content;
+		return frame;
+	},
 
-			_.each( this.defaults, function( value, key ) {
-				model[ key ] = self.coerce( model, key );
+	shortcode : function( model ) {
+		var content;
 
-				if ( value === model[ key ] ) {
-					delete model[ key ];
-				}
-			}, this );
+		_.each( this.defaults, function( value, key ) {
+			model[ key ] = this.coerce( model, key );
 
-			content = model.content;
-			delete model.content;
+			if ( value === model[ key ] ) {
+				delete model[ key ];
+			}
+		}, this );
 
-			return new wp.shortcode({
-				tag: 'audio',
-				attrs: model,
-				content: content
-			});
-		}
-	};
+		content = model.content;
+		delete model.content;
 
-	/**
-	 * Shortcode modeling for video
-	 *  `edit()` prepares the shortcode for the media modal
-	 *  `shortcode()` builds the new shortcode after update
-	 *
-	 * @namespace
-	 */
-	wp.media.video = {
-		coerce : wp.media.coerce,
-
-		defaults : {
-			id : wp.media.view.settings.post.id,
-			src : '',
-			poster : '',
-			loop : false,
-			autoplay : false,
-			preload : 'metadata',
-			content : '',
-			width : 640,
-			height : 360
-		},
-
-		edit : function( data ) {
-			var frame,
-				shortcode = wp.shortcode.next( 'video', data ).shortcode,
-				attrs;
-
-			attrs = shortcode.attrs.named;
-			attrs.content = shortcode.content;
-
-			frame = wp.media({
-				frame: 'video',
-				state: 'video-details',
-				metadata: _.defaults( attrs, this.defaults )
-			});
+		return new wp.shortcode({
+			tag: 'audio',
+			attrs: model,
+			content: content
+		});
+	}
+};
+
+/**
+ * Shortcode modeling for video
+ *  `edit()` prepares the shortcode for the media modal
+ *  `shortcode()` builds the new shortcode after update
+ *
+ * @namespace
+ */
+wp.media.video = {
+	coerce : wp.media.coerce,
+
+	defaults : {
+		id : wp.media.view.settings.post.id,
+		src : '',
+		poster : '',
+		loop : false,
+		autoplay : false,
+		preload : 'metadata',
+		content : '',
+		width : 640,
+		height : 360
+	},
+
+	edit : function( data ) {
+		var frame,
+			shortcode = wp.shortcode.next( 'video', data ).shortcode,
+			attrs;
+
+		attrs = shortcode.attrs.named;
+		attrs.content = shortcode.content;
+
+		frame = wp.media({
+			frame: 'video',
+			state: 'video-details',
+			metadata: _.defaults( attrs, this.defaults )
+		});
 
-			return frame;
-		},
+		return frame;
+	},
 
-		shortcode : function( model ) {
-			var content;
+	shortcode : function( model ) {
+		var content;
 
-			_.each( this.defaults, function( value, key ) {
-				model[ key ] = this.coerce( model, key );
+		_.each( this.defaults, function( value, key ) {
+			model[ key ] = this.coerce( model, key );
 
-				if ( value === model[ key ] ) {
-					delete model[ key ];
-				}
-			}, this );
+			if ( value === model[ key ] ) {
+				delete model[ key ];
+			}
+		}, this );
 
-			content = model.content;
-			delete model.content;
+		content = model.content;
+		delete model.content;
 
-			return new wp.shortcode({
-				tag: 'video',
-				attrs: model,
-				content: content
-			});
-		}
-	};
+		return new wp.shortcode({
+			tag: 'video',
+			attrs: model,
+			content: content
+		});
+	}
+};
 
-	media.model.PostMedia = require( './models/post-media.js' );
-	media.controller.AudioDetails = require( './controllers/audio-details.js' );
-	media.controller.VideoDetails = require( './controllers/video-details.js' );
-	media.view.MediaFrame.MediaDetails = require( './views/frame/media-details.js' );
-	media.view.MediaFrame.AudioDetails = require( './views/frame/audio-details.js' );
-	media.view.MediaFrame.VideoDetails = require( './views/frame/video-details.js' );
-	media.view.MediaDetails = require( './views/media-details.js' );
-	media.view.AudioDetails = require( './views/audio-details.js' );
-	media.view.VideoDetails = require( './views/video-details.js' );
+media.model.PostMedia = require( './models/post-media.js' );
+media.controller.AudioDetails = require( './controllers/audio-details.js' );
+media.controller.VideoDetails = require( './controllers/video-details.js' );
+media.view.MediaFrame.MediaDetails = require( './views/frame/media-details.js' );
+media.view.MediaFrame.AudioDetails = require( './views/frame/audio-details.js' );
+media.view.MediaFrame.VideoDetails = require( './views/frame/video-details.js' );
+media.view.MediaDetails = require( './views/media-details.js' );
+media.view.AudioDetails = require( './views/audio-details.js' );
+media.view.VideoDetails = require( './views/video-details.js' );
 
-}(_));
 },{"./controllers/audio-details.js":2,"./controllers/video-details.js":8,"./models/post-media.js":9,"./views/audio-details.js":21,"./views/frame/audio-details.js":25,"./views/frame/media-details.js":26,"./views/frame/video-details.js":28,"./views/media-details.js":31,"./views/video-details.js":50}],2:[function(require,module,exports){
-/*globals wp */
-
 /**
  * The controller for the Audio Details state
  *
@@ -255,9 +245,8 @@
 });
 
 module.exports = AudioDetails;
-},{"./state.js":7}],3:[function(require,module,exports){
-/*globals _, wp, Backbone, getUserSetting, setUserSetting */
 
+},{"./state.js":7}],3:[function(require,module,exports){
 /**
  * wp.media.controller.Library
  *
@@ -295,6 +284,8 @@
 var selectionSync = require( '../utils/selection-sync.js' ),
 	State = require( './state.js' ),
 	l10n = wp.media.view.l10n,
+	getUserSetting = window.getUserSetting,
+	setUserSetting = window.setUserSetting,
 	Library;
 
 Library = State.extend({
@@ -329,7 +320,7 @@
 			this.set( 'library', wp.media.query() );
 		}
 
-		if ( ! (selection instanceof Selection) ) {
+		if ( ! ( selection instanceof wp.media.model.Selection ) ) {
 			props = selection;
 
 			if ( ! props ) {
@@ -528,9 +519,8 @@
 _.extend( Library.prototype, selectionSync );
 
 module.exports = Library;
-},{"../utils/selection-sync.js":10,"./state.js":7}],4:[function(require,module,exports){
-/*globals _, wp */
 
+},{"../utils/selection-sync.js":10,"./state.js":7}],4:[function(require,module,exports){
 /**
  * wp.media.controller.MediaLibrary
  *
@@ -579,9 +569,8 @@
 });
 
 module.exports = MediaLibrary;
-},{"./library.js":3}],5:[function(require,module,exports){
-/*globals _, Backbone */
 
+},{"./library.js":3}],5:[function(require,module,exports){
 /**
  * wp.media.controller.Region
  *
@@ -759,9 +748,8 @@
 });
 
 module.exports = Region;
-},{}],6:[function(require,module,exports){
-/*globals _, Backbone */
 
+},{}],6:[function(require,module,exports){
 /**
  * wp.media.controller.StateMachine
  *
@@ -884,9 +872,8 @@
 });
 
 module.exports = StateMachine;
-},{}],7:[function(require,module,exports){
-/*globals _, Backbone */
 
+},{}],7:[function(require,module,exports){
 /**
  * wp.media.controller.State
  *
@@ -1126,9 +1113,8 @@
 });
 
 module.exports = State;
-},{}],8:[function(require,module,exports){
-/*globals wp */
 
+},{}],8:[function(require,module,exports){
 /**
  * The controller for the Video Details state
  *
@@ -1158,9 +1144,8 @@
 });
 
 module.exports = VideoDetails;
-},{"./state.js":7}],9:[function(require,module,exports){
-/*globals Backbone, _, wp */
 
+},{"./state.js":7}],9:[function(require,module,exports){
 /**
  * Shared model class for audio and video. Updates the model after
  *   "Add Audio|Video Source" and "Replace Audio|Video" states return
@@ -1199,9 +1184,8 @@
 });
 
 module.exports = PostMedia;
-},{}],10:[function(require,module,exports){
-/*globals _ */
 
+},{}],10:[function(require,module,exports){
 /**
  * wp.media.selectionSync
  *
@@ -1266,9 +1250,8 @@
 };
 
 module.exports = selectionSync;
-},{}],11:[function(require,module,exports){
-/*globals _ */
 
+},{}],11:[function(require,module,exports){
 /**
  * wp.media.view.AttachmentCompat
  *
@@ -1352,9 +1335,8 @@
 });
 
 module.exports = AttachmentCompat;
-},{"./view.js":51}],12:[function(require,module,exports){
-/*globals _, jQuery */
 
+},{"./view.js":51}],12:[function(require,module,exports){
 /**
  * wp.media.view.AttachmentFilters
  *
@@ -1431,9 +1413,8 @@
 });
 
 module.exports = AttachmentFilters;
-},{"./view.js":51}],13:[function(require,module,exports){
-/*globals _, wp */
 
+},{"./view.js":51}],13:[function(require,module,exports){
 /**
  * wp.media.view.AttachmentFilters.All
  *
@@ -1523,9 +1504,8 @@
 });
 
 module.exports = All;
-},{"../attachment-filters.js":12}],14:[function(require,module,exports){
-/*globals _, wp */
 
+},{"../attachment-filters.js":12}],14:[function(require,module,exports){
 /**
  * A filter dropdown for month/dates.
  *
@@ -1566,9 +1546,8 @@
 });
 
 module.exports = DateFilter;
-},{"../attachment-filters.js":12}],15:[function(require,module,exports){
-/*globals wp */
 
+},{"../attachment-filters.js":12}],15:[function(require,module,exports){
 /**
  * wp.media.view.AttachmentFilters.Uploaded
  *
@@ -1627,9 +1606,8 @@
 });
 
 module.exports = Uploaded;
-},{"../attachment-filters.js":12}],16:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"../attachment-filters.js":12}],16:[function(require,module,exports){
 /**
  * wp.media.view.Attachment
  *
@@ -2182,9 +2160,8 @@
 });
 
 module.exports = Attachment;
-},{"./view.js":51}],17:[function(require,module,exports){
-/*globals _, wp */
 
+},{"./view.js":51}],17:[function(require,module,exports){
 /**
  * wp.media.view.Attachment.Details
  *
@@ -2244,7 +2221,7 @@
 	deleteAttachment: function( event ) {
 		event.preventDefault();
 
-		if ( confirm( l10n.warnDelete ) ) {
+		if ( window.confirm( l10n.warnDelete ) ) {
 			this.model.destroy();
 			// Keep focus inside media modal
 			// after image is deleted
@@ -2323,6 +2300,7 @@
 });
 
 module.exports = Details;
+
 },{"../attachment.js":16}],18:[function(require,module,exports){
 /**
  * wp.media.view.Attachment.Library
@@ -2343,9 +2321,8 @@
 });
 
 module.exports = Library;
-},{"../attachment.js":16}],19:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"../attachment.js":16}],19:[function(require,module,exports){
 /**
  * wp.media.view.Attachments
  *
@@ -2618,7 +2595,7 @@
 
 		// The scroll event occurs on the document, but the element
 		// that should be checked is the document body.
-		if ( el == document ) {
+		if ( el === document ) {
 			el = document.body;
 			scrollTop = $(document).scrollTop();
 		}
@@ -2644,9 +2621,8 @@
 });
 
 module.exports = Attachments;
-},{"./attachment.js":16,"./view.js":51}],20:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"./attachment.js":16,"./view.js":51}],20:[function(require,module,exports){
 /**
  * wp.media.view.AttachmentsBrowser
  *
@@ -2837,13 +2813,13 @@
 						return;
 					}
 
-					if ( ! mediaTrash && ! confirm( l10n.warnBulkDelete ) ) {
+					if ( ! mediaTrash && ! window.confirm( l10n.warnBulkDelete ) ) {
 						return;
 					}
 
 					if ( mediaTrash &&
 						'trash' !== selection.at( 0 ).get( 'status' ) &&
-						! confirm( l10n.warnBulkTrash ) ) {
+						! window.confirm( l10n.warnBulkTrash ) ) {
 
 						return;
 					}
@@ -2891,7 +2867,7 @@
 					click: function() {
 						var removed = [], selection = this.controller.state().get( 'selection' );
 
-						if ( ! selection.length || ! confirm( l10n.warnBulkDelete ) ) {
+						if ( ! selection.length || ! window.confirm( l10n.warnBulkDelete ) ) {
 							return;
 						}
 
@@ -3104,9 +3080,8 @@
 });
 
 module.exports = AttachmentsBrowser;
-},{"../attachment-compat.js":11,"../attachment-filters/all.js":13,"../attachment-filters/date.js":14,"../attachment-filters/uploaded.js":15,"../attachment/details.js":17,"../attachment/library.js":18,"../attachments.js":19,"../label.js":30,"../search.js":39,"../settings/attachment-display.js":41,"../sidebar.js":42,"../spinner.js":43,"../toolbar.js":44,"../uploader/inline.js":46,"../uploader/status.js":48,"../view.js":51}],21:[function(require,module,exports){
-/*globals wp */
 
+},{"../attachment-compat.js":11,"../attachment-filters/all.js":13,"../attachment-filters/date.js":14,"../attachment-filters/uploaded.js":15,"../attachment/details.js":17,"../attachment/library.js":18,"../attachments.js":19,"../label.js":30,"../search.js":39,"../settings/attachment-display.js":41,"../sidebar.js":42,"../spinner.js":43,"../toolbar.js":44,"../uploader/inline.js":46,"../uploader/status.js":48,"../view.js":51}],21:[function(require,module,exports){
 /**
  * wp.media.view.AudioDetails
  *
@@ -3143,9 +3118,8 @@
 });
 
 module.exports = AudioDetails;
-},{"./media-details":31}],22:[function(require,module,exports){
-/*globals _, Backbone */
 
+},{"./media-details":31}],22:[function(require,module,exports){
 /**
  * wp.media.view.Button
  *
@@ -3233,6 +3207,7 @@
 });
 
 module.exports = Button;
+
 },{"./view.js":51}],23:[function(require,module,exports){
 /**
  * wp.media.view.FocusManager
@@ -3281,9 +3256,8 @@
 });
 
 module.exports = FocusManager;
-},{"./view.js":51}],24:[function(require,module,exports){
-/*globals _, Backbone */
 
+},{"./view.js":51}],24:[function(require,module,exports){
 /**
  * wp.media.view.Frame
  *
@@ -3454,9 +3428,8 @@
 _.extend( Frame.prototype, StateMachine.prototype );
 
 module.exports = Frame;
-},{"../controllers/region.js":5,"../controllers/state-machine.js":6,"../controllers/state.js":7,"./view.js":51}],25:[function(require,module,exports){
-/*globals wp */
 
+},{"../controllers/region.js":5,"../controllers/state-machine.js":6,"../controllers/state.js":7,"./view.js":51}],25:[function(require,module,exports){
 /**
  * wp.media.view.MediaFrame.AudioDetails
  *
@@ -3532,9 +3505,8 @@
 });
 
 module.exports = AudioDetails;
-},{"../../controllers/audio-details.js":2,"../../controllers/media-library.js":4,"../audio-details.js":21,"./media-details":26}],26:[function(require,module,exports){
-/*globals wp */
 
+},{"../../controllers/audio-details.js":2,"../../controllers/media-library.js":4,"../audio-details.js":21,"./media-details":26}],26:[function(require,module,exports){
 /**
  * wp.media.view.MediaFrame.MediaDetails
  *
@@ -3665,9 +3637,8 @@
 });
 
 module.exports = MediaDetails;
-},{"../toolbar.js":44,"../view.js":51,"./select.js":27}],27:[function(require,module,exports){
-/*globals _, wp */
 
+},{"../toolbar.js":44,"../view.js":51,"./select.js":27}],27:[function(require,module,exports){
 /**
  * wp.media.view.MediaFrame.Select
  *
@@ -3840,9 +3811,8 @@
 });
 
 module.exports = Select;
-},{"../../controllers/library.js":3,"../attachments/browser.js":20,"../media-frame.js":32,"../toolbar/select.js":45,"../uploader/inline.js":46}],28:[function(require,module,exports){
-/*globals _, wp */
 
+},{"../../controllers/library.js":3,"../attachments/browser.js":20,"../media-frame.js":32,"../toolbar/select.js":45,"../uploader/inline.js":46}],28:[function(require,module,exports){
 /**
  * wp.media.view.MediaFrame.VideoDetails
  *
@@ -3978,6 +3948,7 @@
 });
 
 module.exports = VideoDetails;
+
 },{"../../controllers/media-library.js":4,"../../controllers/video-details.js":8,"../video-details.js":50,"./media-details":26}],29:[function(require,module,exports){
 /**
  * wp.media.view.Iframe
@@ -4004,6 +3975,7 @@
 });
 
 module.exports = Iframe;
+
 },{"./view.js":51}],30:[function(require,module,exports){
 /**
  * @class
@@ -4030,9 +4002,8 @@
 });
 
 module.exports = Label;
-},{"./view.js":51}],31:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"./view.js":51}],31:[function(require,module,exports){
 /**
  * wp.media.view.MediaDetails
  *
@@ -4116,7 +4087,7 @@
 	 */
 	setPlayer : function() {
 		if ( ! this.players.length && this.media ) {
-			this.players.push( new MediaElementPlayer( this.media, this.settings ) );
+			this.players.push( new window.MediaElementPlayer( this.media, this.settings ) );
 		}
 	},
 
@@ -4144,7 +4115,7 @@
 	 */
 	render: function() {
 		AttachmentDisplay.prototype.render.apply( this, arguments );
-		
+
 		setTimeout( _.bind( function() {
 			this.resetFocus();
 		}, this ), 10 );
@@ -4183,9 +4154,8 @@
 });
 
 module.exports = MediaDetails;
-},{"./settings/attachment-display.js":41}],32:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"./settings/attachment-display.js":41}],32:[function(require,module,exports){
 /**
  * wp.media.view.MediaFrame
  *
@@ -4438,9 +4408,8 @@
 });
 
 module.exports = MediaFrame;
-},{"./frame.js":24,"./iframe.js":29,"./menu.js":34,"./modal.js":35,"./router.js":38,"./toolbar.js":44,"./uploader/window.js":49,"./view.js":51}],33:[function(require,module,exports){
-/*globals wp, jQuery */
 
+},{"./frame.js":24,"./iframe.js":29,"./menu.js":34,"./modal.js":35,"./router.js":38,"./toolbar.js":44,"./uploader/window.js":49,"./view.js":51}],33:[function(require,module,exports){
 /**
  * wp.media.view.MenuItem
  *
@@ -4512,6 +4481,7 @@
 });
 
 module.exports = MenuItem;
+
 },{"./view.js":51}],34:[function(require,module,exports){
 /**
  * wp.media.view.Menu
@@ -4628,9 +4598,8 @@
 });
 
 module.exports = Menu;
-},{"./menu-item.js":33,"./priority-list.js":36}],35:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"./menu-item.js":33,"./priority-list.js":36}],35:[function(require,module,exports){
 /**
  * wp.media.view.Modal
  *
@@ -4844,9 +4813,8 @@
 });
 
 module.exports = Modal;
-},{"./focus-manager.js":23,"./view.js":51}],36:[function(require,module,exports){
-/*globals _, Backbone */
 
+},{"./focus-manager.js":23,"./view.js":51}],36:[function(require,module,exports){
 /**
  * wp.media.view.PriorityList
  *
@@ -4945,6 +4913,7 @@
 });
 
 module.exports = PriorityList;
+
 },{"./view.js":51}],37:[function(require,module,exports){
 /**
  * wp.media.view.RouterItem
@@ -4971,6 +4940,7 @@
 });
 
 module.exports = RouterItem;
+
 },{"./menu-item.js":33}],38:[function(require,module,exports){
 /**
  * wp.media.view.Router
@@ -5008,9 +4978,8 @@
 });
 
 module.exports = Router;
-},{"./menu.js":34,"./router-item.js":37}],39:[function(require,module,exports){
-/*globals wp */
 
+},{"./menu.js":34,"./router-item.js":37}],39:[function(require,module,exports){
 /**
  * wp.media.view.Search
  *
@@ -5058,9 +5027,8 @@
 });
 
 module.exports = Search;
-},{"./view.js":51}],40:[function(require,module,exports){
-/*globals _, Backbone, jQuery */
 
+},{"./view.js":51}],40:[function(require,module,exports){
 /**
  * wp.media.view.Settings
  *
@@ -5168,7 +5136,7 @@
 		// If the setting has a corresponding user setting,
 		// update that as well.
 		if ( userSetting = $setting.data('userSetting') ) {
-			setUserSetting( userSetting, value );
+			window.setUserSetting( userSetting, value );
 		}
 	},
 
@@ -5180,9 +5148,8 @@
 });
 
 module.exports = Settings;
-},{"./view.js":51}],41:[function(require,module,exports){
-/*globals _, wp */
 
+},{"./view.js":51}],41:[function(require,module,exports){
 /**
  * wp.media.view.Settings.AttachmentDisplay
  *
@@ -5275,6 +5242,7 @@
 });
 
 module.exports = AttachmentDisplay;
+
 },{"../settings.js":40}],42:[function(require,module,exports){
 /**
  * wp.media.view.Sidebar
@@ -5293,9 +5261,8 @@
 });
 
 module.exports = Sidebar;
-},{"./priority-list.js":36}],43:[function(require,module,exports){
-/*globals _, wp */
 
+},{"./priority-list.js":36}],43:[function(require,module,exports){
 /**
  * wp.media.view.Spinner
  *
@@ -5332,9 +5299,8 @@
 });
 
 module.exports = Spinner;
-},{"./view.js":51}],44:[function(require,module,exports){
-/*globals Backbone, _ */
 
+},{"./view.js":51}],44:[function(require,module,exports){
 /**
  * wp.media.view.Toolbar
  *
@@ -5495,9 +5461,8 @@
 });
 
 module.exports = Toolbar;
-},{"./button.js":22,"./priority-list.js":36,"./view.js":51}],45:[function(require,module,exports){
-/*globals _, wp */
 
+},{"./button.js":22,"./priority-list.js":36,"./view.js":51}],45:[function(require,module,exports){
 /**
  * wp.media.view.Toolbar.Select
  *
@@ -5566,9 +5531,8 @@
 });
 
 module.exports = Select;
-},{"../toolbar.js":44}],46:[function(require,module,exports){
-/*globals _, wp */
 
+},{"../toolbar.js":44}],46:[function(require,module,exports){
 /**
  * wp.media.view.UploaderInline
  *
@@ -5699,9 +5663,8 @@
 });
 
 module.exports = UploaderInline;
-},{"../view.js":51,"./status.js":48}],47:[function(require,module,exports){
-/*globals wp */
 
+},{"../view.js":51,"./status.js":48}],47:[function(require,module,exports){
 /**
  * wp.media.view.UploaderStatusError
  *
@@ -5719,9 +5682,8 @@
 });
 
 module.exports = UploaderStatusError;
-},{"../view.js":51}],48:[function(require,module,exports){
-/*globals _, wp */
 
+},{"../view.js":51}],48:[function(require,module,exports){
 /**
  * wp.media.view.UploaderStatus
  *
@@ -5859,9 +5821,8 @@
 });
 
 module.exports = UploaderStatus;
-},{"../view.js":51,"./status-error.js":47}],49:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"../view.js":51,"./status-error.js":47}],49:[function(require,module,exports){
 /**
  * wp.media.view.UploaderWindow
  *
@@ -5972,9 +5933,8 @@
 });
 
 module.exports = UploaderWindow;
-},{"../view.js":51}],50:[function(require,module,exports){
-/*globals wp */
 
+},{"../view.js":51}],50:[function(require,module,exports){
 /**
  * wp.media.view.VideoDetails
  *
@@ -6016,9 +5976,8 @@
 });
 
 module.exports = VideoDetails;
-},{"./media-details":31}],51:[function(require,module,exports){
-/*globals wp */
 
+},{"./media-details":31}],51:[function(require,module,exports){
 /**
  * wp.media.View
  *
@@ -6083,4 +6042,5 @@
 });
 
 module.exports = View;
+
 },{}]},{},[1]);
Index: src/wp-includes/js/media/audio-video.manifest.js
===================================================================
--- src/wp-includes/js/media/audio-video.manifest.js	(revision 31383)
+++ src/wp-includes/js/media/audio-video.manifest.js	(working copy)
@@ -1,224 +1,215 @@
-/* global wp, _wpMediaViewsL10n, _wpmejsSettings, MediaElementPlayer */
-
-(function(_) {
-	var media = wp.media,
-		baseSettings = {},
-		l10n = typeof _wpMediaViewsL10n === 'undefined' ? {} : _wpMediaViewsL10n;
-
-	if ( ! _.isUndefined( window._wpmejsSettings ) ) {
-		baseSettings = _wpmejsSettings;
-	}
+var media = wp.media,
+	baseSettings = window._wpmejsSettings || {},
+	l10n = window._wpMediaViewsL10n || {};
+
+/**
+ * @mixin
+ */
+wp.media.mixin = {
+	mejsSettings: baseSettings,
+
+	removeAllPlayers: function() {
+		var p;
+
+		if ( window.mejs && window.mejs.players ) {
+			for ( p in window.mejs.players ) {
+				window.mejs.players[p].pause();
+				this.removePlayer( window.mejs.players[p] );
+			}
+		}
+	},
 
 	/**
-	 * @mixin
+	 * Override the MediaElement method for removing a player.
+	 *	MediaElement tries to pull the audio/video tag out of
+	 *	its container and re-add it to the DOM.
 	 */
-	wp.media.mixin = {
-		mejsSettings: baseSettings,
-
-		removeAllPlayers: function() {
-			var p;
-
-			if ( window.mejs && window.mejs.players ) {
-				for ( p in window.mejs.players ) {
-					window.mejs.players[p].pause();
-					this.removePlayer( window.mejs.players[p] );
-				}
-			}
-		},
+	removePlayer: function(t) {
+		var featureIndex, feature;
 
-		/**
-		 * Override the MediaElement method for removing a player.
-		 *	MediaElement tries to pull the audio/video tag out of
-		 *	its container and re-add it to the DOM.
-		 */
-		removePlayer: function(t) {
-			var featureIndex, feature;
-
-			if ( ! t.options ) {
-				return;
-			}
-
-			// invoke features cleanup
-			for ( featureIndex in t.options.features ) {
-				feature = t.options.features[featureIndex];
-				if ( t['clean' + feature] ) {
-					try {
-						t['clean' + feature](t);
-					} catch (e) {}
-				}
-			}
-
-			if ( ! t.isDynamic ) {
-				t.$node.remove();
-			}
+		if ( ! t.options ) {
+			return;
+		}
 
-			if ( 'native' !== t.media.pluginType ) {
-				t.media.remove();
+		// invoke features cleanup
+		for ( featureIndex in t.options.features ) {
+			feature = t.options.features[featureIndex];
+			if ( t['clean' + feature] ) {
+				try {
+					t['clean' + feature](t);
+				} catch (e) {}
 			}
+		}
 
-			delete window.mejs.players[t.id];
-
-			t.container.remove();
-			t.globalUnbind();
-			delete t.node.player;
-		},
-
-		/**
-		 * Allows any class that has set 'player' to a MediaElementPlayer
-		 *  instance to remove the player when listening to events.
-		 *
-		 *  Examples: modal closes, shortcode properties are removed, etc.
-		 */
-		unsetPlayers : function() {
-			if ( this.players && this.players.length ) {
-				_.each( this.players, function (player) {
-					player.pause();
-					wp.media.mixin.removePlayer( player );
-				} );
-				this.players = [];
-			}
+		if ( ! t.isDynamic ) {
+			t.$node.remove();
 		}
-	};
 
-	/**
-	 * Autowire "collection"-type shortcodes
-	 */
-	wp.media.playlist = new wp.media.collection({
-		tag: 'playlist',
-		editTitle : l10n.editPlaylistTitle,
-		defaults : {
-			id: wp.media.view.settings.post.id,
-			style: 'light',
-			tracklist: true,
-			tracknumbers: true,
-			images: true,
-			artists: true,
-			type: 'audio'
+		if ( 'native' !== t.media.pluginType ) {
+			t.media.remove();
 		}
-	});
 
-	/**
-	 * Shortcode modeling for audio
-	 *  `edit()` prepares the shortcode for the media modal
-	 *  `shortcode()` builds the new shortcode after update
-	 *
-	 * @namespace
-	 */
-	wp.media.audio = {
-		coerce : wp.media.coerce,
+		delete window.mejs.players[t.id];
 
-		defaults : {
-			id : wp.media.view.settings.post.id,
-			src : '',
-			loop : false,
-			autoplay : false,
-			preload : 'none',
-			width : 400
-		},
-
-		edit : function( data ) {
-			var frame, shortcode = wp.shortcode.next( 'audio', data ).shortcode;
-
-			frame = wp.media({
-				frame: 'audio',
-				state: 'audio-details',
-				metadata: _.defaults( shortcode.attrs.named, this.defaults )
-			});
-
-			return frame;
-		},
-
-		shortcode : function( model ) {
-			var content;
-
-			_.each( this.defaults, function( value, key ) {
-				model[ key ] = self.coerce( model, key );
-
-				if ( value === model[ key ] ) {
-					delete model[ key ];
-				}
-			}, this );
-
-			content = model.content;
-			delete model.content;
-
-			return new wp.shortcode({
-				tag: 'audio',
-				attrs: model,
-				content: content
-			});
-		}
-	};
+		t.container.remove();
+		t.globalUnbind();
+		delete t.node.player;
+	},
 
 	/**
-	 * Shortcode modeling for video
-	 *  `edit()` prepares the shortcode for the media modal
-	 *  `shortcode()` builds the new shortcode after update
+	 * Allows any class that has set 'player' to a MediaElementPlayer
+	 *  instance to remove the player when listening to events.
 	 *
-	 * @namespace
+	 *  Examples: modal closes, shortcode properties are removed, etc.
 	 */
-	wp.media.video = {
-		coerce : wp.media.coerce,
+	unsetPlayers : function() {
+		if ( this.players && this.players.length ) {
+			_.each( this.players, function (player) {
+				player.pause();
+				wp.media.mixin.removePlayer( player );
+			} );
+			this.players = [];
+		}
+	}
+};
+
+/**
+ * Autowire "collection"-type shortcodes
+ */
+wp.media.playlist = new wp.media.collection({
+	tag: 'playlist',
+	editTitle : l10n.editPlaylistTitle,
+	defaults : {
+		id: wp.media.view.settings.post.id,
+		style: 'light',
+		tracklist: true,
+		tracknumbers: true,
+		images: true,
+		artists: true,
+		type: 'audio'
+	}
+});
 
-		defaults : {
-			id : wp.media.view.settings.post.id,
-			src : '',
-			poster : '',
-			loop : false,
-			autoplay : false,
-			preload : 'metadata',
-			content : '',
-			width : 640,
-			height : 360
-		},
-
-		edit : function( data ) {
-			var frame,
-				shortcode = wp.shortcode.next( 'video', data ).shortcode,
-				attrs;
-
-			attrs = shortcode.attrs.named;
-			attrs.content = shortcode.content;
-
-			frame = wp.media({
-				frame: 'video',
-				state: 'video-details',
-				metadata: _.defaults( attrs, this.defaults )
-			});
-
-			return frame;
-		},
-
-		shortcode : function( model ) {
-			var content;
-
-			_.each( this.defaults, function( value, key ) {
-				model[ key ] = this.coerce( model, key );
-
-				if ( value === model[ key ] ) {
-					delete model[ key ];
-				}
-			}, this );
-
-			content = model.content;
-			delete model.content;
-
-			return new wp.shortcode({
-				tag: 'video',
-				attrs: model,
-				content: content
-			});
-		}
-	};
-
-	media.model.PostMedia = require( './models/post-media.js' );
-	media.controller.AudioDetails = require( './controllers/audio-details.js' );
-	media.controller.VideoDetails = require( './controllers/video-details.js' );
-	media.view.MediaFrame.MediaDetails = require( './views/frame/media-details.js' );
-	media.view.MediaFrame.AudioDetails = require( './views/frame/audio-details.js' );
-	media.view.MediaFrame.VideoDetails = require( './views/frame/video-details.js' );
-	media.view.MediaDetails = require( './views/media-details.js' );
-	media.view.AudioDetails = require( './views/audio-details.js' );
-	media.view.VideoDetails = require( './views/video-details.js' );
+/**
+ * Shortcode modeling for audio
+ *  `edit()` prepares the shortcode for the media modal
+ *  `shortcode()` builds the new shortcode after update
+ *
+ * @namespace
+ */
+wp.media.audio = {
+	coerce : wp.media.coerce,
+
+	defaults : {
+		id : wp.media.view.settings.post.id,
+		src : '',
+		loop : false,
+		autoplay : false,
+		preload : 'none',
+		width : 400
+	},
+
+	edit : function( data ) {
+		var frame, shortcode = wp.shortcode.next( 'audio', data ).shortcode;
+
+		frame = wp.media({
+			frame: 'audio',
+			state: 'audio-details',
+			metadata: _.defaults( shortcode.attrs.named, this.defaults )
+		});
+
+		return frame;
+	},
+
+	shortcode : function( model ) {
+		var content;
+
+		_.each( this.defaults, function( value, key ) {
+			model[ key ] = this.coerce( model, key );
+
+			if ( value === model[ key ] ) {
+				delete model[ key ];
+			}
+		}, this );
+
+		content = model.content;
+		delete model.content;
+
+		return new wp.shortcode({
+			tag: 'audio',
+			attrs: model,
+			content: content
+		});
+	}
+};
+
+/**
+ * Shortcode modeling for video
+ *  `edit()` prepares the shortcode for the media modal
+ *  `shortcode()` builds the new shortcode after update
+ *
+ * @namespace
+ */
+wp.media.video = {
+	coerce : wp.media.coerce,
+
+	defaults : {
+		id : wp.media.view.settings.post.id,
+		src : '',
+		poster : '',
+		loop : false,
+		autoplay : false,
+		preload : 'metadata',
+		content : '',
+		width : 640,
+		height : 360
+	},
+
+	edit : function( data ) {
+		var frame,
+			shortcode = wp.shortcode.next( 'video', data ).shortcode,
+			attrs;
+
+		attrs = shortcode.attrs.named;
+		attrs.content = shortcode.content;
+
+		frame = wp.media({
+			frame: 'video',
+			state: 'video-details',
+			metadata: _.defaults( attrs, this.defaults )
+		});
+
+		return frame;
+	},
+
+	shortcode : function( model ) {
+		var content;
+
+		_.each( this.defaults, function( value, key ) {
+			model[ key ] = this.coerce( model, key );
+
+			if ( value === model[ key ] ) {
+				delete model[ key ];
+			}
+		}, this );
+
+		content = model.content;
+		delete model.content;
+
+		return new wp.shortcode({
+			tag: 'video',
+			attrs: model,
+			content: content
+		});
+	}
+};
 
-}(_));
\ No newline at end of file
+media.model.PostMedia = require( './models/post-media.js' );
+media.controller.AudioDetails = require( './controllers/audio-details.js' );
+media.controller.VideoDetails = require( './controllers/video-details.js' );
+media.view.MediaFrame.MediaDetails = require( './views/frame/media-details.js' );
+media.view.MediaFrame.AudioDetails = require( './views/frame/audio-details.js' );
+media.view.MediaFrame.VideoDetails = require( './views/frame/video-details.js' );
+media.view.MediaDetails = require( './views/media-details.js' );
+media.view.AudioDetails = require( './views/audio-details.js' );
+media.view.VideoDetails = require( './views/video-details.js' );
Index: src/wp-includes/js/media/controllers/audio-details.js
===================================================================
--- src/wp-includes/js/media/controllers/audio-details.js	(revision 31383)
+++ src/wp-includes/js/media/controllers/audio-details.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals wp */
-
 /**
  * The controller for the Audio Details state
  *
@@ -28,4 +26,4 @@
 	}
 });
 
-module.exports = AudioDetails;
\ No newline at end of file
+module.exports = AudioDetails;
Index: src/wp-includes/js/media/controllers/collection-add.js
===================================================================
--- src/wp-includes/js/media/controllers/collection-add.js	(revision 31383)
+++ src/wp-includes/js/media/controllers/collection-add.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp */
-
 /**
  * wp.media.controller.CollectionAdd
  *
@@ -98,4 +96,4 @@
 	}
 });
 
-module.exports = CollectionAdd;
\ No newline at end of file
+module.exports = CollectionAdd;
Index: src/wp-includes/js/media/controllers/collection-edit.js
===================================================================
--- src/wp-includes/js/media/controllers/collection-edit.js	(revision 31383)
+++ src/wp-includes/js/media/controllers/collection-edit.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals wp, jQuery, Backbone */
-
 /**
  * wp.media.controller.CollectionEdit
  *
@@ -159,4 +157,4 @@
 	}
 });
 
-module.exports = CollectionEdit;
\ No newline at end of file
+module.exports = CollectionEdit;
Index: src/wp-includes/js/media/controllers/cropper.js
===================================================================
--- src/wp-includes/js/media/controllers/cropper.js	(revision 31383)
+++ src/wp-includes/js/media/controllers/cropper.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp, Backbone */
-
 /**
  * wp.media.controller.Cropper
  *
@@ -75,7 +73,7 @@
 
 						this.$el.text(l10n.cropping);
 						this.$el.attr('disabled', true);
-						
+
 						controller.state().doCrop( selection ).done( function( croppedImage ) {
 							controller.trigger('cropped', croppedImage );
 							controller.close();
@@ -116,4 +114,4 @@
 	}
 });
 
-module.exports = Cropper;
\ No newline at end of file
+module.exports = Cropper;
Index: src/wp-includes/js/media/controllers/edit-attachment-metadata.js
===================================================================
--- src/wp-includes/js/media/controllers/edit-attachment-metadata.js	(revision 31383)
+++ src/wp-includes/js/media/controllers/edit-attachment-metadata.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals wp */
-
 /**
  * wp.media.controller.EditAttachmentMetadata
  *
@@ -26,4 +24,4 @@
 	}
 });
 
-module.exports = EditAttachmentMetadata;
\ No newline at end of file
+module.exports = EditAttachmentMetadata;
Index: src/wp-includes/js/media/controllers/edit-image.js
===================================================================
--- src/wp-includes/js/media/controllers/edit-image.js	(revision 31383)
+++ src/wp-includes/js/media/controllers/edit-image.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp */
-
 /**
  * wp.media.controller.EditImage
  *
@@ -75,4 +73,4 @@
 	}
 });
 
-module.exports = EditImage;
\ No newline at end of file
+module.exports = EditImage;
Index: src/wp-includes/js/media/controllers/embed.js
===================================================================
--- src/wp-includes/js/media/controllers/embed.js	(revision 31383)
+++ src/wp-includes/js/media/controllers/embed.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp, jQuery, Backbone */
-
 /**
  * wp.media.controller.Embed
  *
@@ -134,4 +132,4 @@
 	}
 });
 
-module.exports = Embed;
\ No newline at end of file
+module.exports = Embed;
Index: src/wp-includes/js/media/controllers/featured-image.js
===================================================================
--- src/wp-includes/js/media/controllers/featured-image.js	(revision 31383)
+++ src/wp-includes/js/media/controllers/featured-image.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp */
-
 /**
  * wp.media.controller.FeaturedImage
  *
@@ -119,4 +117,4 @@
 	}
 });
 
-module.exports = FeaturedImage;
\ No newline at end of file
+module.exports = FeaturedImage;
Index: src/wp-includes/js/media/controllers/gallery-add.js
===================================================================
--- src/wp-includes/js/media/controllers/gallery-add.js	(revision 31383)
+++ src/wp-includes/js/media/controllers/gallery-add.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp */
-
 /**
  * A state for selecting more images to add to a gallery.
  *
@@ -51,8 +49,9 @@
 	 */
 	initialize: function() {
 		// If a library wasn't supplied, create a library of images.
-		if ( ! this.get('library') )
+		if ( ! this.get('library') ) {
 			this.set( 'library', wp.media.query({ type: 'image' }) );
+		}
 
 		Library.prototype.initialize.apply( this, arguments );
 	},
@@ -64,8 +63,9 @@
 		var library = this.get('library'),
 			edit    = this.frame.state('gallery-edit').get('library');
 
-		if ( this.editLibrary && this.editLibrary !== edit )
+		if ( this.editLibrary && this.editLibrary !== edit ) {
 			library.unobserve( this.editLibrary );
+		}
 
 		// Accepts attachments that exist in the original library and
 		// that do not exist in gallery's library.
@@ -84,4 +84,4 @@
 	}
 });
 
-module.exports = GalleryAdd;
\ No newline at end of file
+module.exports = GalleryAdd;
Index: src/wp-includes/js/media/controllers/gallery-edit.js
===================================================================
--- src/wp-includes/js/media/controllers/gallery-edit.js	(revision 31383)
+++ src/wp-includes/js/media/controllers/gallery-edit.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals wp, Backbone */
-
 /**
  * wp.media.controller.GalleryEdit
  *
@@ -61,12 +59,15 @@
 	 */
 	initialize: function() {
 		// If we haven't been provided a `library`, create a `Selection`.
-		if ( ! this.get('library') )
+		if ( ! this.get('library') ) {
 			this.set( 'library', new wp.media.model.Selection() );
+		}
 
 		// The single `Attachment` view to be used in the `Attachments` view.
-		if ( ! this.get('AttachmentView') )
+		if ( ! this.get('AttachmentView') ) {
 			this.set( 'AttachmentView', EditLibraryView );
+		}
+
 		Library.prototype.initialize.apply( this, arguments );
 	},
 
@@ -136,4 +137,4 @@
 	}
 });
 
-module.exports = GalleryEdit;
\ No newline at end of file
+module.exports = GalleryEdit;
Index: src/wp-includes/js/media/controllers/image-details.js
===================================================================
--- src/wp-includes/js/media/controllers/image-details.js	(revision 31383)
+++ src/wp-includes/js/media/controllers/image-details.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp */
-
 /**
  * wp.media.controller.ImageDetails
  *
@@ -59,4 +57,4 @@
 	}
 });
 
-module.exports = ImageDetails;
\ No newline at end of file
+module.exports = ImageDetails;
Index: src/wp-includes/js/media/controllers/library.js
===================================================================
--- src/wp-includes/js/media/controllers/library.js	(revision 31383)
+++ src/wp-includes/js/media/controllers/library.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp, Backbone, getUserSetting, setUserSetting */
-
 /**
  * wp.media.controller.Library
  *
@@ -37,6 +35,8 @@
 var selectionSync = require( '../utils/selection-sync.js' ),
 	State = require( './state.js' ),
 	l10n = wp.media.view.l10n,
+	getUserSetting = window.getUserSetting,
+	setUserSetting = window.setUserSetting,
 	Library;
 
 Library = State.extend({
@@ -71,7 +71,7 @@
 			this.set( 'library', wp.media.query() );
 		}
 
-		if ( ! (selection instanceof Selection) ) {
+		if ( ! ( selection instanceof wp.media.model.Selection ) ) {
 			props = selection;
 
 			if ( ! props ) {
@@ -269,4 +269,4 @@
 // Make selectionSync available on any Media Library state.
 _.extend( Library.prototype, selectionSync );
 
-module.exports = Library;
\ No newline at end of file
+module.exports = Library;
Index: src/wp-includes/js/media/controllers/media-library.js
===================================================================
--- src/wp-includes/js/media/controllers/media-library.js	(revision 31383)
+++ src/wp-includes/js/media/controllers/media-library.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp */
-
 /**
  * wp.media.controller.MediaLibrary
  *
@@ -47,4 +45,4 @@
 	}
 });
 
-module.exports = MediaLibrary;
\ No newline at end of file
+module.exports = MediaLibrary;
Index: src/wp-includes/js/media/controllers/region.js
===================================================================
--- src/wp-includes/js/media/controllers/region.js	(revision 31383)
+++ src/wp-includes/js/media/controllers/region.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, Backbone */
-
 /**
  * wp.media.controller.Region
  *
@@ -176,4 +174,4 @@
 	}
 });
 
-module.exports = Region;
\ No newline at end of file
+module.exports = Region;
Index: src/wp-includes/js/media/controllers/replace-image.js
===================================================================
--- src/wp-includes/js/media/controllers/replace-image.js	(revision 31383)
+++ src/wp-includes/js/media/controllers/replace-image.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp */
-
 /**
  * wp.media.controller.ReplaceImage
  *
@@ -105,4 +103,4 @@
 	}
 });
 
-module.exports = ReplaceImage;
\ No newline at end of file
+module.exports = ReplaceImage;
Index: src/wp-includes/js/media/controllers/state-machine.js
===================================================================
--- src/wp-includes/js/media/controllers/state-machine.js	(revision 31383)
+++ src/wp-includes/js/media/controllers/state-machine.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, Backbone */
-
 /**
  * wp.media.controller.StateMachine
  *
@@ -121,4 +119,4 @@
 	};
 });
 
-module.exports = StateMachine;
\ No newline at end of file
+module.exports = StateMachine;
Index: src/wp-includes/js/media/controllers/state.js
===================================================================
--- src/wp-includes/js/media/controllers/state.js	(revision 31383)
+++ src/wp-includes/js/media/controllers/state.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, Backbone */
-
 /**
  * wp.media.controller.State
  *
@@ -238,4 +236,4 @@
 	};
 });
 
-module.exports = State;
\ No newline at end of file
+module.exports = State;
Index: src/wp-includes/js/media/controllers/video-details.js
===================================================================
--- src/wp-includes/js/media/controllers/video-details.js	(revision 31383)
+++ src/wp-includes/js/media/controllers/video-details.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals wp */
-
 /**
  * The controller for the Video Details state
  *
@@ -28,4 +26,4 @@
 	}
 });
 
-module.exports = VideoDetails;
\ No newline at end of file
+module.exports = VideoDetails;
Index: src/wp-includes/js/media/grid.js
===================================================================
--- src/wp-includes/js/media/grid.js	(revision 31383)
+++ src/wp-includes/js/media/grid.js	(working copy)
@@ -1,6 +1,4 @@
 (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
-/*globals wp */
-
 /**
  * wp.media.controller.EditAttachmentMetadata
  *
@@ -28,9 +26,8 @@
 });
 
 module.exports = EditAttachmentMetadata;
-},{"./state.js":6}],2:[function(require,module,exports){
-/*globals _, wp */
 
+},{"./state.js":6}],2:[function(require,module,exports){
 /**
  * wp.media.controller.EditImage
  *
@@ -107,9 +104,8 @@
 });
 
 module.exports = EditImage;
-},{"../views/toolbar.js":46,"./state.js":6}],3:[function(require,module,exports){
-/*globals _, wp, Backbone, getUserSetting, setUserSetting */
 
+},{"../views/toolbar.js":46,"./state.js":6}],3:[function(require,module,exports){
 /**
  * wp.media.controller.Library
  *
@@ -147,6 +143,8 @@
 var selectionSync = require( '../utils/selection-sync.js' ),
 	State = require( './state.js' ),
 	l10n = wp.media.view.l10n,
+	getUserSetting = window.getUserSetting,
+	setUserSetting = window.setUserSetting,
 	Library;
 
 Library = State.extend({
@@ -181,7 +179,7 @@
 			this.set( 'library', wp.media.query() );
 		}
 
-		if ( ! (selection instanceof Selection) ) {
+		if ( ! ( selection instanceof wp.media.model.Selection ) ) {
 			props = selection;
 
 			if ( ! props ) {
@@ -380,9 +378,8 @@
 _.extend( Library.prototype, selectionSync );
 
 module.exports = Library;
-},{"../utils/selection-sync.js":9,"./state.js":6}],4:[function(require,module,exports){
-/*globals _, Backbone */
 
+},{"../utils/selection-sync.js":9,"./state.js":6}],4:[function(require,module,exports){
 /**
  * wp.media.controller.Region
  *
@@ -560,9 +557,8 @@
 });
 
 module.exports = Region;
-},{}],5:[function(require,module,exports){
-/*globals _, Backbone */
 
+},{}],5:[function(require,module,exports){
 /**
  * wp.media.controller.StateMachine
  *
@@ -685,9 +681,8 @@
 });
 
 module.exports = StateMachine;
-},{}],6:[function(require,module,exports){
-/*globals _, Backbone */
 
+},{}],6:[function(require,module,exports){
 /**
  * wp.media.controller.State
  *
@@ -927,25 +922,21 @@
 });
 
 module.exports = State;
+
 },{}],7:[function(require,module,exports){
-/* global wp, _wpMediaViewsL10n, MediaElementPlayer, _wpMediaGridSettings */
-(function (wp) {
-	var media = wp.media;
-
-	media.controller.EditAttachmentMetadata = require( './controllers/edit-attachment-metadata.js' );
-	media.view.MediaFrame.Manage = require( './views/frame/manage.js' );
-	media.view.Attachment.Details.TwoColumn = require( './views/attachment/details-two-column.js' );
-	media.view.MediaFrame.Manage.Router = require( './routers/manage.js' );
-	media.view.EditImage.Details = require( './views/edit-image-details.js' );
-	media.view.MediaFrame.EditAttachments = require( './views/frame/edit-attachments.js' );
-	media.view.SelectModeToggleButton = require( './views/button/select-mode-toggle.js' );
-	media.view.DeleteSelectedButton = require( './views/button/delete-selected.js' );
-	media.view.DeleteSelectedPermanentlyButton = require( './views/button/delete-selected-permanently.js' );
+var media = wp.media;
 
-}(wp));
-},{"./controllers/edit-attachment-metadata.js":1,"./routers/manage.js":8,"./views/attachment/details-two-column.js":16,"./views/button/delete-selected-permanently.js":22,"./views/button/delete-selected.js":23,"./views/button/select-mode-toggle.js":24,"./views/edit-image-details.js":25,"./views/frame/edit-attachments.js":29,"./views/frame/manage.js":30}],8:[function(require,module,exports){
-/*globals jQuery, Backbone */
+media.controller.EditAttachmentMetadata = require( './controllers/edit-attachment-metadata.js' );
+media.view.MediaFrame.Manage = require( './views/frame/manage.js' );
+media.view.Attachment.Details.TwoColumn = require( './views/attachment/details-two-column.js' );
+media.view.MediaFrame.Manage.Router = require( './routers/manage.js' );
+media.view.EditImage.Details = require( './views/edit-image-details.js' );
+media.view.MediaFrame.EditAttachments = require( './views/frame/edit-attachments.js' );
+media.view.SelectModeToggleButton = require( './views/button/select-mode-toggle.js' );
+media.view.DeleteSelectedButton = require( './views/button/delete-selected.js' );
+media.view.DeleteSelectedPermanentlyButton = require( './views/button/delete-selected-permanently.js' );
 
+},{"./controllers/edit-attachment-metadata.js":1,"./routers/manage.js":8,"./views/attachment/details-two-column.js":16,"./views/button/delete-selected-permanently.js":22,"./views/button/delete-selected.js":23,"./views/button/select-mode-toggle.js":24,"./views/edit-image-details.js":25,"./views/frame/edit-attachments.js":29,"./views/frame/manage.js":30}],8:[function(require,module,exports){
 /**
  * A router for handling the browser history and application state.
  *
@@ -990,9 +981,8 @@
 });
 
 module.exports = Router;
-},{}],9:[function(require,module,exports){
-/*globals _ */
 
+},{}],9:[function(require,module,exports){
 /**
  * wp.media.selectionSync
  *
@@ -1057,9 +1047,8 @@
 };
 
 module.exports = selectionSync;
-},{}],10:[function(require,module,exports){
-/*globals _ */
 
+},{}],10:[function(require,module,exports){
 /**
  * wp.media.view.AttachmentCompat
  *
@@ -1143,9 +1132,8 @@
 });
 
 module.exports = AttachmentCompat;
-},{"./view.js":51}],11:[function(require,module,exports){
-/*globals _, jQuery */
 
+},{"./view.js":51}],11:[function(require,module,exports){
 /**
  * wp.media.view.AttachmentFilters
  *
@@ -1222,9 +1210,8 @@
 });
 
 module.exports = AttachmentFilters;
-},{"./view.js":51}],12:[function(require,module,exports){
-/*globals _, wp */
 
+},{"./view.js":51}],12:[function(require,module,exports){
 /**
  * wp.media.view.AttachmentFilters.All
  *
@@ -1314,9 +1301,8 @@
 });
 
 module.exports = All;
-},{"../attachment-filters.js":11}],13:[function(require,module,exports){
-/*globals _, wp */
 
+},{"../attachment-filters.js":11}],13:[function(require,module,exports){
 /**
  * A filter dropdown for month/dates.
  *
@@ -1357,9 +1343,8 @@
 });
 
 module.exports = DateFilter;
-},{"../attachment-filters.js":11}],14:[function(require,module,exports){
-/*globals wp */
 
+},{"../attachment-filters.js":11}],14:[function(require,module,exports){
 /**
  * wp.media.view.AttachmentFilters.Uploaded
  *
@@ -1418,9 +1403,8 @@
 });
 
 module.exports = Uploaded;
-},{"../attachment-filters.js":11}],15:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"../attachment-filters.js":11}],15:[function(require,module,exports){
 /**
  * wp.media.view.Attachment
  *
@@ -1973,9 +1957,8 @@
 });
 
 module.exports = Attachment;
-},{"./view.js":51}],16:[function(require,module,exports){
-/*globals wp */
 
+},{"./view.js":51}],16:[function(require,module,exports){
 /**
  * A similar view to media.view.Attachment.Details
  * for use in the Edit Attachment modal.
@@ -2010,15 +1993,14 @@
 		wp.media.mixin.removeAllPlayers();
 		this.$( 'audio, video' ).each( function (i, elem) {
 			var el = MediaDetails.prepareSrc( elem );
-			new MediaElementPlayer( el, wp.media.mixin.mejsSettings );
+			new window.MediaElementPlayer( el, wp.media.mixin.mejsSettings );
 		} );
 	}
 });
 
 module.exports = TwoColumn;
-},{"../media-details.js":33,"./details.js":17}],17:[function(require,module,exports){
-/*globals _, wp */
 
+},{"../media-details.js":33,"./details.js":17}],17:[function(require,module,exports){
 /**
  * wp.media.view.Attachment.Details
  *
@@ -2078,7 +2060,7 @@
 	deleteAttachment: function( event ) {
 		event.preventDefault();
 
-		if ( confirm( l10n.warnDelete ) ) {
+		if ( window.confirm( l10n.warnDelete ) ) {
 			this.model.destroy();
 			// Keep focus inside media modal
 			// after image is deleted
@@ -2157,6 +2139,7 @@
 });
 
 module.exports = Details;
+
 },{"../attachment.js":15}],18:[function(require,module,exports){
 /**
  * wp.media.view.Attachment.Library
@@ -2177,9 +2160,8 @@
 });
 
 module.exports = Library;
-},{"../attachment.js":15}],19:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"../attachment.js":15}],19:[function(require,module,exports){
 /**
  * wp.media.view.Attachments
  *
@@ -2452,7 +2434,7 @@
 
 		// The scroll event occurs on the document, but the element
 		// that should be checked is the document body.
-		if ( el == document ) {
+		if ( el === document ) {
 			el = document.body;
 			scrollTop = $(document).scrollTop();
 		}
@@ -2478,9 +2460,8 @@
 });
 
 module.exports = Attachments;
-},{"./attachment.js":15,"./view.js":51}],20:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"./attachment.js":15,"./view.js":51}],20:[function(require,module,exports){
 /**
  * wp.media.view.AttachmentsBrowser
  *
@@ -2671,13 +2652,13 @@
 						return;
 					}
 
-					if ( ! mediaTrash && ! confirm( l10n.warnBulkDelete ) ) {
+					if ( ! mediaTrash && ! window.confirm( l10n.warnBulkDelete ) ) {
 						return;
 					}
 
 					if ( mediaTrash &&
 						'trash' !== selection.at( 0 ).get( 'status' ) &&
-						! confirm( l10n.warnBulkTrash ) ) {
+						! window.confirm( l10n.warnBulkTrash ) ) {
 
 						return;
 					}
@@ -2725,7 +2706,7 @@
 					click: function() {
 						var removed = [], selection = this.controller.state().get( 'selection' );
 
-						if ( ! selection.length || ! confirm( l10n.warnBulkDelete ) ) {
+						if ( ! selection.length || ! window.confirm( l10n.warnBulkDelete ) ) {
 							return;
 						}
 
@@ -2938,9 +2919,8 @@
 });
 
 module.exports = AttachmentsBrowser;
-},{"../attachment-compat.js":10,"../attachment-filters/all.js":12,"../attachment-filters/date.js":13,"../attachment-filters/uploaded.js":14,"../attachment/details.js":17,"../attachment/library.js":18,"../attachments.js":19,"../label.js":32,"../search.js":41,"../settings/attachment-display.js":43,"../sidebar.js":44,"../spinner.js":45,"../toolbar.js":46,"../uploader/inline.js":47,"../uploader/status.js":49,"../view.js":51}],21:[function(require,module,exports){
-/*globals _, Backbone */
 
+},{"../attachment-compat.js":10,"../attachment-filters/all.js":12,"../attachment-filters/date.js":13,"../attachment-filters/uploaded.js":14,"../attachment/details.js":17,"../attachment/library.js":18,"../attachments.js":19,"../label.js":32,"../search.js":41,"../settings/attachment-display.js":43,"../sidebar.js":44,"../spinner.js":45,"../toolbar.js":46,"../uploader/inline.js":47,"../uploader/status.js":49,"../view.js":51}],21:[function(require,module,exports){
 /**
  * wp.media.view.Button
  *
@@ -3028,6 +3008,7 @@
 });
 
 module.exports = Button;
+
 },{"./view.js":51}],22:[function(require,module,exports){
 /**
  * When MEDIA_TRASH is true, a button that handles bulk Delete Permanently logic
@@ -3072,9 +3053,8 @@
 });
 
 module.exports = DeleteSelectedPermanently;
-},{"../button.js":21,"./delete-selected.js":23}],23:[function(require,module,exports){
-/*globals wp */
 
+},{"../button.js":21,"./delete-selected.js":23}],23:[function(require,module,exports){
 /**
  * A button that handles bulk Delete/Trash logic
  *
@@ -3124,9 +3104,8 @@
 });
 
 module.exports = DeleteSelected;
-},{"../button.js":21}],24:[function(require,module,exports){
-/*globals wp */
 
+},{"../button.js":21}],24:[function(require,module,exports){
 var Button = require( '../button.js' ),
 	l10n = wp.media.view.l10n,
 	SelectModeToggle;
@@ -3180,6 +3159,7 @@
 });
 
 module.exports = SelectModeToggle;
+
 },{"../button.js":21}],25:[function(require,module,exports){
 var View = require( './view.js' ),
 	EditImage = require( './edit-image.js' ),
@@ -3205,9 +3185,8 @@
 });
 
 module.exports = Details;
-},{"./edit-image.js":26,"./view.js":51}],26:[function(require,module,exports){
-/*globals _, wp */
 
+},{"./edit-image.js":26,"./view.js":51}],26:[function(require,module,exports){
 var View = require( './view.js' ),
 	EditImage;
 
@@ -3259,6 +3238,7 @@
 });
 
 module.exports = EditImage;
+
 },{"./view.js":51}],27:[function(require,module,exports){
 /**
  * wp.media.view.FocusManager
@@ -3307,9 +3287,8 @@
 });
 
 module.exports = FocusManager;
-},{"./view.js":51}],28:[function(require,module,exports){
-/*globals _, Backbone */
 
+},{"./view.js":51}],28:[function(require,module,exports){
 /**
  * wp.media.view.Frame
  *
@@ -3480,9 +3459,8 @@
 _.extend( Frame.prototype, StateMachine.prototype );
 
 module.exports = Frame;
-},{"../controllers/region.js":4,"../controllers/state-machine.js":5,"../controllers/state.js":6,"./view.js":51}],29:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"../controllers/region.js":4,"../controllers/state-machine.js":5,"../controllers/state.js":6,"./view.js":51}],29:[function(require,module,exports){
 /**
  * A frame for editing the details of a specific media item.
  *
@@ -3727,9 +3705,8 @@
 });
 
 module.exports = EditAttachments;
-},{"../../controllers/edit-attachment-metadata.js":1,"../../controllers/edit-image.js":2,"../attachment-compat.js":10,"../attachment/details-two-column.js":16,"../edit-image-details.js":25,"../frame.js":28,"../media-frame.js":34,"../modal.js":37}],30:[function(require,module,exports){
-/*globals _, Backbone, wp, jQuery */
 
+},{"../../controllers/edit-attachment-metadata.js":1,"../../controllers/edit-image.js":2,"../attachment-compat.js":10,"../attachment/details-two-column.js":16,"../edit-image-details.js":25,"../frame.js":28,"../media-frame.js":34,"../modal.js":37}],30:[function(require,module,exports){
 /**
  * wp.media.view.MediaFrame.Manage
  *
@@ -3967,7 +3944,7 @@
 		// Verify pushState support and activate
 		if ( window.history && window.history.pushState ) {
 			Backbone.history.start( {
-				root: _wpMediaGridSettings.adminUrl,
+				root: window._wpMediaGridSettings.adminUrl,
 				pushState: true
 			} );
 		}
@@ -3975,6 +3952,7 @@
 });
 
 module.exports = Manage;
+
 },{"../../controllers/library.js":3,"../../routers/manage.js":8,"../attachments/browser.js":20,"../media-frame.js":34,"../uploader/window.js":50}],31:[function(require,module,exports){
 /**
  * wp.media.view.Iframe
@@ -4001,6 +3979,7 @@
 });
 
 module.exports = Iframe;
+
 },{"./view.js":51}],32:[function(require,module,exports){
 /**
  * @class
@@ -4027,9 +4006,8 @@
 });
 
 module.exports = Label;
-},{"./view.js":51}],33:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"./view.js":51}],33:[function(require,module,exports){
 /**
  * wp.media.view.MediaDetails
  *
@@ -4113,7 +4091,7 @@
 	 */
 	setPlayer : function() {
 		if ( ! this.players.length && this.media ) {
-			this.players.push( new MediaElementPlayer( this.media, this.settings ) );
+			this.players.push( new window.MediaElementPlayer( this.media, this.settings ) );
 		}
 	},
 
@@ -4141,7 +4119,7 @@
 	 */
 	render: function() {
 		AttachmentDisplay.prototype.render.apply( this, arguments );
-		
+
 		setTimeout( _.bind( function() {
 			this.resetFocus();
 		}, this ), 10 );
@@ -4180,9 +4158,8 @@
 });
 
 module.exports = MediaDetails;
-},{"./settings/attachment-display.js":43}],34:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"./settings/attachment-display.js":43}],34:[function(require,module,exports){
 /**
  * wp.media.view.MediaFrame
  *
@@ -4435,9 +4412,8 @@
 });
 
 module.exports = MediaFrame;
-},{"./frame.js":28,"./iframe.js":31,"./menu.js":36,"./modal.js":37,"./router.js":40,"./toolbar.js":46,"./uploader/window.js":50,"./view.js":51}],35:[function(require,module,exports){
-/*globals wp, jQuery */
 
+},{"./frame.js":28,"./iframe.js":31,"./menu.js":36,"./modal.js":37,"./router.js":40,"./toolbar.js":46,"./uploader/window.js":50,"./view.js":51}],35:[function(require,module,exports){
 /**
  * wp.media.view.MenuItem
  *
@@ -4509,6 +4485,7 @@
 });
 
 module.exports = MenuItem;
+
 },{"./view.js":51}],36:[function(require,module,exports){
 /**
  * wp.media.view.Menu
@@ -4625,9 +4602,8 @@
 });
 
 module.exports = Menu;
-},{"./menu-item.js":35,"./priority-list.js":38}],37:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"./menu-item.js":35,"./priority-list.js":38}],37:[function(require,module,exports){
 /**
  * wp.media.view.Modal
  *
@@ -4841,9 +4817,8 @@
 });
 
 module.exports = Modal;
-},{"./focus-manager.js":27,"./view.js":51}],38:[function(require,module,exports){
-/*globals _, Backbone */
 
+},{"./focus-manager.js":27,"./view.js":51}],38:[function(require,module,exports){
 /**
  * wp.media.view.PriorityList
  *
@@ -4942,6 +4917,7 @@
 });
 
 module.exports = PriorityList;
+
 },{"./view.js":51}],39:[function(require,module,exports){
 /**
  * wp.media.view.RouterItem
@@ -4968,6 +4944,7 @@
 });
 
 module.exports = RouterItem;
+
 },{"./menu-item.js":35}],40:[function(require,module,exports){
 /**
  * wp.media.view.Router
@@ -5005,9 +4982,8 @@
 });
 
 module.exports = Router;
-},{"./menu.js":36,"./router-item.js":39}],41:[function(require,module,exports){
-/*globals wp */
 
+},{"./menu.js":36,"./router-item.js":39}],41:[function(require,module,exports){
 /**
  * wp.media.view.Search
  *
@@ -5055,9 +5031,8 @@
 });
 
 module.exports = Search;
-},{"./view.js":51}],42:[function(require,module,exports){
-/*globals _, Backbone, jQuery */
 
+},{"./view.js":51}],42:[function(require,module,exports){
 /**
  * wp.media.view.Settings
  *
@@ -5165,7 +5140,7 @@
 		// If the setting has a corresponding user setting,
 		// update that as well.
 		if ( userSetting = $setting.data('userSetting') ) {
-			setUserSetting( userSetting, value );
+			window.setUserSetting( userSetting, value );
 		}
 	},
 
@@ -5177,9 +5152,8 @@
 });
 
 module.exports = Settings;
-},{"./view.js":51}],43:[function(require,module,exports){
-/*globals _, wp */
 
+},{"./view.js":51}],43:[function(require,module,exports){
 /**
  * wp.media.view.Settings.AttachmentDisplay
  *
@@ -5272,6 +5246,7 @@
 });
 
 module.exports = AttachmentDisplay;
+
 },{"../settings.js":42}],44:[function(require,module,exports){
 /**
  * wp.media.view.Sidebar
@@ -5290,9 +5265,8 @@
 });
 
 module.exports = Sidebar;
-},{"./priority-list.js":38}],45:[function(require,module,exports){
-/*globals _, wp */
 
+},{"./priority-list.js":38}],45:[function(require,module,exports){
 /**
  * wp.media.view.Spinner
  *
@@ -5329,9 +5303,8 @@
 });
 
 module.exports = Spinner;
-},{"./view.js":51}],46:[function(require,module,exports){
-/*globals Backbone, _ */
 
+},{"./view.js":51}],46:[function(require,module,exports){
 /**
  * wp.media.view.Toolbar
  *
@@ -5492,9 +5465,8 @@
 });
 
 module.exports = Toolbar;
-},{"./button.js":21,"./priority-list.js":38,"./view.js":51}],47:[function(require,module,exports){
-/*globals _, wp */
 
+},{"./button.js":21,"./priority-list.js":38,"./view.js":51}],47:[function(require,module,exports){
 /**
  * wp.media.view.UploaderInline
  *
@@ -5625,9 +5597,8 @@
 });
 
 module.exports = UploaderInline;
-},{"../view.js":51,"./status.js":49}],48:[function(require,module,exports){
-/*globals wp */
 
+},{"../view.js":51,"./status.js":49}],48:[function(require,module,exports){
 /**
  * wp.media.view.UploaderStatusError
  *
@@ -5645,9 +5616,8 @@
 });
 
 module.exports = UploaderStatusError;
-},{"../view.js":51}],49:[function(require,module,exports){
-/*globals _, wp */
 
+},{"../view.js":51}],49:[function(require,module,exports){
 /**
  * wp.media.view.UploaderStatus
  *
@@ -5785,9 +5755,8 @@
 });
 
 module.exports = UploaderStatus;
-},{"../view.js":51,"./status-error.js":48}],50:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"../view.js":51,"./status-error.js":48}],50:[function(require,module,exports){
 /**
  * wp.media.view.UploaderWindow
  *
@@ -5898,9 +5867,8 @@
 });
 
 module.exports = UploaderWindow;
-},{"../view.js":51}],51:[function(require,module,exports){
-/*globals wp */
 
+},{"../view.js":51}],51:[function(require,module,exports){
 /**
  * wp.media.View
  *
@@ -5965,4 +5933,5 @@
 });
 
 module.exports = View;
+
 },{}]},{},[7]);
Index: src/wp-includes/js/media/grid.manifest.js
===================================================================
--- src/wp-includes/js/media/grid.manifest.js	(revision 31383)
+++ src/wp-includes/js/media/grid.manifest.js	(working copy)
@@ -1,15 +1,11 @@
-/* global wp, _wpMediaViewsL10n, MediaElementPlayer, _wpMediaGridSettings */
-(function (wp) {
-	var media = wp.media;
+var media = wp.media;
 
-	media.controller.EditAttachmentMetadata = require( './controllers/edit-attachment-metadata.js' );
-	media.view.MediaFrame.Manage = require( './views/frame/manage.js' );
-	media.view.Attachment.Details.TwoColumn = require( './views/attachment/details-two-column.js' );
-	media.view.MediaFrame.Manage.Router = require( './routers/manage.js' );
-	media.view.EditImage.Details = require( './views/edit-image-details.js' );
-	media.view.MediaFrame.EditAttachments = require( './views/frame/edit-attachments.js' );
-	media.view.SelectModeToggleButton = require( './views/button/select-mode-toggle.js' );
-	media.view.DeleteSelectedButton = require( './views/button/delete-selected.js' );
-	media.view.DeleteSelectedPermanentlyButton = require( './views/button/delete-selected-permanently.js' );
-
-}(wp));
\ No newline at end of file
+media.controller.EditAttachmentMetadata = require( './controllers/edit-attachment-metadata.js' );
+media.view.MediaFrame.Manage = require( './views/frame/manage.js' );
+media.view.Attachment.Details.TwoColumn = require( './views/attachment/details-two-column.js' );
+media.view.MediaFrame.Manage.Router = require( './routers/manage.js' );
+media.view.EditImage.Details = require( './views/edit-image-details.js' );
+media.view.MediaFrame.EditAttachments = require( './views/frame/edit-attachments.js' );
+media.view.SelectModeToggleButton = require( './views/button/select-mode-toggle.js' );
+media.view.DeleteSelectedButton = require( './views/button/delete-selected.js' );
+media.view.DeleteSelectedPermanentlyButton = require( './views/button/delete-selected-permanently.js' );
Index: src/wp-includes/js/media/models/attachment.js
===================================================================
--- src/wp-includes/js/media/models/attachment.js	(revision 31383)
+++ src/wp-includes/js/media/models/attachment.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals jQuery, Backbone, _, wp */
-
 /**
  * wp.media.model.Attachment
  *
@@ -128,7 +126,7 @@
 			return $.Deferred().rejectWith( this ).promise();
 		}
 
-		return media.post( 'save-attachment-compat', _.defaults({
+		return wp.media.post( 'save-attachment-compat', _.defaults({
 			id:      this.id,
 			nonce:   this.get('nonces').update,
 			post_id: wp.media.model.settings.post.id
@@ -165,4 +163,4 @@
 	})
 });
 
-module.exports = Attachment;
\ No newline at end of file
+module.exports = Attachment;
Index: src/wp-includes/js/media/models/attachments.js
===================================================================
--- src/wp-includes/js/media/models/attachments.js	(revision 31383)
+++ src/wp-includes/js/media/models/attachments.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals jQuery, Backbone, _, wp */
-
 /**
  * wp.media.model.Attachments
  *
@@ -323,8 +321,9 @@
 		// checking if we're still mirroring that collection when
 		// the request resolves.
 		mirroring.more( options ).done( function() {
-			if ( this === attachments.mirroring )
+			if ( this === attachments.mirroring ) {
 				deferred.resolveWith( this );
+			}
 		});
 
 		return deferred.promise();
@@ -532,4 +531,4 @@
 	}
 });
 
-module.exports = Attachments;
\ No newline at end of file
+module.exports = Attachments;
Index: src/wp-includes/js/media/models/post-image.js
===================================================================
--- src/wp-includes/js/media/models/post-image.js	(revision 31383)
+++ src/wp-includes/js/media/models/post-image.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals jQuery, Backbone */
-
 /**
  * wp.media.model.PostImage
  *
@@ -153,4 +151,4 @@
 	}
 });
 
-module.exports = PostImage;
\ No newline at end of file
+module.exports = PostImage;
Index: src/wp-includes/js/media/models/post-media.js
===================================================================
--- src/wp-includes/js/media/models/post-media.js	(revision 31383)
+++ src/wp-includes/js/media/models/post-media.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals Backbone, _, wp */
-
 /**
  * Shared model class for audio and video. Updates the model after
  *   "Add Audio|Video Source" and "Replace Audio|Video" states return
@@ -37,4 +35,4 @@
 	}
 });
 
-module.exports = PostMedia;
\ No newline at end of file
+module.exports = PostMedia;
Index: src/wp-includes/js/media/models/query.js
===================================================================
--- src/wp-includes/js/media/models/query.js	(revision 31383)
+++ src/wp-includes/js/media/models/query.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals jQuery, _, wp */
-
 /**
  * wp.media.model.Query
  *
@@ -305,4 +303,4 @@
 	}())
 });
 
-module.exports = Query;
\ No newline at end of file
+module.exports = Query;
Index: src/wp-includes/js/media/models/selection.js
===================================================================
--- src/wp-includes/js/media/models/selection.js	(revision 31383)
+++ src/wp-includes/js/media/models/selection.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _ */
-
 /**
  * wp.media.model.Selection
  *
@@ -94,4 +92,4 @@
 	}
 });
 
-module.exports = Selection;
\ No newline at end of file
+module.exports = Selection;
Index: src/wp-includes/js/media/models.js
===================================================================
--- src/wp-includes/js/media/models.js	(revision 31383)
+++ src/wp-includes/js/media/models.js	(working copy)
@@ -1,239 +1,235 @@
 (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
-/* global _wpMediaModelsL10n:false */
+var $ = jQuery,
+	Attachment, Attachments, l10n, media;
+
 window.wp = window.wp || {};
 
-(function($){
-	var Attachment, Attachments, l10n, media;
+/**
+ * Create and return a media frame.
+ *
+ * Handles the default media experience.
+ *
+ * @param  {object} attributes The properties passed to the main media controller.
+ * @return {wp.media.view.MediaFrame} A media workflow.
+ */
+media = wp.media = function( attributes ) {
+	var MediaFrame = media.view.MediaFrame,
+		frame;
 
-	/**
-	 * Create and return a media frame.
-	 *
-	 * Handles the default media experience.
-	 *
-	 * @param  {object} attributes The properties passed to the main media controller.
-	 * @return {wp.media.view.MediaFrame} A media workflow.
-	 */
-	media = wp.media = function( attributes ) {
-		var MediaFrame = media.view.MediaFrame,
-			frame;
+	if ( ! MediaFrame ) {
+		return;
+	}
 
-		if ( ! MediaFrame ) {
-			return;
-		}
+	attributes = _.defaults( attributes || {}, {
+		frame: 'select'
+	});
 
-		attributes = _.defaults( attributes || {}, {
-			frame: 'select'
-		});
+	if ( 'select' === attributes.frame && MediaFrame.Select ) {
+		frame = new MediaFrame.Select( attributes );
+	} else if ( 'post' === attributes.frame && MediaFrame.Post ) {
+		frame = new MediaFrame.Post( attributes );
+	} else if ( 'manage' === attributes.frame && MediaFrame.Manage ) {
+		frame = new MediaFrame.Manage( attributes );
+	} else if ( 'image' === attributes.frame && MediaFrame.ImageDetails ) {
+		frame = new MediaFrame.ImageDetails( attributes );
+	} else if ( 'audio' === attributes.frame && MediaFrame.AudioDetails ) {
+		frame = new MediaFrame.AudioDetails( attributes );
+	} else if ( 'video' === attributes.frame && MediaFrame.VideoDetails ) {
+		frame = new MediaFrame.VideoDetails( attributes );
+	} else if ( 'edit-attachments' === attributes.frame && MediaFrame.EditAttachments ) {
+		frame = new MediaFrame.EditAttachments( attributes );
+	}
 
-		if ( 'select' === attributes.frame && MediaFrame.Select ) {
-			frame = new MediaFrame.Select( attributes );
-		} else if ( 'post' === attributes.frame && MediaFrame.Post ) {
-			frame = new MediaFrame.Post( attributes );
-		} else if ( 'manage' === attributes.frame && MediaFrame.Manage ) {
-			frame = new MediaFrame.Manage( attributes );
-		} else if ( 'image' === attributes.frame && MediaFrame.ImageDetails ) {
-			frame = new MediaFrame.ImageDetails( attributes );
-		} else if ( 'audio' === attributes.frame && MediaFrame.AudioDetails ) {
-			frame = new MediaFrame.AudioDetails( attributes );
-		} else if ( 'video' === attributes.frame && MediaFrame.VideoDetails ) {
-			frame = new MediaFrame.VideoDetails( attributes );
-		} else if ( 'edit-attachments' === attributes.frame && MediaFrame.EditAttachments ) {
-			frame = new MediaFrame.EditAttachments( attributes );
-		}
+	delete attributes.frame;
 
-		delete attributes.frame;
+	media.frame = frame;
 
-		media.frame = frame;
+	return frame;
+};
 
-		return frame;
-	};
+_.extend( media, { model: {}, view: {}, controller: {}, frames: {} });
 
-	_.extend( media, { model: {}, view: {}, controller: {}, frames: {} });
+// Link any localized strings.
+l10n = media.model.l10n = window._wpMediaModelsL10n || {};
 
-	// Link any localized strings.
-	l10n = media.model.l10n = typeof _wpMediaModelsL10n === 'undefined' ? {} : _wpMediaModelsL10n;
+// Link any settings.
+media.model.settings = l10n.settings || {};
+delete l10n.settings;
 
-	// Link any settings.
-	media.model.settings = l10n.settings || {};
-	delete l10n.settings;
+Attachments = media.model.Attachments = require( './models/attachments.js' );
+Attachment = media.model.Attachment = require( './models/attachment.js' );
 
-	Attachments = media.model.Attachments = require( './models/attachments.js' );
-	Attachment = media.model.Attachment = require( './models/attachment.js' );
+media.model.Query = require( './models/query.js' );
+media.model.PostImage = require( './models/post-image.js' );
+media.model.Selection = require( './models/selection.js' );
 
-	media.model.Query = require( './models/query.js' );
-	media.model.PostImage = require( './models/post-image.js' );
-	media.model.Selection = require( './models/selection.js' );
+/**
+ * ========================================================================
+ * UTILITIES
+ * ========================================================================
+ */
 
-	/**
-	 * ========================================================================
-	 * UTILITIES
-	 * ========================================================================
-	 */
+/**
+ * A basic equality comparator for Backbone models.
+ *
+ * Used to order models within a collection - @see wp.media.model.Attachments.comparator().
+ *
+ * @param  {mixed}  a  The primary parameter to compare.
+ * @param  {mixed}  b  The primary parameter to compare.
+ * @param  {string} ac The fallback parameter to compare, a's cid.
+ * @param  {string} bc The fallback parameter to compare, b's cid.
+ * @return {number}    -1: a should come before b.
+ *                      0: a and b are of the same rank.
+ *                      1: b should come before a.
+ */
+media.compare = function( a, b, ac, bc ) {
+	if ( _.isEqual( a, b ) ) {
+		return ac === bc ? 0 : (ac > bc ? -1 : 1);
+	} else {
+		return a > b ? -1 : 1;
+	}
+};
 
+_.extend( media, {
 	/**
-	 * A basic equality comparator for Backbone models.
+	 * media.template( id )
+	 *
+	 * Fetch a JavaScript template for an id, and return a templating function for it.
 	 *
-	 * Used to order models within a collection - @see wp.media.model.Attachments.comparator().
+	 * See wp.template() in `wp-includes/js/wp-util.js`.
 	 *
-	 * @param  {mixed}  a  The primary parameter to compare.
-	 * @param  {mixed}  b  The primary parameter to compare.
-	 * @param  {string} ac The fallback parameter to compare, a's cid.
-	 * @param  {string} bc The fallback parameter to compare, b's cid.
-	 * @return {number}    -1: a should come before b.
-	 *                      0: a and b are of the same rank.
-	 *                      1: b should come before a.
+	 * @borrows wp.template as template
 	 */
-	media.compare = function( a, b, ac, bc ) {
-		if ( _.isEqual( a, b ) ) {
-			return ac === bc ? 0 : (ac > bc ? -1 : 1);
-		} else {
-			return a > b ? -1 : 1;
-		}
-	};
-
-	_.extend( media, {
-		/**
-		 * media.template( id )
-		 *
-		 * Fetch a JavaScript template for an id, and return a templating function for it.
-		 *
-		 * See wp.template() in `wp-includes/js/wp-util.js`.
-		 *
-		 * @borrows wp.template as template
-		 */
-		template: wp.template,
-
-		/**
-		 * media.post( [action], [data] )
-		 *
-		 * Sends a POST request to WordPress.
-		 * See wp.ajax.post() in `wp-includes/js/wp-util.js`.
-		 *
-		 * @borrows wp.ajax.post as post
-		 */
-		post: wp.ajax.post,
-
-		/**
-		 * media.ajax( [action], [options] )
-		 *
-		 * Sends an XHR request to WordPress.
-		 * See wp.ajax.send() in `wp-includes/js/wp-util.js`.
-		 *
-		 * @borrows wp.ajax.send as ajax
-		 */
-		ajax: wp.ajax.send,
-
-		/**
-		 * Scales a set of dimensions to fit within bounding dimensions.
-		 *
-		 * @param {Object} dimensions
-		 * @returns {Object}
-		 */
-		fit: function( dimensions ) {
-			var width     = dimensions.width,
-				height    = dimensions.height,
-				maxWidth  = dimensions.maxWidth,
-				maxHeight = dimensions.maxHeight,
-				constraint;
-
-			// Compare ratios between the two values to determine which
-			// max to constrain by. If a max value doesn't exist, then the
-			// opposite side is the constraint.
-			if ( ! _.isUndefined( maxWidth ) && ! _.isUndefined( maxHeight ) ) {
-				constraint = ( width / height > maxWidth / maxHeight ) ? 'width' : 'height';
-			} else if ( _.isUndefined( maxHeight ) ) {
-				constraint = 'width';
-			} else if (  _.isUndefined( maxWidth ) && height > maxHeight ) {
-				constraint = 'height';
-			}
-
-			// If the value of the constrained side is larger than the max,
-			// then scale the values. Otherwise return the originals; they fit.
-			if ( 'width' === constraint && width > maxWidth ) {
-				return {
-					width : maxWidth,
-					height: Math.round( maxWidth * height / width )
-				};
-			} else if ( 'height' === constraint && height > maxHeight ) {
-				return {
-					width : Math.round( maxHeight * width / height ),
-					height: maxHeight
-				};
-			} else {
-				return {
-					width : width,
-					height: height
-				};
-			}
-		},
-		/**
-		 * Truncates a string by injecting an ellipsis into the middle.
-		 * Useful for filenames.
-		 *
-		 * @param {String} string
-		 * @param {Number} [length=30]
-		 * @param {String} [replacement=&hellip;]
-		 * @returns {String} The string, unless length is greater than string.length.
-		 */
-		truncate: function( string, length, replacement ) {
-			length = length || 30;
-			replacement = replacement || '&hellip;';
-
-			if ( string.length <= length ) {
-				return string;
-			}
-
-			return string.substr( 0, length / 2 ) + replacement + string.substr( -1 * length / 2 );
-		}
-	});
+	template: wp.template,
 
 	/**
-	 * ========================================================================
-	 * MODELS
-	 * ========================================================================
+	 * media.post( [action], [data] )
+	 *
+	 * Sends a POST request to WordPress.
+	 * See wp.ajax.post() in `wp-includes/js/wp-util.js`.
+	 *
+	 * @borrows wp.ajax.post as post
 	 */
+	post: wp.ajax.post,
+
 	/**
-	 * wp.media.attachment
+	 * media.ajax( [action], [options] )
 	 *
-	 * @static
-	 * @param {String} id A string used to identify a model.
-	 * @returns {wp.media.model.Attachment}
+	 * Sends an XHR request to WordPress.
+	 * See wp.ajax.send() in `wp-includes/js/wp-util.js`.
+	 *
+	 * @borrows wp.ajax.send as ajax
 	 */
-	media.attachment = function( id ) {
-		return Attachment.get( id );
-	};
+	ajax: wp.ajax.send,
 
 	/**
-	 * A collection of all attachments that have been fetched from the server.
+	 * Scales a set of dimensions to fit within bounding dimensions.
 	 *
-	 * @static
-	 * @member {wp.media.model.Attachments}
+	 * @param {Object} dimensions
+	 * @returns {Object}
 	 */
-	Attachments.all = new Attachments();
+	fit: function( dimensions ) {
+		var width     = dimensions.width,
+			height    = dimensions.height,
+			maxWidth  = dimensions.maxWidth,
+			maxHeight = dimensions.maxHeight,
+			constraint;
 
+		// Compare ratios between the two values to determine which
+		// max to constrain by. If a max value doesn't exist, then the
+		// opposite side is the constraint.
+		if ( ! _.isUndefined( maxWidth ) && ! _.isUndefined( maxHeight ) ) {
+			constraint = ( width / height > maxWidth / maxHeight ) ? 'width' : 'height';
+		} else if ( _.isUndefined( maxHeight ) ) {
+			constraint = 'width';
+		} else if (  _.isUndefined( maxWidth ) && height > maxHeight ) {
+			constraint = 'height';
+		}
+
+		// If the value of the constrained side is larger than the max,
+		// then scale the values. Otherwise return the originals; they fit.
+		if ( 'width' === constraint && width > maxWidth ) {
+			return {
+				width : maxWidth,
+				height: Math.round( maxWidth * height / width )
+			};
+		} else if ( 'height' === constraint && height > maxHeight ) {
+			return {
+				width : Math.round( maxHeight * width / height ),
+				height: maxHeight
+			};
+		} else {
+			return {
+				width : width,
+				height: height
+			};
+		}
+	},
 	/**
-	 * wp.media.query
+	 * Truncates a string by injecting an ellipsis into the middle.
+	 * Useful for filenames.
 	 *
-	 * Shorthand for creating a new Attachments Query.
-	 *
-	 * @param {object} [props]
-	 * @returns {wp.media.model.Attachments}
+	 * @param {String} string
+	 * @param {Number} [length=30]
+	 * @param {String} [replacement=&hellip;]
+	 * @returns {String} The string, unless length is greater than string.length.
 	 */
-	media.query = function( props ) {
-		return new Attachments( null, {
-			props: _.extend( _.defaults( props || {}, { orderby: 'date' } ), { query: true } )
-		});
-	};
+	truncate: function( string, length, replacement ) {
+		length = length || 30;
+		replacement = replacement || '&hellip;';
 
-	// Clean up. Prevents mobile browsers caching
-	$(window).on('unload', function(){
-		window.wp = null;
+		if ( string.length <= length ) {
+			return string;
+		}
+
+		return string.substr( 0, length / 2 ) + replacement + string.substr( -1 * length / 2 );
+	}
+});
+
+/**
+ * ========================================================================
+ * MODELS
+ * ========================================================================
+ */
+/**
+ * wp.media.attachment
+ *
+ * @static
+ * @param {String} id A string used to identify a model.
+ * @returns {wp.media.model.Attachment}
+ */
+media.attachment = function( id ) {
+	return Attachment.get( id );
+};
+
+/**
+ * A collection of all attachments that have been fetched from the server.
+ *
+ * @static
+ * @member {wp.media.model.Attachments}
+ */
+Attachments.all = new Attachments();
+
+/**
+ * wp.media.query
+ *
+ * Shorthand for creating a new Attachments Query.
+ *
+ * @param {object} [props]
+ * @returns {wp.media.model.Attachments}
+ */
+media.query = function( props ) {
+	return new Attachments( null, {
+		props: _.extend( _.defaults( props || {}, { orderby: 'date' } ), { query: true } )
 	});
+};
 
-}(jQuery));
-},{"./models/attachment.js":2,"./models/attachments.js":3,"./models/post-image.js":4,"./models/query.js":5,"./models/selection.js":6}],2:[function(require,module,exports){
-/*globals jQuery, Backbone, _, wp */
+// Clean up. Prevents mobile browsers caching
+$(window).on('unload', function(){
+	window.wp = null;
+});
 
+},{"./models/attachment.js":2,"./models/attachments.js":3,"./models/post-image.js":4,"./models/query.js":5,"./models/selection.js":6}],2:[function(require,module,exports){
 /**
  * wp.media.model.Attachment
  *
@@ -362,7 +358,7 @@
 			return $.Deferred().rejectWith( this ).promise();
 		}
 
-		return media.post( 'save-attachment-compat', _.defaults({
+		return wp.media.post( 'save-attachment-compat', _.defaults({
 			id:      this.id,
 			nonce:   this.get('nonces').update,
 			post_id: wp.media.model.settings.post.id
@@ -400,9 +396,8 @@
 });
 
 module.exports = Attachment;
-},{"./attachments.js":3}],3:[function(require,module,exports){
-/*globals jQuery, Backbone, _, wp */
 
+},{"./attachments.js":3}],3:[function(require,module,exports){
 /**
  * wp.media.model.Attachments
  *
@@ -726,8 +721,9 @@
 		// checking if we're still mirroring that collection when
 		// the request resolves.
 		mirroring.more( options ).done( function() {
-			if ( this === attachments.mirroring )
+			if ( this === attachments.mirroring ) {
 				deferred.resolveWith( this );
+			}
 		});
 
 		return deferred.promise();
@@ -936,9 +932,8 @@
 });
 
 module.exports = Attachments;
-},{"./attachment.js":2,"./query.js":5}],4:[function(require,module,exports){
-/*globals jQuery, Backbone */
 
+},{"./attachment.js":2,"./query.js":5}],4:[function(require,module,exports){
 /**
  * wp.media.model.PostImage
  *
@@ -1093,9 +1088,8 @@
 });
 
 module.exports = PostImage;
-},{"./attachment":2}],5:[function(require,module,exports){
-/*globals jQuery, _, wp */
 
+},{"./attachment":2}],5:[function(require,module,exports){
 /**
  * wp.media.model.Query
  *
@@ -1402,9 +1396,8 @@
 });
 
 module.exports = Query;
-},{"./attachments.js":3}],6:[function(require,module,exports){
-/*globals _ */
 
+},{"./attachments.js":3}],6:[function(require,module,exports){
 /**
  * wp.media.model.Selection
  *
@@ -1500,4 +1493,5 @@
 });
 
 module.exports = Selection;
+
 },{"./attachments.js":3}]},{},[1]);
Index: src/wp-includes/js/media/models.manifest.js
===================================================================
--- src/wp-includes/js/media/models.manifest.js	(revision 31383)
+++ src/wp-includes/js/media/models.manifest.js	(working copy)
@@ -1,232 +1,229 @@
-/* global _wpMediaModelsL10n:false */
+var $ = jQuery,
+	Attachment, Attachments, l10n, media;
+
 window.wp = window.wp || {};
 
-(function($){
-	var Attachment, Attachments, l10n, media;
+/**
+ * Create and return a media frame.
+ *
+ * Handles the default media experience.
+ *
+ * @param  {object} attributes The properties passed to the main media controller.
+ * @return {wp.media.view.MediaFrame} A media workflow.
+ */
+media = wp.media = function( attributes ) {
+	var MediaFrame = media.view.MediaFrame,
+		frame;
+
+	if ( ! MediaFrame ) {
+		return;
+	}
 
-	/**
-	 * Create and return a media frame.
-	 *
-	 * Handles the default media experience.
-	 *
-	 * @param  {object} attributes The properties passed to the main media controller.
-	 * @return {wp.media.view.MediaFrame} A media workflow.
-	 */
-	media = wp.media = function( attributes ) {
-		var MediaFrame = media.view.MediaFrame,
-			frame;
+	attributes = _.defaults( attributes || {}, {
+		frame: 'select'
+	});
 
-		if ( ! MediaFrame ) {
-			return;
-		}
+	if ( 'select' === attributes.frame && MediaFrame.Select ) {
+		frame = new MediaFrame.Select( attributes );
+	} else if ( 'post' === attributes.frame && MediaFrame.Post ) {
+		frame = new MediaFrame.Post( attributes );
+	} else if ( 'manage' === attributes.frame && MediaFrame.Manage ) {
+		frame = new MediaFrame.Manage( attributes );
+	} else if ( 'image' === attributes.frame && MediaFrame.ImageDetails ) {
+		frame = new MediaFrame.ImageDetails( attributes );
+	} else if ( 'audio' === attributes.frame && MediaFrame.AudioDetails ) {
+		frame = new MediaFrame.AudioDetails( attributes );
+	} else if ( 'video' === attributes.frame && MediaFrame.VideoDetails ) {
+		frame = new MediaFrame.VideoDetails( attributes );
+	} else if ( 'edit-attachments' === attributes.frame && MediaFrame.EditAttachments ) {
+		frame = new MediaFrame.EditAttachments( attributes );
+	}
 
-		attributes = _.defaults( attributes || {}, {
-			frame: 'select'
-		});
-
-		if ( 'select' === attributes.frame && MediaFrame.Select ) {
-			frame = new MediaFrame.Select( attributes );
-		} else if ( 'post' === attributes.frame && MediaFrame.Post ) {
-			frame = new MediaFrame.Post( attributes );
-		} else if ( 'manage' === attributes.frame && MediaFrame.Manage ) {
-			frame = new MediaFrame.Manage( attributes );
-		} else if ( 'image' === attributes.frame && MediaFrame.ImageDetails ) {
-			frame = new MediaFrame.ImageDetails( attributes );
-		} else if ( 'audio' === attributes.frame && MediaFrame.AudioDetails ) {
-			frame = new MediaFrame.AudioDetails( attributes );
-		} else if ( 'video' === attributes.frame && MediaFrame.VideoDetails ) {
-			frame = new MediaFrame.VideoDetails( attributes );
-		} else if ( 'edit-attachments' === attributes.frame && MediaFrame.EditAttachments ) {
-			frame = new MediaFrame.EditAttachments( attributes );
-		}
+	delete attributes.frame;
 
-		delete attributes.frame;
+	media.frame = frame;
 
-		media.frame = frame;
+	return frame;
+};
 
-		return frame;
-	};
+_.extend( media, { model: {}, view: {}, controller: {}, frames: {} });
 
-	_.extend( media, { model: {}, view: {}, controller: {}, frames: {} });
+// Link any localized strings.
+l10n = media.model.l10n = window._wpMediaModelsL10n || {};
 
-	// Link any localized strings.
-	l10n = media.model.l10n = typeof _wpMediaModelsL10n === 'undefined' ? {} : _wpMediaModelsL10n;
+// Link any settings.
+media.model.settings = l10n.settings || {};
+delete l10n.settings;
 
-	// Link any settings.
-	media.model.settings = l10n.settings || {};
-	delete l10n.settings;
+Attachments = media.model.Attachments = require( './models/attachments.js' );
+Attachment = media.model.Attachment = require( './models/attachment.js' );
 
-	Attachments = media.model.Attachments = require( './models/attachments.js' );
-	Attachment = media.model.Attachment = require( './models/attachment.js' );
+media.model.Query = require( './models/query.js' );
+media.model.PostImage = require( './models/post-image.js' );
+media.model.Selection = require( './models/selection.js' );
 
-	media.model.Query = require( './models/query.js' );
-	media.model.PostImage = require( './models/post-image.js' );
-	media.model.Selection = require( './models/selection.js' );
+/**
+ * ========================================================================
+ * UTILITIES
+ * ========================================================================
+ */
 
-	/**
-	 * ========================================================================
-	 * UTILITIES
-	 * ========================================================================
-	 */
+/**
+ * A basic equality comparator for Backbone models.
+ *
+ * Used to order models within a collection - @see wp.media.model.Attachments.comparator().
+ *
+ * @param  {mixed}  a  The primary parameter to compare.
+ * @param  {mixed}  b  The primary parameter to compare.
+ * @param  {string} ac The fallback parameter to compare, a's cid.
+ * @param  {string} bc The fallback parameter to compare, b's cid.
+ * @return {number}    -1: a should come before b.
+ *                      0: a and b are of the same rank.
+ *                      1: b should come before a.
+ */
+media.compare = function( a, b, ac, bc ) {
+	if ( _.isEqual( a, b ) ) {
+		return ac === bc ? 0 : (ac > bc ? -1 : 1);
+	} else {
+		return a > b ? -1 : 1;
+	}
+};
 
+_.extend( media, {
 	/**
-	 * A basic equality comparator for Backbone models.
+	 * media.template( id )
 	 *
-	 * Used to order models within a collection - @see wp.media.model.Attachments.comparator().
+	 * Fetch a JavaScript template for an id, and return a templating function for it.
 	 *
-	 * @param  {mixed}  a  The primary parameter to compare.
-	 * @param  {mixed}  b  The primary parameter to compare.
-	 * @param  {string} ac The fallback parameter to compare, a's cid.
-	 * @param  {string} bc The fallback parameter to compare, b's cid.
-	 * @return {number}    -1: a should come before b.
-	 *                      0: a and b are of the same rank.
-	 *                      1: b should come before a.
+	 * See wp.template() in `wp-includes/js/wp-util.js`.
+	 *
+	 * @borrows wp.template as template
 	 */
-	media.compare = function( a, b, ac, bc ) {
-		if ( _.isEqual( a, b ) ) {
-			return ac === bc ? 0 : (ac > bc ? -1 : 1);
-		} else {
-			return a > b ? -1 : 1;
-		}
-	};
-
-	_.extend( media, {
-		/**
-		 * media.template( id )
-		 *
-		 * Fetch a JavaScript template for an id, and return a templating function for it.
-		 *
-		 * See wp.template() in `wp-includes/js/wp-util.js`.
-		 *
-		 * @borrows wp.template as template
-		 */
-		template: wp.template,
-
-		/**
-		 * media.post( [action], [data] )
-		 *
-		 * Sends a POST request to WordPress.
-		 * See wp.ajax.post() in `wp-includes/js/wp-util.js`.
-		 *
-		 * @borrows wp.ajax.post as post
-		 */
-		post: wp.ajax.post,
-
-		/**
-		 * media.ajax( [action], [options] )
-		 *
-		 * Sends an XHR request to WordPress.
-		 * See wp.ajax.send() in `wp-includes/js/wp-util.js`.
-		 *
-		 * @borrows wp.ajax.send as ajax
-		 */
-		ajax: wp.ajax.send,
-
-		/**
-		 * Scales a set of dimensions to fit within bounding dimensions.
-		 *
-		 * @param {Object} dimensions
-		 * @returns {Object}
-		 */
-		fit: function( dimensions ) {
-			var width     = dimensions.width,
-				height    = dimensions.height,
-				maxWidth  = dimensions.maxWidth,
-				maxHeight = dimensions.maxHeight,
-				constraint;
-
-			// Compare ratios between the two values to determine which
-			// max to constrain by. If a max value doesn't exist, then the
-			// opposite side is the constraint.
-			if ( ! _.isUndefined( maxWidth ) && ! _.isUndefined( maxHeight ) ) {
-				constraint = ( width / height > maxWidth / maxHeight ) ? 'width' : 'height';
-			} else if ( _.isUndefined( maxHeight ) ) {
-				constraint = 'width';
-			} else if (  _.isUndefined( maxWidth ) && height > maxHeight ) {
-				constraint = 'height';
-			}
-
-			// If the value of the constrained side is larger than the max,
-			// then scale the values. Otherwise return the originals; they fit.
-			if ( 'width' === constraint && width > maxWidth ) {
-				return {
-					width : maxWidth,
-					height: Math.round( maxWidth * height / width )
-				};
-			} else if ( 'height' === constraint && height > maxHeight ) {
-				return {
-					width : Math.round( maxHeight * width / height ),
-					height: maxHeight
-				};
-			} else {
-				return {
-					width : width,
-					height: height
-				};
-			}
-		},
-		/**
-		 * Truncates a string by injecting an ellipsis into the middle.
-		 * Useful for filenames.
-		 *
-		 * @param {String} string
-		 * @param {Number} [length=30]
-		 * @param {String} [replacement=&hellip;]
-		 * @returns {String} The string, unless length is greater than string.length.
-		 */
-		truncate: function( string, length, replacement ) {
-			length = length || 30;
-			replacement = replacement || '&hellip;';
-
-			if ( string.length <= length ) {
-				return string;
-			}
-
-			return string.substr( 0, length / 2 ) + replacement + string.substr( -1 * length / 2 );
-		}
-	});
+	template: wp.template,
 
 	/**
-	 * ========================================================================
-	 * MODELS
-	 * ========================================================================
+	 * media.post( [action], [data] )
+	 *
+	 * Sends a POST request to WordPress.
+	 * See wp.ajax.post() in `wp-includes/js/wp-util.js`.
+	 *
+	 * @borrows wp.ajax.post as post
 	 */
+	post: wp.ajax.post,
+
 	/**
-	 * wp.media.attachment
+	 * media.ajax( [action], [options] )
+	 *
+	 * Sends an XHR request to WordPress.
+	 * See wp.ajax.send() in `wp-includes/js/wp-util.js`.
 	 *
-	 * @static
-	 * @param {String} id A string used to identify a model.
-	 * @returns {wp.media.model.Attachment}
+	 * @borrows wp.ajax.send as ajax
 	 */
-	media.attachment = function( id ) {
-		return Attachment.get( id );
-	};
+	ajax: wp.ajax.send,
 
 	/**
-	 * A collection of all attachments that have been fetched from the server.
+	 * Scales a set of dimensions to fit within bounding dimensions.
 	 *
-	 * @static
-	 * @member {wp.media.model.Attachments}
+	 * @param {Object} dimensions
+	 * @returns {Object}
 	 */
-	Attachments.all = new Attachments();
+	fit: function( dimensions ) {
+		var width     = dimensions.width,
+			height    = dimensions.height,
+			maxWidth  = dimensions.maxWidth,
+			maxHeight = dimensions.maxHeight,
+			constraint;
+
+		// Compare ratios between the two values to determine which
+		// max to constrain by. If a max value doesn't exist, then the
+		// opposite side is the constraint.
+		if ( ! _.isUndefined( maxWidth ) && ! _.isUndefined( maxHeight ) ) {
+			constraint = ( width / height > maxWidth / maxHeight ) ? 'width' : 'height';
+		} else if ( _.isUndefined( maxHeight ) ) {
+			constraint = 'width';
+		} else if (  _.isUndefined( maxWidth ) && height > maxHeight ) {
+			constraint = 'height';
+		}
 
+		// If the value of the constrained side is larger than the max,
+		// then scale the values. Otherwise return the originals; they fit.
+		if ( 'width' === constraint && width > maxWidth ) {
+			return {
+				width : maxWidth,
+				height: Math.round( maxWidth * height / width )
+			};
+		} else if ( 'height' === constraint && height > maxHeight ) {
+			return {
+				width : Math.round( maxHeight * width / height ),
+				height: maxHeight
+			};
+		} else {
+			return {
+				width : width,
+				height: height
+			};
+		}
+	},
 	/**
-	 * wp.media.query
+	 * Truncates a string by injecting an ellipsis into the middle.
+	 * Useful for filenames.
 	 *
-	 * Shorthand for creating a new Attachments Query.
-	 *
-	 * @param {object} [props]
-	 * @returns {wp.media.model.Attachments}
-	 */
-	media.query = function( props ) {
-		return new Attachments( null, {
-			props: _.extend( _.defaults( props || {}, { orderby: 'date' } ), { query: true } )
-		});
-	};
-
-	// Clean up. Prevents mobile browsers caching
-	$(window).on('unload', function(){
-		window.wp = null;
+	 * @param {String} string
+	 * @param {Number} [length=30]
+	 * @param {String} [replacement=&hellip;]
+	 * @returns {String} The string, unless length is greater than string.length.
+	 */
+	truncate: function( string, length, replacement ) {
+		length = length || 30;
+		replacement = replacement || '&hellip;';
+
+		if ( string.length <= length ) {
+			return string;
+		}
+
+		return string.substr( 0, length / 2 ) + replacement + string.substr( -1 * length / 2 );
+	}
+});
+
+/**
+ * ========================================================================
+ * MODELS
+ * ========================================================================
+ */
+/**
+ * wp.media.attachment
+ *
+ * @static
+ * @param {String} id A string used to identify a model.
+ * @returns {wp.media.model.Attachment}
+ */
+media.attachment = function( id ) {
+	return Attachment.get( id );
+};
+
+/**
+ * A collection of all attachments that have been fetched from the server.
+ *
+ * @static
+ * @member {wp.media.model.Attachments}
+ */
+Attachments.all = new Attachments();
+
+/**
+ * wp.media.query
+ *
+ * Shorthand for creating a new Attachments Query.
+ *
+ * @param {object} [props]
+ * @returns {wp.media.model.Attachments}
+ */
+media.query = function( props ) {
+	return new Attachments( null, {
+		props: _.extend( _.defaults( props || {}, { orderby: 'date' } ), { query: true } )
 	});
+};
 
-}(jQuery));
\ No newline at end of file
+// Clean up. Prevents mobile browsers caching
+$(window).on('unload', function(){
+	window.wp = null;
+});
Index: src/wp-includes/js/media/routers/manage.js
===================================================================
--- src/wp-includes/js/media/routers/manage.js	(revision 31383)
+++ src/wp-includes/js/media/routers/manage.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals jQuery, Backbone */
-
 /**
  * A router for handling the browser history and application state.
  *
@@ -43,4 +41,4 @@
 	}
 });
 
-module.exports = Router;
\ No newline at end of file
+module.exports = Router;
Index: src/wp-includes/js/media/utils/selection-sync.js
===================================================================
--- src/wp-includes/js/media/utils/selection-sync.js	(revision 31383)
+++ src/wp-includes/js/media/utils/selection-sync.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _ */
-
 /**
  * wp.media.selectionSync
  *
@@ -63,4 +61,4 @@
 	}
 };
 
-module.exports = selectionSync;
\ No newline at end of file
+module.exports = selectionSync;
Index: src/wp-includes/js/media/views/attachment/details-two-column.js
===================================================================
--- src/wp-includes/js/media/views/attachment/details-two-column.js	(revision 31383)
+++ src/wp-includes/js/media/views/attachment/details-two-column.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals wp */
-
 /**
  * A similar view to media.view.Attachment.Details
  * for use in the Edit Attachment modal.
@@ -34,9 +32,9 @@
 		wp.media.mixin.removeAllPlayers();
 		this.$( 'audio, video' ).each( function (i, elem) {
 			var el = MediaDetails.prepareSrc( elem );
-			new MediaElementPlayer( el, wp.media.mixin.mejsSettings );
+			new window.MediaElementPlayer( el, wp.media.mixin.mejsSettings );
 		} );
 	}
 });
 
-module.exports = TwoColumn;
\ No newline at end of file
+module.exports = TwoColumn;
Index: src/wp-includes/js/media/views/attachment/details.js
===================================================================
--- src/wp-includes/js/media/views/attachment/details.js	(revision 31383)
+++ src/wp-includes/js/media/views/attachment/details.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp */
-
 /**
  * wp.media.view.Attachment.Details
  *
@@ -59,7 +57,7 @@
 	deleteAttachment: function( event ) {
 		event.preventDefault();
 
-		if ( confirm( l10n.warnDelete ) ) {
+		if ( window.confirm( l10n.warnDelete ) ) {
 			this.model.destroy();
 			// Keep focus inside media modal
 			// after image is deleted
@@ -137,4 +135,4 @@
 	}
 });
 
-module.exports = Details;
\ No newline at end of file
+module.exports = Details;
Index: src/wp-includes/js/media/views/attachment/edit-library.js
===================================================================
--- src/wp-includes/js/media/views/attachment/edit-library.js	(revision 31383)
+++ src/wp-includes/js/media/views/attachment/edit-library.js	(working copy)
@@ -16,4 +16,4 @@
 	}
 });
 
-module.exports = EditLibrary;
\ No newline at end of file
+module.exports = EditLibrary;
Index: src/wp-includes/js/media/views/attachment/edit-selection.js
===================================================================
--- src/wp-includes/js/media/views/attachment/edit-selection.js	(revision 31383)
+++ src/wp-includes/js/media/views/attachment/edit-selection.js	(working copy)
@@ -17,4 +17,4 @@
 	}
 });
 
-module.exports = EditSelection;
\ No newline at end of file
+module.exports = EditSelection;
Index: src/wp-includes/js/media/views/attachment/library.js
===================================================================
--- src/wp-includes/js/media/views/attachment/library.js	(revision 31383)
+++ src/wp-includes/js/media/views/attachment/library.js	(working copy)
@@ -16,4 +16,4 @@
 	}
 });
 
-module.exports = Library;
\ No newline at end of file
+module.exports = Library;
Index: src/wp-includes/js/media/views/attachment/selection.js
===================================================================
--- src/wp-includes/js/media/views/attachment/selection.js	(revision 31383)
+++ src/wp-includes/js/media/views/attachment/selection.js	(working copy)
@@ -20,4 +20,4 @@
 	}
 });
 
-module.exports = Selection;
\ No newline at end of file
+module.exports = Selection;
Index: src/wp-includes/js/media/views/attachment-compat.js
===================================================================
--- src/wp-includes/js/media/views/attachment-compat.js	(revision 31383)
+++ src/wp-includes/js/media/views/attachment-compat.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _ */
-
 /**
  * wp.media.view.AttachmentCompat
  *
@@ -82,4 +80,4 @@
 	}
 });
 
-module.exports = AttachmentCompat;
\ No newline at end of file
+module.exports = AttachmentCompat;
Index: src/wp-includes/js/media/views/attachment-filters/all.js
===================================================================
--- src/wp-includes/js/media/views/attachment-filters/all.js	(revision 31383)
+++ src/wp-includes/js/media/views/attachment-filters/all.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp */
-
 /**
  * wp.media.view.AttachmentFilters.All
  *
@@ -88,4 +86,4 @@
 	}
 });
 
-module.exports = All;
\ No newline at end of file
+module.exports = All;
Index: src/wp-includes/js/media/views/attachment-filters/date.js
===================================================================
--- src/wp-includes/js/media/views/attachment-filters/date.js	(revision 31383)
+++ src/wp-includes/js/media/views/attachment-filters/date.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp */
-
 /**
  * A filter dropdown for month/dates.
  *
@@ -39,4 +37,4 @@
 	}
 });
 
-module.exports = DateFilter;
\ No newline at end of file
+module.exports = DateFilter;
Index: src/wp-includes/js/media/views/attachment-filters/uploaded.js
===================================================================
--- src/wp-includes/js/media/views/attachment-filters/uploaded.js	(revision 31383)
+++ src/wp-includes/js/media/views/attachment-filters/uploaded.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals wp */
-
 /**
  * wp.media.view.AttachmentFilters.Uploaded
  *
@@ -57,4 +55,4 @@
 	}
 });
 
-module.exports = Uploaded;
\ No newline at end of file
+module.exports = Uploaded;
Index: src/wp-includes/js/media/views/attachment-filters.js
===================================================================
--- src/wp-includes/js/media/views/attachment-filters.js	(revision 31383)
+++ src/wp-includes/js/media/views/attachment-filters.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, jQuery */
-
 /**
  * wp.media.view.AttachmentFilters
  *
@@ -75,4 +73,4 @@
 	}
 });
 
-module.exports = AttachmentFilters;
\ No newline at end of file
+module.exports = AttachmentFilters;
Index: src/wp-includes/js/media/views/attachment.js
===================================================================
--- src/wp-includes/js/media/views/attachment.js	(revision 31383)
+++ src/wp-includes/js/media/views/attachment.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp, jQuery */
-
 /**
  * wp.media.view.Attachment
  *
@@ -551,4 +549,4 @@
 	};
 });
 
-module.exports = Attachment;
\ No newline at end of file
+module.exports = Attachment;
Index: src/wp-includes/js/media/views/attachments/browser.js
===================================================================
--- src/wp-includes/js/media/views/attachments/browser.js	(revision 31383)
+++ src/wp-includes/js/media/views/attachments/browser.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp, jQuery */
-
 /**
  * wp.media.view.AttachmentsBrowser
  *
@@ -190,13 +188,13 @@
 						return;
 					}
 
-					if ( ! mediaTrash && ! confirm( l10n.warnBulkDelete ) ) {
+					if ( ! mediaTrash && ! window.confirm( l10n.warnBulkDelete ) ) {
 						return;
 					}
 
 					if ( mediaTrash &&
 						'trash' !== selection.at( 0 ).get( 'status' ) &&
-						! confirm( l10n.warnBulkTrash ) ) {
+						! window.confirm( l10n.warnBulkTrash ) ) {
 
 						return;
 					}
@@ -244,7 +242,7 @@
 					click: function() {
 						var removed = [], selection = this.controller.state().get( 'selection' );
 
-						if ( ! selection.length || ! confirm( l10n.warnBulkDelete ) ) {
+						if ( ! selection.length || ! window.confirm( l10n.warnBulkDelete ) ) {
 							return;
 						}
 
@@ -456,4 +454,4 @@
 	}
 });
 
-module.exports = AttachmentsBrowser;
\ No newline at end of file
+module.exports = AttachmentsBrowser;
Index: src/wp-includes/js/media/views/attachments/selection.js
===================================================================
--- src/wp-includes/js/media/views/attachments/selection.js	(revision 31383)
+++ src/wp-includes/js/media/views/attachments/selection.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _ */
-
 /**
  * wp.media.view.Attachments.Selection
  *
@@ -28,4 +26,4 @@
 	}
 });
 
-module.exports = Selection;
\ No newline at end of file
+module.exports = Selection;
Index: src/wp-includes/js/media/views/attachments.js
===================================================================
--- src/wp-includes/js/media/views/attachments.js	(revision 31383)
+++ src/wp-includes/js/media/views/attachments.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp, jQuery */
-
 /**
  * wp.media.view.Attachments
  *
@@ -272,7 +270,7 @@
 
 		// The scroll event occurs on the document, but the element
 		// that should be checked is the document body.
-		if ( el == document ) {
+		if ( el === document ) {
 			el = document.body;
 			scrollTop = $(document).scrollTop();
 		}
@@ -297,4 +295,4 @@
 	}
 });
 
-module.exports = Attachments;
\ No newline at end of file
+module.exports = Attachments;
Index: src/wp-includes/js/media/views/audio-details.js
===================================================================
--- src/wp-includes/js/media/views/audio-details.js	(revision 31383)
+++ src/wp-includes/js/media/views/audio-details.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals wp */
-
 /**
  * wp.media.view.AudioDetails
  *
@@ -35,4 +33,4 @@
 	}
 });
 
-module.exports = AudioDetails;
\ No newline at end of file
+module.exports = AudioDetails;
Index: src/wp-includes/js/media/views/button/delete-selected-permanently.js
===================================================================
--- src/wp-includes/js/media/views/button/delete-selected-permanently.js	(revision 31383)
+++ src/wp-includes/js/media/views/button/delete-selected-permanently.js	(working copy)
@@ -40,4 +40,4 @@
 	}
 });
 
-module.exports = DeleteSelectedPermanently;
\ No newline at end of file
+module.exports = DeleteSelectedPermanently;
Index: src/wp-includes/js/media/views/button/delete-selected.js
===================================================================
--- src/wp-includes/js/media/views/button/delete-selected.js	(revision 31383)
+++ src/wp-includes/js/media/views/button/delete-selected.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals wp */
-
 /**
  * A button that handles bulk Delete/Trash logic
  *
@@ -48,4 +46,4 @@
 	}
 });
 
-module.exports = DeleteSelected;
\ No newline at end of file
+module.exports = DeleteSelected;
Index: src/wp-includes/js/media/views/button/select-mode-toggle.js
===================================================================
--- src/wp-includes/js/media/views/button/select-mode-toggle.js	(revision 31383)
+++ src/wp-includes/js/media/views/button/select-mode-toggle.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals wp */
-
 var Button = require( '../button.js' ),
 	l10n = wp.media.view.l10n,
 	SelectModeToggle;
@@ -52,4 +50,4 @@
 	}
 });
 
-module.exports = SelectModeToggle;
\ No newline at end of file
+module.exports = SelectModeToggle;
Index: src/wp-includes/js/media/views/button-group.js
===================================================================
--- src/wp-includes/js/media/views/button-group.js	(revision 31383)
+++ src/wp-includes/js/media/views/button-group.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, Backbone, jQuery */
-
 /**
  * wp.media.view.ButtonGroup
  *
@@ -45,4 +43,4 @@
 	}
 });
 
-module.exports = ButtonGroup;
\ No newline at end of file
+module.exports = ButtonGroup;
Index: src/wp-includes/js/media/views/button.js
===================================================================
--- src/wp-includes/js/media/views/button.js	(revision 31383)
+++ src/wp-includes/js/media/views/button.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, Backbone */
-
 /**
  * wp.media.view.Button
  *
@@ -86,4 +84,4 @@
 	}
 });
 
-module.exports = Button;
\ No newline at end of file
+module.exports = Button;
Index: src/wp-includes/js/media/views/cropper.js
===================================================================
--- src/wp-includes/js/media/views/cropper.js	(revision 31383)
+++ src/wp-includes/js/media/views/cropper.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp, jQuery */
-
 /**
  * wp.media.view.Cropper
  *
@@ -60,9 +58,9 @@
 
 		this.views.add( '.upload-errors', new UploaderStatusError({
 			filename: UploaderStatus.prototype.filename(filename),
-			message: _wpMediaViewsL10n.cropError
+			message: window._wpMediaViewsL10n.cropError
 		}), { at: 0 });
 	}
 });
 
-module.exports = Cropper;
\ No newline at end of file
+module.exports = Cropper;
Index: src/wp-includes/js/media/views/edit-image-details.js
===================================================================
--- src/wp-includes/js/media/views/edit-image-details.js	(revision 31383)
+++ src/wp-includes/js/media/views/edit-image-details.js	(working copy)
@@ -21,4 +21,4 @@
 	}
 });
 
-module.exports = Details;
\ No newline at end of file
+module.exports = Details;
Index: src/wp-includes/js/media/views/edit-image.js
===================================================================
--- src/wp-includes/js/media/views/edit-image.js	(revision 31383)
+++ src/wp-includes/js/media/views/edit-image.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp */
-
 var View = require( './view.js' ),
 	EditImage;
 
@@ -50,4 +48,4 @@
 
 });
 
-module.exports = EditImage;
\ No newline at end of file
+module.exports = EditImage;
Index: src/wp-includes/js/media/views/embed/image.js
===================================================================
--- src/wp-includes/js/media/views/embed/image.js	(revision 31383)
+++ src/wp-includes/js/media/views/embed/image.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals wp */
-
 /**
  * wp.media.view.EmbedImage
  *
@@ -30,4 +28,4 @@
 	}
 });
 
-module.exports = EmbedImage;
\ No newline at end of file
+module.exports = EmbedImage;
Index: src/wp-includes/js/media/views/embed/link.js
===================================================================
--- src/wp-includes/js/media/views/embed/link.js	(revision 31383)
+++ src/wp-includes/js/media/views/embed/link.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp, jQuery */
-
 /**
  * wp.media.view.EmbedLink
  *
@@ -64,4 +62,4 @@
 	}
 });
 
-module.exports = EmbedLink;
\ No newline at end of file
+module.exports = EmbedLink;
Index: src/wp-includes/js/media/views/embed/url.js
===================================================================
--- src/wp-includes/js/media/views/embed/url.js	(revision 31383)
+++ src/wp-includes/js/media/views/embed/url.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp, jQuery */
-
 /**
  * wp.media.view.EmbedUrl
  *
@@ -76,4 +74,4 @@
 	}
 });
 
-module.exports = EmbedUrl;
\ No newline at end of file
+module.exports = EmbedUrl;
Index: src/wp-includes/js/media/views/embed.js
===================================================================
--- src/wp-includes/js/media/views/embed.js	(revision 31383)
+++ src/wp-includes/js/media/views/embed.js	(working copy)
@@ -65,4 +65,4 @@
 	}
 });
 
-module.exports = Embed;
\ No newline at end of file
+module.exports = Embed;
Index: src/wp-includes/js/media/views/focus-manager.js
===================================================================
--- src/wp-includes/js/media/views/focus-manager.js	(revision 31383)
+++ src/wp-includes/js/media/views/focus-manager.js	(working copy)
@@ -44,4 +44,4 @@
 
 });
 
-module.exports = FocusManager;
\ No newline at end of file
+module.exports = FocusManager;
Index: src/wp-includes/js/media/views/frame/audio-details.js
===================================================================
--- src/wp-includes/js/media/views/frame/audio-details.js	(revision 31383)
+++ src/wp-includes/js/media/views/frame/audio-details.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals wp */
-
 /**
  * wp.media.view.MediaFrame.AudioDetails
  *
@@ -74,4 +72,4 @@
 	}
 });
 
-module.exports = AudioDetails;
\ No newline at end of file
+module.exports = AudioDetails;
Index: src/wp-includes/js/media/views/frame/edit-attachments.js
===================================================================
--- src/wp-includes/js/media/views/frame/edit-attachments.js	(revision 31383)
+++ src/wp-includes/js/media/views/frame/edit-attachments.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp, jQuery */
-
 /**
  * A frame for editing the details of a specific media item.
  *
@@ -243,4 +241,4 @@
 	}
 });
 
-module.exports = EditAttachments;
\ No newline at end of file
+module.exports = EditAttachments;
Index: src/wp-includes/js/media/views/frame/image-details.js
===================================================================
--- src/wp-includes/js/media/views/frame/image-details.js	(revision 31383)
+++ src/wp-includes/js/media/views/frame/image-details.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals wp */
-
 /**
  * wp.media.view.MediaFrame.ImageDetails
  *
@@ -180,4 +178,4 @@
 
 });
 
-module.exports = ImageDetails;
\ No newline at end of file
+module.exports = ImageDetails;
Index: src/wp-includes/js/media/views/frame/manage.js
===================================================================
--- src/wp-includes/js/media/views/frame/manage.js	(revision 31383)
+++ src/wp-includes/js/media/views/frame/manage.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, Backbone, wp, jQuery */
-
 /**
  * wp.media.view.MediaFrame.Manage
  *
@@ -237,11 +235,11 @@
 		// Verify pushState support and activate
 		if ( window.history && window.history.pushState ) {
 			Backbone.history.start( {
-				root: _wpMediaGridSettings.adminUrl,
+				root: window._wpMediaGridSettings.adminUrl,
 				pushState: true
 			} );
 		}
 	}
 });
 
-module.exports = Manage;
\ No newline at end of file
+module.exports = Manage;
Index: src/wp-includes/js/media/views/frame/media-details.js
===================================================================
--- src/wp-includes/js/media/views/frame/media-details.js	(revision 31383)
+++ src/wp-includes/js/media/views/frame/media-details.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals wp */
-
 /**
  * wp.media.view.MediaFrame.MediaDetails
  *
@@ -129,4 +127,4 @@
 	}
 });
 
-module.exports = MediaDetails;
\ No newline at end of file
+module.exports = MediaDetails;
Index: src/wp-includes/js/media/views/frame/post.js
===================================================================
--- src/wp-includes/js/media/views/frame/post.js	(revision 31383)
+++ src/wp-includes/js/media/views/frame/post.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp */
-
 /**
  * wp.media.view.MediaFrame.Post
  *
@@ -748,4 +746,4 @@
 	}
 });
 
-module.exports = Post;
\ No newline at end of file
+module.exports = Post;
Index: src/wp-includes/js/media/views/frame/select.js
===================================================================
--- src/wp-includes/js/media/views/frame/select.js	(revision 31383)
+++ src/wp-includes/js/media/views/frame/select.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp */
-
 /**
  * wp.media.view.MediaFrame.Select
  *
@@ -171,4 +169,4 @@
 	}
 });
 
-module.exports = Select;
\ No newline at end of file
+module.exports = Select;
Index: src/wp-includes/js/media/views/frame/video-details.js
===================================================================
--- src/wp-includes/js/media/views/frame/video-details.js	(revision 31383)
+++ src/wp-includes/js/media/views/frame/video-details.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp */
-
 /**
  * wp.media.view.MediaFrame.VideoDetails
  *
@@ -134,4 +132,4 @@
 	}
 });
 
-module.exports = VideoDetails;
\ No newline at end of file
+module.exports = VideoDetails;
Index: src/wp-includes/js/media/views/frame.js
===================================================================
--- src/wp-includes/js/media/views/frame.js	(revision 31383)
+++ src/wp-includes/js/media/views/frame.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, Backbone */
-
 /**
  * wp.media.view.Frame
  *
@@ -169,4 +167,4 @@
 // Make the `Frame` a `StateMachine`.
 _.extend( Frame.prototype, StateMachine.prototype );
 
-module.exports = Frame;
\ No newline at end of file
+module.exports = Frame;
Index: src/wp-includes/js/media/views/iframe.js
===================================================================
--- src/wp-includes/js/media/views/iframe.js	(revision 31383)
+++ src/wp-includes/js/media/views/iframe.js	(working copy)
@@ -22,4 +22,4 @@
 	}
 });
 
-module.exports = Iframe;
\ No newline at end of file
+module.exports = Iframe;
Index: src/wp-includes/js/media/views/image-details.js
===================================================================
--- src/wp-includes/js/media/views/image-details.js	(revision 31383)
+++ src/wp-includes/js/media/views/image-details.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp, jQuery */
-
 /**
  * wp.media.view.ImageDetails
  *
@@ -73,7 +71,7 @@
 	postRender: function() {
 		setTimeout( _.bind( this.resetFocus, this ), 10 );
 		this.toggleLinkSettings();
-		if ( getUserSetting( 'advImgDetails' ) === 'show' ) {
+		if ( window.getUserSetting( 'advImgDetails' ) === 'show' ) {
 			this.toggleAdvanced( true );
 		}
 		this.trigger( 'post-render' );
@@ -146,7 +144,7 @@
 			mode = 'show';
 		}
 
-		setUserSetting( 'advImgDetails', mode );
+		window.setUserSetting( 'advImgDetails', mode );
 	},
 
 	editAttachment: function( event ) {
@@ -165,4 +163,4 @@
 	}
 });
 
-module.exports = AttachmentDisplay;
\ No newline at end of file
+module.exports = AttachmentDisplay;
Index: src/wp-includes/js/media/views/label.js
===================================================================
--- src/wp-includes/js/media/views/label.js	(revision 31383)
+++ src/wp-includes/js/media/views/label.js	(working copy)
@@ -22,4 +22,4 @@
 	}
 });
 
-module.exports = Label;
\ No newline at end of file
+module.exports = Label;
Index: src/wp-includes/js/media/views/media-details.js
===================================================================
--- src/wp-includes/js/media/views/media-details.js	(revision 31383)
+++ src/wp-includes/js/media/views/media-details.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp, jQuery */
-
 /**
  * wp.media.view.MediaDetails
  *
@@ -83,7 +81,7 @@
 	 */
 	setPlayer : function() {
 		if ( ! this.players.length && this.media ) {
-			this.players.push( new MediaElementPlayer( this.media, this.settings ) );
+			this.players.push( new window.MediaElementPlayer( this.media, this.settings ) );
 		}
 	},
 
@@ -111,7 +109,7 @@
 	 */
 	render: function() {
 		AttachmentDisplay.prototype.render.apply( this, arguments );
-		
+
 		setTimeout( _.bind( function() {
 			this.resetFocus();
 		}, this ), 10 );
@@ -149,4 +147,4 @@
 	}
 });
 
-module.exports = MediaDetails;
\ No newline at end of file
+module.exports = MediaDetails;
Index: src/wp-includes/js/media/views/media-frame.js
===================================================================
--- src/wp-includes/js/media/views/media-frame.js	(revision 31383)
+++ src/wp-includes/js/media/views/media-frame.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp, jQuery */
-
 /**
  * wp.media.view.MediaFrame
  *
@@ -251,4 +249,4 @@
 	};
 });
 
-module.exports = MediaFrame;
\ No newline at end of file
+module.exports = MediaFrame;
Index: src/wp-includes/js/media/views/menu-item.js
===================================================================
--- src/wp-includes/js/media/views/menu-item.js	(revision 31383)
+++ src/wp-includes/js/media/views/menu-item.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals wp, jQuery */
-
 /**
  * wp.media.view.MenuItem
  *
@@ -70,4 +68,4 @@
 	}
 });
 
-module.exports = MenuItem;
\ No newline at end of file
+module.exports = MenuItem;
Index: src/wp-includes/js/media/views/menu.js
===================================================================
--- src/wp-includes/js/media/views/menu.js	(revision 31383)
+++ src/wp-includes/js/media/views/menu.js	(working copy)
@@ -112,4 +112,4 @@
 	}
 });
 
-module.exports = Menu;
\ No newline at end of file
+module.exports = Menu;
Index: src/wp-includes/js/media/views/modal.js
===================================================================
--- src/wp-includes/js/media/views/modal.js	(revision 31383)
+++ src/wp-includes/js/media/views/modal.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp, jQuery */
-
 /**
  * wp.media.view.Modal
  *
@@ -212,4 +210,4 @@
 	}
 });
 
-module.exports = Modal;
\ No newline at end of file
+module.exports = Modal;
Index: src/wp-includes/js/media/views/priority-list.js
===================================================================
--- src/wp-includes/js/media/views/priority-list.js	(revision 31383)
+++ src/wp-includes/js/media/views/priority-list.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, Backbone */
-
 /**
  * wp.media.view.PriorityList
  *
@@ -97,4 +95,4 @@
 	}
 });
 
-module.exports = PriorityList;
\ No newline at end of file
+module.exports = PriorityList;
Index: src/wp-includes/js/media/views/router-item.js
===================================================================
--- src/wp-includes/js/media/views/router-item.js	(revision 31383)
+++ src/wp-includes/js/media/views/router-item.js	(working copy)
@@ -22,4 +22,4 @@
 	}
 });
 
-module.exports = RouterItem;
\ No newline at end of file
+module.exports = RouterItem;
Index: src/wp-includes/js/media/views/router.js
===================================================================
--- src/wp-includes/js/media/views/router.js	(revision 31383)
+++ src/wp-includes/js/media/views/router.js	(working copy)
@@ -33,4 +33,4 @@
 	}
 });
 
-module.exports = Router;
\ No newline at end of file
+module.exports = Router;
Index: src/wp-includes/js/media/views/search.js
===================================================================
--- src/wp-includes/js/media/views/search.js	(revision 31383)
+++ src/wp-includes/js/media/views/search.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals wp */
-
 /**
  * wp.media.view.Search
  *
@@ -46,4 +44,4 @@
 	}
 });
 
-module.exports = Search;
\ No newline at end of file
+module.exports = Search;
Index: src/wp-includes/js/media/views/selection.js
===================================================================
--- src/wp-includes/js/media/views/selection.js	(revision 31383)
+++ src/wp-includes/js/media/views/selection.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, Backbone, wp */
-
 /**
  * wp.media.view.Selection
  *
@@ -82,4 +80,4 @@
 	}
 });
 
-module.exports = Selection;
\ No newline at end of file
+module.exports = Selection;
Index: src/wp-includes/js/media/views/settings/attachment-display.js
===================================================================
--- src/wp-includes/js/media/views/settings/attachment-display.js	(revision 31383)
+++ src/wp-includes/js/media/views/settings/attachment-display.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp */
-
 /**
  * wp.media.view.Settings.AttachmentDisplay
  *
@@ -91,4 +89,4 @@
 	}
 });
 
-module.exports = AttachmentDisplay;
\ No newline at end of file
+module.exports = AttachmentDisplay;
Index: src/wp-includes/js/media/views/settings/gallery.js
===================================================================
--- src/wp-includes/js/media/views/settings/gallery.js	(revision 31383)
+++ src/wp-includes/js/media/views/settings/gallery.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals wp */
-
 /**
  * wp.media.view.Settings.Gallery
  *
@@ -17,4 +15,4 @@
 	template:  wp.template('gallery-settings')
 });
 
-module.exports = Gallery;
\ No newline at end of file
+module.exports = Gallery;
Index: src/wp-includes/js/media/views/settings/playlist.js
===================================================================
--- src/wp-includes/js/media/views/settings/playlist.js	(revision 31383)
+++ src/wp-includes/js/media/views/settings/playlist.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals wp */
-
 /**
  * wp.media.view.Settings.Playlist
  *
@@ -17,4 +15,4 @@
 	template:  wp.template('playlist-settings')
 });
 
-module.exports = Playlist;
\ No newline at end of file
+module.exports = Playlist;
Index: src/wp-includes/js/media/views/settings.js
===================================================================
--- src/wp-includes/js/media/views/settings.js	(revision 31383)
+++ src/wp-includes/js/media/views/settings.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, Backbone, jQuery */
-
 /**
  * wp.media.view.Settings
  *
@@ -107,7 +105,7 @@
 		// If the setting has a corresponding user setting,
 		// update that as well.
 		if ( userSetting = $setting.data('userSetting') ) {
-			setUserSetting( userSetting, value );
+			window.setUserSetting( userSetting, value );
 		}
 	},
 
@@ -118,4 +116,4 @@
 	}
 });
 
-module.exports = Settings;
\ No newline at end of file
+module.exports = Settings;
Index: src/wp-includes/js/media/views/sidebar.js
===================================================================
--- src/wp-includes/js/media/views/sidebar.js	(revision 31383)
+++ src/wp-includes/js/media/views/sidebar.js	(working copy)
@@ -14,4 +14,4 @@
 	className: 'media-sidebar'
 });
 
-module.exports = Sidebar;
\ No newline at end of file
+module.exports = Sidebar;
Index: src/wp-includes/js/media/views/spinner.js
===================================================================
--- src/wp-includes/js/media/views/spinner.js	(revision 31383)
+++ src/wp-includes/js/media/views/spinner.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp */
-
 /**
  * wp.media.view.Spinner
  *
@@ -35,4 +33,4 @@
 	}
 });
 
-module.exports = Spinner;
\ No newline at end of file
+module.exports = Spinner;
Index: src/wp-includes/js/media/views/toolbar/embed.js
===================================================================
--- src/wp-includes/js/media/views/toolbar/embed.js	(revision 31383)
+++ src/wp-includes/js/media/views/toolbar/embed.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp */
-
 /**
  * wp.media.view.Toolbar.Embed
  *
@@ -34,4 +32,4 @@
 	}
 });
 
-module.exports = Embed;
\ No newline at end of file
+module.exports = Embed;
Index: src/wp-includes/js/media/views/toolbar/select.js
===================================================================
--- src/wp-includes/js/media/views/toolbar/select.js	(revision 31383)
+++ src/wp-includes/js/media/views/toolbar/select.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp */
-
 /**
  * wp.media.view.Toolbar.Select
  *
@@ -67,4 +65,4 @@
 	}
 });
 
-module.exports = Select;
\ No newline at end of file
+module.exports = Select;
Index: src/wp-includes/js/media/views/toolbar.js
===================================================================
--- src/wp-includes/js/media/views/toolbar.js	(revision 31383)
+++ src/wp-includes/js/media/views/toolbar.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals Backbone, _ */
-
 /**
  * wp.media.view.Toolbar
  *
@@ -159,4 +157,4 @@
 	}
 });
 
-module.exports = Toolbar;
\ No newline at end of file
+module.exports = Toolbar;
Index: src/wp-includes/js/media/views/uploader/editor.js
===================================================================
--- src/wp-includes/js/media/views/uploader/editor.js	(revision 31383)
+++ src/wp-includes/js/media/views/uploader/editor.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp, jQuery */
-
 /**
  * Creates a dropzone on WP editor instances (elements with .wp-editor-wrap
  * or #wp-fullscreen-body) and relays drag'n'dropped files to a media workflow.
@@ -216,4 +214,4 @@
 	}
 });
 
-module.exports = EditorUploader;
\ No newline at end of file
+module.exports = EditorUploader;
Index: src/wp-includes/js/media/views/uploader/inline.js
===================================================================
--- src/wp-includes/js/media/views/uploader/inline.js	(revision 31383)
+++ src/wp-includes/js/media/views/uploader/inline.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp */
-
 /**
  * wp.media.view.UploaderInline
  *
@@ -129,4 +127,4 @@
 
 });
 
-module.exports = UploaderInline;
\ No newline at end of file
+module.exports = UploaderInline;
Index: src/wp-includes/js/media/views/uploader/status-error.js
===================================================================
--- src/wp-includes/js/media/views/uploader/status-error.js	(revision 31383)
+++ src/wp-includes/js/media/views/uploader/status-error.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals wp */
-
 /**
  * wp.media.view.UploaderStatusError
  *
@@ -16,4 +14,4 @@
 	template:  wp.template('uploader-status-error')
 });
 
-module.exports = UploaderStatusError;
\ No newline at end of file
+module.exports = UploaderStatusError;
Index: src/wp-includes/js/media/views/uploader/status.js
===================================================================
--- src/wp-includes/js/media/views/uploader/status.js	(revision 31383)
+++ src/wp-includes/js/media/views/uploader/status.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp */
-
 /**
  * wp.media.view.UploaderStatus
  *
@@ -136,4 +134,4 @@
 	}
 });
 
-module.exports = UploaderStatus;
\ No newline at end of file
+module.exports = UploaderStatus;
Index: src/wp-includes/js/media/views/uploader/window.js
===================================================================
--- src/wp-includes/js/media/views/uploader/window.js	(revision 31383)
+++ src/wp-includes/js/media/views/uploader/window.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals _, wp, jQuery */
-
 /**
  * wp.media.view.UploaderWindow
  *
@@ -109,4 +107,4 @@
 	}
 });
 
-module.exports = UploaderWindow;
\ No newline at end of file
+module.exports = UploaderWindow;
Index: src/wp-includes/js/media/views/video-details.js
===================================================================
--- src/wp-includes/js/media/views/video-details.js	(revision 31383)
+++ src/wp-includes/js/media/views/video-details.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals wp */
-
 /**
  * wp.media.view.VideoDetails
  *
@@ -40,4 +38,4 @@
 	}
 });
 
-module.exports = VideoDetails;
\ No newline at end of file
+module.exports = VideoDetails;
Index: src/wp-includes/js/media/views/view.js
===================================================================
--- src/wp-includes/js/media/views/view.js	(revision 31383)
+++ src/wp-includes/js/media/views/view.js	(working copy)
@@ -1,5 +1,3 @@
-/*globals wp */
-
 /**
  * wp.media.View
  *
@@ -63,4 +61,4 @@
 	}
 });
 
-module.exports = View;
\ No newline at end of file
+module.exports = View;
Index: src/wp-includes/js/media/views.js
===================================================================
--- src/wp-includes/js/media/views.js	(revision 31383)
+++ src/wp-includes/js/media/views.js	(working copy)
@@ -1,6 +1,4 @@
 (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
-/*globals _, wp */
-
 /**
  * wp.media.controller.CollectionAdd
  *
@@ -100,9 +98,8 @@
 });
 
 module.exports = CollectionAdd;
-},{"./library.js":10}],2:[function(require,module,exports){
-/*globals wp, jQuery, Backbone */
 
+},{"./library.js":10}],2:[function(require,module,exports){
 /**
  * wp.media.controller.CollectionEdit
  *
@@ -263,9 +260,8 @@
 });
 
 module.exports = CollectionEdit;
-},{"../views/attachment/edit-library.js":25,"../views/view.js":71,"./library.js":10}],3:[function(require,module,exports){
-/*globals _, wp, Backbone */
 
+},{"../views/attachment/edit-library.js":25,"../views/view.js":71,"./library.js":10}],3:[function(require,module,exports){
 /**
  * wp.media.controller.Cropper
  *
@@ -341,7 +337,7 @@
 
 						this.$el.text(l10n.cropping);
 						this.$el.attr('disabled', true);
-						
+
 						controller.state().doCrop( selection ).done( function( croppedImage ) {
 							controller.trigger('cropped', croppedImage );
 							controller.close();
@@ -383,9 +379,8 @@
 });
 
 module.exports = Cropper;
-},{"../views/cropper.js":34,"../views/toolbar.js":63,"./state.js":15}],4:[function(require,module,exports){
-/*globals _, wp */
 
+},{"../views/cropper.js":34,"../views/toolbar.js":63,"./state.js":15}],4:[function(require,module,exports){
 /**
  * wp.media.controller.EditImage
  *
@@ -462,9 +457,8 @@
 });
 
 module.exports = EditImage;
-},{"../views/toolbar.js":63,"./state.js":15}],5:[function(require,module,exports){
-/*globals _, wp, jQuery, Backbone */
 
+},{"../views/toolbar.js":63,"./state.js":15}],5:[function(require,module,exports){
 /**
  * wp.media.controller.Embed
  *
@@ -600,9 +594,8 @@
 });
 
 module.exports = Embed;
-},{"./state.js":15}],6:[function(require,module,exports){
-/*globals _, wp */
 
+},{"./state.js":15}],6:[function(require,module,exports){
 /**
  * wp.media.controller.FeaturedImage
  *
@@ -723,9 +716,8 @@
 });
 
 module.exports = FeaturedImage;
-},{"./library.js":10}],7:[function(require,module,exports){
-/*globals _, wp */
 
+},{"./library.js":10}],7:[function(require,module,exports){
 /**
  * A state for selecting more images to add to a gallery.
  *
@@ -777,8 +769,9 @@
 	 */
 	initialize: function() {
 		// If a library wasn't supplied, create a library of images.
-		if ( ! this.get('library') )
+		if ( ! this.get('library') ) {
 			this.set( 'library', wp.media.query({ type: 'image' }) );
+		}
 
 		Library.prototype.initialize.apply( this, arguments );
 	},
@@ -790,8 +783,9 @@
 		var library = this.get('library'),
 			edit    = this.frame.state('gallery-edit').get('library');
 
-		if ( this.editLibrary && this.editLibrary !== edit )
+		if ( this.editLibrary && this.editLibrary !== edit ) {
 			library.unobserve( this.editLibrary );
+		}
 
 		// Accepts attachments that exist in the original library and
 		// that do not exist in gallery's library.
@@ -811,9 +805,8 @@
 });
 
 module.exports = GalleryAdd;
-},{"./library.js":10}],8:[function(require,module,exports){
-/*globals wp, Backbone */
 
+},{"./library.js":10}],8:[function(require,module,exports){
 /**
  * wp.media.controller.GalleryEdit
  *
@@ -875,12 +868,15 @@
 	 */
 	initialize: function() {
 		// If we haven't been provided a `library`, create a `Selection`.
-		if ( ! this.get('library') )
+		if ( ! this.get('library') ) {
 			this.set( 'library', new wp.media.model.Selection() );
+		}
 
 		// The single `Attachment` view to be used in the `Attachments` view.
-		if ( ! this.get('AttachmentView') )
+		if ( ! this.get('AttachmentView') ) {
 			this.set( 'AttachmentView', EditLibraryView );
+		}
+
 		Library.prototype.initialize.apply( this, arguments );
 	},
 
@@ -951,9 +947,8 @@
 });
 
 module.exports = GalleryEdit;
-},{"../views/attachment/edit-library.js":25,"../views/settings/gallery.js":59,"./library.js":10}],9:[function(require,module,exports){
-/*globals _, wp */
 
+},{"../views/attachment/edit-library.js":25,"../views/settings/gallery.js":59,"./library.js":10}],9:[function(require,module,exports){
 /**
  * wp.media.controller.ImageDetails
  *
@@ -1014,9 +1009,8 @@
 });
 
 module.exports = ImageDetails;
-},{"./library.js":10,"./state.js":15}],10:[function(require,module,exports){
-/*globals _, wp, Backbone, getUserSetting, setUserSetting */
 
+},{"./library.js":10,"./state.js":15}],10:[function(require,module,exports){
 /**
  * wp.media.controller.Library
  *
@@ -1054,6 +1048,8 @@
 var selectionSync = require( '../utils/selection-sync.js' ),
 	State = require( './state.js' ),
 	l10n = wp.media.view.l10n,
+	getUserSetting = window.getUserSetting,
+	setUserSetting = window.setUserSetting,
 	Library;
 
 Library = State.extend({
@@ -1088,7 +1084,7 @@
 			this.set( 'library', wp.media.query() );
 		}
 
-		if ( ! (selection instanceof Selection) ) {
+		if ( ! ( selection instanceof wp.media.model.Selection ) ) {
 			props = selection;
 
 			if ( ! props ) {
@@ -1287,9 +1283,8 @@
 _.extend( Library.prototype, selectionSync );
 
 module.exports = Library;
-},{"../utils/selection-sync.js":16,"./state.js":15}],11:[function(require,module,exports){
-/*globals _, wp */
 
+},{"../utils/selection-sync.js":16,"./state.js":15}],11:[function(require,module,exports){
 /**
  * wp.media.controller.MediaLibrary
  *
@@ -1338,9 +1333,8 @@
 });
 
 module.exports = MediaLibrary;
-},{"./library.js":10}],12:[function(require,module,exports){
-/*globals _, Backbone */
 
+},{"./library.js":10}],12:[function(require,module,exports){
 /**
  * wp.media.controller.Region
  *
@@ -1518,9 +1512,8 @@
 });
 
 module.exports = Region;
-},{}],13:[function(require,module,exports){
-/*globals _, wp */
 
+},{}],13:[function(require,module,exports){
 /**
  * wp.media.controller.ReplaceImage
  *
@@ -1627,9 +1620,8 @@
 });
 
 module.exports = ReplaceImage;
-},{"./library.js":10}],14:[function(require,module,exports){
-/*globals _, Backbone */
 
+},{"./library.js":10}],14:[function(require,module,exports){
 /**
  * wp.media.controller.StateMachine
  *
@@ -1752,9 +1744,8 @@
 });
 
 module.exports = StateMachine;
-},{}],15:[function(require,module,exports){
-/*globals _, Backbone */
 
+},{}],15:[function(require,module,exports){
 /**
  * wp.media.controller.State
  *
@@ -1994,9 +1985,8 @@
 });
 
 module.exports = State;
-},{}],16:[function(require,module,exports){
-/*globals _ */
 
+},{}],16:[function(require,module,exports){
 /**
  * wp.media.selectionSync
  *
@@ -2061,158 +2051,155 @@
 };
 
 module.exports = selectionSync;
-},{}],17:[function(require,module,exports){
-/* global _wpMediaViewsL10n, confirm, getUserSetting, setUserSetting */
-( function( $, _ ) {
-	var l10n,
-		media = wp.media;
-
-	media.isTouchDevice = ( 'ontouchend' in document );
-
-	// Link any localized strings.
-	l10n = media.view.l10n = typeof _wpMediaViewsL10n === 'undefined' ? {} : _wpMediaViewsL10n;
-
-	// Link any settings.
-	media.view.settings = l10n.settings || {};
-	delete l10n.settings;
-
-	// Copy the `post` setting over to the model settings.
-	media.model.settings.post = media.view.settings.post;
-
-	// Check if the browser supports CSS 3.0 transitions
-	$.support.transition = (function(){
-		var style = document.documentElement.style,
-			transitions = {
-				WebkitTransition: 'webkitTransitionEnd',
-				MozTransition:    'transitionend',
-				OTransition:      'oTransitionEnd otransitionend',
-				transition:       'transitionend'
-			}, transition;
 
-		transition = _.find( _.keys( transitions ), function( transition ) {
-			return ! _.isUndefined( style[ transition ] );
-		});
+},{}],17:[function(require,module,exports){
+var media = wp.media,
+	$ = jQuery,
+	l10n;
 
-		return transition && {
-			end: transitions[ transition ]
-		};
-	}());
+media.isTouchDevice = ( 'ontouchend' in document );
 
-	/**
-	 * A shared event bus used to provide events into
-	 * the media workflows that 3rd-party devs can use to hook
-	 * in.
-	 */
-	media.events = _.extend( {}, Backbone.Events );
+// Link any localized strings.
+l10n = media.view.l10n = window._wpMediaViewsL10n || {};
 
-	/**
-	 * Makes it easier to bind events using transitions.
-	 *
-	 * @param {string} selector
-	 * @param {Number} sensitivity
-	 * @returns {Promise}
-	 */
-	media.transition = function( selector, sensitivity ) {
-		var deferred = $.Deferred();
+// Link any settings.
+media.view.settings = l10n.settings || {};
+delete l10n.settings;
+
+// Copy the `post` setting over to the model settings.
+media.model.settings.post = media.view.settings.post;
+
+// Check if the browser supports CSS 3.0 transitions
+$.support.transition = (function(){
+	var style = document.documentElement.style,
+		transitions = {
+			WebkitTransition: 'webkitTransitionEnd',
+			MozTransition:    'transitionend',
+			OTransition:      'oTransitionEnd otransitionend',
+			transition:       'transitionend'
+		}, transition;
+
+	transition = _.find( _.keys( transitions ), function( transition ) {
+		return ! _.isUndefined( style[ transition ] );
+	});
 
-		sensitivity = sensitivity || 2000;
+	return transition && {
+		end: transitions[ transition ]
+	};
+}());
 
-		if ( $.support.transition ) {
-			if ( ! (selector instanceof $) ) {
-				selector = $( selector );
-			}
+/**
+ * A shared event bus used to provide events into
+ * the media workflows that 3rd-party devs can use to hook
+ * in.
+ */
+media.events = _.extend( {}, Backbone.Events );
 
-			// Resolve the deferred when the first element finishes animating.
-			selector.first().one( $.support.transition.end, deferred.resolve );
+/**
+ * Makes it easier to bind events using transitions.
+ *
+ * @param {string} selector
+ * @param {Number} sensitivity
+ * @returns {Promise}
+ */
+media.transition = function( selector, sensitivity ) {
+	var deferred = $.Deferred();
 
-			// Just in case the event doesn't trigger, fire a callback.
-			_.delay( deferred.resolve, sensitivity );
+	sensitivity = sensitivity || 2000;
 
-		// Otherwise, execute on the spot.
-		} else {
-			deferred.resolve();
+	if ( $.support.transition ) {
+		if ( ! (selector instanceof $) ) {
+			selector = $( selector );
 		}
 
-		return deferred.promise();
-	};
+		// Resolve the deferred when the first element finishes animating.
+		selector.first().one( $.support.transition.end, deferred.resolve );
 
-	media.controller.Region = require( './controllers/region.js' );
-	media.controller.StateMachine = require( './controllers/state-machine.js' );
-	media.controller.State = require( './controllers/state.js' );
-
-	media.selectionSync = require( './utils/selection-sync.js' );
-	media.controller.Library = require( './controllers/library.js' );
-	media.controller.ImageDetails = require( './controllers/image-details.js' );
-	media.controller.GalleryEdit = require( './controllers/gallery-edit.js' );
-	media.controller.GalleryAdd = require( './controllers/gallery-add.js' );
-	media.controller.CollectionEdit = require( './controllers/collection-edit.js' );
-	media.controller.CollectionAdd = require( './controllers/collection-add.js' );
-	media.controller.FeaturedImage = require( './controllers/featured-image.js' );
-	media.controller.ReplaceImage = require( './controllers/replace-image.js' );
-	media.controller.EditImage = require( './controllers/edit-image.js' );
-	media.controller.MediaLibrary = require( './controllers/media-library.js' );
-	media.controller.Embed = require( './controllers/embed.js' );
-	media.controller.Cropper = require( './controllers/cropper.js' );
-
-	media.View = require( './views/view.js' );
-	media.view.Frame = require( './views/view.js' );
-	media.view.MediaFrame = require( './views/media-frame.js' );
-	media.view.MediaFrame.Select = require( './views/frame/select.js' );
-	media.view.MediaFrame.Post = require( './views/frame/post.js' );
-	media.view.MediaFrame.ImageDetails = require( './views/frame/image-details.js' );
-	media.view.Modal = require( './views/modal.js' );
-	media.view.FocusManager = require( './views/focus-manager.js' );
-	media.view.UploaderWindow = require( './views/uploader/window.js' );
-	media.view.EditorUploader = require( './views/uploader/editor.js' );
-	media.view.UploaderInline = require( './views/uploader/inline.js' );
-	media.view.UploaderStatus = require( './views/uploader/status.js' );
-	media.view.UploaderStatusError = require( './views/uploader/status-error.js' );
-	media.view.Toolbar = require( './views/toolbar.js' );
-	media.view.Toolbar.Select = require( './views/toolbar/select.js' );
-	media.view.Toolbar.Embed = require( './views/toolbar/embed.js' );
-	media.view.Button = require( './views/button.js' );
-	media.view.ButtonGroup = require( './views/button-group.js' );
-	media.view.PriorityList = require( './views/priority-list.js' );
-	media.view.MenuItem = require( './views/menu-item.js' );
-	media.view.Menu = require( './views/menu.js' );
-	media.view.RouterItem = require( './views/router-item.js' );
-	media.view.Router = require( './views/router.js' );
-	media.view.Sidebar = require( './views/sidebar.js' );
-	media.view.Attachment = require( './views/attachment.js' );
-	media.view.Attachment.Library = require( './views/attachment/library.js' );
-	media.view.Attachment.EditLibrary = require( './views/attachment/edit-library.js' );
-	media.view.Attachments = require( './views/attachments.js' );
-	media.view.Search = require( './views/search.js' );
-	media.view.AttachmentFilters = require( './views/attachment-filters.js' );
-	media.view.DateFilter = require( './views/attachment-filters/date.js' );
-	media.view.AttachmentFilters.Uploaded = require( './views/attachment-filters/uploaded.js' );
-	media.view.AttachmentFilters.All = require( './views/attachment-filters/all.js' );
-	media.view.AttachmentsBrowser = require( './views/attachments/browser.js' );
-	media.view.Selection = require( './views/selection.js' );
-	media.view.Attachment.Selection = require( './views/attachment/selection.js' );
-	media.view.Attachments.Selection = require( './views/attachments/selection.js' );
-	media.view.Attachment.EditSelection = require( './views/attachment/edit-selection.js' );
-	media.view.Settings = require( './views/settings.js' );
-	media.view.Settings.AttachmentDisplay = require( './views/settings/attachment-display.js' );
-	media.view.Settings.Gallery = require( './views/settings/gallery.js' );
-	media.view.Settings.Playlist = require( './views/settings/playlist.js' );
-	media.view.Attachment.Details = require( './views/attachment/details.js' );
-	media.view.AttachmentCompat = require( './views/attachment-compat.js' );
-	media.view.Iframe = require( './views/iframe.js' );
-	media.view.Embed = require( './views/embed.js' );
-	media.view.Label = require( './views/label.js' );
-	media.view.EmbedUrl = require( './views/embed/url.js' );
-	media.view.EmbedLink = require( './views/embed/link.js' );
-	media.view.EmbedImage = require( './views/embed/image.js' );
-	media.view.ImageDetails = require( './views/image-details.js' );
-	media.view.Cropper = require( './views/cropper.js' );
-	media.view.EditImage = require( './views/edit-image.js' );
-	media.view.Spinner = require( './views/spinner.js' );
+		// Just in case the event doesn't trigger, fire a callback.
+		_.delay( deferred.resolve, sensitivity );
 
-}(jQuery, _));
-},{"./controllers/collection-add.js":1,"./controllers/collection-edit.js":2,"./controllers/cropper.js":3,"./controllers/edit-image.js":4,"./controllers/embed.js":5,"./controllers/featured-image.js":6,"./controllers/gallery-add.js":7,"./controllers/gallery-edit.js":8,"./controllers/image-details.js":9,"./controllers/library.js":10,"./controllers/media-library.js":11,"./controllers/region.js":12,"./controllers/replace-image.js":13,"./controllers/state-machine.js":14,"./controllers/state.js":15,"./utils/selection-sync.js":16,"./views/attachment-compat.js":18,"./views/attachment-filters.js":19,"./views/attachment-filters/all.js":20,"./views/attachment-filters/date.js":21,"./views/attachment-filters/uploaded.js":22,"./views/attachment.js":23,"./views/attachment/details.js":24,"./views/attachment/edit-library.js":25,"./views/attachment/edit-selection.js":26,"./views/attachment/library.js":27,"./views/attachment/selection.js":28,"./views/attachments.js":29,"./views/attachments/browser.js":30,"./views/attachments/selection.js":31,"./views/button-group.js":32,"./views/button.js":33,"./views/cropper.js":34,"./views/edit-image.js":35,"./views/embed.js":36,"./views/embed/image.js":37,"./views/embed/link.js":38,"./views/embed/url.js":39,"./views/focus-manager.js":40,"./views/frame/image-details.js":42,"./views/frame/post.js":43,"./views/frame/select.js":44,"./views/iframe.js":45,"./views/image-details.js":46,"./views/label.js":47,"./views/media-frame.js":48,"./views/menu-item.js":49,"./views/menu.js":50,"./views/modal.js":51,"./views/priority-list.js":52,"./views/router-item.js":53,"./views/router.js":54,"./views/search.js":55,"./views/selection.js":56,"./views/settings.js":57,"./views/settings/attachment-display.js":58,"./views/settings/gallery.js":59,"./views/settings/playlist.js":60,"./views/sidebar.js":61,"./views/spinner.js":62,"./views/toolbar.js":63,"./views/toolbar/embed.js":64,"./views/toolbar/select.js":65,"./views/uploader/editor.js":66,"./views/uploader/inline.js":67,"./views/uploader/status-error.js":68,"./views/uploader/status.js":69,"./views/uploader/window.js":70,"./views/view.js":71}],18:[function(require,module,exports){
-/*globals _ */
+	// Otherwise, execute on the spot.
+	} else {
+		deferred.resolve();
+	}
+
+	return deferred.promise();
+};
 
+media.controller.Region = require( './controllers/region.js' );
+media.controller.StateMachine = require( './controllers/state-machine.js' );
+media.controller.State = require( './controllers/state.js' );
+
+media.selectionSync = require( './utils/selection-sync.js' );
+media.controller.Library = require( './controllers/library.js' );
+media.controller.ImageDetails = require( './controllers/image-details.js' );
+media.controller.GalleryEdit = require( './controllers/gallery-edit.js' );
+media.controller.GalleryAdd = require( './controllers/gallery-add.js' );
+media.controller.CollectionEdit = require( './controllers/collection-edit.js' );
+media.controller.CollectionAdd = require( './controllers/collection-add.js' );
+media.controller.FeaturedImage = require( './controllers/featured-image.js' );
+media.controller.ReplaceImage = require( './controllers/replace-image.js' );
+media.controller.EditImage = require( './controllers/edit-image.js' );
+media.controller.MediaLibrary = require( './controllers/media-library.js' );
+media.controller.Embed = require( './controllers/embed.js' );
+media.controller.Cropper = require( './controllers/cropper.js' );
+
+media.View = require( './views/view.js' );
+media.view.Frame = require( './views/view.js' );
+media.view.MediaFrame = require( './views/media-frame.js' );
+media.view.MediaFrame.Select = require( './views/frame/select.js' );
+media.view.MediaFrame.Post = require( './views/frame/post.js' );
+media.view.MediaFrame.ImageDetails = require( './views/frame/image-details.js' );
+media.view.Modal = require( './views/modal.js' );
+media.view.FocusManager = require( './views/focus-manager.js' );
+media.view.UploaderWindow = require( './views/uploader/window.js' );
+media.view.EditorUploader = require( './views/uploader/editor.js' );
+media.view.UploaderInline = require( './views/uploader/inline.js' );
+media.view.UploaderStatus = require( './views/uploader/status.js' );
+media.view.UploaderStatusError = require( './views/uploader/status-error.js' );
+media.view.Toolbar = require( './views/toolbar.js' );
+media.view.Toolbar.Select = require( './views/toolbar/select.js' );
+media.view.Toolbar.Embed = require( './views/toolbar/embed.js' );
+media.view.Button = require( './views/button.js' );
+media.view.ButtonGroup = require( './views/button-group.js' );
+media.view.PriorityList = require( './views/priority-list.js' );
+media.view.MenuItem = require( './views/menu-item.js' );
+media.view.Menu = require( './views/menu.js' );
+media.view.RouterItem = require( './views/router-item.js' );
+media.view.Router = require( './views/router.js' );
+media.view.Sidebar = require( './views/sidebar.js' );
+media.view.Attachment = require( './views/attachment.js' );
+media.view.Attachment.Library = require( './views/attachment/library.js' );
+media.view.Attachment.EditLibrary = require( './views/attachment/edit-library.js' );
+media.view.Attachments = require( './views/attachments.js' );
+media.view.Search = require( './views/search.js' );
+media.view.AttachmentFilters = require( './views/attachment-filters.js' );
+media.view.DateFilter = require( './views/attachment-filters/date.js' );
+media.view.AttachmentFilters.Uploaded = require( './views/attachment-filters/uploaded.js' );
+media.view.AttachmentFilters.All = require( './views/attachment-filters/all.js' );
+media.view.AttachmentsBrowser = require( './views/attachments/browser.js' );
+media.view.Selection = require( './views/selection.js' );
+media.view.Attachment.Selection = require( './views/attachment/selection.js' );
+media.view.Attachments.Selection = require( './views/attachments/selection.js' );
+media.view.Attachment.EditSelection = require( './views/attachment/edit-selection.js' );
+media.view.Settings = require( './views/settings.js' );
+media.view.Settings.AttachmentDisplay = require( './views/settings/attachment-display.js' );
+media.view.Settings.Gallery = require( './views/settings/gallery.js' );
+media.view.Settings.Playlist = require( './views/settings/playlist.js' );
+media.view.Attachment.Details = require( './views/attachment/details.js' );
+media.view.AttachmentCompat = require( './views/attachment-compat.js' );
+media.view.Iframe = require( './views/iframe.js' );
+media.view.Embed = require( './views/embed.js' );
+media.view.Label = require( './views/label.js' );
+media.view.EmbedUrl = require( './views/embed/url.js' );
+media.view.EmbedLink = require( './views/embed/link.js' );
+media.view.EmbedImage = require( './views/embed/image.js' );
+media.view.ImageDetails = require( './views/image-details.js' );
+media.view.Cropper = require( './views/cropper.js' );
+media.view.EditImage = require( './views/edit-image.js' );
+media.view.Spinner = require( './views/spinner.js' );
+
+},{"./controllers/collection-add.js":1,"./controllers/collection-edit.js":2,"./controllers/cropper.js":3,"./controllers/edit-image.js":4,"./controllers/embed.js":5,"./controllers/featured-image.js":6,"./controllers/gallery-add.js":7,"./controllers/gallery-edit.js":8,"./controllers/image-details.js":9,"./controllers/library.js":10,"./controllers/media-library.js":11,"./controllers/region.js":12,"./controllers/replace-image.js":13,"./controllers/state-machine.js":14,"./controllers/state.js":15,"./utils/selection-sync.js":16,"./views/attachment-compat.js":18,"./views/attachment-filters.js":19,"./views/attachment-filters/all.js":20,"./views/attachment-filters/date.js":21,"./views/attachment-filters/uploaded.js":22,"./views/attachment.js":23,"./views/attachment/details.js":24,"./views/attachment/edit-library.js":25,"./views/attachment/edit-selection.js":26,"./views/attachment/library.js":27,"./views/attachment/selection.js":28,"./views/attachments.js":29,"./views/attachments/browser.js":30,"./views/attachments/selection.js":31,"./views/button-group.js":32,"./views/button.js":33,"./views/cropper.js":34,"./views/edit-image.js":35,"./views/embed.js":36,"./views/embed/image.js":37,"./views/embed/link.js":38,"./views/embed/url.js":39,"./views/focus-manager.js":40,"./views/frame/image-details.js":42,"./views/frame/post.js":43,"./views/frame/select.js":44,"./views/iframe.js":45,"./views/image-details.js":46,"./views/label.js":47,"./views/media-frame.js":48,"./views/menu-item.js":49,"./views/menu.js":50,"./views/modal.js":51,"./views/priority-list.js":52,"./views/router-item.js":53,"./views/router.js":54,"./views/search.js":55,"./views/selection.js":56,"./views/settings.js":57,"./views/settings/attachment-display.js":58,"./views/settings/gallery.js":59,"./views/settings/playlist.js":60,"./views/sidebar.js":61,"./views/spinner.js":62,"./views/toolbar.js":63,"./views/toolbar/embed.js":64,"./views/toolbar/select.js":65,"./views/uploader/editor.js":66,"./views/uploader/inline.js":67,"./views/uploader/status-error.js":68,"./views/uploader/status.js":69,"./views/uploader/window.js":70,"./views/view.js":71}],18:[function(require,module,exports){
 /**
  * wp.media.view.AttachmentCompat
  *
@@ -2296,9 +2283,8 @@
 });
 
 module.exports = AttachmentCompat;
-},{"./view.js":71}],19:[function(require,module,exports){
-/*globals _, jQuery */
 
+},{"./view.js":71}],19:[function(require,module,exports){
 /**
  * wp.media.view.AttachmentFilters
  *
@@ -2375,9 +2361,8 @@
 });
 
 module.exports = AttachmentFilters;
-},{"./view.js":71}],20:[function(require,module,exports){
-/*globals _, wp */
 
+},{"./view.js":71}],20:[function(require,module,exports){
 /**
  * wp.media.view.AttachmentFilters.All
  *
@@ -2467,9 +2452,8 @@
 });
 
 module.exports = All;
-},{"../attachment-filters.js":19}],21:[function(require,module,exports){
-/*globals _, wp */
 
+},{"../attachment-filters.js":19}],21:[function(require,module,exports){
 /**
  * A filter dropdown for month/dates.
  *
@@ -2510,9 +2494,8 @@
 });
 
 module.exports = DateFilter;
-},{"../attachment-filters.js":19}],22:[function(require,module,exports){
-/*globals wp */
 
+},{"../attachment-filters.js":19}],22:[function(require,module,exports){
 /**
  * wp.media.view.AttachmentFilters.Uploaded
  *
@@ -2571,9 +2554,8 @@
 });
 
 module.exports = Uploaded;
-},{"../attachment-filters.js":19}],23:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"../attachment-filters.js":19}],23:[function(require,module,exports){
 /**
  * wp.media.view.Attachment
  *
@@ -3126,9 +3108,8 @@
 });
 
 module.exports = Attachment;
-},{"./view.js":71}],24:[function(require,module,exports){
-/*globals _, wp */
 
+},{"./view.js":71}],24:[function(require,module,exports){
 /**
  * wp.media.view.Attachment.Details
  *
@@ -3188,7 +3169,7 @@
 	deleteAttachment: function( event ) {
 		event.preventDefault();
 
-		if ( confirm( l10n.warnDelete ) ) {
+		if ( window.confirm( l10n.warnDelete ) ) {
 			this.model.destroy();
 			// Keep focus inside media modal
 			// after image is deleted
@@ -3267,6 +3248,7 @@
 });
 
 module.exports = Details;
+
 },{"../attachment.js":23}],25:[function(require,module,exports){
 /**
  * wp.media.view.Attachment.EditLibrary
@@ -3287,6 +3269,7 @@
 });
 
 module.exports = EditLibrary;
+
 },{"../attachment.js":23}],26:[function(require,module,exports){
 /**
  * wp.media.view.Attachments.EditSelection
@@ -3308,6 +3291,7 @@
 });
 
 module.exports = EditSelection;
+
 },{"./selection.js":28}],27:[function(require,module,exports){
 /**
  * wp.media.view.Attachment.Library
@@ -3328,6 +3312,7 @@
 });
 
 module.exports = Library;
+
 },{"../attachment.js":23}],28:[function(require,module,exports){
 /**
  * wp.media.view.Attachment.Selection
@@ -3352,9 +3337,8 @@
 });
 
 module.exports = Selection;
-},{"../attachment.js":23}],29:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"../attachment.js":23}],29:[function(require,module,exports){
 /**
  * wp.media.view.Attachments
  *
@@ -3627,7 +3611,7 @@
 
 		// The scroll event occurs on the document, but the element
 		// that should be checked is the document body.
-		if ( el == document ) {
+		if ( el === document ) {
 			el = document.body;
 			scrollTop = $(document).scrollTop();
 		}
@@ -3653,9 +3637,8 @@
 });
 
 module.exports = Attachments;
-},{"./attachment.js":23,"./view.js":71}],30:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"./attachment.js":23,"./view.js":71}],30:[function(require,module,exports){
 /**
  * wp.media.view.AttachmentsBrowser
  *
@@ -3846,13 +3829,13 @@
 						return;
 					}
 
-					if ( ! mediaTrash && ! confirm( l10n.warnBulkDelete ) ) {
+					if ( ! mediaTrash && ! window.confirm( l10n.warnBulkDelete ) ) {
 						return;
 					}
 
 					if ( mediaTrash &&
 						'trash' !== selection.at( 0 ).get( 'status' ) &&
-						! confirm( l10n.warnBulkTrash ) ) {
+						! window.confirm( l10n.warnBulkTrash ) ) {
 
 						return;
 					}
@@ -3900,7 +3883,7 @@
 					click: function() {
 						var removed = [], selection = this.controller.state().get( 'selection' );
 
-						if ( ! selection.length || ! confirm( l10n.warnBulkDelete ) ) {
+						if ( ! selection.length || ! window.confirm( l10n.warnBulkDelete ) ) {
 							return;
 						}
 
@@ -4113,9 +4096,8 @@
 });
 
 module.exports = AttachmentsBrowser;
-},{"../attachment-compat.js":18,"../attachment-filters/all.js":20,"../attachment-filters/date.js":21,"../attachment-filters/uploaded.js":22,"../attachment/details.js":24,"../attachment/library.js":27,"../attachments.js":29,"../label.js":47,"../search.js":55,"../settings/attachment-display.js":58,"../sidebar.js":61,"../spinner.js":62,"../toolbar.js":63,"../uploader/inline.js":67,"../uploader/status.js":69,"../view.js":71}],31:[function(require,module,exports){
-/*globals _ */
 
+},{"../attachment-compat.js":18,"../attachment-filters/all.js":20,"../attachment-filters/date.js":21,"../attachment-filters/uploaded.js":22,"../attachment/details.js":24,"../attachment/library.js":27,"../attachments.js":29,"../label.js":47,"../search.js":55,"../settings/attachment-display.js":58,"../sidebar.js":61,"../spinner.js":62,"../toolbar.js":63,"../uploader/inline.js":67,"../uploader/status.js":69,"../view.js":71}],31:[function(require,module,exports){
 /**
  * wp.media.view.Attachments.Selection
  *
@@ -4145,9 +4127,8 @@
 });
 
 module.exports = Selection;
-},{"../attachment/selection.js":28,"../attachments.js":29}],32:[function(require,module,exports){
-/*globals _, Backbone, jQuery */
 
+},{"../attachment/selection.js":28,"../attachments.js":29}],32:[function(require,module,exports){
 /**
  * wp.media.view.ButtonGroup
  *
@@ -4194,9 +4175,8 @@
 });
 
 module.exports = ButtonGroup;
-},{"./button.js":33,"./view.js":71}],33:[function(require,module,exports){
-/*globals _, Backbone */
 
+},{"./button.js":33,"./view.js":71}],33:[function(require,module,exports){
 /**
  * wp.media.view.Button
  *
@@ -4284,9 +4264,8 @@
 });
 
 module.exports = Button;
-},{"./view.js":71}],34:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"./view.js":71}],34:[function(require,module,exports){
 /**
  * wp.media.view.Cropper
  *
@@ -4347,15 +4326,14 @@
 
 		this.views.add( '.upload-errors', new UploaderStatusError({
 			filename: UploaderStatus.prototype.filename(filename),
-			message: _wpMediaViewsL10n.cropError
+			message: window._wpMediaViewsL10n.cropError
 		}), { at: 0 });
 	}
 });
 
 module.exports = Cropper;
-},{"./uploader/status-error.js":68,"./uploader/status.js":69,"./view.js":71}],35:[function(require,module,exports){
-/*globals _, wp */
 
+},{"./uploader/status-error.js":68,"./uploader/status.js":69,"./view.js":71}],35:[function(require,module,exports){
 var View = require( './view.js' ),
 	EditImage;
 
@@ -4407,6 +4385,7 @@
 });
 
 module.exports = EditImage;
+
 },{"./view.js":71}],36:[function(require,module,exports){
 /**
  * wp.media.view.Embed
@@ -4476,9 +4455,8 @@
 });
 
 module.exports = Embed;
-},{"./embed/image.js":37,"./embed/link.js":38,"./embed/url.js":39,"./view.js":71}],37:[function(require,module,exports){
-/*globals wp */
 
+},{"./embed/image.js":37,"./embed/link.js":38,"./embed/url.js":39,"./view.js":71}],37:[function(require,module,exports){
 /**
  * wp.media.view.EmbedImage
  *
@@ -4510,9 +4488,8 @@
 });
 
 module.exports = EmbedImage;
-},{"../settings/attachment-display.js":58}],38:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"../settings/attachment-display.js":58}],38:[function(require,module,exports){
 /**
  * wp.media.view.EmbedLink
  *
@@ -4578,9 +4555,8 @@
 });
 
 module.exports = EmbedLink;
-},{"../settings.js":57}],39:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"../settings.js":57}],39:[function(require,module,exports){
 /**
  * wp.media.view.EmbedUrl
  *
@@ -4658,6 +4634,7 @@
 });
 
 module.exports = EmbedUrl;
+
 },{"../view.js":71}],40:[function(require,module,exports){
 /**
  * wp.media.view.FocusManager
@@ -4706,9 +4683,8 @@
 });
 
 module.exports = FocusManager;
-},{"./view.js":71}],41:[function(require,module,exports){
-/*globals _, Backbone */
 
+},{"./view.js":71}],41:[function(require,module,exports){
 /**
  * wp.media.view.Frame
  *
@@ -4879,9 +4855,8 @@
 _.extend( Frame.prototype, StateMachine.prototype );
 
 module.exports = Frame;
-},{"../controllers/region.js":12,"../controllers/state-machine.js":14,"../controllers/state.js":15,"./view.js":71}],42:[function(require,module,exports){
-/*globals wp */
 
+},{"../controllers/region.js":12,"../controllers/state-machine.js":14,"../controllers/state.js":15,"./view.js":71}],42:[function(require,module,exports){
 /**
  * wp.media.view.MediaFrame.ImageDetails
  *
@@ -5063,9 +5038,8 @@
 });
 
 module.exports = ImageDetails;
-},{"../../controllers/edit-image.js":4,"../../controllers/image-details.js":9,"../../controllers/replace-image.js":13,"../edit-image.js":35,"../image-details.js":46,"../toolbar.js":63,"./select.js":44}],43:[function(require,module,exports){
-/*globals _, wp */
 
+},{"../../controllers/edit-image.js":4,"../../controllers/image-details.js":9,"../../controllers/replace-image.js":13,"../edit-image.js":35,"../image-details.js":46,"../toolbar.js":63,"./select.js":44}],43:[function(require,module,exports){
 /**
  * wp.media.view.MediaFrame.Post
  *
@@ -5815,9 +5789,8 @@
 });
 
 module.exports = Post;
-},{"../../controllers/collection-add.js":1,"../../controllers/collection-edit.js":2,"../../controllers/edit-image.js":4,"../../controllers/embed.js":5,"../../controllers/featured-image.js":6,"../../controllers/gallery-add.js":7,"../../controllers/gallery-edit.js":8,"../../controllers/library.js":10,"../attachment/edit-selection.js":26,"../attachments/browser.js":30,"../edit-image.js":35,"../embed.js":36,"../selection.js":56,"../settings/playlist.js":60,"../toolbar.js":63,"../toolbar/embed.js":64,"../view.js":71,"./select.js":44}],44:[function(require,module,exports){
-/*globals _, wp */
 
+},{"../../controllers/collection-add.js":1,"../../controllers/collection-edit.js":2,"../../controllers/edit-image.js":4,"../../controllers/embed.js":5,"../../controllers/featured-image.js":6,"../../controllers/gallery-add.js":7,"../../controllers/gallery-edit.js":8,"../../controllers/library.js":10,"../attachment/edit-selection.js":26,"../attachments/browser.js":30,"../edit-image.js":35,"../embed.js":36,"../selection.js":56,"../settings/playlist.js":60,"../toolbar.js":63,"../toolbar/embed.js":64,"../view.js":71,"./select.js":44}],44:[function(require,module,exports){
 /**
  * wp.media.view.MediaFrame.Select
  *
@@ -5990,6 +5963,7 @@
 });
 
 module.exports = Select;
+
 },{"../../controllers/library.js":10,"../attachments/browser.js":30,"../media-frame.js":48,"../toolbar/select.js":65,"../uploader/inline.js":67}],45:[function(require,module,exports){
 /**
  * wp.media.view.Iframe
@@ -6016,9 +5990,8 @@
 });
 
 module.exports = Iframe;
-},{"./view.js":71}],46:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"./view.js":71}],46:[function(require,module,exports){
 /**
  * wp.media.view.ImageDetails
  *
@@ -6092,7 +6065,7 @@
 	postRender: function() {
 		setTimeout( _.bind( this.resetFocus, this ), 10 );
 		this.toggleLinkSettings();
-		if ( getUserSetting( 'advImgDetails' ) === 'show' ) {
+		if ( window.getUserSetting( 'advImgDetails' ) === 'show' ) {
 			this.toggleAdvanced( true );
 		}
 		this.trigger( 'post-render' );
@@ -6165,7 +6138,7 @@
 			mode = 'show';
 		}
 
-		setUserSetting( 'advImgDetails', mode );
+		window.setUserSetting( 'advImgDetails', mode );
 	},
 
 	editAttachment: function( event ) {
@@ -6185,6 +6158,7 @@
 });
 
 module.exports = AttachmentDisplay;
+
 },{"./settings/attachment-display.js":58}],47:[function(require,module,exports){
 /**
  * @class
@@ -6211,9 +6185,8 @@
 });
 
 module.exports = Label;
-},{"./view.js":71}],48:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"./view.js":71}],48:[function(require,module,exports){
 /**
  * wp.media.view.MediaFrame
  *
@@ -6466,9 +6439,8 @@
 });
 
 module.exports = MediaFrame;
-},{"./frame.js":41,"./iframe.js":45,"./menu.js":50,"./modal.js":51,"./router.js":54,"./toolbar.js":63,"./uploader/window.js":70,"./view.js":71}],49:[function(require,module,exports){
-/*globals wp, jQuery */
 
+},{"./frame.js":41,"./iframe.js":45,"./menu.js":50,"./modal.js":51,"./router.js":54,"./toolbar.js":63,"./uploader/window.js":70,"./view.js":71}],49:[function(require,module,exports){
 /**
  * wp.media.view.MenuItem
  *
@@ -6540,6 +6512,7 @@
 });
 
 module.exports = MenuItem;
+
 },{"./view.js":71}],50:[function(require,module,exports){
 /**
  * wp.media.view.Menu
@@ -6656,9 +6629,8 @@
 });
 
 module.exports = Menu;
-},{"./menu-item.js":49,"./priority-list.js":52}],51:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"./menu-item.js":49,"./priority-list.js":52}],51:[function(require,module,exports){
 /**
  * wp.media.view.Modal
  *
@@ -6872,9 +6844,8 @@
 });
 
 module.exports = Modal;
-},{"./focus-manager.js":40,"./view.js":71}],52:[function(require,module,exports){
-/*globals _, Backbone */
 
+},{"./focus-manager.js":40,"./view.js":71}],52:[function(require,module,exports){
 /**
  * wp.media.view.PriorityList
  *
@@ -6973,6 +6944,7 @@
 });
 
 module.exports = PriorityList;
+
 },{"./view.js":71}],53:[function(require,module,exports){
 /**
  * wp.media.view.RouterItem
@@ -6999,6 +6971,7 @@
 });
 
 module.exports = RouterItem;
+
 },{"./menu-item.js":49}],54:[function(require,module,exports){
 /**
  * wp.media.view.Router
@@ -7036,9 +7009,8 @@
 });
 
 module.exports = Router;
-},{"./menu.js":50,"./router-item.js":53}],55:[function(require,module,exports){
-/*globals wp */
 
+},{"./menu.js":50,"./router-item.js":53}],55:[function(require,module,exports){
 /**
  * wp.media.view.Search
  *
@@ -7086,9 +7058,8 @@
 });
 
 module.exports = Search;
-},{"./view.js":71}],56:[function(require,module,exports){
-/*globals _, Backbone, wp */
 
+},{"./view.js":71}],56:[function(require,module,exports){
 /**
  * wp.media.view.Selection
  *
@@ -7172,9 +7143,8 @@
 });
 
 module.exports = Selection;
-},{"./attachments/selection.js":31,"./view.js":71}],57:[function(require,module,exports){
-/*globals _, Backbone, jQuery */
 
+},{"./attachments/selection.js":31,"./view.js":71}],57:[function(require,module,exports){
 /**
  * wp.media.view.Settings
  *
@@ -7282,7 +7252,7 @@
 		// If the setting has a corresponding user setting,
 		// update that as well.
 		if ( userSetting = $setting.data('userSetting') ) {
-			setUserSetting( userSetting, value );
+			window.setUserSetting( userSetting, value );
 		}
 	},
 
@@ -7294,9 +7264,8 @@
 });
 
 module.exports = Settings;
-},{"./view.js":71}],58:[function(require,module,exports){
-/*globals _, wp */
 
+},{"./view.js":71}],58:[function(require,module,exports){
 /**
  * wp.media.view.Settings.AttachmentDisplay
  *
@@ -7389,9 +7358,8 @@
 });
 
 module.exports = AttachmentDisplay;
-},{"../settings.js":57}],59:[function(require,module,exports){
-/*globals wp */
 
+},{"../settings.js":57}],59:[function(require,module,exports){
 /**
  * wp.media.view.Settings.Gallery
  *
@@ -7410,9 +7378,8 @@
 });
 
 module.exports = Gallery;
-},{"../settings.js":57}],60:[function(require,module,exports){
-/*globals wp */
 
+},{"../settings.js":57}],60:[function(require,module,exports){
 /**
  * wp.media.view.Settings.Playlist
  *
@@ -7431,6 +7398,7 @@
 });
 
 module.exports = Playlist;
+
 },{"../settings.js":57}],61:[function(require,module,exports){
 /**
  * wp.media.view.Sidebar
@@ -7449,9 +7417,8 @@
 });
 
 module.exports = Sidebar;
-},{"./priority-list.js":52}],62:[function(require,module,exports){
-/*globals _, wp */
 
+},{"./priority-list.js":52}],62:[function(require,module,exports){
 /**
  * wp.media.view.Spinner
  *
@@ -7488,9 +7455,8 @@
 });
 
 module.exports = Spinner;
-},{"./view.js":71}],63:[function(require,module,exports){
-/*globals Backbone, _ */
 
+},{"./view.js":71}],63:[function(require,module,exports){
 /**
  * wp.media.view.Toolbar
  *
@@ -7651,9 +7617,8 @@
 });
 
 module.exports = Toolbar;
-},{"./button.js":33,"./priority-list.js":52,"./view.js":71}],64:[function(require,module,exports){
-/*globals _, wp */
 
+},{"./button.js":33,"./priority-list.js":52,"./view.js":71}],64:[function(require,module,exports){
 /**
  * wp.media.view.Toolbar.Embed
  *
@@ -7689,9 +7654,8 @@
 });
 
 module.exports = Embed;
-},{"./select.js":65}],65:[function(require,module,exports){
-/*globals _, wp */
 
+},{"./select.js":65}],65:[function(require,module,exports){
 /**
  * wp.media.view.Toolbar.Select
  *
@@ -7760,9 +7724,8 @@
 });
 
 module.exports = Select;
-},{"../toolbar.js":63}],66:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"../toolbar.js":63}],66:[function(require,module,exports){
 /**
  * Creates a dropzone on WP editor instances (elements with .wp-editor-wrap
  * or #wp-fullscreen-body) and relays drag'n'dropped files to a media workflow.
@@ -7980,9 +7943,8 @@
 });
 
 module.exports = EditorUploader;
-},{"../view.js":71}],67:[function(require,module,exports){
-/*globals _, wp */
 
+},{"../view.js":71}],67:[function(require,module,exports){
 /**
  * wp.media.view.UploaderInline
  *
@@ -8113,9 +8075,8 @@
 });
 
 module.exports = UploaderInline;
-},{"../view.js":71,"./status.js":69}],68:[function(require,module,exports){
-/*globals wp */
 
+},{"../view.js":71,"./status.js":69}],68:[function(require,module,exports){
 /**
  * wp.media.view.UploaderStatusError
  *
@@ -8133,9 +8094,8 @@
 });
 
 module.exports = UploaderStatusError;
-},{"../view.js":71}],69:[function(require,module,exports){
-/*globals _, wp */
 
+},{"../view.js":71}],69:[function(require,module,exports){
 /**
  * wp.media.view.UploaderStatus
  *
@@ -8273,9 +8233,8 @@
 });
 
 module.exports = UploaderStatus;
-},{"../view.js":71,"./status-error.js":68}],70:[function(require,module,exports){
-/*globals _, wp, jQuery */
 
+},{"../view.js":71,"./status-error.js":68}],70:[function(require,module,exports){
 /**
  * wp.media.view.UploaderWindow
  *
@@ -8386,9 +8345,8 @@
 });
 
 module.exports = UploaderWindow;
-},{"../view.js":71}],71:[function(require,module,exports){
-/*globals wp */
 
+},{"../view.js":71}],71:[function(require,module,exports){
 /**
  * wp.media.View
  *
@@ -8453,4 +8411,5 @@
 });
 
 module.exports = View;
+
 },{}]},{},[17]);
Index: src/wp-includes/js/media/views.manifest.js
===================================================================
--- src/wp-includes/js/media/views.manifest.js	(revision 31383)
+++ src/wp-includes/js/media/views.manifest.js	(working copy)
@@ -1,148 +1,145 @@
-/* global _wpMediaViewsL10n, confirm, getUserSetting, setUserSetting */
-( function( $, _ ) {
-	var l10n,
-		media = wp.media;
-
-	media.isTouchDevice = ( 'ontouchend' in document );
-
-	// Link any localized strings.
-	l10n = media.view.l10n = typeof _wpMediaViewsL10n === 'undefined' ? {} : _wpMediaViewsL10n;
-
-	// Link any settings.
-	media.view.settings = l10n.settings || {};
-	delete l10n.settings;
-
-	// Copy the `post` setting over to the model settings.
-	media.model.settings.post = media.view.settings.post;
-
-	// Check if the browser supports CSS 3.0 transitions
-	$.support.transition = (function(){
-		var style = document.documentElement.style,
-			transitions = {
-				WebkitTransition: 'webkitTransitionEnd',
-				MozTransition:    'transitionend',
-				OTransition:      'oTransitionEnd otransitionend',
-				transition:       'transitionend'
-			}, transition;
-
-		transition = _.find( _.keys( transitions ), function( transition ) {
-			return ! _.isUndefined( style[ transition ] );
-		});
-
-		return transition && {
-			end: transitions[ transition ]
-		};
-	}());
-
-	/**
-	 * A shared event bus used to provide events into
-	 * the media workflows that 3rd-party devs can use to hook
-	 * in.
-	 */
-	media.events = _.extend( {}, Backbone.Events );
-
-	/**
-	 * Makes it easier to bind events using transitions.
-	 *
-	 * @param {string} selector
-	 * @param {Number} sensitivity
-	 * @returns {Promise}
-	 */
-	media.transition = function( selector, sensitivity ) {
-		var deferred = $.Deferred();
-
-		sensitivity = sensitivity || 2000;
-
-		if ( $.support.transition ) {
-			if ( ! (selector instanceof $) ) {
-				selector = $( selector );
-			}
-
-			// Resolve the deferred when the first element finishes animating.
-			selector.first().one( $.support.transition.end, deferred.resolve );
-
-			// Just in case the event doesn't trigger, fire a callback.
-			_.delay( deferred.resolve, sensitivity );
-
-		// Otherwise, execute on the spot.
-		} else {
-			deferred.resolve();
-		}
+var media = wp.media,
+	$ = jQuery,
+	l10n;
+
+media.isTouchDevice = ( 'ontouchend' in document );
+
+// Link any localized strings.
+l10n = media.view.l10n = window._wpMediaViewsL10n || {};
+
+// Link any settings.
+media.view.settings = l10n.settings || {};
+delete l10n.settings;
+
+// Copy the `post` setting over to the model settings.
+media.model.settings.post = media.view.settings.post;
+
+// Check if the browser supports CSS 3.0 transitions
+$.support.transition = (function(){
+	var style = document.documentElement.style,
+		transitions = {
+			WebkitTransition: 'webkitTransitionEnd',
+			MozTransition:    'transitionend',
+			OTransition:      'oTransitionEnd otransitionend',
+			transition:       'transitionend'
+		}, transition;
+
+	transition = _.find( _.keys( transitions ), function( transition ) {
+		return ! _.isUndefined( style[ transition ] );
+	});
 
-		return deferred.promise();
+	return transition && {
+		end: transitions[ transition ]
 	};
+}());
+
+/**
+ * A shared event bus used to provide events into
+ * the media workflows that 3rd-party devs can use to hook
+ * in.
+ */
+media.events = _.extend( {}, Backbone.Events );
+
+/**
+ * Makes it easier to bind events using transitions.
+ *
+ * @param {string} selector
+ * @param {Number} sensitivity
+ * @returns {Promise}
+ */
+media.transition = function( selector, sensitivity ) {
+	var deferred = $.Deferred();
+
+	sensitivity = sensitivity || 2000;
+
+	if ( $.support.transition ) {
+		if ( ! (selector instanceof $) ) {
+			selector = $( selector );
+		}
+
+		// Resolve the deferred when the first element finishes animating.
+		selector.first().one( $.support.transition.end, deferred.resolve );
 
-	media.controller.Region = require( './controllers/region.js' );
-	media.controller.StateMachine = require( './controllers/state-machine.js' );
-	media.controller.State = require( './controllers/state.js' );
-
-	media.selectionSync = require( './utils/selection-sync.js' );
-	media.controller.Library = require( './controllers/library.js' );
-	media.controller.ImageDetails = require( './controllers/image-details.js' );
-	media.controller.GalleryEdit = require( './controllers/gallery-edit.js' );
-	media.controller.GalleryAdd = require( './controllers/gallery-add.js' );
-	media.controller.CollectionEdit = require( './controllers/collection-edit.js' );
-	media.controller.CollectionAdd = require( './controllers/collection-add.js' );
-	media.controller.FeaturedImage = require( './controllers/featured-image.js' );
-	media.controller.ReplaceImage = require( './controllers/replace-image.js' );
-	media.controller.EditImage = require( './controllers/edit-image.js' );
-	media.controller.MediaLibrary = require( './controllers/media-library.js' );
-	media.controller.Embed = require( './controllers/embed.js' );
-	media.controller.Cropper = require( './controllers/cropper.js' );
-
-	media.View = require( './views/view.js' );
-	media.view.Frame = require( './views/view.js' );
-	media.view.MediaFrame = require( './views/media-frame.js' );
-	media.view.MediaFrame.Select = require( './views/frame/select.js' );
-	media.view.MediaFrame.Post = require( './views/frame/post.js' );
-	media.view.MediaFrame.ImageDetails = require( './views/frame/image-details.js' );
-	media.view.Modal = require( './views/modal.js' );
-	media.view.FocusManager = require( './views/focus-manager.js' );
-	media.view.UploaderWindow = require( './views/uploader/window.js' );
-	media.view.EditorUploader = require( './views/uploader/editor.js' );
-	media.view.UploaderInline = require( './views/uploader/inline.js' );
-	media.view.UploaderStatus = require( './views/uploader/status.js' );
-	media.view.UploaderStatusError = require( './views/uploader/status-error.js' );
-	media.view.Toolbar = require( './views/toolbar.js' );
-	media.view.Toolbar.Select = require( './views/toolbar/select.js' );
-	media.view.Toolbar.Embed = require( './views/toolbar/embed.js' );
-	media.view.Button = require( './views/button.js' );
-	media.view.ButtonGroup = require( './views/button-group.js' );
-	media.view.PriorityList = require( './views/priority-list.js' );
-	media.view.MenuItem = require( './views/menu-item.js' );
-	media.view.Menu = require( './views/menu.js' );
-	media.view.RouterItem = require( './views/router-item.js' );
-	media.view.Router = require( './views/router.js' );
-	media.view.Sidebar = require( './views/sidebar.js' );
-	media.view.Attachment = require( './views/attachment.js' );
-	media.view.Attachment.Library = require( './views/attachment/library.js' );
-	media.view.Attachment.EditLibrary = require( './views/attachment/edit-library.js' );
-	media.view.Attachments = require( './views/attachments.js' );
-	media.view.Search = require( './views/search.js' );
-	media.view.AttachmentFilters = require( './views/attachment-filters.js' );
-	media.view.DateFilter = require( './views/attachment-filters/date.js' );
-	media.view.AttachmentFilters.Uploaded = require( './views/attachment-filters/uploaded.js' );
-	media.view.AttachmentFilters.All = require( './views/attachment-filters/all.js' );
-	media.view.AttachmentsBrowser = require( './views/attachments/browser.js' );
-	media.view.Selection = require( './views/selection.js' );
-	media.view.Attachment.Selection = require( './views/attachment/selection.js' );
-	media.view.Attachments.Selection = require( './views/attachments/selection.js' );
-	media.view.Attachment.EditSelection = require( './views/attachment/edit-selection.js' );
-	media.view.Settings = require( './views/settings.js' );
-	media.view.Settings.AttachmentDisplay = require( './views/settings/attachment-display.js' );
-	media.view.Settings.Gallery = require( './views/settings/gallery.js' );
-	media.view.Settings.Playlist = require( './views/settings/playlist.js' );
-	media.view.Attachment.Details = require( './views/attachment/details.js' );
-	media.view.AttachmentCompat = require( './views/attachment-compat.js' );
-	media.view.Iframe = require( './views/iframe.js' );
-	media.view.Embed = require( './views/embed.js' );
-	media.view.Label = require( './views/label.js' );
-	media.view.EmbedUrl = require( './views/embed/url.js' );
-	media.view.EmbedLink = require( './views/embed/link.js' );
-	media.view.EmbedImage = require( './views/embed/image.js' );
-	media.view.ImageDetails = require( './views/image-details.js' );
-	media.view.Cropper = require( './views/cropper.js' );
-	media.view.EditImage = require( './views/edit-image.js' );
-	media.view.Spinner = require( './views/spinner.js' );
+		// Just in case the event doesn't trigger, fire a callback.
+		_.delay( deferred.resolve, sensitivity );
 
-}(jQuery, _));
\ No newline at end of file
+	// Otherwise, execute on the spot.
+	} else {
+		deferred.resolve();
+	}
+
+	return deferred.promise();
+};
+
+media.controller.Region = require( './controllers/region.js' );
+media.controller.StateMachine = require( './controllers/state-machine.js' );
+media.controller.State = require( './controllers/state.js' );
+
+media.selectionSync = require( './utils/selection-sync.js' );
+media.controller.Library = require( './controllers/library.js' );
+media.controller.ImageDetails = require( './controllers/image-details.js' );
+media.controller.GalleryEdit = require( './controllers/gallery-edit.js' );
+media.controller.GalleryAdd = require( './controllers/gallery-add.js' );
+media.controller.CollectionEdit = require( './controllers/collection-edit.js' );
+media.controller.CollectionAdd = require( './controllers/collection-add.js' );
+media.controller.FeaturedImage = require( './controllers/featured-image.js' );
+media.controller.ReplaceImage = require( './controllers/replace-image.js' );
+media.controller.EditImage = require( './controllers/edit-image.js' );
+media.controller.MediaLibrary = require( './controllers/media-library.js' );
+media.controller.Embed = require( './controllers/embed.js' );
+media.controller.Cropper = require( './controllers/cropper.js' );
+
+media.View = require( './views/view.js' );
+media.view.Frame = require( './views/view.js' );
+media.view.MediaFrame = require( './views/media-frame.js' );
+media.view.MediaFrame.Select = require( './views/frame/select.js' );
+media.view.MediaFrame.Post = require( './views/frame/post.js' );
+media.view.MediaFrame.ImageDetails = require( './views/frame/image-details.js' );
+media.view.Modal = require( './views/modal.js' );
+media.view.FocusManager = require( './views/focus-manager.js' );
+media.view.UploaderWindow = require( './views/uploader/window.js' );
+media.view.EditorUploader = require( './views/uploader/editor.js' );
+media.view.UploaderInline = require( './views/uploader/inline.js' );
+media.view.UploaderStatus = require( './views/uploader/status.js' );
+media.view.UploaderStatusError = require( './views/uploader/status-error.js' );
+media.view.Toolbar = require( './views/toolbar.js' );
+media.view.Toolbar.Select = require( './views/toolbar/select.js' );
+media.view.Toolbar.Embed = require( './views/toolbar/embed.js' );
+media.view.Button = require( './views/button.js' );
+media.view.ButtonGroup = require( './views/button-group.js' );
+media.view.PriorityList = require( './views/priority-list.js' );
+media.view.MenuItem = require( './views/menu-item.js' );
+media.view.Menu = require( './views/menu.js' );
+media.view.RouterItem = require( './views/router-item.js' );
+media.view.Router = require( './views/router.js' );
+media.view.Sidebar = require( './views/sidebar.js' );
+media.view.Attachment = require( './views/attachment.js' );
+media.view.Attachment.Library = require( './views/attachment/library.js' );
+media.view.Attachment.EditLibrary = require( './views/attachment/edit-library.js' );
+media.view.Attachments = require( './views/attachments.js' );
+media.view.Search = require( './views/search.js' );
+media.view.AttachmentFilters = require( './views/attachment-filters.js' );
+media.view.DateFilter = require( './views/attachment-filters/date.js' );
+media.view.AttachmentFilters.Uploaded = require( './views/attachment-filters/uploaded.js' );
+media.view.AttachmentFilters.All = require( './views/attachment-filters/all.js' );
+media.view.AttachmentsBrowser = require( './views/attachments/browser.js' );
+media.view.Selection = require( './views/selection.js' );
+media.view.Attachment.Selection = require( './views/attachment/selection.js' );
+media.view.Attachments.Selection = require( './views/attachments/selection.js' );
+media.view.Attachment.EditSelection = require( './views/attachment/edit-selection.js' );
+media.view.Settings = require( './views/settings.js' );
+media.view.Settings.AttachmentDisplay = require( './views/settings/attachment-display.js' );
+media.view.Settings.Gallery = require( './views/settings/gallery.js' );
+media.view.Settings.Playlist = require( './views/settings/playlist.js' );
+media.view.Attachment.Details = require( './views/attachment/details.js' );
+media.view.AttachmentCompat = require( './views/attachment-compat.js' );
+media.view.Iframe = require( './views/iframe.js' );
+media.view.Embed = require( './views/embed.js' );
+media.view.Label = require( './views/label.js' );
+media.view.EmbedUrl = require( './views/embed/url.js' );
+media.view.EmbedLink = require( './views/embed/link.js' );
+media.view.EmbedImage = require( './views/embed/image.js' );
+media.view.ImageDetails = require( './views/image-details.js' );
+media.view.Cropper = require( './views/cropper.js' );
+media.view.EditImage = require( './views/edit-image.js' );
+media.view.Spinner = require( './views/spinner.js' );
