1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 06:08:02 +01:00

Normalise element related temporary variable names (elt -> elem).

This commit is contained in:
Doug Kearns
2008-12-30 23:34:05 +11:00
parent f7b110e45f
commit 0f0d26d504
2 changed files with 17 additions and 17 deletions

View File

@@ -557,9 +557,9 @@ function Editor() //{{{
unselectText: function () unselectText: function ()
{ {
let elt = window.document.commandDispatcher.focusedElement; let elem = window.document.commandDispatcher.focusedElement;
if (elt && elt.selectionEnd) if (elem && elem.selectionEnd)
elt.selectionEnd = elt.selectionStart; elem.selectionEnd = elem.selectionStart;
}, },
selectedText: function () selectedText: function ()
@@ -570,20 +570,20 @@ function Editor() //{{{
pasteClipboard: function () pasteClipboard: function ()
{ {
let elt = window.document.commandDispatcher.focusedElement; let elem = window.document.commandDispatcher.focusedElement;
if (elt.setSelectionRange && util.readFromClipboard()) if (elem.setSelectionRange && util.readFromClipboard())
// readFromClipboard would return 'undefined' if not checked // readFromClipboard would return 'undefined' if not checked
// dunno about .setSelectionRange // dunno about .setSelectionRange
{ {
let rangeStart = elt.selectionStart; // caret position let rangeStart = elem.selectionStart; // caret position
let rangeEnd = elt.selectionEnd; let rangeEnd = elem.selectionEnd;
let tempStr1 = elt.value.substring(0, rangeStart); let tempStr1 = elem.value.substring(0, rangeStart);
let tempStr2 = util.readFromClipboard(); let tempStr2 = util.readFromClipboard();
let tempStr3 = elt.value.substring(rangeEnd); let tempStr3 = elem.value.substring(rangeEnd);
elt.value = tempStr1 + tempStr2 + tempStr3; elem.value = tempStr1 + tempStr2 + tempStr3;
elt.selectionStart = rangeStart + tempStr2.length; elem.selectionStart = rangeStart + tempStr2.length;
elt.selectionEnd = elt.selectionStart; elem.selectionEnd = elem.selectionStart;
} }
}, },

View File

@@ -458,14 +458,14 @@ function Events() //{{{
function isFormElemFocused() function isFormElemFocused()
{ {
let elt = window.document.commandDispatcher.focusedElement; let elem = window.document.commandDispatcher.focusedElement;
if (elt == null) if (elem == null)
return false; return false;
try try
{ // sometimes the elt doesn't have .localName { // sometimes the elem doesn't have .localName
let tagname = elt.localName.toLowerCase(); let tagname = elem.localName.toLowerCase();
let type = elt.type.toLowerCase(); let type = elem.type.toLowerCase();
if ((tagname == "input" && (type != "image")) || if ((tagname == "input" && (type != "image")) ||
tagname == "textarea" || tagname == "textarea" ||