Full-project rename. `git grep -i aksrt` is now empty apart from the
DBMigrator 3.3.0 changelog note that documents the rename itself.
Code identifiers
- PHP namespace AKSRT\ -> Jio\ (composer PSR-4 + 378 declarations)
- global constants AKSRT_* -> JIO_* (VERSION/DIR/URI, PAY_TYPE_*, CAPTCHA_*)
- procedural functions, hooks, options, meta keys, table names,
cookies, query vars, ajax actions and nonces: aksrt_ -> jio_
- text domain aksrt -> jio; Theme Name -> Jio
- JS globals: aksrtData/aksrtAdminData/... -> jioData/jioAdminData/...,
window.AKSRTCaptcha & friends -> window.JioCaptcha, Aksrt* -> Jio*
- Vue components Aks*.vue -> Jio*.vue (15 files renamed + imports)
- CSS classes/data-attrs/custom properties: aksrt- -> jio-
- REST namespace aksrt/v1 -> jio/v1 (incl. payment gateway callbacks)
Storage layer
- DB tables {prefix}aksrt_* -> {prefix}jio_*; SCHEMA_VERSION 3.2.0 -> 3.3.0
so dbDelta creates the new names on install
- widget id_base aksrt_widget_* -> jio_widget_*
- uninstall.php drop list rebuilt from the actual migrator tables
(dropped 3 stale entries, added the 17 missing ones)
Removed
- hardcoded https://api.aksrt.com/version.json default update endpoint;
get_endpoint() now reads the 「更新端点」 setting and do_check() no-ops
when it is empty
Files renamed: inc/helpers/aksrt-*.php -> jio-*.php (54),
assets/admin/src/components/form/Aks*.vue -> Jio*.vue (15).
Build artifacts regenerated: assets/css/build, assets/js/runtime,
assets/admin/build.
Verified: audit-psr4-paths errors=0, audit-admin-contracts errors=0
(warnings=56, unchanged baseline), 813/813 widget-system tests,
44/44 phpunit, php -l clean across all PHP.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
121 lines
3.9 KiB
JavaScript
121 lines
3.9 KiB
JavaScript
/**
|
|
* Jio Content Protection — Copy copyright / Right-click disable / F12 detection
|
|
*
|
|
* All features are DEFAULT OFF and configurable via Settings.
|
|
* This is a "soft" protection — it increases the barrier but cannot truly prevent copying.
|
|
*
|
|
* @package Jio
|
|
*/
|
|
|
|
(function () {
|
|
'use strict';
|
|
|
|
var config = (window.jioData && window.jioData.contentProtect) || {};
|
|
|
|
// Bail if nothing enabled
|
|
if (!config.enabled) return;
|
|
|
|
/* ============================================================
|
|
* 1. 复制时追加版权声明
|
|
* ============================================================ */
|
|
if (config.copyNotice) {
|
|
document.addEventListener('copy', function (e) {
|
|
var selection = window.getSelection();
|
|
if (!selection || selection.isCollapsed) return;
|
|
|
|
var text = selection.toString();
|
|
if (text.length < 20) return; // Too short, skip
|
|
|
|
var notice = '\n\n---\n' +
|
|
'版权声明:本文' + (config.copyNoticeText || '来自本站,请尊重原创版权。') + '\n' +
|
|
'链接:' + window.location.href;
|
|
|
|
// Append notice to clipboard
|
|
var clipboardData = e.clipboardData || window.clipboardData;
|
|
if (clipboardData) {
|
|
e.preventDefault();
|
|
clipboardData.setData('text/plain', text + notice);
|
|
}
|
|
});
|
|
}
|
|
|
|
/* ============================================================
|
|
* 2. 禁用右键菜单
|
|
* ============================================================ */
|
|
if (config.disableRightClick) {
|
|
document.addEventListener('contextmenu', function (e) {
|
|
// Allow on input/textarea elements
|
|
var tag = e.target.tagName;
|
|
if (tag === 'INPUT' || tag === 'TEXTAREA' || e.target.isContentEditable) return;
|
|
|
|
e.preventDefault();
|
|
|
|
// Show brief notification
|
|
showProtectionNotice('本站已禁用右键菜单');
|
|
});
|
|
}
|
|
|
|
/* ============================================================
|
|
* 3. F12 / DevTools 检测(仅提示,不阻止)
|
|
* ============================================================ */
|
|
if (config.detectDevTools) {
|
|
document.addEventListener('keydown', function (e) {
|
|
// F12
|
|
if (e.key === 'F12' || e.keyCode === 123) {
|
|
e.preventDefault();
|
|
showProtectionNotice('本站已禁用开发者工具');
|
|
return false;
|
|
}
|
|
|
|
// Ctrl+Shift+I / Cmd+Option+I
|
|
if ((e.ctrlKey || e.metaKey) && e.shiftKey && (e.key === 'I' || e.key === 'i' || e.keyCode === 73)) {
|
|
e.preventDefault();
|
|
showProtectionNotice('本站已禁用开发者工具');
|
|
return false;
|
|
}
|
|
|
|
// Ctrl+Shift+J / Cmd+Option+J
|
|
if ((e.ctrlKey || e.metaKey) && e.shiftKey && (e.key === 'J' || e.key === 'j' || e.keyCode === 74)) {
|
|
e.preventDefault();
|
|
showProtectionNotice('本站已禁用开发者工具');
|
|
return false;
|
|
}
|
|
|
|
// Ctrl+U (view source)
|
|
if ((e.ctrlKey || e.metaKey) && (e.key === 'u' || e.key === 'U' || e.keyCode === 85)) {
|
|
e.preventDefault();
|
|
showProtectionNotice('本站已禁用查看源代码');
|
|
return false;
|
|
}
|
|
});
|
|
}
|
|
|
|
/* ============================================================
|
|
* Protection notice toast
|
|
* ============================================================ */
|
|
var noticeTimer = null;
|
|
|
|
function showProtectionNotice(text) {
|
|
if (noticeTimer) clearTimeout(noticeTimer);
|
|
|
|
var el = document.getElementById('jio-protection-notice');
|
|
if (!el) {
|
|
el = document.createElement('div');
|
|
el.id = 'jio-protection-notice';
|
|
el.style.cssText =
|
|
'position:fixed;bottom:20px;left:50%;transform:translateX(-50%);' +
|
|
'background:rgba(0,0,0,0.75);color:#fff;padding:8px 20px;border-radius:8px;' +
|
|
'font-size:13px;z-index:99999;transition:opacity 0.3s;pointer-events:none;';
|
|
document.body.appendChild(el);
|
|
}
|
|
|
|
el.textContent = text;
|
|
el.style.opacity = '1';
|
|
|
|
noticeTimer = setTimeout(function () {
|
|
el.style.opacity = '0';
|
|
}, 2000);
|
|
}
|
|
|
|
})();
|