1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 04:27:58 +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 ()
{
let elt = window.document.commandDispatcher.focusedElement;
if (elt && elt.selectionEnd)
elt.selectionEnd = elt.selectionStart;
let elem = window.document.commandDispatcher.focusedElement;
if (elem && elem.selectionEnd)
elem.selectionEnd = elem.selectionStart;
},
selectedText: function ()
@@ -570,20 +570,20 @@ function Editor() //{{{
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
// dunno about .setSelectionRange
{
let rangeStart = elt.selectionStart; // caret position
let rangeEnd = elt.selectionEnd;
let tempStr1 = elt.value.substring(0, rangeStart);
let rangeStart = elem.selectionStart; // caret position
let rangeEnd = elem.selectionEnd;
let tempStr1 = elem.value.substring(0, rangeStart);
let tempStr2 = util.readFromClipboard();
let tempStr3 = elt.value.substring(rangeEnd);
elt.value = tempStr1 + tempStr2 + tempStr3;
elt.selectionStart = rangeStart + tempStr2.length;
elt.selectionEnd = elt.selectionStart;
let tempStr3 = elem.value.substring(rangeEnd);
elem.value = tempStr1 + tempStr2 + tempStr3;
elem.selectionStart = rangeStart + tempStr2.length;
elem.selectionEnd = elem.selectionStart;
}
},

View File

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