From d83ef7916561a3034d48c4920efaf556b490e88c Mon Sep 17 00:00:00 2001 From: Magnus Persson Date: Sun, 24 Apr 2022 18:54:16 +0200 Subject: [PATCH] Added copy function for standard formats --- html/format.htm | 48 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/html/format.htm b/html/format.htm index a40ae21..58acd25 100644 --- a/html/format.htm +++ b/html/format.htm @@ -89,16 +89,40 @@
-
-
-
+ + +
+
+ +
+ + +

@@ -129,6 +153,24 @@ selectFormat(); }); + // Copy the selected template + $("#copy-btn").click(function(e) { + var id = $("#predefined").val(); + + //console.log( encodeURIComponent( $("#format").val() ) ); + + formatTemplates.forEach(function (item, index) { + if( item.id == id ) { + $("#format").val( decodeURIComponent(item.format) ); + } + }); + }); + + // Clear the selected template + $("#clear-btn").click(function(e) { + $("#format").val( "" ); + }); + // Store the format $("#format-btn").click(function(e) { var s = $("#format").val();