openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 220daabadbbe26f23600b42ff1c55233e1405336
parent bd5603ed3e47a21875b6ebf9db6e5cfabfb4cd71
Author: dankert <devnull@localhost>
Date:   Wed,  5 Dec 2007 00:01:05 +0100

Falls kein Browser erkannt, dann Text am Ende einf?gen.

Diffstat:
themes/default/js/editor.js | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/themes/default/js/editor.js b/themes/default/js/editor.js @@ -8,6 +8,7 @@ function insert(tagName, aTag, eTag) /* IE */ if(typeof document.selection != 'undefined') { /* Einfuegen des Formatierungscodes */ +// alert('IE'); var range = document.selection.createRange(); var insText = range.text; range.text = aTag + insText + eTag; @@ -23,6 +24,7 @@ function insert(tagName, aTag, eTag) /* Gecko */ else if(typeof input.selectionStart != 'undefined') { +// alert('Gecko'); /* Einfuegen des Formatierungscodes */ var start = input.selectionStart; var end = input.selectionEnd; @@ -42,6 +44,8 @@ function insert(tagName, aTag, eTag) else { /* Abfrage der Einfuegeposition */ + + /* var pos; var re = new RegExp('^[0-9]{0,3}$'); while(!re.test(pos)) { @@ -50,8 +54,11 @@ function insert(tagName, aTag, eTag) if(pos > input.value.length) { pos = input.value.length; } + */ + pos = input.value.length; + /* Einfuegen des Formatierungscodes */ - var insText = prompt("Text:"); + var insText = prompt("Text"); input.value = input.value.substr(0, pos) + aTag + insText + eTag + input.value.substr(pos); } }