summaryrefslogtreecommitdiff
path: root/app/deals/templates
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2023-07-27 10:54:16 -0500
committerluxagraf <sng@luxagraf.net>2023-07-27 10:54:16 -0500
commit5be880ce1fabeb5eb4f1254f74c0212d1b71892b (patch)
tree71d4ae919645554e831ebb9f7d48ccbf1bdd3661 /app/deals/templates
parent94dc3eb97f4ddb09da3dde887703e95d5a876576 (diff)
deals: made a bookmarklet to generate deal code markdown
Diffstat (limited to 'app/deals/templates')
-rw-r--r--app/deals/templates/deals/deal_code.html58
1 files changed, 58 insertions, 0 deletions
diff --git a/app/deals/templates/deals/deal_code.html b/app/deals/templates/deals/deal_code.html
new file mode 100644
index 0000000..2ab33e2
--- /dev/null
+++ b/app/deals/templates/deals/deal_code.html
@@ -0,0 +1,58 @@
+{% load humanize %}
+<html>
+ <head>
+<style>
+body {
+ padding-top: 30px;
+}
+.button {
+ color: white;
+ padding: 1rem;
+ text-decoration: none;
+ background-color: #2ea44f;
+ border: 1px solid rgba(27, 31, 35, .15);
+ border-radius: 6px;
+ box-shadow: rgba(27, 31, 35, .1) 0 1px 0;
+ box-sizing: border-box;
+ color: #fff;
+ cursor: pointer;
+ display: inline-block;
+ font-family: -apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";
+ font-size: 14px;
+ font-weight: 600;
+ line-height: 20px;
+ padding: 6px 16px;
+ position: relative;
+ text-align: center;
+ text-decoration: none;
+ user-select: none;
+ -webkit-user-select: none;
+ touch-action: manipulation;
+ vertical-align: middle;
+ white-space: nowrap;
+}
+</style>
+ </head>
+ <body>
+<a class="button" href="#" onclick="CopyToClipboard('markdown');return false;">Copy Markdown</a>
+
+<textarea id="markdown" style="min-width: 35rem; height: 15rem;">
+
+</textarea>
+
+<script>
+let params = new URL(document.location).searchParams;
+var str = "####"+" ["+params.get("title")+"]("+params.get("url")+")\n\n+++button-group\n\n[Amazon]("+params.get("url")+" \"Amazon\"){: target=\"_blank\"}\n\n+++";
+document.getElementById('markdown').value = str
+function CopyToClipboard(id)
+{
+var r = document.createRange();
+r.selectNode(document.getElementById(id));
+window.getSelection().removeAllRanges();
+window.getSelection().addRange(r);
+document.execCommand('copy');
+window.getSelection().removeAllRanges();
+}
+</script>
+</body>
+</html>