Skip to content

Commit

Permalink
version 1.4: clickable links
Browse files Browse the repository at this point in the history
  • Loading branch information
henkman committed Aug 2, 2016
1 parent 0f611f1 commit 2119f6b
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 18 deletions.
12 changes: 12 additions & 0 deletions common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ interface ReferencesOptions {
HoverOverlayEnabled: boolean
}

interface ClickableLinksOptions {
Enabled: boolean
SameWindow: boolean
Regex: string
}

interface ButtonOptions {
Enabled: boolean
Board: string
Expand All @@ -22,6 +28,7 @@ interface ButtonOptions {
interface Options {
MediaOverlay: MediaOverlayOptions
References: ReferencesOptions
ClickableLinks: ClickableLinksOptions
Button: ButtonOptions
}

Expand All @@ -39,6 +46,11 @@ const defaultOptions: Options = {
ReferenceLinksEnabled: true,
HoverOverlayEnabled: true,
},
ClickableLinks: {
Enabled: true,
SameWindow: true,
Regex: "https?://[^< ]+",
},
Button: {
Enabled: true,
Board: "int",
Expand Down
93 changes: 75 additions & 18 deletions kctier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ chrome.storage.local.get(defaultOptions, function (opts: Options) {
continue;
}
const post_ref = "#" + post_id;
if(header.querySelector(
'[href="'+post_ref+'"]') != null) {
if (header.querySelector(
'[href="' + post_ref + '"]') != null) {
continue;
}
const a = <HTMLAnchorElement>
Expand Down Expand Up @@ -81,8 +81,8 @@ chrome.storage.local.get(defaultOptions, function (opts: Options) {
continue;
}
const post_ref = "#" + post_id;
if(header.querySelector(
'[href="'+post_ref+'"]') != null) {
if (header.querySelector(
'[href="' + post_ref + '"]') != null) {
continue;
}
const a = <HTMLAnchorElement>
Expand Down Expand Up @@ -132,7 +132,8 @@ chrome.storage.local.get(defaultOptions, function (opts: Options) {
window.innerWidth - (erep.left + erep.width),
eref.left);
// TODO: if in view only highlight like the cool kids do
this.overlay = <HTMLDivElement>document.createElement("div");
this.overlay = <HTMLDivElement>
document.createElement("div");
this.overlay.style.background = "#aaaacc";
this.overlay.style.border = "1px rgb(89,89,89) solid"
this.overlay.style.boxShadow =
Expand All @@ -152,7 +153,8 @@ chrome.storage.local.get(defaultOptions, function (opts: Options) {
document.querySelector("#thread_" + id);
if (thread) {
// TODO: if in view only highlight like the cool kids do
this.overlay = <HTMLDivElement>document.createElement("div");
this.overlay = <HTMLDivElement>
document.createElement("div");
const phs = thread.querySelectorAll(".postheader");
if (phs.length == 0) {
return;
Expand Down Expand Up @@ -223,7 +225,8 @@ chrome.storage.local.get(defaultOptions, function (opts: Options) {
constructor(opts: MediaOverlayOptions) {
this.opts = opts;
const links: NodeListOf<HTMLAnchorElement> =
<NodeListOf<HTMLAnchorElement>>document.querySelectorAll(
<NodeListOf<HTMLAnchorElement>>
document.querySelectorAll(
'.file_thread a[target="_blank"], .file_reply a[target="_blank"]'
);
const media = new Array<HTMLAnchorElement>(links.length);
Expand All @@ -248,23 +251,30 @@ chrome.storage.local.get(defaultOptions, function (opts: Options) {
this.media = media.slice(0, o);
window.onresize = this.onResize;
window.onkeyup = this.onKeyup;
this.loadicon = document.createElement("img");
this.loadicon.src = "data:image/gif;base64,R0lGODlhGAAYAPcAAAUFBQYGBgcHBwgIBwgICAkJCAoKCQsLCgwMCgwMCw0NCw4ODBAQDhQUERcXExgYFB4eGSYmICgoIS0tJTExKDMzKTk5Ljs7MD4+Mj8/M0dHOUpJO0tLPExMPU1NPlNTQ1hZSFlaSGFhTmVkUGlpVHl5YIKCaIODaYSEaYSEa4iIbYmJbYqKb4yMcI2NcZKRdJKSdJOSdZOTdpSUdpiYeZmZeqemhaeoh6mohquriK2sirS0j7KzkLa2kr/AmsvMpNDPptXVqtfWq9nYrd/fsuDfsuLitOblt+nouOrquvHxwPr6x/v7x///y8zMzAsLCRESDxISDxMTEBYWEhYWExkZFRoaFR0dGCEhGycnICkpISoqIisrIzAwJzU1KzY2LDY3LTo7MEJCNUNDNkpLPVJSQlJTQ1hYR2NjUGZmUnZ2X3h4YHt7Y4eHbIyNc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IGUKyyhgYaBRPP3OlB50vIkSUncvQIkmADDGOsLMSokWCXPIkWARJz8IoZD1QMKqjTpGiTP1UKXoHzI5AbKAW3GDLaRJEYK2XKQABgJtCPH3zCFMwyiCqiNHYIEcKjJZKfr3pMEjQQh2qeN0eQIDnSZoqbPnvYtCSIJU6hQ3W8yNmbd06BKBfALEB4IAuXyWry7lUjscoLQYJeJJWogAKFwQcDAgAh+QQBCgAEACwAAAAAGAAYAAAIxQABCBxIsKDBgwgTKlzIsKHDhxAjSpw4MEAjRxIGSBQg4lOpQSgYRNQwqonJJZMiWjLJ8k4BiCtZNnEJkSTLJSQicvxEShQLBxIDQMBASdOmEQoOBnDQACEkUEiQFBlx8FaNGRcOvkBy5AiSHAkCNGgQAIADGj16qEBgsEVXr5gWhMiUKQQjKTLSmjBgMAMQr6E+UOj040enCgAerTgxQWkGFzE6AIjkqbAnSQITHFAYoCyACJwKc4ow0UKlShYoAmDEaGFAACH5BAEKAAIALAAAAAAYABgAAAjDAAEIHEiwoMGDCBMePJCFywKFCbHEKXRIVheIBg3EacKxSZ4GGAlmGdSxSSkMIQduMVRSkZiUAhXUKfmnCkyBqmiRWgToJcxTaubASsPKys0EL44gOWIH1U0AFGotRWKrzNOoU6s+Rar0yKwrTwEAxeQqVdiBA0xFMgM2LBQ3gX7AaXszDJ8fPwKZCftFD14/HsS2anUqpAI2e/q4MUVgzZ07awyEXADmQhQAUl716PFKStgAaGLFQhPgrIJVqxSchRkQADs=";
}
private getLoadIcon = (): HTMLImageElement => {
if (!this.loadicon) {
this.loadicon = document.createElement("img");
this.loadicon.src = "data:image/gif;base64,R0lGODlhGAAYAPcAAAUFBQYGBgcHBwgIBwgICAkJCAoKCQsLCgwMCgwMCw0NCw4ODBAQDhQUERcXExgYFB4eGSYmICgoIS0tJTExKDMzKTk5Ljs7MD4+Mj8/M0dHOUpJO0tLPExMPU1NPlNTQ1hZSFlaSGFhTmVkUGlpVHl5YIKCaIODaYSEaYSEa4iIbYmJbYqKb4yM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{
const medium = this.overlay.querySelector("img, video");
if (medium) {
this.overlay.removeChild(medium);
}
this.overlay.appendChild(this.loadicon);
this.overlay.appendChild(this.getLoadIcon());
const href = this.media[this.current].href;
if (href.indexOf(".webm") > 0) {
const vid = <HTMLVideoElement>document.createElement("video");
const vid = <HTMLVideoElement>
document.createElement("video");
vid.style.zIndex = "10";
vid.style.width = vid.style.height = "0";
vid.controls = true;
vid.loop = this.opts.WebmLoop;
const source = <HTMLSourceElement>document.createElement("source");
const source = <HTMLSourceElement>
document.createElement("source");
source.type = "video/webm";
source.src = href;
vid.appendChild(source);
Expand All @@ -277,7 +287,9 @@ chrome.storage.local.get(defaultOptions, function (opts: Options) {
return;
}
this.overlay.removeChild(this.loadicon);
this.resizeElement(vid, vid.videoWidth, vid.videoHeight);
this.resizeElement(vid,
vid.videoWidth,
vid.videoHeight);
vid.play();
};
} else {
Expand All @@ -290,7 +302,9 @@ chrome.storage.local.get(defaultOptions, function (opts: Options) {
return;
}
this.overlay.removeChild(this.loadicon);
this.resizeElement(img, img.naturalWidth, img.naturalHeight);
this.resizeElement(img,
img.naturalWidth,
img.naturalHeight);
};
img.src = href;
}
Expand Down Expand Up @@ -330,7 +344,8 @@ chrome.storage.local.get(defaultOptions, function (opts: Options) {
const oldarrow = this.overlay.querySelector(".arrow_left");
if (this.current > 0) {
if (!oldarrow) {
const arrow = <HTMLDivElement>document.createElement("div");
const arrow = <HTMLDivElement>
document.createElement("div");
arrow.style.position = "absolute";
arrow.style.zIndex = "15";
arrow.style.left = "10px";
Expand All @@ -354,7 +369,8 @@ chrome.storage.local.get(defaultOptions, function (opts: Options) {
const oldarrow = this.overlay.querySelector(".arrow_right");
if (this.current < (this.media.length - 1)) {
if (!oldarrow) {
const arrow = <HTMLDivElement>document.createElement("div");
const arrow = <HTMLDivElement>
document.createElement("div");
arrow.style.position = "absolute";
arrow.style.zIndex = "15";
arrow.style.right = "10px";
Expand Down Expand Up @@ -514,11 +530,13 @@ chrome.storage.local.get(defaultOptions, function (opts: Options) {
}
const href = this.media[this.current].href;
if (href.indexOf(".webm") > 0) {
const vid = <HTMLVideoElement>this.overlay.querySelector("video");
const vid = <HTMLVideoElement>
this.overlay.querySelector("video");
this.resizeElement(vid, vid.videoWidth, vid.videoHeight);
}
else {
const img = <HTMLImageElement>this.overlay.querySelector("img");
const img = <HTMLImageElement>
this.overlay.querySelector("img");
this.resizeElement(img, img.naturalWidth, img.naturalHeight);
}
}
Expand All @@ -527,4 +545,43 @@ chrome.storage.local.get(defaultOptions, function (opts: Options) {
new MediaOverlayHandler(opts.MediaOverlay);
});
}

if (opts.ClickableLinks.Enabled) {
class ClickableLinks {
constructor(opts: ClickableLinksOptions) {
const re = new RegExp(opts.Regex, "g");
const ps = <NodeListOf<HTMLParagraphElement>>
document.querySelectorAll(".thread p");
for (let i = 0; i < ps.length; i++) {
const p = ps[i];
const t = p.innerHTML;
let mod = false;
let r = t;
let o = 0;
let m = re.exec(t);
while (m) {
mod = true;
const s = r.substring(0, o + m.index);
const e = r.substring(o + m.index + m[0].length);
let a: string;
if (opts.SameWindow) {
a = "<a href=\"" + m[0] + "\">" + m[0] + "</a>";
} else {
a = "<a target=\"_blank\" href=\"" + m[0] + "\">"
+ m[0] + "</a>";
}
r = s + a + e;
o += a.length - m[0].length;
m = re.exec(t);
}
if (mod) {
p.innerHTML = r;
}
}
}
}
window.addEventListener("load", () => {
new ClickableLinks(opts.ClickableLinks);
});
}
});
16 changes: 16 additions & 0 deletions options.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,22 @@ <h3>References</h3>
show preview overlay of post when hovering a reference
</label>
</section>
<section>
<h3>Clickable Links</h3>
<hr/>
<label>
<input type="checkbox" id="clickablelinks_Enabled">
enabled
</label>
<label>
<input type="checkbox" id="clickablelinks_SameWindow">
open in same window
</label>
<label>
<input type="text" id="clickablelinks_Regex">
regex used to find links
</label>
</section>
<section>
<h3>Button</h3>
<hr/>
Expand Down
21 changes: 21 additions & 0 deletions options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ class OptionsHandler {
document.getElementById('references_HoverOverlayEnabled')
).checked,
},
ClickableLinks: {
Enabled: (<HTMLInputElement>
document.getElementById('clickablelinks_Enabled')
).checked,
SameWindow: (<HTMLInputElement>
document.getElementById('clickablelinks_SameWindow')
).checked,
Regex: (<HTMLInputElement>
document.getElementById('clickablelinks_Regex')
).value,
},
Button: {
Enabled: (<HTMLInputElement>
document.getElementById('button_Enabled')
Expand Down Expand Up @@ -90,6 +101,16 @@ class OptionsHandler {
document.getElementById('references_HoverOverlayEnabled')
).checked = opts.References.HoverOverlayEnabled;

(<HTMLInputElement>
document.getElementById('clickablelinks_Enabled')
).checked = opts.ClickableLinks.Enabled;
(<HTMLInputElement>
document.getElementById('clickablelinks_SameWindow')
).checked = opts.ClickableLinks.SameWindow;
(<HTMLSelectElement>
document.getElementById('clickablelinks_Regex')
).value = opts.ClickableLinks.Regex;

(<HTMLInputElement>
document.getElementById('button_Enabled')
).checked = opts.Button.Enabled;
Expand Down

0 comments on commit 2119f6b

Please sign in to comment.