From 02f2155c05164a55f05ddb038c31645bf956dc6d Mon Sep 17 00:00:00 2001 From: ScottDowne Date: Tue, 6 Jul 2010 12:06:09 -0400 Subject: [PATCH] dynamic loading of images, can still override with new image in xml. overlay fade in and out --- .../overlay/{googlemap.png => location.png} | Bin images/overlay/{wikipedia.png => wiki.png} | Bin popcorn.js | 42 +++++++++++++++--- xml/webMadeMovies.xml | 4 +- 4 files changed, 37 insertions(+), 9 deletions(-) rename images/overlay/{googlemap.png => location.png} (100%) rename images/overlay/{wikipedia.png => wiki.png} (100%) diff --git a/images/overlay/googlemap.png b/images/overlay/location.png similarity index 100% rename from images/overlay/googlemap.png rename to images/overlay/location.png diff --git a/images/overlay/wikipedia.png b/images/overlay/wiki.png similarity index 100% rename from images/overlay/wikipedia.png rename to images/overlay/wiki.png diff --git a/popcorn.js b/popcorn.js index 49f5671..90f1552 100644 --- a/popcorn.js +++ b/popcorn.js @@ -164,6 +164,10 @@ } // Checks for a url of an image to overlay onto the video + if (!this.params.overlay) { + this.params.overlay = "images/overlay/" + name + ".png"; + } + if (this.params.overlay) { this.image = document.createElement('img'); var that = this; @@ -172,13 +176,6 @@ .append($(that.image) .attr("src",that.params.overlay) .attr("style", "display:none")).appendTo(VideoManager.overlayDiv); - - this.displayOverlay = function() { - this.image.setAttribute('style', 'display:inline'); - }; - this.removeOverlay = function() { - this.image.setAttribute('style', 'display:none'); - }; } if (!VideoCommand.active[this.params.target]) { @@ -437,6 +434,13 @@ MapCommand.map.setCenter(new google.maps.LatLng(0, 0)); MapCommand.map.setZoom(0); } + + this.displayOverlay = function() { + $(this.image).fadeIn(2000); + }; + this.removeOverlay = function() { + $(this.image).fadeOut(2000); + }; this.onIn = function() { MapCommand.map.setCenter(this.location); MapCommand.map.setZoom(this.params.zoom); @@ -502,6 +506,12 @@ behavior: 'default' } }).render().start(); + this.displayOverlay = function() { + $(this.image).fadeIn(2000); + }; + this.removeOverlay = function() { + $(this.image).fadeOut(2000); + }; this.onIn = function() { this.target.setAttribute('style', 'display:inline'); }; @@ -549,6 +559,12 @@ } }); }); + this.displayOverlay = function() { + $(this.image).fadeIn(2000); + }; + this.removeOverlay = function() { + $(this.image).fadeOut(2000); + }; this.target = target; this.onIn = function() { @@ -595,6 +611,12 @@ }); this.target = target; + this.displayOverlay = function() { + $(this.image).fadeIn(2000); + }; + this.removeOverlay = function() { + $(this.image).fadeOut(2000); + }; this.onIn = function() { this.target.setAttribute('style', 'display:inline'); }; @@ -608,6 +630,12 @@ var FootnoteCommand = function(name, params, text, videoManager) { VideoCommand.call(this, name, params, text, videoManager); + this.displayOverlay = function() { + $(this.image).fadeIn(2000); + }; + this.removeOverlay = function() { + $(this.image).fadeOut(2000); + }; this.onIn = function() { //if the user specifies a target div for this in the xml use it //otherwise make a new div diff --git a/xml/webMadeMovies.xml b/xml/webMadeMovies.xml index ed5d3b4..514e17e 100644 --- a/xml/webMadeMovies.xml +++ b/xml/webMadeMovies.xml @@ -91,9 +91,9 @@ Steve Song - + - + -- 2.43.0