Skip to content
Browse files

Merge Popcorn.js v1.1.1 into master

  • Loading branch information...
2 parents ee5d8fb + d1053a9 commit 90797afbf855944280863b00f9f784c0135018b1 @cadecairos cadecairos committed
Showing with 133 additions and 138 deletions.
  1. +78 −76 players/soundcloud/popcorn.soundcloud.js
  2. +52 −52 plugins/googlefeed/popcorn.googlefeed.js
  3. +3 −10 plugins/timeline/popcorn.timeline.js
View
154 players/soundcloud/popcorn.soundcloud.js
@@ -228,102 +228,104 @@
swfobject.embedSWF( "http://player.soundcloud.com/player.swf", self._playerId, self.offsetWidth, self.height, "9.0.0", "expressInstall.swf", flashvars, params, attributes );
}
- Popcorn.getScript( "http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js" );
- // Source file originally from 'https://github.com/soundcloud/Widget-JS-API/raw/master/soundcloud.player.api.js'
- Popcorn.getScript( "http://popcornjs.org/code/players/soundcloud/lib/soundcloud.player.api.js", function() {
- // Play event is fired twice when player is first started. Ignore second one
- var ignorePlayEvt = 1;
+ Popcorn.soundcloud = function( containerId, src, options ) {
- // Register the wrapper's load event with the player
- soundcloud.addEventListener( 'onPlayerReady', function( object, data ) {
- var wrapper = registry[object.api_getFlashId()];
+ Popcorn.getScript( "http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js" );
- wrapper.swfObj = object;
- wrapper.duration = object.api_getTrackDuration();
- wrapper.currentTime = object.api_getTrackPosition();
- // This eliminates volumechangee event from firing on load
- wrapper.volume = wrapper.previousVolume = object.api_getVolume()/100;
+ // Source file originally from 'https://github.com/soundcloud/Widget-JS-API/raw/master/soundcloud.player.api.js'
+ Popcorn.getScript( "http://popcornjs.org/code/players/soundcloud/lib/soundcloud.player.api.js", function() {
+ // Play event is fired twice when player is first started. Ignore second one
+ var ignorePlayEvt = 1;
- // The numeric id of the track for use with Soundcloud API
- wrapper._mediaId = data.mediaId;
+ // Register the wrapper's load event with the player
+ soundcloud.addEventListener( 'onPlayerReady', function( object, data ) {
+ var wrapper = registry[object.api_getFlashId()];
- wrapper.dispatchEvent( 'load' );
- wrapper.dispatchEvent( 'canplay' );
- wrapper.dispatchEvent( 'durationchange' );
+ wrapper.swfObj = object;
+ wrapper.duration = object.api_getTrackDuration();
+ wrapper.currentTime = object.api_getTrackPosition();
+ // This eliminates volumechangee event from firing on load
+ wrapper.volume = wrapper.previousVolume = object.api_getVolume()/100;
- wrapper.timeupdate();
- });
+ // The numeric id of the track for use with Soundcloud API
+ wrapper._mediaId = data.mediaId;
- // Register events for when the flash player plays a track for the first time
- soundcloud.addEventListener( 'onMediaStart', function( object, data ) {
- var wrapper = registry[object.api_getFlashId()];
- wrapper.played = 1;
- wrapper.dispatchEvent( 'playing' );
- });
+ wrapper.dispatchEvent( 'load' );
+ wrapper.dispatchEvent( 'canplay' );
+ wrapper.dispatchEvent( 'durationchange' );
- // Register events for when the flash player plays a track
- soundcloud.addEventListener( 'onMediaPlay', function( object, data ) {
- if ( ignorePlayEvt ) {
- ignorePlayEvt = 0;
- return;
- }
+ wrapper.timeupdate();
+ });
- var wrapper = registry[object.api_getFlashId()];
- wrapper.dispatchEvent( 'play' );
- });
+ // Register events for when the flash player plays a track for the first time
+ soundcloud.addEventListener( 'onMediaStart', function( object, data ) {
+ var wrapper = registry[object.api_getFlashId()];
+ wrapper.played = 1;
+ wrapper.dispatchEvent( 'playing' );
+ });
- // Register events for when the flash player pauses a track
- soundcloud.addEventListener( 'onMediaPause', function( object, data ) {
- var wrapper = registry[object.api_getFlashId()];
- wrapper.dispatchEvent( 'pause' );
- });
+ // Register events for when the flash player plays a track
+ soundcloud.addEventListener( 'onMediaPlay', function( object, data ) {
+ if ( ignorePlayEvt ) {
+ ignorePlayEvt = 0;
+ return;
+ }
- // Register events for when the flash player is buffering
- soundcloud.addEventListener( 'onMediaBuffering', function( object, data ) {
- var wrapper = registry[object.api_getFlashId()];
+ var wrapper = registry[object.api_getFlashId()];
+ wrapper.dispatchEvent( 'play' );
+ });
- wrapper.dispatchEvent( 'progress' );
+ // Register events for when the flash player pauses a track
+ soundcloud.addEventListener( 'onMediaPause', function( object, data ) {
+ var wrapper = registry[object.api_getFlashId()];
+ wrapper.dispatchEvent( 'pause' );
+ });
- if ( wrapper.readyState === 0 ) {
- wrapper.readyState = 3;
- wrapper.dispatchEvent( "readystatechange" );
- }
- });
+ // Register events for when the flash player is buffering
+ soundcloud.addEventListener( 'onMediaBuffering', function( object, data ) {
+ var wrapper = registry[object.api_getFlashId()];
- // Register events for when the flash player is done buffering
- soundcloud.addEventListener( 'onMediaDoneBuffering', function( object, data ) {
- var wrapper = registry[object.api_getFlashId()];
- wrapper.dispatchEvent( 'canplaythrough' );
- });
+ wrapper.dispatchEvent( 'progress' );
- // Register events for when the flash player has finished playing
- soundcloud.addEventListener( 'onMediaEnd', function( object, data ) {
- var wrapper = registry[object.api_getFlashId()];
- wrapper.paused = 1;
- //wrapper.pause();
- wrapper.dispatchEvent( 'ended' );
- });
+ if ( wrapper.readyState === 0 ) {
+ wrapper.readyState = 3;
+ wrapper.dispatchEvent( "readystatechange" );
+ }
+ });
- // Register events for when the flash player has seeked
- soundcloud.addEventListener( 'onMediaSeek', function( object, data ) {
- var wrapper = registry[object.api_getFlashId()];
+ // Register events for when the flash player is done buffering
+ soundcloud.addEventListener( 'onMediaDoneBuffering', function( object, data ) {
+ var wrapper = registry[object.api_getFlashId()];
+ wrapper.dispatchEvent( 'canplaythrough' );
+ });
- wrapper.setCurrentTime( object.api_getTrackPosition() );
+ // Register events for when the flash player has finished playing
+ soundcloud.addEventListener( 'onMediaEnd', function( object, data ) {
+ var wrapper = registry[object.api_getFlashId()];
+ wrapper.paused = 1;
+ //wrapper.pause();
+ wrapper.dispatchEvent( 'ended' );
+ });
- if ( wrapper.paused ) {
- wrapper.dispatchEvent( "timeupdate" );
- }
- });
+ // Register events for when the flash player has seeked
+ soundcloud.addEventListener( 'onMediaSeek', function( object, data ) {
+ var wrapper = registry[object.api_getFlashId()];
- // Register events for when the flash player has errored
- soundcloud.addEventListener( 'onPlayerError', function( object, data ) {
- var wrapper = registry[object.api_getFlashId()];
- wrapper.dispatchEvent( 'error' );
+ wrapper.setCurrentTime( object.api_getTrackPosition() );
+
+ if ( wrapper.paused ) {
+ wrapper.dispatchEvent( "timeupdate" );
+ }
+ });
+
+ // Register events for when the flash player has errored
+ soundcloud.addEventListener( 'onPlayerError', function( object, data ) {
+ var wrapper = registry[object.api_getFlashId()];
+ wrapper.dispatchEvent( 'error' );
+ });
});
- });
- Popcorn.soundcloud = function( containerId, src, options ) {
return new Popcorn.soundcloud.init( containerId, src, options );
};
@@ -690,4 +692,4 @@
});
}
});
-})( Popcorn, window );
+})( Popcorn, window );
View
104 plugins/googlefeed/popcorn.googlefeed.js
@@ -2,58 +2,7 @@
(function ( Popcorn ) {
var i = 1,
- scriptLoaded = false,
-
- dynamicFeedLoad = function() {
- var dontLoad = false,
- k = 0,
- links = document.getElementsByTagName( "link" ),
- len = links.length,
- head = document.head || document.getElementsByTagName( "head" )[ 0 ],
- css = document.createElement( "link" ),
- resource = "//www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.";
-
- if ( !window.GFdynamicFeedControl ) {
-
- Popcorn.getScript( resource + "js", function() {
- scriptLoaded = true;
- });
-
- } else {
- scriptLoaded = true;
- }
-
- // Checking if the css file is already included
- for ( ; k < len; k++ ){
- if ( links[ k ].href === resource + "css" ) {
- dontLoad = true;
- }
- }
-
- if ( !dontLoad ) {
- css.type = "text/css";
- css.rel = "stylesheet";
- css.href = resource + "css";
- head.insertBefore( css, head.firstChild );
- }
- };
-
- if ( !window.google ) {
-
- Popcorn.getScript( "//www.google.com/jsapi", function() {
-
- google.load( "feeds", "1", {
-
- callback: function () {
-
- dynamicFeedLoad();
- }
- });
- });
-
- } else {
- dynamicFeedLoad();
- }
+ scriptLoaded = false;
/**
* googlefeed popcorn plug-in
@@ -81,6 +30,57 @@
Popcorn.plugin( "googlefeed", function( options ) {
+ var dynamicFeedLoad = function() {
+ var dontLoad = false,
+ k = 0,
+ links = document.getElementsByTagName( "link" ),
+ len = links.length,
+ head = document.head || document.getElementsByTagName( "head" )[ 0 ],
+ css = document.createElement( "link" ),
+ resource = "//www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.";
+
+ if ( !window.GFdynamicFeedControl ) {
+
+ Popcorn.getScript( resource + "js", function() {
+ scriptLoaded = true;
+ });
+
+ } else {
+ scriptLoaded = true;
+ }
+
+ // Checking if the css file is already included
+ for ( ; k < len; k++ ){
+ if ( links[ k ].href === resource + "css" ) {
+ dontLoad = true;
+ }
+ }
+
+ if ( !dontLoad ) {
+ css.type = "text/css";
+ css.rel = "stylesheet";
+ css.href = resource + "css";
+ head.insertBefore( css, head.firstChild );
+ }
+ };
+
+ if ( !window.google ) {
+
+ Popcorn.getScript( "//www.google.com/jsapi", function() {
+
+ google.load( "feeds", "1", {
+
+ callback: function () {
+
+ dynamicFeedLoad();
+ }
+ });
+ });
+
+ } else {
+ dynamicFeedLoad();
+ }
+
// create a new div and append it to the parent div so nothing
// that already exists in the parent div gets overwritten
var newdiv = document.createElement( "div" ),
View
13 plugins/timeline/popcorn.timeline.js
@@ -26,14 +26,7 @@
*
*/
- var i = 1,
- head = document.getElementsByTagName( "head" )[ 0 ],
- css = document.createElement( "link" );
-
- css.type = "text/css";
- css.rel = "stylesheet";
- css.href = "//popcornjs.org/code/plugins/timeline/popcorn.timeline.css";
- head.insertBefore( css, head.firstChild );
+ var i = 1;
Popcorn.plugin( "timeline" , function( options ) {
@@ -81,8 +74,8 @@
// Default to empty if not used
//options.innerHTML = options.innerHTML || "";
- contentDiv.innerHTML = "<p><span id='big'>" + options.title + "</span><br />" +
- "<span id='mid'>" + options.text + "</span><br />" + options.innerHTML;
+ contentDiv.innerHTML = "<p><span id='big' style='font-size:24px; line-height: 130%;' >" + options.title + "</span><br />" +
+ "<span id='mid' style='font-size: 16px;'>" + options.text + "</span><br />" + options.innerHTML;
return {

0 comments on commit 90797af

Please sign in to comment.
Something went wrong with that request. Please try again.