25 lines
905 B
JavaScript
Executable File
25 lines
905 B
JavaScript
Executable File
(function($) {
|
|
$.fn.articlesaffiche = function(contenu){
|
|
$(this).html(Mustache.to_html($('#tpl_articlelist').html(),contenu)).promise().done(function(){
|
|
$('figure.article-item').on ('click',function(e){
|
|
e.preventDefault();
|
|
var data = {};
|
|
console.log($(this).find('button').attr('href').replace('.html','.json'));
|
|
$.getJSON($(this).find('button').attr('href').replace('.html','.json') , function( contenuarticle){
|
|
$('#articlecontent').html(Mustache.to_html($('#tpl_article').html(),contenuarticle))
|
|
.promise().done(function(){
|
|
$('#maincontent').css('display','none');
|
|
$('#articlecontent').css('display','block');
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
};
|
|
|
|
$.fn.articlemaj = function(contenu){
|
|
|
|
};
|
|
|
|
}(jQuery));
|