mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Made keystrokes working with Safari (Chrome)
SVN revision: 2138
This commit is contained in:
parent
21a67ec16e
commit
9fd81e39e7
@ -7,7 +7,7 @@ function getSelection(text)
|
|||||||
rng = sel.createRange();
|
rng = sel.createRange();
|
||||||
rng.colapse;
|
rng.colapse;
|
||||||
return rng.text;
|
return rng.text;
|
||||||
} else if (browser == 'Mozilla')
|
} else if (browser == 'Mozilla' || browser == 'Safari')
|
||||||
if (text.selectionEnd > 0 && text.selectionEnd != text.selectionStart &&
|
if (text.selectionEnd > 0 && text.selectionEnd != text.selectionStart &&
|
||||||
text.value.charAt(text.selectionEnd-1) == ' ')
|
text.value.charAt(text.selectionEnd-1) == ' ')
|
||||||
return text.value.substring(text.selectionStart, text.selectionEnd-1);
|
return text.value.substring(text.selectionStart, text.selectionEnd-1);
|
||||||
@ -31,7 +31,7 @@ function replaceSelection(doc, text, newSelection, cursorPos)
|
|||||||
rng.moveEnd('character', -(newSelection.length-cursorPos));
|
rng.moveEnd('character', -(newSelection.length-cursorPos));
|
||||||
rng.select();
|
rng.select();
|
||||||
}
|
}
|
||||||
} else if (browser == 'Mozilla') {
|
} else if (browser == 'Mozilla' || browser == 'Safari') {
|
||||||
start = text.selectionStart;
|
start = text.selectionStart;
|
||||||
stop = text.selectionEnd;
|
stop = text.selectionEnd;
|
||||||
if (text.selectionEnd > 0 && text.selectionStart != text.selectionEnd &&
|
if (text.selectionEnd > 0 && text.selectionStart != text.selectionEnd &&
|
||||||
@ -166,7 +166,7 @@ function elKeyPress(evt)
|
|||||||
|
|
||||||
if (evt.ctrlKey && !evt.shiftKey && !evt.altKey) {
|
if (evt.ctrlKey && !evt.shiftKey && !evt.altKey) {
|
||||||
|
|
||||||
if (browser == 'MSIE') {
|
if (browser == 'MSIE' || browser == 'Safari') {
|
||||||
if (unicode == 10)
|
if (unicode == 10)
|
||||||
unicode = 13;
|
unicode = 13;
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user