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
|
<html>
<head>
<meta charset="utf-8" />
<title>Paragraphes</title>
<script type="text/javascript" src="tinymce/tinymce.min.js"></script>
<script type="text/javascript">
function InitialiserTiny()
{
tinymce.init({
selector: "textarea#AffichageDuMessage",
menubar : "false",
statusbar : "false",
menu : "false",
toolbar: "false",
});
}
function Ajoutertexte()
{
Demande = "<p>Salut<b> comment</b> ça va?</p>";
tinyMCE.execCommand('mceInsertContent',false,Demande);
}
function Select()
{
tinyMCE.activeEditor.selection.select(tinyMCE.activeEditor.dom.select('p')[0]);
}
function FaireFocus()
{
tinyMCE.execCommand('mceFocus',false,'AffichageDuMessage');
}
</script>
</head>
<body>
<form>
<p class="titre">Message</p>
<fieldset id="message">
<textarea id="AffichageDuMessage" name="AffichageDuMessage" rows="35" cols="150"></textarea><br>
</fieldset>
<input type="button" value="Initialisation" onclick="InitialiserTiny();" />
<input type="button" value="Afficher le message" onclick="Ajoutertexte();" />
<input type="button" value="Sélectionner le texte" onclick="Select();" />
<input type="button" value="focus" onclick="FaireFocus();" />
</form>
</body>
</html> |