PHP 8.2.31
Preview: connection-key.js Size: 1.27 KB
//proc/self/root/home/nshryvcy/blissfulnepal.com/wp-content/plugins/airlift/js/connection-key.js

(function() {
	document.addEventListener('DOMContentLoaded', function() {
		var keyField = document.getElementById('al-connection-key');
		var viewButton = document.getElementById('al-view-connection-key');
		var copyButton = document.getElementById('al-copy-connection-key');
		if (!keyField || !viewButton || !copyButton) {
			return;
		}

		viewButton.addEventListener('click', function() {
			if (keyField.type === 'password') {
				keyField.type = 'text';
				viewButton.textContent = 'Hide Key';
			} else {
				keyField.type = 'password';
				viewButton.textContent = 'View Key';
			}
		});

		copyButton.addEventListener('click', function() {
			var previousType = keyField.type;
			keyField.type = 'text';

			var updateCopyState = function() {
				copyButton.textContent = 'Copied!';
				setTimeout(function() {
					copyButton.textContent = 'Copy Key';
				}, 2000);
			};

			var restoreField = function() {
				keyField.type = previousType;
			};

			if (navigator.clipboard && navigator.clipboard.writeText) {
				navigator.clipboard.writeText(keyField.value).then(function() {
					updateCopyState();
				}).finally(function() {
					restoreField();
				});
				return;
			}

			keyField.select();
			document.execCommand('copy');
			updateCopyState();
			restoreField();
		});
	});
})();

Directory Contents

Dirs: 0 × Files: 1

Name Size Perms Modified Actions
1.27 KB lrw-r--r-- 2026-04-02 01:31:45
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).