|
|
@ -77,17 +77,28 @@ if (BI.jQuery) { |
|
|
|
* 3、text和py各自取tidx/pidx + keyword.length索引开始的子串作为新的text和py, 重复1, 直到text和py有一个为"" |
|
|
|
* 3、text和py各自取tidx/pidx + keyword.length索引开始的子串作为新的text和py, 重复1, 直到text和py有一个为"" |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
__textKeywordMarked__: function (text, keyword, py) { |
|
|
|
__textKeywordMarked__: function (text, keyword, py) { |
|
|
|
|
|
|
|
if (text === null) { |
|
|
|
|
|
|
|
if (BI.isIE9Below()) { |
|
|
|
|
|
|
|
return this.html("(null)"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// textContent性能更好,并且原生防xss
|
|
|
|
|
|
|
|
this[0].textContent = "(null)"; |
|
|
|
|
|
|
|
return this; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (BI.isUndefined(text)) { |
|
|
|
|
|
|
|
text = ""; |
|
|
|
|
|
|
|
} |
|
|
|
if (!BI.isKey(keyword) || (text + "").length > 100) { |
|
|
|
if (!BI.isKey(keyword) || (text + "").length > 100) { |
|
|
|
if (BI.isIE9Below()) { |
|
|
|
if (BI.isIE9Below()) { |
|
|
|
return this.html(BI.htmlEncode(text)); |
|
|
|
return this.html(BI.htmlEncode(text)); |
|
|
|
} |
|
|
|
} |
|
|
|
// textContent性能更好,并且原生防xss
|
|
|
|
// textContent性能更好,并且原生防xss
|
|
|
|
this[0].textContent = text; |
|
|
|
this[0].textContent = text; |
|
|
|
return this; |
|
|
|
return this; |
|
|
|
} |
|
|
|
} |
|
|
|
keyword = keyword + ""; |
|
|
|
keyword = keyword + ""; |
|
|
|
keyword = BI.toUpperCase(keyword); |
|
|
|
keyword = BI.toUpperCase(keyword); |
|
|
|
var textLeft = (text || "") + ""; |
|
|
|
var textLeft = text + ""; |
|
|
|
py = (py || BI.makeFirstPY(text, { |
|
|
|
py = (py || BI.makeFirstPY(text, { |
|
|
|
splitChar: "\u200b" |
|
|
|
splitChar: "\u200b" |
|
|
|
})) + ""; |
|
|
|
})) + ""; |
|
|
|