diff --git a/metadata-generator.html b/metadata-generator.html
index 7f57b8d..9a331a3 100644
--- a/metadata-generator.html
+++ b/metadata-generator.html
@@ -248,13 +248,28 @@
-
-
-
-
+
+
+
@@ -664,11 +679,11 @@
return creators;
}
- function copy_generated_output() {
+ function copy_generated_output(text_element_id) {
if (!navigator.clipboard) {
return;
}
- navigator.clipboard.writeText(document.getElementById("comment").value).then(function() {
+ navigator.clipboard.writeText(document.getElementById(text_element_id).value).then(function() {
$("#copied_to_clipboard_toast").toast("show");
}, function(err) {
console.error('Async: Could not copy text: ', err);
@@ -720,9 +735,11 @@
+ ('0' + datePublished.getDate()).slice(-2);
meta.datePublished = dateString;
}
- document.getElementById("comment").value = jsyaml.dump(meta);
+ document.getElementById("yaml_output").value = jsyaml.dump(meta);
+ document.getElementById("json_output").value = JSON.stringify(meta, null, 2);
if (navigator.clipboard) {
- document.getElementById("button_copy_generated_output").disabled = false
+ document.getElementById("button_copy_generated_output_yaml").disabled = false
+ document.getElementById("button_copy_generated_output_json").disabled = false
}
}