Navigation Menu

Skip to content
This repository has been archived by the owner on May 24, 2021. It is now read-only.

Commit

Permalink
simplifies table creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Kambfhase committed Feb 20, 2013
1 parent 3ac3128 commit 771f0e1
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions podlove-web-player/podlove-web-player.js
Expand Up @@ -244,24 +244,27 @@
};

var generateChapterTable = function( params, playerId){
var class_names = 'podlovewebplayer_chapters';
if (params.chapterlinks != 'false') {
class_names += ' linked linked_'+params.chapterlinks;
}
var chaptersActive = "";
if (params.chaptersVisible == true) {
chaptersActive = " active";
}
var tablestring = '<div class="podlovewebplayer_chapterbox showonplay'+chaptersActive+'"><table rel="'+playerId+'" class="'+class_names+'">';

var tablestring = '<div class="podlovewebplayer_chapterbox showonplay"><table>';
tablestring += '<caption>Podcast Chapters</caption><thead><tr>';
tablestring += '<th scope="col">Chapter Number</th>';
tablestring += '<th scope="col">Start time</th>';
tablestring += '<th scope="col">Title</th>';
tablestring += '<th scope="col">Duration</th>';
tablestring += '</tr></thead>';
tablestring += '<tbody></tbody></table></div>';
var wrapper = $(tablestring);
var table = wrapper.find('table');
var div = $(tablestring);
var table = div.find('table');

if (params.chaptersVisible === true) {
div.addClass('active');
}

table.addClass('podlovewebplayer_chapters').attr('rel', playerId);
if (params.chapterlinks != 'false') {
table.addClass('linked linked_'+params.chapterlinks);
}


//prepare row data
var tempchapters = [];
Expand Down Expand Up @@ -338,7 +341,7 @@
});


return wrapper;
return div;
};


Expand Down

0 comments on commit 771f0e1

Please sign in to comment.