Skip to content

Commit

Permalink
fixed dollchan script (refmap)
Browse files Browse the repository at this point in the history
  • Loading branch information
miku-nyan committed Sep 3, 2015
1 parent 13dce48 commit 1cc21f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions assets/dollscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -3639,7 +3639,7 @@ function loadDocFiles(imgOnly) {
' link[rel="alternate stylesheet"], script, ' + aib.qPostForm, dc), $del);
$each($T('a', dc), function(el) {
var num, tc = el.textContent;
if(tc[0] === '>' && tc[1] === '>' && (num = +tc.substr(2)) && (num in pByNum)) {
if(tc[0] === '>' && tc[1] === '>' && (num = +/(\d+)/.exec(tc.substr(2))[1]) && (num in pByNum)) {
el.href = aib.anchor + num;
} else {
el.href = getAbsLink(el.href);
Expand Down Expand Up @@ -9211,7 +9211,7 @@ function genRefMap(posts, thrURL) {
for(pNum in posts) {
for(i = 0, links = $T('a', posts[pNum].msg), len = links.length; i < len; ++i) {
tc = links[i].textContent;
if(tc[0] === '>' && tc[1] === '>' && (lNum = +tc.substr(2)) && (lNum in posts)) {
if(tc[0] === '>' && tc[1] === '>' && (lNum = +/(\d+)/.exec(tc.substr(2))[1]) && (lNum in posts)) {
post = posts[lNum];
ref = post.ref;
if(ref.indexOf(pNum) === -1) {
Expand Down Expand Up @@ -9239,7 +9239,7 @@ function updRefMap(post, add) {
for(i = 0, links = $T('a', post.msg), len = links.length; i < len; ++i) {
link = links[i];
tc = link.textContent;
if(tc[0] === '>' && tc[1] === '>' && (lNum = +tc.substr(2)) && (lNum in pByNum)) {
if(tc[0] === '>' && tc[1] === '>' && (lNum = +/(\d+)/.exec(tc.substr(2))[1]) && (lNum in pByNum)) {
lPost = pByNum[lNum];
if(!TNum) {
link.href = '#' + (aib.fch ? 'p' : '') + lNum;
Expand Down

0 comments on commit 1cc21f4

Please sign in to comment.