(((meta ((content . "Zettelstore Copy Reference JavaScript") (name . "title"))) (meta ((content . "configuration") (name . "role"))) (meta ((content . "js") (name . "syntax"))) (meta ((content . "2") (name . "box-number"))) (meta ((content . "") (name . "copyright"))) (meta ((content . "20260206134600") (name . "created"))) (meta ((content . "en") (name . "lang"))) (meta ((content . "") (name . "license"))) (meta ((content . "20260206134600") (name . "published"))) (meta ((content . "public") (name . "visibility")))) (pre (code ((class . "language-js")) "/*-----------------------------------------------------------------------------\n * Copyright (c) 2026-present Detlef Stern\n *\n * This file is part of Zettelstore.\n *\n * Zettelstore is licensed under the latest version of the EUPL (European Union\n * Public License). Please see file LICENSE.txt for your rights and obligations\n * under this license.\n *\n * SPDX-License-Identifier: EUPL-1.2\n * SPDX-FileCopyrightText: 2026-present Detlef Stern\n *-----------------------------------------------------------------------------\n */\n\nfunction zsShowNotification(message, success) {\n var notification = document.createElement('div');\n notification.classList.add('notification');\n notification.classList.add(success ? 'success' : 'error');\n notification.textContent = message;\n document.body.appendChild(notification);\n setTimeout(function() {\n if (notification.parentNode) {\n document.body.removeChild(notification);\n }\n }, 1732);\n}\n\ndocument.getElementById('zsCopyReference').addEventListener('click', function(event) {\n event.preventDefault();\n var reference = this.getAttribute('data-ref');\n navigator.clipboard.writeText(reference)\n .then(function() {\n zsShowNotification(\"Reference copied to clipboard.\", true);\n })\n .catch(function(error) {\n console.error(\"Error copying text: \", error);\n zsShowNotification(\"Failed to copy reference. Please try again.\", false);\n });\n });")))