mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
2a4b879c21
commit
63664e6c1c
1155 changed files with 62261 additions and 84 deletions
3
dashboard-ui/bower_components/prism/plugins/autolinker/prism-autolinker.css
vendored
Normal file
3
dashboard-ui/bower_components/prism/plugins/autolinker/prism-autolinker.css
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
.token a {
|
||||
color: inherit;
|
||||
}
|
70
dashboard-ui/bower_components/prism/plugins/autolinker/prism-autolinker.js
vendored
Normal file
70
dashboard-ui/bower_components/prism/plugins/autolinker/prism-autolinker.js
vendored
Normal file
|
@ -0,0 +1,70 @@
|
|||
(function(){
|
||||
|
||||
if (
|
||||
typeof self !== 'undefined' && !self.Prism ||
|
||||
typeof global !== 'undefined' && !global.Prism
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
var url = /\b([a-z]{3,7}:\/\/|tel:)[\w\-+%~/.:#=?&]+/,
|
||||
email = /\b\S+@[\w.]+[a-z]{2}/,
|
||||
linkMd = /\[([^\]]+)]\(([^)]+)\)/,
|
||||
|
||||
// Tokens that may contain URLs and emails
|
||||
candidates = ['comment', 'url', 'attr-value', 'string'];
|
||||
|
||||
Prism.hooks.add('before-highlight', function(env) {
|
||||
// Abort if grammar has already been processed
|
||||
if (!env.grammar || env.grammar['url-link']) {
|
||||
return;
|
||||
}
|
||||
Prism.languages.DFS(env.grammar, function (key, def, type) {
|
||||
if (candidates.indexOf(type) > -1 && Prism.util.type(def) !== 'Array') {
|
||||
if (!def.pattern) {
|
||||
def = this[key] = {
|
||||
pattern: def
|
||||
};
|
||||
}
|
||||
|
||||
def.inside = def.inside || {};
|
||||
|
||||
if (type == 'comment') {
|
||||
def.inside['md-link'] = linkMd;
|
||||
}
|
||||
if (type == 'attr-value') {
|
||||
Prism.languages.insertBefore('inside', 'punctuation', { 'url-link': url }, def);
|
||||
}
|
||||
else {
|
||||
def.inside['url-link'] = url;
|
||||
}
|
||||
|
||||
def.inside['email-link'] = email;
|
||||
}
|
||||
});
|
||||
env.grammar['url-link'] = url;
|
||||
env.grammar['email-link'] = email;
|
||||
});
|
||||
|
||||
Prism.hooks.add('wrap', function(env) {
|
||||
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;
|
||||
}
|
||||
});
|
||||
|
||||
})();
|
1
dashboard-ui/bower_components/prism/plugins/autolinker/prism-autolinker.min.js
vendored
Normal file
1
dashboard-ui/bower_components/prism/plugins/autolinker/prism-autolinker.min.js
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
!function(){if(("undefined"==typeof self||self.Prism)&&("undefined"==typeof global||global.Prism)){var i=/\b([a-z]{3,7}:\/\/|tel:)[\w\-+%~\/.:#=?&]+/,n=/\b\S+@[\w.]+[a-z]{2}/,e=/\[([^\]]+)]\(([^)]+)\)/,t=["comment","url","attr-value","string"];Prism.hooks.add("before-highlight",function(a){a.grammar&&!a.grammar["url-link"]&&(Prism.languages.DFS(a.grammar,function(a,r,l){t.indexOf(l)>-1&&"Array"!==Prism.util.type(r)&&(r.pattern||(r=this[a]={pattern:r}),r.inside=r.inside||{},"comment"==l&&(r.inside["md-link"]=e),"attr-value"==l?Prism.languages.insertBefore("inside","punctuation",{"url-link":i},r):r.inside["url-link"]=i,r.inside["email-link"]=n)}),a.grammar["url-link"]=i,a.grammar["email-link"]=n)}),Prism.hooks.add("wrap",function(i){if(/-link$/.test(i.type)){i.tag="a";var n=i.content;if("email-link"==i.type&&0!=n.indexOf("mailto:"))n="mailto:"+n;else if("md-link"==i.type){var t=i.content.match(e);n=t[2],i.content=t[1]}i.attributes.href=n}})}}();
|
Loading…
Add table
Add a link
Reference in a new issue