remove unnessary files. Make timthumb work
$('.commentSection form').click(function(event){
event.stopPropagation();
});
$('.commentSection input').focus(function(event){
event.stopPropagation();
console.log($(this).val() + ' ' + values[returnOldValue($(this).attr('name'))]);
if($(this).val() == values[returnOldValue($(this).attr('name'))]){
$(this).val(($(this).attr('name') == 'twitter') ?'@':'');
$(this).css('color', '#000');
}
});
$('.commentInput').focus(function(event){
event.stopPropagation();
if($(this).val() == values[returnOldValue($(this).attr('name'))]){
$(this).val('');
$(this).css('color', '#000');
}
});
var pseudo = 'nom/pseudo';
var mail = 'mail';
var twitter = 'twitter';
var comment = 'votre commentaire';
var values = [pseudo, mail, twitter, comment];
$('.commentSection input').focusout(function(event){
event.stopPropagation();
if($(this).val().length == 0 || $(this).val() == '@'){
$(this).val(values[returnOldValue($(this).attr('name'))]);
$(this).css('color', '#b7b7b7');
}
});
$('.commentInput').focusout(function(event){
event.stopPropagation();
console.log(isThisEqual($(this).val().length, 0));
if($(this).val().length == 0 || $(this).val().length == '@'){
$(this).val(values[returnOldValue($(this).attr('name'))]);
$(this).css('color', '#b7b7b7');
}
});
function isThisEqual(un, deux){
console.log(un + '//' + deux);
if(un == deux){
return true;
}
return false;
}
function returnOldValue(attribut)
{
switch(attribut)
{
case 'pseudo':
return 0
break;
case 'mail' :
return 1
break;
case 'twitter' :
return 2
break;
case 'comment' :
return 3
break;
}
}