Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
eeb7d79
Update dark-theme.css
benhatsor Jan 15, 2023
465773c
Update full.css
benhatsor Jan 15, 2023
fd9df29
Update codeit-autolinker.js
benhatsor Jan 15, 2023
0b64812
Update codeit-autolinker.js
benhatsor Jan 15, 2023
c427ff3
Update codeit-autolinker.js
benhatsor Jan 15, 2023
70d8843
Update codeit-autolinker.js
benhatsor Jan 15, 2023
e416e8f
Update markdown-dark.css
benhatsor Jan 15, 2023
60d6b14
Update codeit-autolinker.js
benhatsor Jan 15, 2023
ad137dc
Update codeit-autolinker.js
benhatsor Jan 15, 2023
52857b3
Update codeit-autolinker.js
benhatsor Jan 15, 2023
90a2556
Update codeit-autolinker.js
benhatsor Jan 15, 2023
1f89cd0
Update codeit-autolinker.js
benhatsor Jan 15, 2023
327c71d
Update codeit-autolinker.js
benhatsor Jan 15, 2023
3f895a2
Update dark-theme.css
benhatsor Jan 15, 2023
70296d9
Update codeit-autolinker.js
benhatsor Jan 15, 2023
1a645dc
Update codeit-autolinker.js
benhatsor Jan 15, 2023
e22ea22
Update codeit-match-braces.js
benhatsor Jan 15, 2023
e270604
Update codeit-autolinker.js
benhatsor Jan 15, 2023
d053e0f
Update codeit-autolinker.js
benhatsor Jan 15, 2023
ae20f70
Update codeit-autolinker.js
benhatsor Jan 15, 2023
2dd30cd
Update codeit-autolinker.js
benhatsor Jan 15, 2023
43655c9
Update codeit-autolinker.js
benhatsor Jan 15, 2023
b4682c0
Update codeit-autolinker.js
benhatsor Jan 15, 2023
4d0200c
Update codeit-autolinker.js
benhatsor Jan 15, 2023
9326acc
Update codeit-autolinker.js
benhatsor Jan 15, 2023
ea843de
Update codeit-autolinker.js
benhatsor Jan 15, 2023
6014627
Update codeit-autolinker.js
benhatsor Jan 15, 2023
d3da912
Update codeit-autolinker.js
benhatsor Jan 15, 2023
0ef758f
Update codeit-match-braces.js
benhatsor Jan 16, 2023
085cd74
Update client-channel.js
benhatsor Jan 16, 2023
e3c21b2
Update full.css
benhatsor Jan 16, 2023
10056d9
Update client-channel.js
benhatsor Jan 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion dark-theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ cd-el {
.token.atrule,
.token.url .token.content,
.token.url-reference .token.variable,
.language-markdown .token.code-block .token.punctuation {
.language-markdown .token.code-block .token.punctuation,
.language-markdown .token.tag .token.punctuation {
color: #a6c3d4;
}

Expand Down Expand Up @@ -240,6 +241,10 @@ cd-el {
text-decoration: underline;
}

.token.strike .token.content {
text-decoration: line-through;
}


.token.brace.brace-active {
position: relative;
Expand Down
8 changes: 7 additions & 1 deletion full.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,12 @@ body.notransition .bottom-wrapper {
}

.bottom-wrapper.hidden {
pointer-events: none;
transform: translateY(calc(100% + env(safe-area-inset-bottom, 0px)));
}

.bottom-wrapper.expanded {
pointer-events: auto;
transform: translateY(calc(-1 * var(--window-height, 100vh) + 44px + env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)));
height: 44px;
}
Expand Down Expand Up @@ -1665,10 +1667,14 @@ body:not(.mobile) .menu::-webkit-scrollbar-thumb {
background-color: rgb(130 134 137 / 50%);
}

body:not(.mobile) .menu::-webkit-scrollbar-thumb:not(:active):hover {
body:not(.mobile) .menu::-webkit-scrollbar-thumb:hover {
background-color: rgb(130 134 137 / 65%);
}

body:not(.mobile) .menu::-webkit-scrollbar-thumb:active {
background-color: rgb(130 134 137 / 50%);
}

.menu .icon {
padding: 10px 15px;
padding: 8px 13px;
Expand Down
88 changes: 54 additions & 34 deletions lib/plugins/codeit-autolinker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
return;
}

var url = /\b([a-z]{3,7}:\/\/|tel:)[\w\-+%~/.:=&@]+(?:\?[\w\-+%~/.:=?&!$'()*,;@]*)?(?:#[\w\-+%~/.:#=?&!$'()*,;@]*)?/;
var url = /\b([a-z]{3,7}:\/\/|tel:)[\w\-+%~/.:=&!$'()*,;@]+(?:\?[\w\-+%~/.:=?&!$'()*,;@]*)?(?:#[\w\-+%~/.:#=?&!$'()*,;@]*)?/;
var email = /\b\S+@[\w.]+[a-z]{2}/;
var linkMd = /\[([^\]]+)\]\(([^)]+)\)/;

Expand All @@ -13,7 +13,7 @@

Prism.plugins.autolinker = {
processGrammar: function (grammar) {
// Abort if grammar has already been processed
// abort if grammar has already been processed
if (!grammar || grammar['url-link']) {
return;
}
Expand All @@ -26,7 +26,7 @@
}

def.inside = def.inside || {};

if (type == 'comment') {
def.inside['md-link'] = linkMd;
}
Expand All @@ -45,40 +45,60 @@
};

Prism.hooks.add('before-tokenize', function (env) {
if (env.language !== 'markdown') {
Prism.plugins.autolinker.processGrammar(env.grammar);
}
if (env.language === 'markdown') return;
Prism.plugins.autolinker.processGrammar(env.grammar);
});


const onClickEvent = 'if ((event.ctrlKey || event.metaKey) && event.shiftKey) { event.preventDefault(); window.open(this.href, \'_blank\') }';

const isMac = navigator.platform.indexOf('Mac') > -1;

const linkTitle = isMac ? '⌘ + ⇧ + click to open link' : 'Ctrl + Shift + click to open link';

Prism.hooks.add('wrap', function (env) {

if (env.language === 'markdown') return;

if (env.language === 'markdown' &&
env.type === 'url-reference') {

let matches = env.content.match(url);

if (matches && matches[0]) {

matches[0] = matches[0].replaceAll('\'','').replaceAll('"','').replaceAll('`','');

env.content = env.content.replace(matches[0], '<a class="token url-link" title="' + linkTitle + '" onclick="' + onClickEvent + '" href="'+ matches[0] + '">' + matches[0] + '</a>');

}

}

if (/-link$/.test(env.type)) {
env.tag = 'a';

var href = env.content;

if (env.type == 'email-link' && href.indexOf('mailto:') != 0) {
href = 'mailto:' + href;
} else if (env.type == 'md-link') {
// markdown
var match = env.content.match(linkMd);

href = match[2];
env.content = match[1];
}

env.attributes.href = href.replaceAll('\'','').replaceAll('"','').replaceAll('`','');

Prism.hooks.add('wrap', function (env) {
if (env.language !== 'markdown') {
if (/-link$/.test(env.type)) {
env.tag = 'a';

var href = env.content;

if (env.type == 'email-link' && href.indexOf('mailto:') != 0) {
href = 'mailto:' + href;
} else if (env.type == 'md-link') {
// Markdown
var match = env.content.match(linkMd);

href = match[2];
env.content = match[1];
}

var isMac = navigator.platform.indexOf('Mac') > -1;

env.attributes.href = href.replaceAll('\'','').replaceAll('"','').replaceAll('`','');

env.attributes.onclick = 'if ((event.ctrlKey || event.metaKey) && event.shiftKey) { event.preventDefault(); window.open(this.href, "_blank") }';
env.attributes.title = isMac ? '⌘ + ⇧ + click to open link' : 'Ctrl + Shift + click to open link';
env.attributes.onclick = onClickEvent;
env.attributes.title = linkTitle;

// silently catch any error thrown by decodeURIComponent
try {
env.content = decodeURIComponent(env.content);
} catch (e) {}
}
// silently catch any error thrown by decodeURIComponent
try {
env.content = decodeURIComponent(env.content);
} catch (e) {}
}
});

Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/codeit-match-braces.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
}

Prism.hooks.add('complete', function (env) {

var code = env.element;

rematch(code);
Expand Down
6 changes: 3 additions & 3 deletions live-view/extensions/markdown-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@ body table {
-webkit-appearance: none;
}

body table::-webkit-scrollbar-track {
body:not(.mobile) table::-webkit-scrollbar-track {
border-radius: 0 0 10px 10px;
background-color: var(--color-canvas-default) !important;
box-shadow: inset 0px 1px 0 0 var(--color-border-default) !important;
box-shadow: inset 0 1px 0 0 var(--table-border-color);
}

body thead {
Expand Down Expand Up @@ -286,7 +286,7 @@ body cd-el {
cursor: unset;
}

body cd-el::-webkit-scrollbar-track {
body:not(.mobile) cd-el::-webkit-scrollbar-track {
border-radius: 0 0 10px 10px;
}

Expand Down
2 changes: 1 addition & 1 deletion worker/client-channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


// update worker name when updating worker
const WORKER_NAME = 'codeit-worker-v625';
const WORKER_NAME = 'codeit-worker-v627';


// internal paths
Expand Down