pull/3549/head
Conduitry 5 years ago
parent a2cd1fec7f
commit 66c44919a7

@ -38,7 +38,7 @@
{#each labels as label, index} {#each labels as label, index}
<button <button
class:selected={offset === index} class:selected={offset === index}
on:click={() => {offset = index}} on:click={() => offset = index}
> >
{label} {label}
</button> </button>

@ -4,7 +4,7 @@
let offset = null; let offset = null;
if (user) { if (user) {
var url = 'apps.json'; let url = 'apps.json';
if (page.query.offset) { if (page.query.offset) {
url += `?offset=${encodeURIComponent(page.query.offset)}`; url += `?offset=${encodeURIComponent(page.query.offset)}`;
} }

@ -7,23 +7,6 @@ import marked from 'marked';
import PrismJS from 'prismjs'; import PrismJS from 'prismjs';
import 'prismjs/components/prism-bash'; import 'prismjs/components/prism-bash';
const escaped = {
'"': '&quot;',
"'": '&#39;',
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
};
const unescaped = Object.keys(escaped).reduce(
(unescaped, key) => ((unescaped[escaped[key]] = key), unescaped),
{}
);
function unescape(str) {
return String(str).replace(/&.+?;/g, match => unescaped[match] || match);
}
const blockTypes = [ const blockTypes = [
'blockquote', 'blockquote',
'html', 'html',

@ -95,7 +95,8 @@ export async function patch(req, res) {
const { user } = req; const { user } = req;
if (!user) return; if (!user) return;
let id, uid = req.params.id; let id;
const uid = req.params.id;
try { try {
const [row] = await query(`select * from gists where uid = $1 limit 1`, [uid]); const [row] = await query(`select * from gists where uid = $1 limit 1`, [uid]);
@ -110,7 +111,9 @@ export async function patch(req, res) {
try { try {
const obj = await body(req); const obj = await body(req);
obj.updated_at = 'now()'; obj.updated_at = 'now()';
let k, cols=[], vals=[]; let k;
const cols = [];
const vals = [];
for (k in obj) { for (k in obj) {
cols.push(k); cols.push(k);
vals.push(k === 'files' ? JSON.stringify(obj[k]) : obj[k]); vals.push(k === 'files' ? JSON.stringify(obj[k]) : obj[k]);

@ -18,7 +18,6 @@
import { getContext } from 'svelte'; import { getContext } from 'svelte';
import ScreenToggle from '../../../components/ScreenToggle.svelte'; import ScreenToggle from '../../../components/ScreenToggle.svelte';
import { Icon } from '@sveltejs/site-kit';
import TableOfContents from './_TableOfContents.svelte'; import TableOfContents from './_TableOfContents.svelte';
import { import {

Loading…
Cancel
Save