Skip to content

Commit

Permalink
3.0.5 taobao
Browse files Browse the repository at this point in the history
  • Loading branch information
lkytal committed Feb 23, 2015
1 parent 9e4a554 commit 1bdd734
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 88 deletions.
20 changes: 10 additions & 10 deletions linkMix.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if (typeof exportFunction !== "undefined" && exportFunction !== null) {

setLink = function(candidate) {
var span, text;
if ((candidate == null) || candidate.nodeName === "#cdata-section") {
if ((candidate == null) || candidate.parentNode.className.indexOf("texttolink") !== -1 || candidate.nodeName === "#cdata-section") {
return;
}
text = candidate.textContent.replace(url_regexp, '<a href="$1" target="_blank" class="texttolink" onmouseover="setHttp(event);">$1</a>');
Expand All @@ -62,16 +62,16 @@ xpath = "//text()[not(ancestor::" + (excludedTags.join(') and not(ancestor::'))
filter = new RegExp("^(" + (excludedTags.join('|')) + ")$", "i");

linkPack = function(result, start) {
var i, _i, _j, _ref, _ref1;
var i, j, k, ref, ref1, ref2, ref3;
if (start + 10000 < result.snapshotLength) {
for (i = _i = start, _ref = start + 10000; start <= _ref ? _i <= _ref : _i >= _ref; i = start <= _ref ? ++_i : --_i) {
for (i = j = ref = start, ref1 = start + 10000; ref <= ref1 ? j <= ref1 : j >= ref1; i = ref <= ref1 ? ++j : --j) {
setLink(result.snapshotItem(i));
}
setTimeout(function() {
return linkPack(result, start + 10000);
}, 15);
} else {
for (i = _j = start, _ref1 = result.snapshotLength; start <= _ref1 ? _j <= _ref1 : _j >= _ref1; i = start <= _ref1 ? ++_j : --_j) {
for (i = k = ref2 = start, ref3 = result.snapshotLength; ref2 <= ref3 ? k <= ref3 : k >= ref3; i = ref2 <= ref3 ? ++k : --k) {
setLink(result.snapshotItem(i));
}
}
Expand All @@ -98,13 +98,13 @@ observePage = function(root) {
};

observer = new window.MutationObserver(function(mutations) {
var Node, mutation, _i, _j, _len, _len1, _ref;
for (_i = 0, _len = mutations.length; _i < _len; _i++) {
mutation = mutations[_i];
var Node, j, k, len, len1, mutation, ref;
for (j = 0, len = mutations.length; j < len; j++) {
mutation = mutations[j];
if (mutation.type === "childList") {
_ref = mutation.addedNodes;
for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
Node = _ref[_j];
ref = mutation.addedNodes;
for (k = 0, len1 = ref.length; k < len1; k++) {
Node = ref[k];
observePage(Node);
}
}
Expand Down
2 changes: 1 addition & 1 deletion meta/popsearch.meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// @include *
// @exclude */test/index.html*
// @require http://libs.baidu.com/jquery/2.1.1/jquery.min.js
// @version 3.0.4
// @version 3.0.5
// @icon http://lkytal.qiniudn.com/ic.ico
// @grant GM_xmlhttpRequest
// @grant GM_addStyle
Expand Down
Loading

0 comments on commit 1bdd734

Please sign in to comment.