Skip to content

Commit

Permalink
Changing images to image.
Browse files Browse the repository at this point in the history
  • Loading branch information
travist committed Jan 3, 2019
1 parent c4a4556 commit 97004b1
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 65 deletions.
2 changes: 1 addition & 1 deletion js/compressed/jquery.media.node.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/compressed/jquery.media.parser.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/jquery.osmplayer.compressed.js

Large diffs are not rendered by default.

62 changes: 31 additions & 31 deletions js/jquery.osmplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3014,7 +3014,7 @@
/**
* Copyright (c) 2010 Alethia Inc,
* http://www.alethia-inc.com
* Developed by Travis Tidwell | travist at alethia-inc.com
* Developed by Travis Tidwell | travist at alethia-inc.com
*
* License: GPL version 3.
*
Expand All @@ -3024,7 +3024,7 @@
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
Expand All @@ -3038,7 +3038,7 @@
*/



// Set up our defaults for this component.
jQuery.media.defaults = jQuery.extend( jQuery.media.defaults, {
node:"",
Expand All @@ -3051,28 +3051,28 @@
mediaRegion:"#mediaregion",
field:".mediafield"
});

jQuery.fn.medianode = function( server, settings ) {
if( this.length === 0 ) {
return null;
}
return new (function( server, node, settings ) {
settings = jQuery.media.utils.getSettings(settings);

// Save the jQuery display.
this.display = node;
this.nodeInfo = {};
this.incremented = false;
var _this = this;

// Add the min player as the player for this node.
this.player = this.display.find(settings.ids.mediaRegion).minplayer( settings );
if( this.player && (settings.incrementTime !== 0)) {
this.player.display.unbind("mediaupdate").bind( "mediaupdate", function( event, data ) {
_this.onMediaUpdate( data );
});
}

// Store all loaded images.
this.images = [];

Expand All @@ -3095,7 +3095,7 @@

// Add the voters to this node.
this.addVoters( this.display );

// Handle the media events.
this.onMediaUpdate = function( data ) {
if( !this.incremented ) {
Expand All @@ -3119,7 +3119,7 @@
}
}
};

this.loadNode = function( _nodeInfo ) {
return this.getNode( this.translateNode( _nodeInfo ) );
};
Expand Down Expand Up @@ -3175,7 +3175,7 @@
// Set the node information object.
this.nodeInfo = _nodeInfo;
this.incremented = false;

// Load the media...
if( this.player && this.nodeInfo.mediafiles ) {
// Load the preview image.
Expand All @@ -3190,20 +3190,20 @@
// Load the media...
this.player.loadFiles( this.nodeInfo.mediafiles.media );
}

// Get the vote for these voters.
if( this.voter ) {
this.voter.getVote( _nodeInfo );
}
if( this.uservoter ) {
this.uservoter.getVote( _nodeInfo );
}

// Load all of our fields.
this.display.find(settings.ids.field).each( function() {
_this.setField( this, _nodeInfo, $(this).attr("type"), $(this).attr("field") );
});

// Trigger our node loaded event.
this.display.trigger( "nodeload", this.nodeInfo );
}
Expand All @@ -3216,7 +3216,7 @@
case "text":
this.setTextField( fieldObj, _nodeInfo, fieldName );
break;

case "image":
this.setImageField( fieldObj, fieldName );
break;
Expand All @@ -3229,7 +3229,7 @@
}
}
};

this.setTextField = function( fieldObj, _nodeInfo, fieldName ) {
var field = _nodeInfo[fieldName];
if( field ) {
Expand All @@ -3255,10 +3255,10 @@
};

this.getImage = function( imageName ) {
var images = this.nodeInfo.mediafiles ? this.nodeInfo.mediafiles.images : null;
var images = this.nodeInfo.mediafiles ? this.nodeInfo.mediafiles.image : null;
var image = null;
if( images ) {

// Get the image.
if( images[imageName] ) {
image = images[imageName];
Expand All @@ -3272,7 +3272,7 @@
}
}
}

// If they just provided a string, then still show the image.
image = (typeof image === "string") ? {
path:image
Expand All @@ -3287,7 +3287,7 @@
}
return image;
};

this.setImageField = function( fieldObj, fieldName ) {
var file = this.getImage( fieldName );
if( file ) {
Expand Down Expand Up @@ -3659,7 +3659,7 @@
/**
* Copyright (c) 2010 Alethia Inc,
* http://www.alethia-inc.com
* Developed by Travis Tidwell | travist at alethia-inc.com
* Developed by Travis Tidwell | travist at alethia-inc.com
*
* License: GPL version 3.
*
Expand All @@ -3669,7 +3669,7 @@
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
Expand All @@ -3688,7 +3688,7 @@
return new (function( settings ) {
var _this = this;
this.onLoaded = null;

// Parse the contents from a file.
this.parseFile = function( file, onLoaded ) {
this.onLoaded = onLoaded;
Expand All @@ -3706,7 +3706,7 @@
}
});
};

// Parse an xml string.
this.parseXML = function( xml ) {
// Try to parse a playlist in any format...
Expand All @@ -3722,7 +3722,7 @@
}
return playlist;
};

// Parse XSPF contents.
this.parseXSPF = function( xml ) {
var playlist = {
Expand All @@ -3738,7 +3738,7 @@
title: $(this).find("title").text(),
description: $(this).find("annotation").text(),
mediafiles: {
images:{
image:{
"image":{
path:$(this).find("image").text()
}
Expand Down Expand Up @@ -3769,7 +3769,7 @@
nid:playlist.total_rows,
title: $(this).find("title").text(),
mediafiles: {
images:{
image:{
"image":{
path:$(this).find("image").text()
}
Expand All @@ -3795,7 +3795,7 @@
var channel = jQuery("rss channel", xml);
if( channel.length > 0 ) {
var youTube = (channel.find("generator").text() == "YouTube data API");

// Iterate through all the items.
channel.find("item").each( function(index) {
playlist.total_rows++;
Expand All @@ -3807,13 +3807,13 @@
}
return playlist;
};

// Parse a default RSS Item.
this.parseRSSItem = function( item ) {
return {
title: item.find("title").text(),
mediafiles: {
images:{
image:{
"image":{
path:item.find("image").text()
}
Expand All @@ -3826,15 +3826,15 @@
}
};
};

// Parse a YouTube item.
this.parseYouTubeItem = function( item ) {
var description = item.find("description").text();
var media = item.find("link").text().replace("&feature=youtube_gdata", "");
return {
title: item.find("title").text(),
mediafiles: {
images:{
image:{
"image":{
path:jQuery("img", description).eq(0).attr("src")
}
Expand Down
Loading

0 comments on commit 97004b1

Please sign in to comment.