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

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

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

@ -7,23 +7,6 @@ import marked from 'marked';
import PrismJS from 'prismjs';
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 = [
'blockquote',
'html',

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

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

Loading…
Cancel
Save