2012-08-05 08:29:21 +00:00
|
|
|
function load_slides() {
|
|
|
|
|
var filelist = [
|
|
|
|
|
"What is the world made of",
|
2012-08-05 10:00:11 +00:00
|
|
|
"Strong interactions" /*,
|
|
|
|
|
"The Electromagnetic Interaction",
|
|
|
|
|
"Nuclear decay and the weak interaction",
|
|
|
|
|
"The Three Generations of Matter",
|
|
|
|
|
"The Higgs",
|
|
|
|
|
"Antimatter"*/
|
|
|
|
|
];
|
2012-08-05 08:29:21 +00:00
|
|
|
|
|
|
|
|
//$(filelist).each(function(){alert($(this).html());});
|
2012-08-05 10:00:11 +00:00
|
|
|
var last = false;
|
|
|
|
|
|
2012-08-05 08:29:21 +00:00
|
|
|
for (var i = 0; i < filelist.length; i++ ) {
|
2012-08-05 10:00:11 +00:00
|
|
|
|
|
|
|
|
if (i == filelist.length - 1 ) {
|
|
|
|
|
last = true;
|
|
|
|
|
}
|
|
|
|
|
|
2012-08-05 08:29:21 +00:00
|
|
|
var filename = to_filename(filelist[i]);
|
|
|
|
|
// get
|
2012-08-05 10:00:11 +00:00
|
|
|
var chapter = get_html(filename, "chapter", "html", last);
|
2012-08-05 08:29:21 +00:00
|
|
|
//var readmore = get_html(filelist[i], "readmore", "html");
|
|
|
|
|
// here we just need the URL
|
|
|
|
|
//var icon = get_html(filelist[i], "img", "png");
|
|
|
|
|
//
|
2012-08-05 10:00:11 +00:00
|
|
|
//alert (chapter);
|
|
|
|
|
|
2012-08-05 08:29:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function to_filename(title) {
|
|
|
|
|
return title.toLowerCase().replace(/ /g, '_');
|
|
|
|
|
}
|
|
|
|
|
|
2012-08-05 10:00:11 +00:00
|
|
|
function get_html(file, prefix, extension, last ){
|
|
|
|
|
|
|
|
|
|
$.ajax( "./" + prefix + "/" + file + "." + extension ).done( function(data) {
|
|
|
|
|
//alert('<li class="slide"><div>' + data + "</div></li>");
|
|
|
|
|
$("#slider").append('<li class="slide"><div>' + data + "</div></li>");
|
|
|
|
|
if (last) {
|
|
|
|
|
set_sliders();
|
2012-08-05 08:29:21 +00:00
|
|
|
|
2012-08-05 10:00:11 +00:00
|
|
|
}
|
|
|
|
|
//return data;
|
|
|
|
|
});
|
2012-08-05 08:29:21 +00:00
|
|
|
|
|
|
|
|
}
|