CSDN-copy-without-login

Allow copying code in CSDN posts without logging in.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         CSDN-copy-without-login
// @namespace    lytning98_CSDN-copy-without-login
// @version      0.1
// @description  Allow copying code in CSDN posts without logging in.
// @author       lytning98
// @source       https://github.com/lytning98/CSDN-copy-without-login
// @match        https://blog.csdn.net/*/article/details/*
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var engine = hljs.copyCode ? 'hljs' : 'mdcp';
    var $bindee = engine == 'hljs' ? $('.hljs-button.signin') : $('.prettyprint > code');

    eval(engine).signin = Function();
    $bindee.attr('onclick', engine + '.copyCode(event)');
    $('.hljs-button.signin').attr('class', 'hljs-button {2}').attr('data-title', '不登录也复制');

})();