diff options
author | David Lawrence <dlawrence@mozilla.com> | 2011-10-05 00:25:23 +0200 |
---|---|---|
committer | David Lawrence <dlawrence@mozilla.com> | 2011-10-05 00:25:23 +0200 |
commit | 57584dc4744fea59833ef355f7513690d246c70f (patch) | |
tree | 805f2b2941eca17eaf97263165d11d9e676ad9d1 /js | |
parent | 785580c6c290b93fe25868cfbb5d4e300749de62 (diff) | |
download | bugzilla-57584dc4744fea59833ef355f7513690d246c70f.tar.gz bugzilla-57584dc4744fea59833ef355f7513690d246c70f.tar.xz |
more porting work
Diffstat (limited to 'js')
-rw-r--r-- | js/comments.js | 27 | ||||
-rw-r--r-- | js/field.js | 5 |
2 files changed, 30 insertions, 2 deletions
diff --git a/js/comments.js b/js/comments.js index f46499b62..28ef54397 100644 --- a/js/comments.js +++ b/js/comments.js @@ -145,3 +145,30 @@ function goto_add_comments( anchor ){ },10); return false; } + +if (typeof Node == 'undefined') { + /* MSIE doesn't define Node, so provide a compatibility object */ + window.Node = { + TEXT_NODE: 3, + ENTITY_REFERENCE_NODE: 5 + }; +} + +/* Concatenates all text from element's childNodes. This is used + * instead of innerHTML because we want the actual text (and + * innerText is non-standard). + */ +function getText(element) { + var child, text = ""; + for (var i=0; i < element.childNodes.length; i++) { + child = element.childNodes[i]; + var type = child.nodeType; + if (type == Node.TEXT_NODE || type == Node.ENTITY_REFERENCE_NODE) { + text += child.nodeValue; + } else { + /* recurse into nodes of other types */ + text += getText(child); + } + } + return text; +} diff --git a/js/field.js b/js/field.js index 1a3bc3efd..a0684ffce 100644 --- a/js/field.js +++ b/js/field.js @@ -273,7 +273,7 @@ function showEditableField (e, ContainerInputArray) { * * var e: the event * var ContainerInputArray: An array containing the (edit) and text area and the input being displayed - * var ContainerInputArray[0]: the conainer that will be hidden usually shows the (edit) text + * var ContainerInputArray[0]: the container that will be hidden usually shows the (edit) text * var ContainerInputArray[1]: the input area and label that will be displayed * var ContainerInputArray[2]: the field that is on the page, might get changed by browser autocomplete * var ContainerInputArray[3]: the original value from the page loading. @@ -684,7 +684,8 @@ YAHOO.bugzilla.userAutocomplete = { id : YAHOO.bugzilla.userAutocomplete.counter, params : [ { match : [ decodeURIComponent(enteredText) ], - include_fields : [ "name", "real_name" ] + include_fields : [ "name", "real_name" ], + include_disabled : 1 } ] }; var stringified = YAHOO.lang.JSON.stringify(json_object); |