(zettel (meta (box-number "2") (created "20260202123100") (modified "20260206134600") (published "20260206134600") (role "configuration") (syntax "js") (title "Zettelstore Base JavaScript") (visibility "public")) (rights 4) (encoding "") (content "/*-----------------------------------------------------------------------------\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\n // Polyfill for Clipboard API (for older browsers)\n(function() {\n if (!navigator.clipboard) {\n navigator.clipboard = {\n writeText: function(text) {\n return new Promise(function(resolve, reject) {\n var tempInput = document.createElement('input');\n tempInput.value = text;\n document.body.appendChild(tempInput);\n tempInput.select();\n var success = document.execCommand('copy');\n document.body.removeChild(tempInput);\n\n if (success) {\n resolve();\n } else {\n reject(new Error('Failed to copy text using execCommand.'));\n }\n });\n }\n };\n }\n})();\n"))