Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions add-on/jplayer.playlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@
itemClass: "jp-playlist-item",
freeGroupClass: "jp-free-media",
freeItemClass: "jp-playlist-item-free",
removeItemClass: "jp-playlist-item-remove"
removeItemClass: "jp-playlist-item-remove",
downloadPrefix: '',
downloadForceRightClick: true
}
},
option: function(option, value) { // For changing playlist options only
Expand Down Expand Up @@ -252,7 +254,7 @@
} else {
listItem += " | ";
}
listItem += "<a class='" + self.options.playlistOptions.freeItemClass + "' href='" + value + "' tabindex='1'>" + property + "</a>";
listItem += "<a class='" + self.options.playlistOptions.freeItemClass + "' href='" + self.options.playlistOptions.downloadPrefix + value + "' tabindex='1'>Download</a>";
}
});
listItem += ")</span>";
Expand All @@ -279,11 +281,13 @@
});

// Create live handlers that disable free media links to force access via right click
$(this.cssSelector.playlist).off("click", "a." + this.options.playlistOptions.freeItemClass).on("click", "a." + this.options.playlistOptions.freeItemClass, function() {
$(this).parent().parent().find("." + self.options.playlistOptions.itemClass).click();
$(this).blur();
return false;
});
if(this.options.downloadForceRightClick) {
$(this.cssSelector.playlist).off("click", "a." + this.options.playlistOptions.freeItemClass).on("click", "a." + this.options.playlistOptions.freeItemClass, function() {
$(this).parent().parent().find("." + self.options.playlistOptions.itemClass).click();
$(this).blur();
return false;
});
}

// Create live handlers for the remove controls
$(this.cssSelector.playlist).off("click", "a." + this.options.playlistOptions.removeItemClass).on("click", "a." + this.options.playlistOptions.removeItemClass, function() {
Expand Down