Old addition never checked in

This commit is contained in:
moodler
2006-05-02 07:59:38 +00:00
parent e2b4f1f361
commit f41ab276c7
+20
View File
@@ -1,5 +1,25 @@
// Miscellaneous core Javascript functions for Moodle
//insert text @ a cursor
function insertAtCursor(myField, myValue) {
//IE support
if (document.selection) {
myField.focus();
sel = document.selection.createRange();
sel.text = myValue;
}
//MOZILLA/NETSCAPE support
else if (myField.selectionStart || myField.selectionStart == '0') {
var startPos = myField.selectionStart;
var endPos = myField.selectionEnd;
myField.value = myField.value.substring(0, startPos)
+ myValue
+ myField.value.substring(endPos, myField.value.length);
} else {
myField.value += myValue;
}
}
function popUpProperties(inobj) {
op = window.open();
op.document.open('text/plain');