Add Memos Clipper extension with Markdown content extraction and browser integration.

This commit is contained in:
2026-03-15 09:34:59 +01:00
parent 2acd843b2b
commit a2f0a0e262
18 changed files with 3774 additions and 0 deletions

80
src/settings.html Normal file
View File

@@ -0,0 +1,80 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Memos Clipper — Settings</title>
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="settings.css" />
</head>
<body>
<div class="page">
<header class="p-6 border-b border-gray-100 bg-white">
<div class="logo flex items-center space-x-3 text-2xl font-bold text-blue-600">
<svg class="w-8 h-8" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>
<polyline points="14 2 14 8 20 8"/>
<line x1="16" y1="13" x2="8" y2="13"/>
<line x1="16" y1="17" x2="8" y2="17"/>
<polyline points="10 9 9 9 8 9"/>
</svg>
<span>Memos Clipper Settings</span>
</div>
</header>
<main class="max-w-3xl mx-auto p-6 space-y-8">
<div class="card bg-white rounded-xl shadow-sm border border-gray-100 p-6 space-y-6">
<h2 class="text-xl font-semibold text-gray-800 border-b pb-2">Connection</h2>
<label class="block space-y-2">
<span class="text-sm font-medium text-gray-700">Memos Instance URL</span>
<input type="url" id="memos-url" placeholder="https://memos.example.com" class="w-full px-4 py-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-blue-100 focus:border-blue-400 outline-none transition" />
<small class="block text-xs text-gray-400">The base URL of your usememos instance (no trailing slash)</small>
</label>
<label class="block space-y-2">
<span class="text-sm font-medium text-gray-700">API Token</span>
<input type="password" id="api-token" placeholder="Your access token" class="w-full px-4 py-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-blue-100 focus:border-blue-400 outline-none transition" />
<small class="block text-xs text-gray-400">Settings → Account → Access Tokens in your Memos instance</small>
</label>
<div class="actions flex space-x-3 pt-2">
<button id="test-btn" class="secondary flex-1 bg-gray-50 hover:bg-gray-100 text-gray-700 font-medium py-2 px-4 rounded-lg border border-gray-200 transition">Test Connection</button>
<button id="save-btn" class="flex-1 bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-lg shadow-sm transition">Save Settings</button>
</div>
<div id="status" class="status hidden p-3 rounded-lg text-sm"></div>
</div>
<div class="card bg-white rounded-xl shadow-sm border border-gray-100 p-6 space-y-6">
<h2 class="text-xl font-semibold text-gray-800 border-b pb-2">Defaults</h2>
<label class="block space-y-2">
<span class="text-sm font-medium text-gray-700">Default visibility</span>
<select id="visibility" class="w-full px-4 py-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-blue-100 focus:border-blue-400 outline-none bg-white transition">
<option value="PRIVATE">Private</option>
<option value="PROTECTED">Protected</option>
<option value="PUBLIC">Public</option>
</select>
</label>
<label class="block space-y-2">
<span class="text-sm font-medium text-gray-700">Default clip mode</span>
<select id="clip-mode" class="w-full px-4 py-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-blue-100 focus:border-blue-400 outline-none bg-white transition">
<option value="page">Full page (article extraction)</option>
<option value="selection">Selection only</option>
</select>
</label>
<div class="space-y-3 pt-2">
<label class="flex items-center space-x-3 cursor-pointer group">
<input type="checkbox" id="include-images" checked class="w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500 transition" />
<span class="text-sm text-gray-700 group-hover:text-gray-900 transition">Upload page images as attachments</span>
</label>
<label class="flex items-center space-x-3 cursor-pointer group">
<input type="checkbox" id="include-tags" class="w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500 transition" />
<span class="text-sm text-gray-700 group-hover:text-gray-900 transition">Automatically add #clipped tag</span>
</label>
</div>
<div class="actions pt-4">
<button id="save-defaults-btn" class="w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-lg shadow-sm transition">Save Defaults</button>
</div>
<div id="defaults-status" class="status hidden p-3 rounded-lg text-sm"></div>
</div>
</main>
</div>
<script src="/settings.js" type="module"></script>
</body>
</html>