-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Still a bug with pictures...
- Loading branch information
Showing
4 changed files
with
95 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
blog/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
(function($){ | ||
$(function(){ | ||
|
||
function findAndFillLastBlogPost() { | ||
$("#loading-post-icon").addClass("loading"); | ||
|
||
$.get( "blog/index.html", function( data ) { | ||
var postBeginning = "<div class=\"post\" id=\""; | ||
var postEnd = String.raw` </div> | ||
</div>`; // be carefull, there must be tabs in this ! Not spaces !! (see blog/index.html) | ||
idxStart = data.indexOf(postBeginning); | ||
idxEnd = data.indexOf(postEnd, idxStart + postBeginning.length) + postEnd.length; | ||
console.log(idxStart); | ||
console.log(idxEnd); | ||
console.log(idxEnd - idxStart); | ||
postTxt = data.substring(idxStart,idxEnd); | ||
|
||
$( "#last-blog-post" ).removeClass("hide"); | ||
$( "#last-blog-post" ).html( postTxt ); | ||
$("#loading-post-icon").addClass("hide"); | ||
}); | ||
} | ||
|
||
findAndFillLastBlogPost(); | ||
|
||
}); // end of document ready | ||
})(jQuery); // end of jQuery name space |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters