|
@@ -1,3 +1,20 @@
|
|
|
|
+SELECT 'button' AS component;
|
|
|
|
+SELECT 'Open' AS title
|
|
|
|
+, 1 AS width
|
|
|
|
+, $tabler_color AS color
|
|
|
|
+, 'https://shandan.one/clip/open?' AS link
|
|
|
|
+;
|
|
|
|
+SELECT 'New' AS title
|
|
|
|
+, 1 AS width
|
|
|
|
+, 'gray-500' AS color
|
|
|
|
+, 'https://shandan.one/clip.sql?' AS link
|
|
|
|
+;
|
|
|
|
+SELECT 'Download' AS title
|
|
|
|
+, 2 AS width
|
|
|
|
+, 'gray-500' AS color
|
|
|
|
+, 'https://shandan.one/clip/'||$hash||'?raw=true' AS link
|
|
|
|
+;
|
|
|
|
+
|
|
SELECT 'form' AS component
|
|
SELECT 'form' AS component
|
|
, '/clip' AS action
|
|
, '/clip' AS action
|
|
, '' AS validate
|
|
, '' AS validate
|
|
@@ -14,32 +31,16 @@ SELECT 'Edit as New' AS value
|
|
, 2 AS width
|
|
, 2 AS width
|
|
, 'submit' AS type
|
|
, 'submit' AS type
|
|
, 'action' AS name
|
|
, 'action' AS name
|
|
-;
|
|
|
|
-SELECT 'New' AS value
|
|
|
|
-, '' AS label
|
|
|
|
-, 1 AS width
|
|
|
|
-, 'submit' AS type
|
|
|
|
-, 'action' AS name
|
|
|
|
-, '/clip.sql' AS action
|
|
|
|
-;
|
|
|
|
-SELECT 'Open' AS value
|
|
|
|
-, '' AS label
|
|
|
|
-, 1 AS width
|
|
|
|
-, 'submit' AS type
|
|
|
|
-, 'action' AS name
|
|
|
|
-, '/clip/open.sql' AS action
|
|
|
|
-;
|
|
|
|
-SELECT 'Download' AS value
|
|
|
|
-, '' AS label
|
|
|
|
-, 2 AS width
|
|
|
|
-, 'submit' AS type
|
|
|
|
-, 'action' AS name
|
|
|
|
|
|
+, '/clip.sql' AS formaction
|
|
;
|
|
;
|
|
SELECT 'Paste something here...' AS placeholder
|
|
SELECT 'Paste something here...' AS placeholder
|
|
-, CASE $content IS NULL WHEN TRUE THEN 'textarea' ELSE 'hidden' END AS type
|
|
|
|
|
|
+, CASE $content IS NULL OR COALESCE($action, '') IN ('Edit as New', 'New') WHEN TRUE THEN 'textarea' ELSE 'hidden' END AS type
|
|
, 'paste' AS name
|
|
, 'paste' AS name
|
|
, '' AS label
|
|
, '' AS label
|
|
-, $content AS value
|
|
|
|
|
|
+, CASE COALESCE($action, '')
|
|
|
|
+ WHEN 'New' THEN NULL
|
|
|
|
+ ELSE $content
|
|
|
|
+END AS value
|
|
;
|
|
;
|
|
SELECT 'code' AS component;
|
|
SELECT 'code' AS component;
|
|
-SELECT $content AS contents WHERE $content IS NOT NULL;
|
|
|
|
|
|
+SELECT $content AS contents WHERE $content IS NOT NULL AND COALESCE($action, '') NOT IN ('Edit as New', 'New');
|