New pop-up help page about smileys - clicking on the smiley inserts it

into the form using Javascript!

Also rationalised and patched some of the other help about text formats.

LANGUAGE EDITORS MAY WANT TO RE-CHECK:

   lang/en/help/textformat.html
This commit is contained in:
moodler
2003-05-08 16:09:30 +00:00
parent a9c2c8fd8f
commit e825f27967
6 changed files with 85 additions and 34 deletions
+19 -1
View File
@@ -34,7 +34,25 @@ function checkall() {
void(el[i].checked=1)
}
<? if ($focus) { echo "function setfocus() { document.$focus.focus() }\n"; } ?>
function inserttext(text) {
<?PHP
if (!empty($SESSION->inserttextform)) {
$insertfield = "opener.document.forms['$SESSION->inserttextform'].$SESSION->inserttextfield";
} else {
$insertfield = "opener.document.forms['theform'].message";
}
echo " text = ' ' + text + ' ';\n";
echo " if ( $insertfield.createTextRange && $insertfield.caretPos) {\n";
echo " var caretPos = $insertfield.caretPos;\n";
echo " caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;\n";
echo " } else {\n";
echo " $insertfield.value += text;\n";
echo " }\n";
echo " $insertfield.focus();\n";
?>
}
<?PHP if ($focus) { echo "function setfocus() { document.$focus.focus() }\n"; } ?>
// done hiding -->
</SCRIPT>