1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="styles.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
<title>Mon Chat</title>
</head>
<body>
<div id="global">
<h1>Mon Tchat</h1>
<div id="messa_chat" class="deplace">La réponse sera affiché à la place de ce texte. </div>
<div id="online" class="deplace"> </div>
<div id="send_chat" class="deplace">
<div id="emoticons">
<a href="#" title="SnormalS"><img alt=":)" border="0" src="smileys/normal.gif" width="20" height="20" /></a>
<a href="#" title="SmalS"><img alt=":(" border="0" src="smileys/mal.gif" width="20" height="20" /></a>
<a href="#" title="StimideS"><img alt=":(" border="0" src="smileys/timide.gif" width="20" height="20" /></a>
<a href="#" title="SpleureS"><img alt=":o" border="0" src="smileys/pleure.gif" width="20" height="20" /></a>
<a href="#" title="SamourS"><img alt=":o" border="0" src="smileys/amour.gif" width="20" height="20" /></a>
<a href="#" title="ScoeurS"><img alt=":o" border="0" src="smileys/coeur.gif" width="20" height="20" /></a>
<a href="#" title="SkissS"><img alt=":o" border="0" src="smileys/kiss.gif" width="20" height="20" /></a>
<a href="#" title="SfleurS"><img alt=":o" border="0" src="smileys/fleur.gif" width="20" height="20" /></a>
</div>
<form method="post" id="monform">
<textarea name="message" id="message" class="message" rows="2" cols="100"></textarea>
<input type="hidden" name="pseudo" id="pseudo" value="jule"/>
<input type="button" id="envoi" value="Go">
</form>
</div>
</div>
<script type="text/javascript" src="fonctions.js"></script>
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script>
$('#emoticons a').click(function() {
var smiley = $(this).attr('title');
ins2pos(smiley, 'message');
});
function ins2pos(str, id) {
var TextArea = document.getElementById(id);
var val = TextArea.value;
var before = val.substring(0, TextArea.selectionStart);
var after = val.substring(TextArea.selectionEnd, val.length);
TextArea.value = before + str + after;
}
</script>
</body>
</html> |
Partager