Some playlist cleanup:

* Check properties against the `window` object when using `_.isUndefined()` on globals
* Fix a typo for `$safe_type` introduced in [27311]

See #26631.



git-svn-id: https://develop.svn.wordpress.org/trunk@27320 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-02-27 21:37:36 +00:00
parent a53fab8750
commit 6736936a43
3 changed files with 8 additions and 9 deletions

View File

@ -632,8 +632,8 @@
*/
insert: function( html ) {
var editor,
hasTinymce = ! _.isUndefined( tinymce ),
hasQuicktags = ! _.isUndefined( QTags ),
hasTinymce = ! _.isUndefined( window.tinymce ),
hasQuicktags = ! _.isUndefined( window.QTags ),
wpActiveEditor = window.wpActiveEditor;
// Delegate to the global `send_to_editor` if it exists.
@ -798,7 +798,7 @@
id = wpActiveEditor;
// If that doesn't work, fall back to `tinymce.activeEditor.id`.
if ( ! id && ! _.isUndefined( tinymce ) && tinymce.activeEditor ) {
if ( ! id && ! _.isUndefined( window.tinymce ) && tinymce.activeEditor ) {
id = tinymce.activeEditor.id;
}
@ -929,7 +929,7 @@
id = this.id( id );
/*
// Save a bookmark of the caret position in IE.
if ( ! _.isUndefined( tinymce ) ) {
if ( ! _.isUndefined( window.tinymce ) ) {
editor = tinymce.get( id );
if ( tinymce.isIE && editor && ! editor.isHidden() ) {

View File

@ -1,4 +1,4 @@
/*globals window, document, $, jQuery */
/*globals window, document, jQuery, _, Backbone, _wpmejsSettings */
(function ($, _, Backbone) {
"use strict";
@ -32,7 +32,7 @@
_.bindAll( this, 'bindPlayer', 'ended', 'clickTrack' );
if ( typeof _wpmejsSettings !== 'undefined' ) {
if ( ! _.isUndefined( window._wpmejsSettings ) ) {
settings.pluginPath = _wpmejsSettings.pluginPath;
}
settings.success = this.bindPlayer;
@ -47,8 +47,7 @@
this.playerNode.attr( 'poster', this.current.get( 'image' ).src );
}
dimensions = this.current.get( 'dimensions' ).resized;
this.playerNode.attr( 'width', dimensions.width );
this.playerNode.attr( 'height', dimensions.height );
this.playerNode.attr( dimensions );
} else {
if ( ! this.data.images ) {
this.current.set( 'image', false );

View File

@ -1117,7 +1117,7 @@ function wp_get_playlist( $attr, $type ) {
}
$data['tracks'] = $tracks;
$safe_type = esc_attr( $safe_type );
$safe_type = esc_attr( $type );
$safe_style = esc_attr( $style );
ob_start();