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
/** | |
* Il faut simplement placer la classe autosubmit sur la balise form | |
* pour déclencher l'autosoumision du formulaire. | |
*/ | |
$(function () { | |
// Dès qu'il y a un changement dans la formulaire. | |
$(".autosubmit select").on("change", function () { | |
// On demande confirmation du changement de statut. | |
if (confirm("Etes-vous sur ?")) { |
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
<?php | |
/* | |
* Calcule l'age en fonction de la date de naissance | |
* Format de date type 12/06/1988 | |
*/ | |
function age($date) { | |
/* | |
* Cette adaptation est obligatoire si on utilise un format de date "Français", | |
* strtotime ne supporte que le format d-m-Y et pas d/m/Y. | |
*/ |
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
/* =WordPress Core | |
-------------------------------------------------------------- */ | |
.alignnone { | |
margin: 5px 20px 20px 0; | |
} | |
.aligncenter, div.aligncenter { | |
display:block; | |
margin: 5px auto 5px auto; | |
} |
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
<?php | |
/* | |
* Fait un rendu d'un block drupal. | |
* Il faut lui passer le type (Block, menu, node) et le nom machine. | |
*/ | |
$block = block_load('type', 'machine_name'); | |
/* Me demandez pas ce que ça fait, j'en ai aucune idée, mais ça marche. */ | |
$render_block = _block_get_renderable_array( _block_render_blocks(array($block))); | |
print render($render_block); |
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
<div style="position: fixed; z-index: -99; width: 100%; height: 100%"> | |
<iframe frameborder="0" height="100%" width="100%" src="https://youtube.com/embed/VIDEO_ID?autoplay=1&controls=0&showinfo=0&autohide=1"></iframe> | |
</div> |
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
<embed height="0" width="0"src="http://youtube.googleapis.com/v/VIDEO_ID&autoplay=1&loop=1" /> |
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
// Quand on click sur le bouton de recherche | |
$("#bouton_recherche").click(function () { | |
// On soumet le formulaire | |
$("#form_recherche").submit(); | |
}); |
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
jQuery(document).ready(function($) { | |
// Le sélécteur de champ. | |
var typeInput = $("input[type=text], input[type=password], input[type=search], input[type=email]"); | |
// Quand on un champ de formulaire prend le focus | |
typeInput.on("focusin", function () { | |
// On récupère ça valeur | |
value = $(this).val(); | |
// Si c'est la valeur par défaut, on vide le champs. | |
if (value == this.defaultValue) $(this).val(""); |
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
<BOUCLE_article(ARTICLES){id_article=5}> | |
<BOUCLE_traduction(ARTICLES){traduction} {lang=#ENV{lang}}> | |
<h1>#TITRE</h1> | |
[<div class="chapo">(#CHAPO)</div>] | |
#TEXTE | |
</BOUCLE_traduction> | |
</BOUCLE_article> |
OlderNewer