|
|
@ -40,7 +40,9 @@ require 'themed_miniwindows'
|
|
|
|
|
|
|
|
|
|
|
|
fontName = GetAlphaOption("output_font_name")
|
|
|
|
fontName = GetAlphaOption("output_font_name")
|
|
|
|
fontHeight = GetOption("output_font_height")
|
|
|
|
fontHeight = GetOption("output_font_height")
|
|
|
|
|
|
|
|
postNo = ""
|
|
|
|
|
|
|
|
author = ""
|
|
|
|
|
|
|
|
subject = ""
|
|
|
|
|
|
|
|
|
|
|
|
if not GetVariable("noteShow") then
|
|
|
|
if not GetVariable("noteShow") then
|
|
|
|
SetVariable("noteShow", "true")
|
|
|
|
SetVariable("noteShow", "true")
|
|
|
@ -126,18 +128,30 @@ end
|
|
|
|
function shouldHyperlink(str, tbl)
|
|
|
|
function shouldHyperlink(str, tbl)
|
|
|
|
local hyperTbl = {}
|
|
|
|
local hyperTbl = {}
|
|
|
|
local youShould = false
|
|
|
|
local youShould = false
|
|
|
|
|
|
|
|
postNo = ""
|
|
|
|
|
|
|
|
author = ""
|
|
|
|
|
|
|
|
subject = ""
|
|
|
|
|
|
|
|
|
|
|
|
table.insert(hyperTbl, TruncateStyles(tbl, 2, 7))
|
|
|
|
for _,v in ipairs(TruncateStyles(tbl, 2, 7)) do
|
|
|
|
table.insert(hyperTbl, TruncateStyles(tbl, 23, 34))
|
|
|
|
postNo = postNo .. v.text
|
|
|
|
table.insert(hyperTbl, TruncateStyles(tbl, 37, 72))
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
for _,v in ipairs(hyperTbl) do
|
|
|
|
for _,v in ipairs(TruncateStyles(tbl, 23, 34)) do
|
|
|
|
for _,w in ipairs(v) do
|
|
|
|
author = author .. v.text
|
|
|
|
if Hash(w.text):find(Hash(str)) then
|
|
|
|
end
|
|
|
|
youShould = true
|
|
|
|
|
|
|
|
break
|
|
|
|
for _,v in ipairs(TruncateStyles(tbl, 37, 72)) do
|
|
|
|
end
|
|
|
|
subject = subject .. v.text
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
postNo = postNo:gsub("[^%z\1-\127]+", ""):gsub("%s+$", "")
|
|
|
|
|
|
|
|
author = author:gsub("[^%z\1-\127]+", ""):gsub("%s+$", "")
|
|
|
|
|
|
|
|
subject = subject:gsub("[^%z\1-\127]+", ""):gsub("%s+$", "")
|
|
|
|
|
|
|
|
byteSubj = subject:gsub("%p", function(c) return string.format("\\%d", string.byte(c)) end)
|
|
|
|
|
|
|
|
str = str:gsub("[^%z\1-\127]+", ""):gsub("%s+$", ""):gsub("%p", function(c) return string.format("\\%d", string.byte(c)) end )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if str:find(postNo) or str:find(author) or str:find(byteSubj) then
|
|
|
|
|
|
|
|
youShould = true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
return youShould
|
|
|
|
return youShould
|
|
|
@ -154,19 +168,12 @@ function hyperText(tbl)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function hyperlinknotes(lines)
|
|
|
|
function hyperlinknotes(lines)
|
|
|
|
local postNo
|
|
|
|
|
|
|
|
local author
|
|
|
|
|
|
|
|
local subj
|
|
|
|
|
|
|
|
for i,v in ipairs(lines) do
|
|
|
|
for i,v in ipairs(lines) do
|
|
|
|
if i == 1 then
|
|
|
|
if i == 1 then
|
|
|
|
Simulate(stylesToANSI(v) .. ColoursToANSI(" @C(Clickable posts)") .. "\n")
|
|
|
|
Simulate(stylesToANSI(v) .. ColoursToANSI(" @C(Clickable posts)") .. "\n")
|
|
|
|
elseif i <= 4 or i == #lines then
|
|
|
|
elseif i <= 4 or i == #lines then
|
|
|
|
Simulate(stylesToANSI(v) .. "\n")
|
|
|
|
Simulate(stylesToANSI(v) .. "\n")
|
|
|
|
elseif i < #lines then
|
|
|
|
elseif i < #lines then
|
|
|
|
--postNo = v[2].text:gsub(" ", "")
|
|
|
|
|
|
|
|
postNo = hyperText(TruncateStyles(v, 2, 7)):gsub(" ", "")
|
|
|
|
|
|
|
|
author = hyperText(TruncateStyles(v, 23, 34)):gsub("%s+$", "")
|
|
|
|
|
|
|
|
subject = hyperText(TruncateStyles(v, 37, 72)):gsub("%s+$", "")
|
|
|
|
|
|
|
|
for j,k in ipairs(v) do
|
|
|
|
for j,k in ipairs(v) do
|
|
|
|
if shouldHyperlink(k.text, v) then
|
|
|
|
if shouldHyperlink(k.text, v) then
|
|
|
|
Hyperlink(prefix .. "Execute('note read " .. postNo .. "')", k.text, "Post #" .. postNo .. ": " .. subject .. " (" .. author .. ")", RGBColourToName(k.textcolour), RGBColourToName(k.backcolour), false, true)
|
|
|
|
Hyperlink(prefix .. "Execute('note read " .. postNo .. "')", k.text, "Post #" .. postNo .. ": " .. subject .. " (" .. author .. ")", RGBColourToName(k.textcolour), RGBColourToName(k.backcolour), false, true)
|
|
|
|