@@ -1,42 +1,56 @@ | |||
(function(){ | |||
var $button = $("<div id='source-button' class='btn btn-primary btn-xs'>< ></div>").click(function(){ | |||
var html = $(this).parent().html(); | |||
html = cleanSource(html); | |||
$("#source-modal pre").text(html); | |||
$("#source-modal").modal(); | |||
}); | |||
$('.bs-component [data-toggle="popover"]').popover(); | |||
$('.bs-component [data-toggle="tooltip"]').tooltip(); | |||
$(".bs-component").hover(function(){ | |||
$(this).append($button); | |||
$button.show(); | |||
}, function(){ | |||
$button.hide(); | |||
}); | |||
function cleanSource(html) { | |||
var lines = html.split(/\n/); | |||
lines.shift(); | |||
lines.splice(-1, 1); | |||
var indentSize = lines[0].length - lines[0].trim().length, | |||
$(window).scroll(function () { | |||
var top = $(document).scrollTop(); | |||
$('.splash').css({ | |||
'background-position': '0px -'+(top/3).toFixed(2)+'px' | |||
}); | |||
if(top > 50) | |||
$('#home > .navbar').removeClass('navbar-transparent'); | |||
else | |||
$('#home > .navbar').addClass('navbar-transparent'); | |||
}); | |||
$("a[href='#']").click(function(e) { | |||
e.preventDefault(); | |||
}); | |||
var $button = $("<div id='source-button' class='btn btn-primary btn-xs'>< ></div>").click(function(){ | |||
var html = $(this).parent().html(); | |||
html = cleanSource(html); | |||
$("#source-modal pre").text(html); | |||
$("#source-modal").modal(); | |||
}); | |||
$('.bs-component [data-toggle="popover"]').popover(); | |||
$('.bs-component [data-toggle="tooltip"]').tooltip(); | |||
$(".bs-component").hover(function(){ | |||
$(this).append($button); | |||
$button.show(); | |||
}, function(){ | |||
$button.hide(); | |||
}); | |||
function cleanSource(html) { | |||
var lines = html.split(/\n/); | |||
lines.shift(); | |||
lines.splice(-1, 1); | |||
var indentSize = lines[0].length - lines[0].trim().length, | |||
re = new RegExp(" {" + indentSize + "}"); | |||
lines = lines.map(function(line){ | |||
if (line.match(re)) { | |||
line = line.substring(indentSize); | |||
} | |||
lines = lines.map(function(line){ | |||
if (line.match(re)) { | |||
line = line.substring(indentSize); | |||
} | |||
return line; | |||
}); | |||
return line; | |||
}); | |||
lines = lines.join("\n"); | |||
lines = lines.join("\n"); | |||
return lines; | |||
} | |||
return lines; | |||
} | |||
})(); | |||
})(); |
@@ -170,37 +170,18 @@ foreach($xml->entry as $entry) { | |||
</div> | |||
</div> | |||
<hr /> | |||
<div class="list-group col-lg-9"> | |||
<a class="list-group-item"> | |||
<button class="btn btn-default btn-xs" data-toggle="modal" data-target="#notes<?php echo $itemnb; ?>" style="float:right;"><i class="ionicons ion-edit"></i></button> | |||
<h4>Notes :</h4> | |||
<p class="list-group-item-text"><?php echo $entry->notes ?></p> | |||
</a> | |||
</div> | |||
<div class="col-lg-3"> | |||
<h4><i class="glyphicon glyphicon-gift" style="color:blue;";></i> <strong><?php echo $entry->gift; ?></strong></h4> | |||
<?php button_modif_gift("gift_reset", $entry->nom, "0"); ?><?php button_modif_gift("gift_moins", $entry->nom, "-"); ?><?php button_modif_gift("gift_plus", $entry->nom, "+"); ?> | |||
</div> | |||
<!-- notes --> | |||
<div class="modal fade" id="notes<?php echo $itemnb;?>" tabindex="-1" role="dialog" aria-labelledby="notes<?php echo $itemnb;?>" aria-hidden="true"> | |||
<div class="modal-dialog"> | |||
<div class="modal-content"> | |||
<div class="modal-body"> | |||
<div class="container-fluid"> | |||
<div class="col-lg-12"> | |||
<form action="action.php?edit_notes&entry=<?php echo $entry->nom; ?>" method="post"> | |||
<textarea name="notes" id="notes<?php echo $itemnb; ?>" cols="80" rows="10"><?php echo $entry->notes;?></textarea> | |||
<div class="modal-footer"> | |||
<button type="button" class="btn btn-default" data-dismiss="modal" style="float:left;">Fermer</button> | |||
<input type="submit" class="btn btn-primary" value="Editer" /> | |||
</div> | |||
</form> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="left" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus." data-original-title="" title="">Left</button> | |||
<button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="top" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus." data-original-title="" title="">Top</button> | |||
<button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="bottom" data-content="Vivamus | |||
sagittis lacus vel augue laoreet rutrum faucibus." data-original-title="" title="">Bottom</button> | |||
<button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="right" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus." data-original-title="" title="">Right</button> | |||
</div> | |||
</div> | |||
</div> | |||