refactor: rename the theme brand and every identifier from AKSRT to Jio
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>
This commit is contained in:
1 parent
5b16bc6e15
commit
35bb96e82f
997 files changed
+28216
-28188
No files matched your search
@@ -1,12 +1,12 @@
|
||||
/**
|
||||
* Front-submit TinyMCE tools matching the reference article editor.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
(function (window, document) {
|
||||
'use strict';
|
||||
|
||||
var cfg = window.aksrtSubmitData || {};
|
||||
var cfg = window.jioSubmitData || {};
|
||||
var editorCfg = cfg.editor || {};
|
||||
var i18n = cfg.i18n || {};
|
||||
var activeModal = null;
|
||||
@@ -17,7 +17,7 @@
|
||||
message,
|
||||
type,
|
||||
duration === undefined ? 5 : duration,
|
||||
id || 'aksrt-front-submit-editor-media-toast'
|
||||
id || 'jio-front-submit-editor-media-toast'
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@
|
||||
return '';
|
||||
}
|
||||
var filename = String(name || safeUrl.split('/').pop() || i18n.attachment || '附件');
|
||||
var idAttr = attachmentId ? ' data-aksrt-file-id="' + Number(attachmentId) + '"' : '';
|
||||
var idAttr = attachmentId ? ' data-jio-file-id="' + Number(attachmentId) + '"' : '';
|
||||
return '<div class="mb20 muted-box file-download-box" contenteditable="false">' +
|
||||
'<div class="flex ac jsb"><div class="flex ac"><div class="mr10">' +
|
||||
'<div class="file-download-icon"><i class="fa fas fa-file-alt" aria-hidden="true"></i></div></div>' +
|
||||
@@ -110,7 +110,7 @@
|
||||
return cfg.restUrl ? cfg.restUrl.replace(/\/$/, '') + '/front-submit/media/' + encodeURIComponent(type) : ''; }
|
||||
|
||||
function currentPostId() {
|
||||
var field = document.querySelector('#aksrt-submit-form input[name="posts_id"]');
|
||||
var field = document.querySelector('#jio-submit-form input[name="posts_id"]');
|
||||
return Number((field && field.value) || cfg.postId || 0) || 0;
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@
|
||||
activeModal.root.remove();
|
||||
if (activeModal.previousFocus && typeof activeModal.previousFocus.focus === 'function') activeModal.previousFocus.focus();
|
||||
activeModal = null;
|
||||
document.body.classList.remove('aksrt-editor-media-open');
|
||||
document.body.classList.remove('jio-editor-media-open');
|
||||
}
|
||||
|
||||
function openMediaModal(options) {
|
||||
@@ -293,31 +293,31 @@
|
||||
var allowEmbed = definition.canEmbed && options.allowEmbed !== false;
|
||||
var canUpload = definition.canUpload && options.canUpload !== false;
|
||||
var root = document.createElement('div');
|
||||
root.className = 'aksrt-editor-media';
|
||||
root.className = 'jio-editor-media';
|
||||
root.setAttribute('data-editor-media-type', type);
|
||||
root.setAttribute('role', 'dialog'); root.setAttribute('aria-modal', 'true'); root.setAttribute('aria-labelledby', 'aksrt-editor-media-title');
|
||||
root.setAttribute('role', 'dialog'); root.setAttribute('aria-modal', 'true'); root.setAttribute('aria-labelledby', 'jio-editor-media-title');
|
||||
root.innerHTML =
|
||||
'<button type="button" class="aksrt-editor-media__backdrop" data-editor-media-close tabindex="-1" aria-label="' + escapeAttr(i18n.close || '关闭') + '"></button>' +
|
||||
'<div class="aksrt-editor-media__dialog" tabindex="-1"><button type="button" class="aksrt-editor-media__close" data-editor-media-close aria-label="' + escapeAttr(i18n.close || '关闭') + '">×</button>' +
|
||||
'<h3 id="aksrt-editor-media-title" class="aksrt-editor-media__title">' + escapeAttr(options.title || definition.title) + '</h3>' +
|
||||
'<div class="aksrt-editor-media__tabs" role="tablist"><button type="button" class="is-active" role="tab" aria-selected="true" data-editor-media-tab="mine">' + escapeAttr(definition.mineTab) + '</button>' +
|
||||
'<button type="button" class="jio-editor-media__backdrop" data-editor-media-close tabindex="-1" aria-label="' + escapeAttr(i18n.close || '关闭') + '"></button>' +
|
||||
'<div class="jio-editor-media__dialog" tabindex="-1"><button type="button" class="jio-editor-media__close" data-editor-media-close aria-label="' + escapeAttr(i18n.close || '关闭') + '">×</button>' +
|
||||
'<h3 id="jio-editor-media-title" class="jio-editor-media__title">' + escapeAttr(options.title || definition.title) + '</h3>' +
|
||||
'<div class="jio-editor-media__tabs" role="tablist"><button type="button" class="is-active" role="tab" aria-selected="true" data-editor-media-tab="mine">' + escapeAttr(definition.mineTab) + '</button>' +
|
||||
(canUpload ? '<button type="button" role="tab" aria-selected="false" data-editor-media-tab="upload">' + escapeAttr(definition.uploadTab) + '</button>' : '') +
|
||||
(allowExternal ? '<button type="button" role="tab" aria-selected="false" data-editor-media-tab="external">' + escapeAttr(definition.externalTab) + '</button>' : '') +
|
||||
(allowEmbed && type === 'video' ? '<button type="button" role="tab" aria-selected="false" data-editor-media-tab="embed">' + escapeAttr(definition.embedTab) + '</button>' : '') + '</div>' +
|
||||
'<div class="aksrt-editor-media__panels"><section class="aksrt-editor-media__panel is-active" data-editor-media-panel="mine">' +
|
||||
'<div class="aksrt-editor-media__search"><label class="screen-reader-text" for="aksrt-editor-media-search">' + escapeAttr(i18n.search || '搜索') + '</label><input id="aksrt-editor-media-search" type="search" class="form-control" placeholder="' + escapeAttr(i18n.searchMedia || '搜索媒体(至少 2 个字符)') + '" data-editor-media-search><button type="button" class="but hollow" data-editor-media-clear>' + escapeAttr(i18n.clear || '清除') + '</button></div>' +
|
||||
'<div class="aksrt-editor-media__status" data-editor-media-status aria-live="polite"></div><div class="aksrt-editor-media__list" data-editor-media-list></div><div class="aksrt-editor-media__mine-actions"><button type="button" class="but hollow aksrt-editor-media__load-more" data-editor-media-more hidden>' + escapeAttr(i18n.loadMore || '加载更多') + '</button><button type="button" class="but c-blue aksrt-editor-media__confirm" data-editor-media-confirm hidden>' + escapeAttr(i18n.confirmInsert || '确认插入') + '</button></div></section>' +
|
||||
(canUpload ? '<section class="aksrt-editor-media__panel" data-editor-media-panel="upload"><label class="aksrt-editor-media__drop"><input type="file" accept="' + escapeAttr(definition.accept) + '"' + (multiple ? ' multiple' : '') + ' data-editor-media-files><i class="fa fas fa-cloud-upload-alt" aria-hidden="true"></i><strong>' + escapeAttr(definition.select) + '</strong><span>' + escapeAttr(definition.hint) + '</span></label><div class="aksrt-editor-media__selection" data-editor-media-selection></div><div class="aksrt-editor-media__progress" data-editor-media-progress hidden></div><button type="button" class="but c-blue aksrt-editor-media__submit" data-editor-media-upload disabled>' + escapeAttr(i18n.confirmUpload || '确认上传') + '</button></section>' : '') +
|
||||
(allowExternal ? '<section class="aksrt-editor-media__panel" data-editor-media-panel="external"><p>' + escapeAttr(definition.externalHint) + '</p><textarea class="form-control" rows="5" placeholder="https://..." data-editor-media-urls></textarea><button type="button" class="but c-blue aksrt-editor-media__submit" data-editor-media-external>' + escapeAttr(i18n.confirmInsert || '确认插入') + '</button></section>' : '') +
|
||||
(allowEmbed && type === 'video' ? '<section class="aksrt-editor-media__panel" data-editor-media-panel="embed"><p>' + escapeAttr(i18n.embedVideoHint || '请输入嵌入地址或者直接粘贴 iframe 嵌入代码:') + '</p><textarea class="form-control" rows="5" placeholder="<iframe src="https://..."></iframe>" data-editor-media-embed></textarea><button type="button" class="but c-blue aksrt-editor-media__submit" data-editor-media-embed-submit>' + escapeAttr(i18n.confirmEmbed || '确认嵌入') + '</button></section>' : '') + '</div></div>';
|
||||
document.body.appendChild(root); document.body.classList.add('aksrt-editor-media-open');
|
||||
'<div class="jio-editor-media__panels"><section class="jio-editor-media__panel is-active" data-editor-media-panel="mine">' +
|
||||
'<div class="jio-editor-media__search"><label class="screen-reader-text" for="jio-editor-media-search">' + escapeAttr(i18n.search || '搜索') + '</label><input id="jio-editor-media-search" type="search" class="form-control" placeholder="' + escapeAttr(i18n.searchMedia || '搜索媒体(至少 2 个字符)') + '" data-editor-media-search><button type="button" class="but hollow" data-editor-media-clear>' + escapeAttr(i18n.clear || '清除') + '</button></div>' +
|
||||
'<div class="jio-editor-media__status" data-editor-media-status aria-live="polite"></div><div class="jio-editor-media__list" data-editor-media-list></div><div class="jio-editor-media__mine-actions"><button type="button" class="but hollow jio-editor-media__load-more" data-editor-media-more hidden>' + escapeAttr(i18n.loadMore || '加载更多') + '</button><button type="button" class="but c-blue jio-editor-media__confirm" data-editor-media-confirm hidden>' + escapeAttr(i18n.confirmInsert || '确认插入') + '</button></div></section>' +
|
||||
(canUpload ? '<section class="jio-editor-media__panel" data-editor-media-panel="upload"><label class="jio-editor-media__drop"><input type="file" accept="' + escapeAttr(definition.accept) + '"' + (multiple ? ' multiple' : '') + ' data-editor-media-files><i class="fa fas fa-cloud-upload-alt" aria-hidden="true"></i><strong>' + escapeAttr(definition.select) + '</strong><span>' + escapeAttr(definition.hint) + '</span></label><div class="jio-editor-media__selection" data-editor-media-selection></div><div class="jio-editor-media__progress" data-editor-media-progress hidden></div><button type="button" class="but c-blue jio-editor-media__submit" data-editor-media-upload disabled>' + escapeAttr(i18n.confirmUpload || '确认上传') + '</button></section>' : '') +
|
||||
(allowExternal ? '<section class="jio-editor-media__panel" data-editor-media-panel="external"><p>' + escapeAttr(definition.externalHint) + '</p><textarea class="form-control" rows="5" placeholder="https://..." data-editor-media-urls></textarea><button type="button" class="but c-blue jio-editor-media__submit" data-editor-media-external>' + escapeAttr(i18n.confirmInsert || '确认插入') + '</button></section>' : '') +
|
||||
(allowEmbed && type === 'video' ? '<section class="jio-editor-media__panel" data-editor-media-panel="embed"><p>' + escapeAttr(i18n.embedVideoHint || '请输入嵌入地址或者直接粘贴 iframe 嵌入代码:') + '</p><textarea class="form-control" rows="5" placeholder="<iframe src="https://..."></iframe>" data-editor-media-embed></textarea><button type="button" class="but c-blue jio-editor-media__submit" data-editor-media-embed-submit>' + escapeAttr(i18n.confirmEmbed || '确认嵌入') + '</button></section>' : '') + '</div></div>';
|
||||
document.body.appendChild(root); document.body.classList.add('jio-editor-media-open');
|
||||
|
||||
var state = { root: root, uploading: false, loading: false, requestId: 0, searchTimer: null, previousFocus: document.activeElement, page: 0, totalPages: 0, search: '', items: [], pinned: [], selected: [], exclude: [] };
|
||||
var list = root.querySelector('[data-editor-media-list]'), status = root.querySelector('[data-editor-media-status]'), more = root.querySelector('[data-editor-media-more]');
|
||||
var confirm = root.querySelector('[data-editor-media-confirm]');
|
||||
var search = root.querySelector('[data-editor-media-search]'), fileInput = root.querySelector('[data-editor-media-files]'), uploadButton = root.querySelector('[data-editor-media-upload]');
|
||||
var selection = root.querySelector('[data-editor-media-selection]'), progress = root.querySelector('[data-editor-media-progress]'), drop = root.querySelector('.aksrt-editor-media__drop'), files = [];
|
||||
function statusText(text, cls) { if (!status) return; status.className = 'aksrt-editor-media__status' + (cls ? ' is-' + cls : ''); status.textContent = text || ''; }
|
||||
var selection = root.querySelector('[data-editor-media-selection]'), progress = root.querySelector('[data-editor-media-progress]'), drop = root.querySelector('.jio-editor-media__drop'), files = [];
|
||||
function statusText(text, cls) { if (!status) return; status.className = 'jio-editor-media__status' + (cls ? ' is-' + cls : ''); status.textContent = text || ''; }
|
||||
function itemId(item) { return Number(item.attachment_id || item.id || 0); }
|
||||
function selectedIndex(id) { return state.selected.findIndex(function (item) { return itemId(item) === id; }); }
|
||||
function renderSelection() { if (selection) selection.textContent = files.length ? (multiple ? (i18n.selectedFiles || '已选择 %d 个文件').replace('%d', String(files.length)) : files[0].name) : ''; if (uploadButton) uploadButton.disabled = !files.length || state.uploading; }
|
||||
@@ -328,9 +328,9 @@
|
||||
var hasImagePreview = itemType === 'image' && (item.thumbnail_url || item.medium_url || item.url);
|
||||
var thumb = hasImagePreview
|
||||
? '<img src="' + escapeAttr(item.thumbnail_url || item.medium_url || item.url || '') + '" alt="' + label + '">'
|
||||
: '<span class="aksrt-editor-media__file-icon"><i class="fa fas fa-' + (itemType === 'video' ? 'video' : 'file-alt') + '" aria-hidden="true"></i></span>';
|
||||
: '<span class="jio-editor-media__file-icon"><i class="fa fas fa-' + (itemType === 'video' ? 'video' : 'file-alt') + '" aria-hidden="true"></i></span>';
|
||||
var meta = type === 'image' ? label : label + (extension(item) ? ' · ' + escapeAttr(extension(item)) : '') + (formatBytes(item.filesizeInBytes) ? ' · ' + escapeAttr(formatBytes(item.filesizeInBytes)) : '');
|
||||
return '<button type="button" class="aksrt-editor-media__item' + (chosen ? ' is-selected' : '') + '" data-editor-media-item="' + id + '"' + (disabled ? ' disabled' : '') + ' aria-pressed="' + (chosen ? 'true' : 'false') + '"><span class="aksrt-editor-media__check">' + (chosen ? String(index + 1) : '<i class="fa fas fa-check" aria-hidden="true"></i>') + '</span><span class="aksrt-editor-media__thumb">' + thumb + '</span><span class="aksrt-editor-media__meta">' + meta + '</span></button>';
|
||||
return '<button type="button" class="jio-editor-media__item' + (chosen ? ' is-selected' : '') + '" data-editor-media-item="' + id + '"' + (disabled ? ' disabled' : '') + ' aria-pressed="' + (chosen ? 'true' : 'false') + '"><span class="jio-editor-media__check">' + (chosen ? String(index + 1) : '<i class="fa fas fa-check" aria-hidden="true"></i>') + '</span><span class="jio-editor-media__thumb">' + thumb + '</span><span class="jio-editor-media__meta">' + meta + '</span></button>';
|
||||
}
|
||||
function renderList() {
|
||||
if (!list) return;
|
||||
@@ -379,9 +379,9 @@
|
||||
if (!files.length || state.uploading) return;
|
||||
state.uploading = true; renderSelection(); renderList();
|
||||
if (uploadButton) uploadButton.textContent = i18n.uploading || '正在上传…';
|
||||
if (progress) { progress.hidden = false; progress.textContent = i18n.uploading || '正在上传…'; progress.style.setProperty('--aksrt-upload-progress', '0%'); }
|
||||
if (progress) { progress.hidden = false; progress.textContent = i18n.uploading || '正在上传…'; progress.style.setProperty('--jio-upload-progress', '0%'); }
|
||||
var complete = 0, total = files.length, nextIndex = 0, results = [];
|
||||
var toastId = 'aksrt-front-submit-editor-media-toast';
|
||||
var toastId = 'jio-front-submit-editor-media-toast';
|
||||
notify(i18n.uploading || '正在上传…', 'load', '', toastId);
|
||||
function worker() {
|
||||
var index = nextIndex++;
|
||||
@@ -392,7 +392,7 @@
|
||||
results[index] = { error: error };
|
||||
}).finally(function () {
|
||||
complete += 1;
|
||||
if (progress) progress.style.setProperty('--aksrt-upload-progress', Math.round((complete / total) * 100) + '%');
|
||||
if (progress) progress.style.setProperty('--jio-upload-progress', Math.round((complete / total) * 100) + '%');
|
||||
}).then(worker);
|
||||
}
|
||||
var workers = Math.min(4, total);
|
||||
@@ -450,10 +450,10 @@
|
||||
if (fileInput) fileInput.addEventListener('change', function () { setFiles(fileInput.files); });
|
||||
if (drop) { ['dragenter', 'dragover'].forEach(function (name) { drop.addEventListener(name, function (event) { event.preventDefault(); drop.classList.add('is-dragging'); }); }); ['dragleave', 'drop'].forEach(function (name) { drop.addEventListener(name, function (event) { event.preventDefault(); drop.classList.remove('is-dragging'); }); }); drop.addEventListener('drop', function (event) { setFiles(event.dataTransfer && event.dataTransfer.files); }); }
|
||||
var onKeydown = function (event) { if (event.key === 'Escape') closeMediaModal(); }; state.onKeydown = onKeydown; activeModal = state; document.addEventListener('keydown', onKeydown);
|
||||
var focusTarget = root.querySelector('.aksrt-editor-media__dialog'); if (focusTarget) focusTarget.focus({ preventScroll: true }); request(1, true);
|
||||
var focusTarget = root.querySelector('.jio-editor-media__dialog'); if (focusTarget) focusTarget.focus({ preventScroll: true }); request(1, true);
|
||||
}
|
||||
|
||||
window.AksrtSubmitMedia = { open: openMediaModal, close: function () { closeMediaModal(); }, upload: uploadMedia };
|
||||
window.JioSubmitMedia = { open: openMediaModal, close: function () { closeMediaModal(); }, upload: uploadMedia };
|
||||
|
||||
function selectedContent(editor) {
|
||||
var content = String(editor.selection.getContent() || '').trim();
|
||||
@@ -472,7 +472,7 @@
|
||||
}
|
||||
|
||||
editor.insertContent(
|
||||
'<div class="tinymce-hide" data-aksrt-hide-type="' + escapeAttr(item.type) + '" contenteditable="false">' +
|
||||
'<div class="tinymce-hide" data-jio-hide-type="' + escapeAttr(item.type) + '" contenteditable="false">' +
|
||||
'<p class="hide-before">' + escapeAttr(item.open) + '</p>' +
|
||||
'<div contenteditable="true">' + content + '</div>' +
|
||||
'<p class="hide-after">' + escapeAttr(item.close) + '</p>' +
|
||||
@@ -572,7 +572,7 @@
|
||||
counter = counter || statusbar.querySelector('[data-submit-word-count]');
|
||||
if (!counter) {
|
||||
counter = document.createElement('span');
|
||||
counter.className = 'mce-wordcount aksrt-submit-word-count';
|
||||
counter.className = 'mce-wordcount jio-submit-word-count';
|
||||
counter.setAttribute('data-submit-word-count', '');
|
||||
counter.setAttribute('aria-live', 'polite');
|
||||
statusbar.appendChild(counter);
|
||||
@@ -678,7 +678,7 @@
|
||||
// 经典编辑器增强浮动工具栏(后台「扩展&增强 → 系统工具」mce_float_toolbar):
|
||||
// 复刻参考主题 editextend.js 的 wptoolbar 上下文工具条。
|
||||
function registerFloatToolbar(editor) {
|
||||
editor.addButton('aksrt_h2', {
|
||||
editor.addButton('jio_h2', {
|
||||
title: 'Heading 2',
|
||||
icon: 'c-svg heading2',
|
||||
stateSelector: 'h2',
|
||||
@@ -688,7 +688,7 @@
|
||||
},
|
||||
});
|
||||
|
||||
editor.addButton('aksrt_h3', {
|
||||
editor.addButton('jio_h3', {
|
||||
title: 'Heading 3',
|
||||
icon: 'c-svg heading3',
|
||||
stateSelector: 'h3',
|
||||
@@ -698,7 +698,7 @@
|
||||
},
|
||||
});
|
||||
|
||||
editor.addButton('aksrt_remove', {
|
||||
editor.addButton('jio_remove', {
|
||||
tooltip: i18n.removeBlock || '删除',
|
||||
icon: 'dashicon dashicons-no-alt',
|
||||
onclick: function () {
|
||||
@@ -732,56 +732,56 @@
|
||||
|
||||
if (['P', 'H1', 'H2', 'H3', 'H4', 'H5', 'UL', 'LI', 'STRONG', 'SPAN', 'CODE'].indexOf(nodeName) !== -1) {
|
||||
if (inRoot || (nodeName === 'SPAN' && parent && parent.parentElement && parent.parentElement.id === 'tinymce')) {
|
||||
bars.push('aksrt_h2', 'aksrt_h3');
|
||||
bars.push('jio_h2', 'jio_h3');
|
||||
}
|
||||
|
||||
if (hasSelection) {
|
||||
bars = ['H1', 'H2', 'H3', 'H4', 'H5'].indexOf(nodeName) === -1 ? ['bold', 'link', 'wp_code'] : [];
|
||||
bars.push('forecolor');
|
||||
if (nodeName === 'P' && editorCfg.canHide) bars.push('aksrt_hide');
|
||||
bars.push('aksrt_remove');
|
||||
if (nodeName === 'P' && editorCfg.canHide) bars.push('jio_hide');
|
||||
bars.push('jio_remove');
|
||||
return bars;
|
||||
}
|
||||
|
||||
if (innerText) {
|
||||
bars.push('bullist', 'numlist', 'aligncenter');
|
||||
if (nodeName === 'P' && inRoot) {
|
||||
bars.push('aksrt_quote');
|
||||
if (editorCfg.canHide) bars.push('aksrt_hide');
|
||||
bars.push('jio_quote');
|
||||
if (editorCfg.canHide) bars.push('jio_hide');
|
||||
}
|
||||
bars.push('aksrt_remove');
|
||||
bars.push('jio_remove');
|
||||
} else {
|
||||
bars.push('bullist', 'aksrt_quote');
|
||||
if (editorCfg.canHide) bars.push('aksrt_hide');
|
||||
if (editorCfg.canUploadImage) bars.push('aksrt_image');
|
||||
bars.push('aksrt_video', 'aksrt_precode');
|
||||
bars.push('bullist', 'jio_quote');
|
||||
if (editorCfg.canHide) bars.push('jio_hide');
|
||||
if (editorCfg.canUploadImage) bars.push('jio_image');
|
||||
bars.push('jio_video', 'jio_precode');
|
||||
}
|
||||
}
|
||||
|
||||
if (!bars.length && (nodeName === 'DIV' || nodeName === 'PRE') && !(element.classList && element.classList.contains('file-download-name'))) {
|
||||
bars.push('aksrt_remove');
|
||||
bars.push('jio_remove');
|
||||
}
|
||||
|
||||
return bars;
|
||||
}
|
||||
|
||||
function registerEditorTools() {
|
||||
if (!window.tinymce || !window.tinymce.PluginManager || window.aksrtSubmitEditorToolsRegistered) {
|
||||
if (!window.tinymce || !window.tinymce.PluginManager || window.jioSubmitEditorToolsRegistered) {
|
||||
return false;
|
||||
}
|
||||
window.aksrtSubmitEditorToolsRegistered = true;
|
||||
window.jioSubmitEditorToolsRegistered = true;
|
||||
|
||||
window.tinymce.PluginManager.add('aksrt_editor_tools', function (editor) {
|
||||
window.tinymce.PluginManager.add('jio_editor_tools', function (editor) {
|
||||
bindCharacterCount(editor);
|
||||
|
||||
if (editorCfg.canUploadImage) {
|
||||
var imageBatch = imageBatchLimit();
|
||||
editor.addButton('aksrt_image', {
|
||||
editor.addButton('jio_image', {
|
||||
text: '',
|
||||
icon: 'image',
|
||||
tooltip: i18n.insertImage || '插入图片',
|
||||
onclick: function () {
|
||||
window.AksrtSubmitMedia.open({
|
||||
window.JioSubmitMedia.open({
|
||||
type: 'image', multiple: imageBatch.multiple, maxItems: imageBatch.maxItems,
|
||||
onSelect: function (items) {
|
||||
editor.insertContent(items.map(function (item) { return mediaMarkup('image', item); }).join('') + '<p></p>');
|
||||
@@ -792,12 +792,12 @@
|
||||
});
|
||||
}
|
||||
|
||||
editor.addButton('aksrt_video', {
|
||||
editor.addButton('jio_video', {
|
||||
text: '',
|
||||
icon: 'media',
|
||||
tooltip: i18n.insertVideo || '插入视频',
|
||||
onclick: function () {
|
||||
window.AksrtSubmitMedia.open({
|
||||
window.JioSubmitMedia.open({
|
||||
type: 'video', multiple: false,
|
||||
onSelect: function (item) {
|
||||
editor.insertContent(mediaMarkup('video', item) + '<p></p>');
|
||||
@@ -812,12 +812,12 @@
|
||||
});
|
||||
|
||||
if (editorCfg.canUploadFile) {
|
||||
editor.addButton('aksrt_file', {
|
||||
editor.addButton('jio_file', {
|
||||
text: '',
|
||||
icon: 'upload',
|
||||
tooltip: i18n.insertFile || '上传附件',
|
||||
onclick: function () {
|
||||
window.AksrtSubmitMedia.open({
|
||||
window.JioSubmitMedia.open({
|
||||
type: 'file', multiple: false,
|
||||
onSelect: function (item) {
|
||||
editor.insertContent(mediaMarkup('file', item) + '<p></p>');
|
||||
@@ -828,7 +828,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
editor.addButton('aksrt_quote', {
|
||||
editor.addButton('jio_quote', {
|
||||
text: '',
|
||||
icon: 'blockquote',
|
||||
tooltip: i18n.quote || '引言',
|
||||
@@ -842,7 +842,7 @@
|
||||
],
|
||||
});
|
||||
|
||||
editor.addButton('aksrt_precode', {
|
||||
editor.addButton('jio_precode', {
|
||||
text: '',
|
||||
icon: 'code',
|
||||
tooltip: i18n.highlightCode || '高亮代码',
|
||||
@@ -863,8 +863,8 @@
|
||||
{
|
||||
text: i18n.loginVisible || '登录可见',
|
||||
type: 'login',
|
||||
open: '[aksrt_hide mode="login"]',
|
||||
close: '[/aksrt_hide]',
|
||||
open: '[jio_hide mode="login"]',
|
||||
close: '[/jio_hide]',
|
||||
},
|
||||
{
|
||||
text: i18n.vipVisible || 'VIP 可见',
|
||||
@@ -889,7 +889,7 @@
|
||||
},
|
||||
};
|
||||
});
|
||||
editor.addButton('aksrt_hide', {
|
||||
editor.addButton('jio_hide', {
|
||||
text: '',
|
||||
icon: 'preview',
|
||||
tooltip: i18n.hiddenContent || '隐藏内容',
|
||||
@@ -907,7 +907,7 @@
|
||||
}
|
||||
|
||||
registerEditorTools();
|
||||
if (!window.aksrtSubmitEditorToolsRegistered) {
|
||||
if (!window.jioSubmitEditorToolsRegistered) {
|
||||
var retryCount = 0;
|
||||
var retryRegistration = function () {
|
||||
if (registerEditorTools()) {
|
||||
|
||||
Reference in new issue
Block a user