use document.createElementNS instead of document.createElement where necessary, as described in bug 39360
a=waterson
This commit is contained in:
rginda%netscape.com 2000-05-18 19:32:02 +00:00
Родитель 25cd24177f
Коммит da936a688d
3 изменённых файлов: 29 добавлений и 13 удалений

Просмотреть файл

@ -61,10 +61,10 @@ function addCommands(commandObject)
"specified. Exits ChatZilla after disconnecting."); "specified. Exits ChatZilla after disconnecting.");
add ("clear", "onInputClear", "", add ("clear", "onInputClear", "",
"Clear the current viewport, discarding *all* content."); "Clear the current view, discarding *all* content.");
add ("delete", "onInputDelete", "", add ("delete", "onInputDelete", "",
"Clear the current viewport, discarding *all* content, and drop it's " + "Clear the current view, discarding *all* content, and drop it's " +
"icon from the toolbar."); "icon from the toolbar.");
add ("hide", "onInputHide", "", add ("hide", "onInputHide", "",

Просмотреть файл

@ -238,7 +238,8 @@ function insertLink (matchText, containerTag)
else else
href = matchText; href = matchText;
var anchor = document.createElement ("html:a"); var anchor = document.createElementNS ("http://www.w3.org/TR/REC-html40",
"html:a");
anchor.setAttribute ("href", href); anchor.setAttribute ("href", href);
anchor.setAttribute ("target", "other_window"); anchor.setAttribute ("target", "other_window");
if (matchText.length >= client.MAX_WORD_DISPLAY) if (matchText.length >= client.MAX_WORD_DISPLAY)
@ -273,7 +274,8 @@ function insertSmiley (emoticon, containerTag)
if (src) if (src)
{ {
var img = document.createElement ("html:img"); var img = document.createElementNS ("http://www.w3.org/TR/REC-html40",
"html:img");
img.setAttribute ("src", client.IMAGEDIR + src); img.setAttribute ("src", client.IMAGEDIR + src);
containerTag.appendChild (img); containerTag.appendChild (img);
} }
@ -552,7 +554,8 @@ function newInlineText (data, className, tagName)
if (typeof tagName == "undefined") if (typeof tagName == "undefined")
tagName = "html:span"; tagName = "html:span";
var a = document.createElement (tagName); var a = document.createElementNS ("http://www.w3.org/TR/REC-html40",
tagName);
a.setAttribute ("class", className); a.setAttribute ("class", className);
switch (typeof data) switch (typeof data)
@ -632,7 +635,9 @@ function addHistory (source, obj)
{ {
if (!source.messages) if (!source.messages)
{ {
source.messages = document.createElement ("html:table"); source.messages =
document.createElementNS ("http://www.w3.org/TR/REC-html40",
"html:table");
source.messages.setAttribute ("class", "chat-view"); source.messages.setAttribute ("class", "chat-view");
source.messages.setAttribute ("cellpadding", "0"); source.messages.setAttribute ("cellpadding", "0");
source.messages.setAttribute ("cellspacing", "0"); source.messages.setAttribute ("cellspacing", "0");
@ -921,7 +926,9 @@ function cli_display (message, msgtype)
for (var l in ary) for (var l in ary)
{ {
msgData.appendChild(newInlineText (ary[l])); msgData.appendChild(newInlineText (ary[l]));
msgData.appendChild (document.createElement ("html:br")); msgData.appendChild
(document.createElementNS ("http://www.w3.org/TR/REC-html40",
"html:br"));
} }
msgRow.appendChild (msgData); msgRow.appendChild (msgData);
@ -963,7 +970,9 @@ function net_display (message, msgtype)
for (var l in ary) for (var l in ary)
{ {
msgData.appendChild(newInlineText(ary[l])); msgData.appendChild(newInlineText(ary[l]));
msgData.appendChild (document.createElement ("html:br")); msgData.appendChild
(document.createElementNS ("http://www.w3.org/TR/REC-html40",
"html:br"));
} }
msgRow.appendChild (msgData); msgRow.appendChild (msgData);
@ -1057,7 +1066,9 @@ function user_display(message, msgtype, sourceNick)
client.munger.munge(ary[l], msgData, getObjectDetails (this)); client.munger.munge(ary[l], msgData, getObjectDetails (this));
else else
msgData.appendChild(newInlineText (ary[l])); msgData.appendChild(newInlineText (ary[l]));
msgData.appendChild (document.createElement ("html:br")); msgData.appendChild
(document.createElementNS ("http://www.w3.org/TR/REC-html40",
"html:br"));
} }
msgRow.appendChild (msgData); msgRow.appendChild (msgData);
@ -1206,7 +1217,9 @@ function chan_display (message, msgtype, nick)
client.munger.munge(ary[l], msgData, getObjectDetails (this)); client.munger.munge(ary[l], msgData, getObjectDetails (this));
else else
msgData.appendChild(newInlineText (ary[l])); msgData.appendChild(newInlineText (ary[l]));
msgData.appendChild (document.createElement ("html:br")); msgData.appendChild
(document.createElementNS ("http://www.w3.org/TR/REC-html40",
"html:br"));
} }
msgRow.appendChild (msgData); msgRow.appendChild (msgData);

Просмотреть файл

@ -74,7 +74,9 @@ function mng_munge (text, containerTag, eventDetails)
var ary; var ary;
if (!containerTag) if (!containerTag)
containerTag = document.createElement (tagName); containerTag =
document.createElementNS ("http://www.w3.org/TR/REC-html40",
this.tagName);
if (this.enabled) if (this.enabled)
{ {
@ -117,8 +119,9 @@ function mng_munge (text, containerTag, eventDetails)
this.munge (text.substr(0,startPos), containerTag, this.munge (text.substr(0,startPos), containerTag,
eventDetails); eventDetails);
var subTag = document.createElement var subTag = document.createElementNS
(this.entries[entry].tagName); ("http://www.w3.org/TR/REC-html40",
this.entries[entry].tagName);
subTag.setAttribute ("class", this.entries[entry].className); subTag.setAttribute ("class", this.entries[entry].className);
subTag.appendChild (document.createTextNode (ary[1])); subTag.appendChild (document.createTextNode (ary[1]));