You've already forked hastebin-ansi
mirror of
https://github.com/armbian/hastebin-ansi.git
synced 2026-01-06 12:30:55 -08:00
Use Google Fonts for regular and bold
This commit is contained in:
@@ -148,7 +148,7 @@ function handleDisplay(stack, code, options) {
|
||||
1: () => pushTag(stack, 'b'), // bold
|
||||
3: () => pushTag(stack, 'i'),
|
||||
4: () => pushTag(stack, 'u'),
|
||||
8: () => pushStyle(stack, 'display:none'),
|
||||
//8: () => pushStyle(stack, 'display:none'),
|
||||
9: () => pushTag(stack, 'strike'),
|
||||
22: () => pushStyle(stack, 'font-weight:normal;text-decoration:none;font-style:normal'),
|
||||
23: () => closeTag(stack, 'i'),
|
||||
|
||||
@@ -1,17 +1,8 @@
|
||||
@font-face {
|
||||
font-family: 'JetBrainsMono';
|
||||
src: url('https://cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono/web/woff2/JetBrainsMono-Regular.woff2') format('woff2'),
|
||||
url('https://cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono/web/woff/JetBrainsMono-Regular.woff') format('woff'),
|
||||
url('https://cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono/ttf/JetBrainsMono-Regular.ttf') format('truetype');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
body {
|
||||
background: #000;
|
||||
padding: 20px 50px;
|
||||
margin: 0;
|
||||
font-family: 'JetBrainsMono', monospace;
|
||||
font-family: 'JetBrains Mono', monospace;
|
||||
}
|
||||
|
||||
body pre.hljs {
|
||||
@@ -20,16 +11,12 @@ body pre.hljs {
|
||||
}
|
||||
|
||||
body pre.hljs code {
|
||||
font-family: 'JetBrainsMono', monospace;
|
||||
font-family: 'JetBrains Mono', monospace;
|
||||
}
|
||||
|
||||
/*
|
||||
@supports (font-variation-settings: normal) {
|
||||
body pre.hljs code {
|
||||
font-family: 'Fira Code VF', monospace;
|
||||
}
|
||||
body pre.hljs code b {
|
||||
font-weight: 800;
|
||||
}
|
||||
*/
|
||||
|
||||
/* textarea */
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/* global $, hljs, window, document */
|
||||
const armbianBuildPrelude = '# Armbian ANSI build logs';
|
||||
|
||||
///// represents a single document
|
||||
var haste_document = function () {
|
||||
@@ -44,10 +43,13 @@ haste_document.prototype.load = function (key, callback, lang) {
|
||||
console.log("Highlighting ANSI");
|
||||
final_language = "ans"
|
||||
highlighted = new Filter({}).toHtml(res.data);
|
||||
console.log("ANSI highlighted!");
|
||||
}
|
||||
//console.log("Language FINAL", final_language, "value", highlighted);
|
||||
let lineCount = res.data.split('\n').length;
|
||||
console.log("Line count", lineCount);
|
||||
callback({
|
||||
value: highlighted, key: key, language: final_language || lang, lineCount: res.data.split('\n').length
|
||||
value: highlighted, key: key, language: final_language || lang, lineCount: lineCount
|
||||
}
|
||||
);
|
||||
}, error: function () {
|
||||
@@ -92,15 +94,12 @@ var haste = function (appName, options) {
|
||||
this.options = options;
|
||||
this.configureShortcuts();
|
||||
this.configureButtons();
|
||||
// If twitter is disabled, hide the button
|
||||
if (!options.twitter) {
|
||||
$('#box2 .twitter').hide();
|
||||
}
|
||||
$('#box2').hide(); // hide the whole hastebin box
|
||||
};
|
||||
|
||||
// Set the page title - include the appName
|
||||
haste.prototype.setTitle = function (ext) {
|
||||
var title = ext ? this.appName + ' - ' + ext : this.appName;
|
||||
var title = ext ? (this.appName + ' - ' + ext) : this.appName;
|
||||
document.title = title;
|
||||
};
|
||||
|
||||
@@ -233,6 +232,7 @@ haste.prototype.removeLineNumbers = function () {
|
||||
|
||||
// Load a document and show it
|
||||
haste.prototype.loadDocument = function (key) {
|
||||
console.log("LOADING DOCUMENT");
|
||||
// Split the key up
|
||||
var parts = key.split('.', 2);
|
||||
console.log("Loading document", key, "with parts", parts);
|
||||
@@ -264,6 +264,7 @@ haste.prototype.duplicateDocument = function () {
|
||||
|
||||
// Lock the current document
|
||||
haste.prototype.lockDocument = function () {
|
||||
console.log("LOCKING DOCUMENT");
|
||||
var _this = this;
|
||||
this.doc.save(this.$textarea.val(), function (err, ret) {
|
||||
if (err) {
|
||||
|
||||
@@ -4,6 +4,11 @@
|
||||
|
||||
<title>hastebin</title>
|
||||
<meta charset="utf-8"/>
|
||||
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;800&display=swap" rel="stylesheet">
|
||||
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/github-dark.min.css"
|
||||
integrity="sha512-rO+olRTkcf304DQBxSWxln8JXCzTHlKnIdnMUwYvQa9/Jd4cQaNkItIUj6Z4nvW1dqK0SKXLbn9h4KwZTNtAyw=="
|
||||
crossorigin="anonymous" referrerpolicy="no-referrer"/>
|
||||
|
||||
Reference in New Issue
Block a user