From e0455fd75d16cfeec34ec102a3eb99b7142b95af Mon Sep 17 00:00:00 2001 From: David Seifried Date: Fri, 29 Jul 2011 15:32:00 -0400 Subject: [PATCH] Fixed all plugins with issues in butter' --- plugins/googlemap/popcorn.googlemap.js | 2 +- plugins/googlenews/popcorn.googlenews.js | 2 +- plugins/subtitle/popcorn.subtitle.js | 2 +- plugins/timeline/popcorn.timeline.js | 2 +- plugins/wordriver/popcorn.wordriver.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/googlemap/popcorn.googlemap.js b/plugins/googlemap/popcorn.googlemap.js index 5c044c9..725bbb6 100755 --- a/plugins/googlemap/popcorn.googlemap.js +++ b/plugins/googlemap/popcorn.googlemap.js @@ -322,7 +322,7 @@ var googleCallback; }, _teardown: function (options) { // the map must be manually removed - document.getElementById(options.target).removeChild(newdiv); + document.getElementById(options.target) && document.getElementById(options.target).removeChild(newdiv); newdiv = map = location = null; } }; diff --git a/plugins/googlenews/popcorn.googlenews.js b/plugins/googlenews/popcorn.googlenews.js index 166be7d..2c294f6 100755 --- a/plugins/googlenews/popcorn.googlenews.js +++ b/plugins/googlenews/popcorn.googlenews.js @@ -54,7 +54,7 @@ start : {elem:'input', type:'text', label:'In'}, end : {elem:'input', type:'text', label:'Out'}, target : 'news-container', - topic : {elem:'select', type:'text', label:'Type'} + topic : {elem:'input', type:'text', label:'Topic'} } }, _setup : function( options ) { diff --git a/plugins/subtitle/popcorn.subtitle.js b/plugins/subtitle/popcorn.subtitle.js index 4d9c718..e801c7d 100755 --- a/plugins/subtitle/popcorn.subtitle.js +++ b/plugins/subtitle/popcorn.subtitle.js @@ -165,7 +165,7 @@ options.container = this.container; } - document.getElementById( options.container.id ).appendChild( newdiv ); + document.getElementById( options.container.id ) && document.getElementById( options.container.id ).appendChild( newdiv ); options.innerContainer = newdiv; options.showSubtitle = function() { diff --git a/plugins/timeline/popcorn.timeline.js b/plugins/timeline/popcorn.timeline.js index 641396b..3cee6b2 100644 --- a/plugins/timeline/popcorn.timeline.js +++ b/plugins/timeline/popcorn.timeline.js @@ -89,7 +89,7 @@ }, _teardown: function( options ) { - while ( target.firstChild ) { + while ( target && target.firstChild ) { target.removeChild( target.firstChild ); } } diff --git a/plugins/wordriver/popcorn.wordriver.js b/plugins/wordriver/popcorn.wordriver.js index cd74c42..173329f 100755 --- a/plugins/wordriver/popcorn.wordriver.js +++ b/plugins/wordriver/popcorn.wordriver.js @@ -139,7 +139,7 @@ // if no more word spans exist in container, remove container container[ options.target ] && !container[ options.target ].childElementCount && - document.getElementById( options.target ).removeChild( container[ options.target ] ) && + document.getElementById( options.target ) && document.getElementById( options.target ).removeChild( container[ options.target ] ) && delete container[ options.target ]; } }); -- 2.43.0