Advanced Clipboard Manager

Son 10 kopyalamayı saklar ve hızlı erişim sağlar.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Advanced Clipboard Manager
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Son 10 kopyalamayı saklar ve hızlı erişim sağlar.
// @author       Mustafa Hakan
// @match        *://*/*
// @grant        GM_addStyle
// @grant        GM_setClipboard
// @grant        GM_getValue
// @grant        GM_setValue
// ==/UserScript==

(function() {
    'use strict';

    GM_addStyle(`
        #clip-panel {
            position: fixed;
            top: 50%;
            right: 0;
            transform: translateY(-50%);
            z-index: 2147483647;
            background: #1a1a1b;
            border: 1px solid #343435;
            border-right: none;
            border-radius: 8px 0 0 8px;
            width: 250px;
            transition: all 0.3s ease;
            font-family: sans-serif;
            box-shadow: -4px 0 15px rgba(0,0,0,0.5);
            display: flex;
            flex-direction: column;
            max-height: 80vh;
            margin-right: -250px;
        }
        #clip-panel.open {
            margin-right: 0;
        }
        #clip-handle {
            position: absolute;
            left: -35px;
            top: 50%;
            transform: translateY(-50%);
            width: 35px;
            height: 60px;
            background: #1a1a1b;
            border: 1px solid #343435;
            border-right: none;
            border-radius: 8px 0 0 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 20px;
        }
        #clip-list {
            overflow-y: auto;
            padding: 10px;
            flex-grow: 1;
        }
        .clip-item {
            background: #272729;
            padding: 8px 12px;
            margin-bottom: 8px;
            border-radius: 4px;
            font-size: 12px;
            color: #d7dadc;
            cursor: pointer;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            transition: background 0.2s;
            border: 1px solid transparent;
        }
        .clip-item:hover {
            background: #343435;
            border-color: #444;
        }
        #clip-header {
            padding: 10px;
            border-bottom: 1px solid #343435;
            font-size: 13px;
            font-weight: bold;
            color: #fff;
            text-align: center;
        }
    `);

    let history = GM_getValue('clipHistory', []);

    const saveHistory = (text) => {
        if (!text || text === history[0]) return;
        history.unshift(text);
        if (history.length > 10) history.pop();
        GM_setValue('clipHistory', history);
        renderList();
    };

    const renderList = () => {
        const list = document.getElementById('clip-list');
        if (!list) return;
        list.innerHTML = '';
        history.forEach((text) => {
            const item = document.createElement('div');
            item.className = 'clip-item';
            item.innerText = text;
            item.title = text;
            item.onclick = () => {
                GM_setClipboard(text);
                document.getElementById('clip-panel').classList.remove('open');
            };
            list.appendChild(item);
        });
    };

    const panel = document.createElement('div');
    panel.id = 'clip-panel';
    panel.innerHTML = `
        <div id="clip-handle">📋</div>
        <div id="clip-header">Kopyalananlar</div>
        <div id="clip-list"></div>
    `;

    document.body.appendChild(panel);
    renderList();

    panel.querySelector('#clip-handle').onclick = () => {
        panel.classList.toggle('open');
    };

    document.addEventListener('copy', () => {
        setTimeout(async () => {
            const text = await navigator.clipboard.readText();
            saveHistory(text);
        }, 100);
    });

})();