Fix canvas formatting persistence and editor interactions
This commit is contained in:
@@ -9,6 +9,7 @@ use RuntimeException;
|
|||||||
final class CanvasStyle
|
final class CanvasStyle
|
||||||
{
|
{
|
||||||
public const PAGE = ['hero', 'heading', 'accent', 'lead', 'eyebrow', 'image', 'actions', 'navigation', 'breadcrumbs'];
|
public const PAGE = ['hero', 'heading', 'accent', 'lead', 'eyebrow', 'image', 'actions', 'navigation', 'breadcrumbs'];
|
||||||
|
public const MIN_MEDIA_SCALE = 1;
|
||||||
public const SECTION = ['section', 'title', 'lead', 'body'];
|
public const SECTION = ['section', 'title', 'lead', 'body'];
|
||||||
|
|
||||||
private const PROPERTIES = [
|
private const PROPERTIES = [
|
||||||
@@ -82,7 +83,7 @@ final class CanvasStyle
|
|||||||
|| ($textLength += strlen($run[0])) > 2400 || !mb_check_encoding($run[0], 'UTF-8')) {
|
|| ($textLength += strlen($run[0])) > 2400 || !mb_check_encoding($run[0], 'UTF-8')) {
|
||||||
throw new RuntimeException('文字格式无效。');
|
throw new RuntimeException('文字格式无效。');
|
||||||
}
|
}
|
||||||
$cleanRuns[] = [$run[0], self::classList($run[1], textOnly: true)];
|
$cleanRuns[] = [self::lineBreaks($run[0]), self::classList($run[1], textOnly: true)];
|
||||||
}
|
}
|
||||||
if ($classes !== '' || $cleanRuns !== []) {
|
if ($classes !== '' || $cleanRuns !== []) {
|
||||||
$styles[$role] = ['classes' => $classes, 'runs' => $cleanRuns];
|
$styles[$role] = ['classes' => $classes, 'runs' => $cleanRuns];
|
||||||
@@ -141,15 +142,21 @@ final class CanvasStyle
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function lineBreaks(string $text): string
|
||||||
|
{
|
||||||
|
return str_replace(["\r\n", "\r"], "\n", $text);
|
||||||
|
}
|
||||||
|
|
||||||
public static function text(array $styles, string $role, string $plain): string
|
public static function text(array $styles, string $role, string $plain): string
|
||||||
{
|
{
|
||||||
|
$plain = self::lineBreaks($plain);
|
||||||
$runs = $styles[$role]['runs'] ?? [];
|
$runs = $styles[$role]['runs'] ?? [];
|
||||||
if ($runs === [] || trim(implode('', array_column($runs, 0))) !== $plain) {
|
if ($runs === [] || self::lineBreaks(trim(implode('', array_column($runs, 0)))) !== $plain) {
|
||||||
return str_replace(["\r\n", "\r", "\n"], '<br>', View::escape($plain));
|
return str_replace("\n", '<br>', View::escape($plain));
|
||||||
}
|
}
|
||||||
$markup = '';
|
$markup = '';
|
||||||
foreach ($runs as [$text, $class]) {
|
foreach ($runs as [$text, $class]) {
|
||||||
$escaped = str_replace("\n", '<br>', View::escape($text));
|
$escaped = str_replace("\n", '<br>', View::escape(self::lineBreaks($text)));
|
||||||
$markup .= $class === '' ? $escaped : '<span class="' . View::escape($class) . '">' . $escaped . '</span>';
|
$markup .= $class === '' ? $escaped : '<span class="' . View::escape($class) . '">' . $escaped . '</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,7 +182,7 @@ final class CanvasStyle
|
|||||||
$css .= '.' . self::PREFIX . "$key-$value{{$property}:{$value}px!important}\n";
|
$css .= '.' . self::PREFIX . "$key-$value{{$property}:{$value}px!important}\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for ($width = 10; $width <= 100; $width++) {
|
for ($width = self::MIN_MEDIA_SCALE; $width <= 100; $width++) {
|
||||||
$css .= ".studio-media-{$width}{--studio-media-factor:calc({$width} / 100)}\n";
|
$css .= ".studio-media-{$width}{--studio-media-factor:calc({$width} / 100)}\n";
|
||||||
}
|
}
|
||||||
foreach (self::TYPOGRAPHY as $key => $value) {
|
foreach (self::TYPOGRAPHY as $key => $value) {
|
||||||
|
|||||||
@@ -32,6 +32,10 @@ final class Licenses
|
|||||||
'url' => 'https://jquery.com/', 'file' => $root . '/public/assets/jquery-LICENSE.txt'],
|
'url' => 'https://jquery.com/', 'file' => $root . '/public/assets/jquery-LICENSE.txt'],
|
||||||
'toast-ui-editor' => ['name' => 'TOAST UI Editor', 'version' => self::declaredVersion($editor, '~@version\h+' . $version . '~'), 'license' => 'MIT',
|
'toast-ui-editor' => ['name' => 'TOAST UI Editor', 'version' => self::declaredVersion($editor, '~@version\h+' . $version . '~'), 'license' => 'MIT',
|
||||||
'url' => 'https://github.com/nhn/tui.editor', 'file' => $root . '/public/assets/vendor/toastui/LICENSE'],
|
'url' => 'https://github.com/nhn/tui.editor', 'file' => $root . '/public/assets/vendor/toastui/LICENSE'],
|
||||||
|
'codemirror' => ['name' => 'CodeMirror', 'version' => '5.65.21', 'license' => 'MIT',
|
||||||
|
'url' => 'https://github.com/codemirror/codemirror5', 'file' => $root . '/public/assets/vendor/codemirror/LICENSE'],
|
||||||
|
'js-beautify' => ['name' => 'JS Beautifier', 'version' => '1.15.4', 'license' => 'MIT',
|
||||||
|
'url' => 'https://github.com/beautifier/js-beautify', 'file' => $root . '/public/assets/vendor/js-beautify/LICENSE'],
|
||||||
'geist' => ['name' => 'Geist', 'license' => 'OFL-1.1',
|
'geist' => ['name' => 'Geist', 'license' => 'OFL-1.1',
|
||||||
'url' => 'https://github.com/vercel/geist-font', 'file' => $root . '/public/assets/geist-OFL.txt'],
|
'url' => 'https://github.com/vercel/geist-font', 'file' => $root . '/public/assets/geist-OFL.txt'],
|
||||||
'dompurify' => ['name' => 'DOMPurify', 'version' => self::declaredVersion($editor, '~@license DOMPurify\h+' . $version . '~'), 'license' => 'Apache-2.0 / MPL-2.0',
|
'dompurify' => ['name' => 'DOMPurify', 'version' => self::declaredVersion($editor, '~@license DOMPurify\h+' . $version . '~'), 'license' => 'Apache-2.0 / MPL-2.0',
|
||||||
|
|||||||
@@ -329,6 +329,9 @@ class AdminController
|
|||||||
foreach (['title', 'description', 'heading', 'accent', 'lead', 'image', 'alt'] as $field) {
|
foreach (['title', 'description', 'heading', 'accent', 'lead', 'image', 'alt'] as $field) {
|
||||||
$data[$field] = $this->input($request, $field);
|
$data[$field] = $this->input($request, $field);
|
||||||
}
|
}
|
||||||
|
foreach (['heading', 'accent', 'lead'] as $field) {
|
||||||
|
$data[$field] = CanvasStyle::lineBreaks($data[$field]);
|
||||||
|
}
|
||||||
$data['name'] = $request->post('name') === null ? $page['name'] : $this->input($request, 'name');
|
$data['name'] = $request->post('name') === null ? $page['name'] : $this->input($request, 'name');
|
||||||
if ($layout) {
|
if ($layout) {
|
||||||
$data['title'] = $data['name'];
|
$data['title'] = $data['name'];
|
||||||
@@ -392,7 +395,7 @@ class AdminController
|
|||||||
(!$layout && $page['page_type'] === 'page' && $data['status'] === 'published' && $data['description'] === '') || mb_strlen($data['description']) > 300 ||
|
(!$layout && $page['page_type'] === 'page' && $data['status'] === 'published' && $data['description'] === '') || mb_strlen($data['description']) > 300 ||
|
||||||
(($data['visibility']['hero'] ?? true) && !array_key_exists('heroHtml', $data['presentation']) && $data['heading'] === '') || mb_strlen($data['heading'] . $data['accent']) > 110 ||
|
(($data['visibility']['hero'] ?? true) && !array_key_exists('heroHtml', $data['presentation']) && $data['heading'] === '') || mb_strlen($data['heading'] . $data['accent']) > 110 ||
|
||||||
mb_strlen($data['lead']) > 600 || mb_strlen($data['alt']) > 200 ||
|
mb_strlen($data['lead']) > 600 || mb_strlen($data['alt']) > 200 ||
|
||||||
($data['image_scale'] !== 0 && ($data['image_scale'] < 10 || $data['image_scale'] > 100)) ||
|
($data['image_scale'] !== 0 && ($data['image_scale'] < CanvasStyle::MIN_MEDIA_SCALE || $data['image_scale'] > 100)) ||
|
||||||
strlen($data['image']) > 1000 || ($data['image'] !== '' && !Html::url($data['image'], true))) {
|
strlen($data['image']) > 1000 || ($data['image'] !== '' && !Html::url($data['image'], true))) {
|
||||||
throw new RuntimeException('请检查页面标题、说明、图片地址和按钮链接。');
|
throw new RuntimeException('请检查页面标题、说明、图片地址和按钮链接。');
|
||||||
}
|
}
|
||||||
@@ -414,7 +417,7 @@ class AdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $this->render($request, 'admin-page', [
|
return $this->render($request, 'admin-page', [
|
||||||
'title' => '编辑 ' . $page['name'], 'page' => $page, 'categories' => $repo->categories(), 'wideAdmin' => true, 'error' => $error, 'saved' => $request->get('saved') === '1',
|
'title' => '编辑 ' . $page['name'], 'page' => $page, 'categories' => $repo->categories(), 'wideAdmin' => true, 'canvasSourceEditor' => true, 'error' => $error, 'saved' => $request->get('saved') === '1',
|
||||||
'pageTemplateDrawer' => !$layout, 'designs' => DesignLibrary::all(), 'layout' => $layout, 'layoutDefault' => $default,
|
'pageTemplateDrawer' => !$layout, 'designs' => DesignLibrary::all(), 'layout' => $layout, 'layoutDefault' => $default,
|
||||||
'layoutBase' => $layout && ($site['layout_defaults'][$layoutKind] ?? null) === $layout['id'],
|
'layoutBase' => $layout && ($site['layout_defaults'][$layoutKind] ?? null) === $layout['id'],
|
||||||
'siteName' => $site['name'], 'layoutHasMember' => $layoutKind === 'header' && LayoutPage::hasMember($page['sections']),
|
'siteName' => $site['name'], 'layoutHasMember' => $layoutKind === 'header' && LayoutPage::hasMember($page['sections']),
|
||||||
|
|||||||
@@ -31,6 +31,12 @@ $active = match (true) {
|
|||||||
<link rel="stylesheet" href="/assets/page-template-drawer.css">
|
<link rel="stylesheet" href="/assets/page-template-drawer.css">
|
||||||
<script src="/assets/page-template-drawer.js" defer></script>
|
<script src="/assets/page-template-drawer.js" defer></script>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
<?php if (!empty($canvasSourceEditor)): ?>
|
||||||
|
<link rel="stylesheet" href="/assets/vendor/codemirror/codemirror.min.css">
|
||||||
|
<script src="/assets/vendor/codemirror/codemirror.min.js" defer></script>
|
||||||
|
<script src="/assets/vendor/codemirror/xml.min.js" defer></script>
|
||||||
|
<script src="/assets/vendor/js-beautify/beautify-html.min.js" defer></script>
|
||||||
|
<?php endif ?>
|
||||||
<?php if (!empty($articleEditor)): ?>
|
<?php if (!empty($articleEditor)): ?>
|
||||||
<link rel="stylesheet" href="/assets/vendor/toastui/toastui-editor.min.css">
|
<link rel="stylesheet" href="/assets/vendor/toastui/toastui-editor.min.css">
|
||||||
<script src="<?= $e(Assets::TOAST_UI_EDITOR) ?>" defer></script>
|
<script src="<?= $e(Assets::TOAST_UI_EDITOR) ?>" defer></script>
|
||||||
@@ -78,7 +84,21 @@ $active = match (true) {
|
|||||||
<label>查找资源<input type="search" data-media-query placeholder="搜索文件名或资源路径"></label>
|
<label>查找资源<input type="search" data-media-query placeholder="搜索文件名或资源路径"></label>
|
||||||
<p data-picker-status role="status"></p>
|
<p data-picker-status role="status"></p>
|
||||||
<div class="picker-grid" data-picker-items></div>
|
<div class="picker-grid" data-picker-items></div>
|
||||||
<a class="back-link" href="/admin/media" target="_blank" rel="noopener noreferrer">打开媒体库上传</a>
|
<div class="actions picker-actions">
|
||||||
|
<button class="button button-outline" type="button" data-refresh-picker><?= View::fragment('studio-icon', ['icon' => 'refresh']) ?>刷新资源</button>
|
||||||
|
<a class="back-link" href="/admin/media" target="_blank" rel="noopener noreferrer">打开媒体库上传</a>
|
||||||
|
</div>
|
||||||
|
</dialog>
|
||||||
|
<dialog class="media-picker admin-action-dialog" id="admin-action-dialog" aria-labelledby="admin-action-heading">
|
||||||
|
<form class="admin-form" method="dialog">
|
||||||
|
<h2 id="admin-action-heading" data-action-title></h2>
|
||||||
|
<p data-action-message hidden></p>
|
||||||
|
<label data-action-field hidden><span data-action-label></span><input data-action-value></label>
|
||||||
|
<div class="actions">
|
||||||
|
<button class="button button-primary" data-action-accept value="accept" type="submit">确定</button>
|
||||||
|
<button class="button button-outline" data-action-cancel type="button">取消</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</dialog>
|
</dialog>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
+18
-4
@@ -91,7 +91,7 @@ $systemLabel = SystemPage::TYPES[$page['page_type']] ?? null;
|
|||||||
<button type="button" data-element-<?= $action ?> aria-label="<?= $label ?>" title="<?= $label ?>"><?= View::fragment('studio-icon', compact('icon')) ?></button>
|
<button type="button" data-element-<?= $action ?> aria-label="<?= $label ?>" title="<?= $label ?>"><?= View::fragment('studio-icon', compact('icon')) ?></button>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</div>
|
</div>
|
||||||
<button class="studio-media-handle" type="button" role="slider" aria-label="媒体宽度" aria-valuemin="10" aria-valuemax="100" aria-valuenow="100" data-media-handle hidden></button>
|
<button class="studio-media-handle" type="button" role="slider" aria-label="媒体宽度" aria-valuemin="<?= CanvasStyle::MIN_MEDIA_SCALE ?>" aria-valuemax="100" aria-valuenow="100" data-media-handle hidden></button>
|
||||||
<div class="studio-media-sizing" data-media-sizing hidden>
|
<div class="studio-media-sizing" data-media-sizing hidden>
|
||||||
<output data-media-size aria-hidden="true"></output>
|
<output data-media-size aria-hidden="true"></output>
|
||||||
<button class="button button-outline" type="button" data-reset-media>原始尺寸</button>
|
<button class="button button-outline" type="button" data-reset-media>原始尺寸</button>
|
||||||
@@ -103,7 +103,10 @@ $systemLabel = SystemPage::TYPES[$page['page_type']] ?? null;
|
|||||||
<div class="admin-heading compact"><h2 id="canvas-source-heading">编辑区块 HTML</h2></div>
|
<div class="admin-heading compact"><h2 id="canvas-source-heading">编辑区块 HTML</h2></div>
|
||||||
<form class="admin-form" method="dialog">
|
<form class="admin-form" method="dialog">
|
||||||
<label>源代码区域<select data-source-part></select></label>
|
<label>源代码区域<select data-source-part></select></label>
|
||||||
<label>HTML<textarea data-source-code rows="15" spellcheck="false" autocapitalize="off" maxlength="300000"></textarea></label>
|
<div>
|
||||||
|
<label for="canvas-source-code">HTML 源码</label>
|
||||||
|
<textarea id="canvas-source-code" data-source-code rows="15" spellcheck="false" autocapitalize="off" maxlength="300000" wrap="off"></textarea>
|
||||||
|
</div>
|
||||||
<p class="field-note" data-source-hint></p>
|
<p class="field-note" data-source-hint></p>
|
||||||
<p class="feedback error" data-source-error role="alert" hidden></p>
|
<p class="feedback error" data-source-error role="alert" hidden></p>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
@@ -118,6 +121,17 @@ $systemLabel = SystemPage::TYPES[$page['page_type']] ?? null;
|
|||||||
<form class="admin-form" method="dialog">
|
<form class="admin-form" method="dialog">
|
||||||
<?php foreach (['p' => ['内边距', 0], 'm' => ['外边距', -128]] as $prefix => [$label, $min]): ?>
|
<?php foreach (['p' => ['内边距', 0], 'm' => ['外边距', -128]] as $prefix => [$label, $min]): ?>
|
||||||
<fieldset class="admin-options canvas-spacing-fields"><legend><?= $label ?>(px)</legend>
|
<fieldset class="admin-options canvas-spacing-fields"><legend><?= $label ?>(px)</legend>
|
||||||
|
<label class="canvas-spacing-preset">四边预设
|
||||||
|
<select data-spacing-preset>
|
||||||
|
<option value="">自定义</option>
|
||||||
|
<option value="template">恢复默认</option>
|
||||||
|
<option value="0">无间距 · 0 px</option>
|
||||||
|
<option value="8">紧凑 · 8 px</option>
|
||||||
|
<option value="16">常规 · 16 px</option>
|
||||||
|
<option value="24">宽松 · 24 px</option>
|
||||||
|
<option value="32">大间距 · 32 px</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
<?php foreach (['t' => '上', 'r' => '右', 'b' => '下', 'l' => '左'] as $side => $direction): ?>
|
<?php foreach (['t' => '上', 'r' => '右', 'b' => '下', 'l' => '左'] as $side => $direction): ?>
|
||||||
<label><?= $direction ?><input name="<?= $prefix . $side ?>" type="number" min="<?= $min ?>" max="128" step="1" placeholder="默认"></label>
|
<label><?= $direction ?><input name="<?= $prefix . $side ?>" type="number" min="<?= $min ?>" max="128" step="1" placeholder="默认"></label>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
@@ -246,8 +260,8 @@ $systemLabel = SystemPage::TYPES[$page['page_type']] ?? null;
|
|||||||
];
|
];
|
||||||
?>
|
?>
|
||||||
<?php foreach ($contentFields as $field => $value): ?>
|
<?php foreach ($contentFields as $field => $value): ?>
|
||||||
<?php if ($field === 'quicklinks'): ?>
|
<?php if (in_array($field, ['heading', 'accent', 'lead', 'quicklinks'], true)): ?>
|
||||||
<textarea name="quicklinks" hidden><?= $e($value) ?></textarea>
|
<textarea name="<?= $e($field) ?>" hidden><?= $e($value) ?></textarea>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<input type="hidden" name="<?= $e($field) ?>" value="<?= $e($value) ?>">
|
<input type="hidden" name="<?= $e($field) ?>" value="<?= $e($value) ?>">
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|||||||
@@ -112,6 +112,7 @@
|
|||||||
.canvas-format-tools [aria-pressed=true] { background: var(--accent-light); color: var(--accent-deep); }
|
.canvas-format-tools [aria-pressed=true] { background: var(--accent-light); color: var(--accent-deep); }
|
||||||
.canvas-spacing-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
|
.canvas-spacing-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
|
||||||
.canvas-spacing-fields input { padding-inline: .4rem; }
|
.canvas-spacing-fields input { padding-inline: .4rem; }
|
||||||
|
.canvas-spacing-preset { grid-column: 1 / -1; grid-template-columns: max-content minmax(0, 15rem); align-items: center; }
|
||||||
.studio-canvas-toolbar button:disabled { opacity: .5; cursor: default; }
|
.studio-canvas-toolbar button:disabled { opacity: .5; cursor: default; }
|
||||||
.preview-selector { display: flex; gap: .35rem; flex-wrap: wrap; }
|
.preview-selector { display: flex; gap: .35rem; flex-wrap: wrap; }
|
||||||
.preview-selector [aria-pressed="true"] { background: var(--accent-light); color: var(--accent-deep); }
|
.preview-selector [aria-pressed="true"] { background: var(--accent-light); color: var(--accent-deep); }
|
||||||
@@ -416,6 +417,17 @@
|
|||||||
|
|
||||||
.canvas-source { width: min(56rem, calc(100% - 2rem)); }
|
.canvas-source { width: min(56rem, calc(100% - 2rem)); }
|
||||||
.canvas-source textarea { font: .9rem / 1.55 var(--mono); tab-size: 4; }
|
.canvas-source textarea { font: .9rem / 1.55 var(--mono); tab-size: 4; }
|
||||||
|
.canvas-source .CodeMirror {
|
||||||
|
height: clamp(12rem, 50vh, 32rem);
|
||||||
|
margin-top: .4rem;
|
||||||
|
border: 1px solid var(--line);
|
||||||
|
border-radius: .5rem;
|
||||||
|
font: .9rem / 1.55 var(--mono);
|
||||||
|
}
|
||||||
|
.canvas-source .CodeMirror-focused { outline: 2px solid var(--accent); outline-offset: 1px; }
|
||||||
|
.picker-actions { justify-content: flex-start; margin-top: .85rem; }
|
||||||
|
.admin-action-dialog { max-width: min(30rem, calc(100% - 2rem)); }
|
||||||
|
.admin-action-dialog h2, #media-picker h2 { margin: 0; font-size: 1.45rem; letter-spacing: -.018em; }
|
||||||
.canvas-image-display { display: flex; align-items: center; gap: .35rem; font-size: .85rem; }
|
.canvas-image-display { display: flex; align-items: center; gap: .35rem; font-size: .85rem; }
|
||||||
.canvas-image-display select, .canvas-format-tools input[type=color] {
|
.canvas-image-display select, .canvas-format-tools input[type=color] {
|
||||||
background: var(--white); border: 1px solid var(--line); border-radius: .35rem;
|
background: var(--white); border: 1px solid var(--line); border-radius: .35rem;
|
||||||
|
|||||||
+31
-2
@@ -1,6 +1,32 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
jQuery(function ($) {
|
jQuery(function ($) {
|
||||||
|
const $actionDialog = $('#admin-action-dialog');
|
||||||
|
const $actionField = $actionDialog.find('[data-action-field]');
|
||||||
|
const $actionValue = $actionField.find('[data-action-value]');
|
||||||
|
|
||||||
|
window.laySiteAction = function ({title, message = '', label, value = '', readOnly = false, accept = '确定'}) {
|
||||||
|
const dialog = $actionDialog.get(0);
|
||||||
|
if (!dialog || dialog.open) return Promise.resolve(null);
|
||||||
|
const hasInput = Boolean(label);
|
||||||
|
$actionDialog.find('[data-action-title]').text(title);
|
||||||
|
$actionDialog.find('[data-action-message]').text(message).prop('hidden', !message);
|
||||||
|
$actionDialog.find('[data-action-label]').text(label || '');
|
||||||
|
$actionField.prop('hidden', !hasInput);
|
||||||
|
$actionValue.val(value).prop({disabled: !hasInput, readOnly});
|
||||||
|
$actionDialog.find('[data-action-accept]').text(accept);
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
dialog.returnValue = '';
|
||||||
|
$actionDialog.one('close', () => {
|
||||||
|
resolve(dialog.returnValue === 'accept' ? (hasInput ? $actionValue.val() : true) : null);
|
||||||
|
});
|
||||||
|
dialog.showModal();
|
||||||
|
if (hasInput) $actionValue.trigger('focus').trigger('select');
|
||||||
|
else $actionDialog.find('[data-action-cancel]').trigger('focus');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
$actionDialog.on('click', '[data-action-cancel]', () => $actionDialog.get(0).close());
|
||||||
|
|
||||||
$('[data-page-layout-editor]').each(function () {
|
$('[data-page-layout-editor]').each(function () {
|
||||||
const {pageLayoutEditor: kind, defaultId} = this.dataset;
|
const {pageLayoutEditor: kind, defaultId} = this.dataset;
|
||||||
const $link = $(this);
|
const $link = $(this);
|
||||||
@@ -114,12 +140,15 @@ jQuery(function ($) {
|
|||||||
if (event.target.form?.method.toLowerCase() === 'post') clearSavedStatus();
|
if (event.target.form?.method.toLowerCase() === 'post') clearSavedStatus();
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
$('form[method="post"]').on('submit', function (event) {
|
$('form[method="post"]').on('submit', async function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const $form = $(this);
|
const $form = $(this);
|
||||||
if ($form.attr('aria-busy') === 'true') return;
|
if ($form.attr('aria-busy') === 'true') return;
|
||||||
const submitter = event.originalEvent?.submitter;
|
const submitter = event.originalEvent?.submitter;
|
||||||
if (submitter?.dataset.confirm && !window.confirm(submitter.dataset.confirm)) return;
|
if (submitter?.dataset.confirm && !await window.laySiteAction({
|
||||||
|
title: '确认操作', message: submitter.dataset.confirm,
|
||||||
|
accept: submitter.getAttribute('aria-label') || submitter.textContent.trim() || '确定',
|
||||||
|
})) return;
|
||||||
clearSavedStatus();
|
clearSavedStatus();
|
||||||
const action = $form.attr('action');
|
const action = $form.attr('action');
|
||||||
const isLogin = action === '/admin/login';
|
const isLogin = action === '/admin/login';
|
||||||
|
|||||||
@@ -38,8 +38,9 @@ jQuery(function ($) {
|
|||||||
$source.prop('hidden', true);
|
$source.prop('hidden', true);
|
||||||
$field.find('[data-article-editor-label]').removeAttr('for');
|
$field.find('[data-article-editor-label]').removeAttr('for');
|
||||||
$field.find('[data-insert-article-image]').prop('hidden', false).on('click', () => {
|
$field.find('[data-insert-article-image]').prop('hidden', false).on('click', () => {
|
||||||
$('#media-picker').triggerHandler('studio:pick', ['image/', (file) => {
|
const $picker = $('#media-picker');
|
||||||
const alt = window.prompt('图片替代文本(装饰图可留空)', file.label);
|
$picker.triggerHandler('studio:pick', ['image/', async (file) => {
|
||||||
|
const alt = await $picker.triggerHandler('studio:image-alt', [file]);
|
||||||
if (alt === null) return;
|
if (alt === null) return;
|
||||||
$status.empty();
|
$status.empty();
|
||||||
editor.focus();
|
editor.focus();
|
||||||
|
|||||||
@@ -415,6 +415,15 @@ progress { width: 100%; height: .8rem; accent-color: var(--accent); }
|
|||||||
|
|
||||||
:where(img, video, audio, .hero-visual)[class*="studio-media-"] { max-width: 100%; }
|
:where(img, video, audio, .hero-visual)[class*="studio-media-"] { max-width: 100%; }
|
||||||
:is(.rich, .hero-inner, .editor-preview, .studio-layout-block) [class*="studio-media-"] { width: var(--studio-media-width, auto); }
|
:is(.rich, .hero-inner, .editor-preview, .studio-layout-block) [class*="studio-media-"] { width: var(--studio-media-width, auto); }
|
||||||
|
.studio-media-1 { --studio-media-width: 1%; }
|
||||||
|
.studio-media-2 { --studio-media-width: 2%; }
|
||||||
|
.studio-media-3 { --studio-media-width: 3%; }
|
||||||
|
.studio-media-4 { --studio-media-width: 4%; }
|
||||||
|
.studio-media-5 { --studio-media-width: 5%; }
|
||||||
|
.studio-media-6 { --studio-media-width: 6%; }
|
||||||
|
.studio-media-7 { --studio-media-width: 7%; }
|
||||||
|
.studio-media-8 { --studio-media-width: 8%; }
|
||||||
|
.studio-media-9 { --studio-media-width: 9%; }
|
||||||
.studio-media-10 { --studio-media-width: 10%; }
|
.studio-media-10 { --studio-media-width: 10%; }
|
||||||
.studio-media-11 { --studio-media-width: 11%; }
|
.studio-media-11 { --studio-media-width: 11%; }
|
||||||
.studio-media-12 { --studio-media-width: 12%; }
|
.studio-media-12 { --studio-media-width: 12%; }
|
||||||
|
|||||||
+110
-41
@@ -8,16 +8,25 @@ jQuery(function ($) {
|
|||||||
let files = [];
|
let files = [];
|
||||||
let mediaType = '';
|
let mediaType = '';
|
||||||
let pickerRequest;
|
let pickerRequest;
|
||||||
|
const $pickerRefresh = $picker.find('[data-refresh-picker]');
|
||||||
|
const mediaUpdates = 'BroadcastChannel' in window ? new BroadcastChannel('laysite-media') : null;
|
||||||
|
|
||||||
|
function imageAlt(file) {
|
||||||
|
return window.laySiteAction({
|
||||||
|
title: '插入图片', label: '替代文本(装饰图可留空)', value: file.label, accept: '插入',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
$picker.on('studio:image-alt', (_event, file) => imageAlt(file));
|
||||||
|
|
||||||
function safeLink(value, media = false) {
|
function safeLink(value, media = false) {
|
||||||
return value !== '' && !/[\u0000-\u0020\u007f\\]/.test(value)
|
return value !== '' && !/[\u0000-\u0020\u007f\\]/.test(value)
|
||||||
&& (/^\/(?!\/)/.test(value) || (media ? /^https:\/\//i : /^(https?:\/\/|mailto:|tel:|#\S)/i).test(value));
|
&& (/^\/(?!\/)/.test(value) || (media ? /^https:\/\//i : /^(https?:\/\/|mailto:|tel:|#\S)/i).test(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
function mediaMarkup(file) {
|
async function mediaMarkup(file) {
|
||||||
let $node;
|
let $node;
|
||||||
if (file.mime.startsWith('image/')) {
|
if (file.mime.startsWith('image/')) {
|
||||||
const alt = window.prompt('图片替代文本(装饰图可留空)', file.label);
|
const alt = await imageAlt(file);
|
||||||
if (alt === null) return '';
|
if (alt === null) return '';
|
||||||
$node = $('<img>', {src: file.url, alt, loading: 'lazy'});
|
$node = $('<img>', {src: file.url, alt, loading: 'lazy'});
|
||||||
} else if (file.mime.startsWith('video/') || file.mime.startsWith('audio/')) {
|
} else if (file.mime.startsWith('video/') || file.mime.startsWith('audio/')) {
|
||||||
@@ -49,19 +58,32 @@ jQuery(function ($) {
|
|||||||
if (!$picker.length || typeof $picker.get(0).showModal !== 'function') return;
|
if (!$picker.length || typeof $picker.get(0).showModal !== 'function') return;
|
||||||
pick = callback;
|
pick = callback;
|
||||||
mediaType = type;
|
mediaType = type;
|
||||||
|
files = [];
|
||||||
$picker.find('[data-media-query]').val('');
|
$picker.find('[data-media-query]').val('');
|
||||||
$pickerItems.empty();
|
$pickerItems.empty();
|
||||||
$pickerStatus.text('加载资源…');
|
|
||||||
$picker.get(0).showModal();
|
$picker.get(0).showModal();
|
||||||
|
refreshPicker();
|
||||||
|
}
|
||||||
|
|
||||||
|
function refreshPicker() {
|
||||||
|
if (!$picker.get(0)?.open) return;
|
||||||
pickerRequest?.abort();
|
pickerRequest?.abort();
|
||||||
pickerRequest = $.getJSON('/admin/media/options').done(function (response) {
|
$pickerStatus.text('正在刷新资源…');
|
||||||
|
$pickerRefresh.prop('disabled', true);
|
||||||
|
pickerRequest = $.ajax({url: '/admin/media/options', dataType: 'json', cache: false}).done((response) => {
|
||||||
files = response.files;
|
files = response.files;
|
||||||
renderPicker();
|
renderPicker();
|
||||||
}).fail(function (_request, status) {
|
}).fail((_request, status) => {
|
||||||
if (status !== 'abort') $pickerStatus.text('媒体库暂时无法打开。');
|
if (status !== 'abort') $pickerStatus.text('媒体库暂时无法刷新,请重试。');
|
||||||
});
|
}).always(() => $pickerRefresh.prop('disabled', false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$picker.on('click', '[data-refresh-picker]', refreshPicker);
|
||||||
|
$(window).on('focus', refreshPicker);
|
||||||
|
$(document).on('visibilitychange', () => { if (!document.hidden) refreshPicker(); });
|
||||||
|
mediaUpdates?.addEventListener('message', (event) => { if (event.data === 'changed') refreshPicker(); });
|
||||||
|
$('form[action^="/admin/media"]').on('studio:saved', () => mediaUpdates?.postMessage('changed'));
|
||||||
|
|
||||||
$picker.on('studio:pick', (_event, type, callback) => openPicker(type, callback));
|
$picker.on('studio:pick', (_event, type, callback) => openPicker(type, callback));
|
||||||
$picker.on('input', '[data-media-query]', renderPicker);
|
$picker.on('input', '[data-media-query]', renderPicker);
|
||||||
$picker.on('click', '[data-close-picker]', () => $picker.get(0).close());
|
$picker.on('click', '[data-close-picker]', () => $picker.get(0).close());
|
||||||
@@ -78,14 +100,15 @@ jQuery(function ($) {
|
|||||||
openPicker($button.data('asset-type') || '', (file) => $input.val(file.url).trigger('input').trigger('focus'));
|
openPicker($button.data('asset-type') || '', (file) => $input.val(file.url).trigger('input').trigger('focus'));
|
||||||
});
|
});
|
||||||
|
|
||||||
$('[data-copy-asset]').on('click', function () {
|
$('[data-copy-asset]').on('click', async function () {
|
||||||
const $button = $(this);
|
const $button = $(this);
|
||||||
const url = $button.data('copy-asset');
|
const url = $button.data('copy-asset');
|
||||||
if (!navigator.clipboard) {
|
try {
|
||||||
window.prompt('复制资源路径', url);
|
await navigator.clipboard.writeText(url);
|
||||||
return;
|
$button.text('已复制');
|
||||||
|
} catch {
|
||||||
|
window.laySiteAction({title: '复制资源路径', label: '资源路径', value: url, readOnly: true, accept: '完成'});
|
||||||
}
|
}
|
||||||
navigator.clipboard.writeText(url).then(() => $button.text('已复制')).catch(() => window.prompt('复制资源路径', url));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('[data-media-library]').each(function () {
|
$('[data-media-library]').each(function () {
|
||||||
@@ -311,6 +334,8 @@ jQuery(function ($) {
|
|||||||
const bodyElements = 'a, article, blockquote, button, details, div, dl, dt, dd, figure, figcaption, footer, h1, h2, h3, h4, h5, h6, header, hr, li, nav, ol, p, pre, progress, section, summary, table, ul, td, th, caption, small';
|
const bodyElements = 'a, article, blockquote, button, details, div, dl, dt, dd, figure, figcaption, footer, h1, h2, h3, h4, h5, h6, header, hr, li, nav, ol, p, pre, progress, section, summary, table, ul, td, th, caption, small';
|
||||||
const mediaTargets = '[data-studio-hero-image], [data-studio-part="body"] img, [data-studio-part="body"] audio, [data-studio-part="body"] video';
|
const mediaTargets = '[data-studio-hero-image], [data-studio-part="body"] img, [data-studio-part="body"] audio, [data-studio-part="body"] video';
|
||||||
const $handle = $studio.find('[data-media-handle]');
|
const $handle = $studio.find('[data-media-handle]');
|
||||||
|
const minMediaWidth = Number($handle.attr('aria-valuemin'));
|
||||||
|
const pathGroups = '[data-studio-navigation], [data-studio-breadcrumbs]';
|
||||||
const $mediaSize = $sizing.find('[data-media-size]');
|
const $mediaSize = $sizing.find('[data-media-size]');
|
||||||
const mediaWidthClass = /^studio-media-\d+$/;
|
const mediaWidthClass = /^studio-media-\d+$/;
|
||||||
|
|
||||||
@@ -395,6 +420,7 @@ jQuery(function ($) {
|
|||||||
let saveComplete = false;
|
let saveComplete = false;
|
||||||
let syncPageFromInputs;
|
let syncPageFromInputs;
|
||||||
let spacingTarget;
|
let spacingTarget;
|
||||||
|
let sourceEditor;
|
||||||
|
|
||||||
function classesOf(node, textOnly = false) {
|
function classesOf(node, textOnly = false) {
|
||||||
const result = {};
|
const result = {};
|
||||||
@@ -450,15 +476,18 @@ jQuery(function ($) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function paintText(node, value, runs) {
|
function paintText(node, value, runs) {
|
||||||
const display = runs?.map(([text]) => text).join('').trim() === value ? runs : [[value, '']];
|
const lineBreaks = (text) => text.replace(/\r\n?/g, '\n');
|
||||||
|
const plain = lineBreaks(value);
|
||||||
|
const display = runs?.map(([text]) => lineBreaks(text)).join('').trim() === plain ? runs : [[plain, '']];
|
||||||
node.replaceChildren();
|
node.replaceChildren();
|
||||||
for (const [text, tokens] of display) {
|
for (const [text, tokens] of display) {
|
||||||
const parent = tokens ? doc.createElement('span') : node;
|
const parent = tokens ? doc.createElement('span') : node;
|
||||||
if (tokens) {
|
if (tokens) {
|
||||||
parent.className = tokens;
|
parent.className = tokens;
|
||||||
|
installMarkupColors(tokens);
|
||||||
node.append(parent);
|
node.append(parent);
|
||||||
}
|
}
|
||||||
text.split('\n').forEach((line, index) => {
|
lineBreaks(text).split('\n').forEach((line, index) => {
|
||||||
if (index) parent.append(doc.createElement('br'));
|
if (index) parent.append(doc.createElement('br'));
|
||||||
if (line) parent.append(line);
|
if (line) parent.append(line);
|
||||||
});
|
});
|
||||||
@@ -525,7 +554,10 @@ jQuery(function ($) {
|
|||||||
|
|
||||||
function setPageStyle(node, style) {
|
function setPageStyle(node, style) {
|
||||||
node.classList.remove(...Object.values(classesOf(node)));
|
node.classList.remove(...Object.values(classesOf(node)));
|
||||||
if (style?.classes) node.classList.add(...style.classes.split(' '));
|
if (style?.classes) {
|
||||||
|
installMarkupColors(style.classes);
|
||||||
|
node.classList.add(...style.classes.split(' '));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function canvasOrder() {
|
function canvasOrder() {
|
||||||
@@ -596,7 +628,7 @@ jQuery(function ($) {
|
|||||||
function openProperties(heading, values, apply, mime = null, allowEmptyUrl = false) {
|
function openProperties(heading, values, apply, mime = null, allowEmptyUrl = false) {
|
||||||
$properties.find('[data-property-heading]').text(heading);
|
$properties.find('[data-property-heading]').text(heading);
|
||||||
$propertyError.prop('hidden', true);
|
$propertyError.prop('hidden', true);
|
||||||
for (const key of ['label', 'note', 'url', 'alt', 'poster', 'quicklinks', 'value', 'max', 'buttonStyle', 'newTab']) {
|
for (const key of ['label', 'note', 'url', 'alt', 'poster', 'quicklinks', 'breadcrumbs', 'value', 'max', 'buttonStyle', 'newTab']) {
|
||||||
const visible = Object.hasOwn(values, key);
|
const visible = Object.hasOwn(values, key);
|
||||||
$propertyForm.find('[data-property-row="' + key + '"]').prop('hidden', !visible);
|
$propertyForm.find('[data-property-row="' + key + '"]').prop('hidden', !visible);
|
||||||
propertyInput(key).val(visible ? values[key] : '');
|
propertyInput(key).val(visible ? values[key] : '');
|
||||||
@@ -795,8 +827,14 @@ jQuery(function ($) {
|
|||||||
$spacingForm.find('input').each(function () {
|
$spacingForm.find('input').each(function () {
|
||||||
this.value = styles[this.name]?.slice(('studio-style-' + this.name + '-').length) || '';
|
this.value = styles[this.name]?.slice(('studio-style-' + this.name + '-').length) || '';
|
||||||
});
|
});
|
||||||
|
$spacingForm.find('[data-spacing-preset]').val('');
|
||||||
$spacing.get(0).showModal();
|
$spacing.get(0).showModal();
|
||||||
});
|
});
|
||||||
|
$spacingForm.on('change', '[data-spacing-preset]', function () {
|
||||||
|
if (this.value !== '') $(this).closest('fieldset').find('input').val(this.value === 'template' ? '' : this.value);
|
||||||
|
}).on('input', 'input', function () {
|
||||||
|
$(this).closest('fieldset').find('[data-spacing-preset]').val('');
|
||||||
|
});
|
||||||
$elementTools.on('click', '[data-element-parent]', () => {
|
$elementTools.on('click', '[data-element-parent]', () => {
|
||||||
const parent = parentElement(selectedElement);
|
const parent = parentElement(selectedElement);
|
||||||
if (!parent) return;
|
if (!parent) return;
|
||||||
@@ -822,8 +860,8 @@ jQuery(function ($) {
|
|||||||
const range = savedRange?.cloneRange();
|
const range = savedRange?.cloneRange();
|
||||||
const edit = (action, value) => editBody(body, range, action, value);
|
const edit = (action, value) => editBody(body, range, action, value);
|
||||||
if (command === 'media') {
|
if (command === 'media') {
|
||||||
openPicker('', (file) => {
|
openPicker('', async (file) => {
|
||||||
const markup = mediaMarkup(file);
|
const markup = await mediaMarkup(file);
|
||||||
if (markup) edit('insertHTML', markup);
|
if (markup) edit('insertHTML', markup);
|
||||||
});
|
});
|
||||||
} else if (command === 'link') {
|
} else if (command === 'link') {
|
||||||
@@ -1064,6 +1102,7 @@ jQuery(function ($) {
|
|||||||
renderLayers();
|
renderLayers();
|
||||||
};
|
};
|
||||||
paths[type] = {read, sync, write};
|
paths[type] = {read, sync, write};
|
||||||
|
heroControls.set('remove-' + type, () => write([]));
|
||||||
heroControls.set(type, () => {
|
heroControls.set(type, () => {
|
||||||
const field = crumb ? 'breadcrumbs' : 'quicklinks';
|
const field = crumb ? 'breadcrumbs' : 'quicklinks';
|
||||||
openProperties(config.heading, {[field]: $input.val()}, (values) => {
|
openProperties(config.heading, {[field]: $input.val()}, (values) => {
|
||||||
@@ -1287,11 +1326,14 @@ jQuery(function ($) {
|
|||||||
if (node) {
|
if (node) {
|
||||||
const bounds = previewBounds(node);
|
const bounds = previewBounds(node);
|
||||||
const x = getAlignment(node) === 'right' ? bounds.left : bounds.right;
|
const x = getAlignment(node) === 'right' ? bounds.left : bounds.right;
|
||||||
const y = (bounds.top + bounds.bottom) / 2;
|
const top = Math.max(0, bounds.top);
|
||||||
const visible = bounds.width > 0 && y >= 0 && y <= container.clientHeight
|
const bottom = Math.min(container.clientHeight, bounds.bottom);
|
||||||
&& x >= 0 && x <= container.clientWidth + 1;
|
const visible = bounds.width > 0 && bounds.right > 0 && bounds.left < container.clientWidth && bottom > top;
|
||||||
$handle.prop('hidden', !mediaDrag && !visible);
|
$handle.prop('hidden', !mediaDrag && !visible);
|
||||||
$handle.css({left: Math.max(11, Math.min(x, container.clientWidth - 11)), top: y});
|
$handle.css({
|
||||||
|
left: Math.max(11, Math.min(x, container.clientWidth - 11)),
|
||||||
|
top: Math.max(23, Math.min((top + bottom) / 2, container.clientHeight - 23)),
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
$handle.prop('hidden', true);
|
$handle.prop('hidden', true);
|
||||||
}
|
}
|
||||||
@@ -1380,10 +1422,11 @@ jQuery(function ($) {
|
|||||||
$elementTools.find('[data-element-copy]').prop('hidden', !canCopy);
|
$elementTools.find('[data-element-copy]').prop('hidden', !canCopy);
|
||||||
const sectionRoot = node.hasAttribute('data-studio-section');
|
const sectionRoot = node.hasAttribute('data-studio-section');
|
||||||
const hero = node.hasAttribute('data-studio-hero') && isHeroVisible();
|
const hero = node.hasAttribute('data-studio-hero') && isHeroVisible();
|
||||||
const deleteLabel = hero || node.dataset.studioField === 'heading' ? '删除首屏'
|
const pathGroup = node.matches(pathGroups);
|
||||||
|
const deleteLabel = pathGroup ? (node.hasAttribute('data-studio-navigation') ? '删除本页目录' : '删除面包屑') : hero || node.dataset.studioField === 'heading' ? '删除首屏'
|
||||||
: node.dataset.studioPart === 'title' || sectionRoot ? '删除区块' : '删除';
|
: node.dataset.studioPart === 'title' || sectionRoot ? '删除区块' : '删除';
|
||||||
$elementTools.find('[data-element-delete]').attr({'aria-label': deleteLabel, title: deleteLabel})
|
$elementTools.find('[data-element-delete]').attr({'aria-label': deleteLabel, title: deleteLabel})
|
||||||
.prop('hidden', !hero && !sectionRoot && !inBody && !selectedMedia && !node.matches(canvasFields));
|
.prop('hidden', !hero && !pathGroup && !sectionRoot && !inBody && !selectedMedia && !node.matches(canvasFields));
|
||||||
$elementTools.find('[data-element-properties]').prop('hidden', !hasProperties && !node.matches('[data-studio-navigation], [data-studio-breadcrumbs]'));
|
$elementTools.find('[data-element-properties]').prop('hidden', !hasProperties && !node.matches('[data-studio-navigation], [data-studio-breadcrumbs]'));
|
||||||
$layers.find('.studio-layer-row').filter((_, row) => $(row).data('canvasNode') === node).attr('aria-current', 'true');
|
$layers.find('.studio-layer-row').filter((_, row) => $(row).data('canvasNode') === node).attr('aria-current', 'true');
|
||||||
if (target) showMediaWidth(currentMediaWidth(target));
|
if (target) showMediaWidth(currentMediaWidth(target));
|
||||||
@@ -1411,7 +1454,10 @@ jQuery(function ($) {
|
|||||||
}
|
}
|
||||||
const inBody = Boolean(node.parentElement?.closest('[data-studio-part="body"]'));
|
const inBody = Boolean(node.parentElement?.closest('[data-studio-part="body"]'));
|
||||||
selectElement(null);
|
selectElement(null);
|
||||||
if (inBody) {
|
if (!copy && node.matches(pathGroups)) {
|
||||||
|
heroControls.get(node.hasAttribute('data-studio-breadcrumbs') ? 'remove-breadcrumbs' : 'remove-navigation')();
|
||||||
|
captureHistory();
|
||||||
|
} else if (inBody) {
|
||||||
if (copy) {
|
if (copy) {
|
||||||
const $clone = $(node.cloneNode(true));
|
const $clone = $(node.cloneNode(true));
|
||||||
$clone.find('[id]').addBack('[id]').removeAttr('id');
|
$clone.find('[id]').addBack('[id]').removeAttr('id');
|
||||||
@@ -1571,8 +1617,23 @@ jQuery(function ($) {
|
|||||||
}
|
}
|
||||||
$source.find('[data-source-reset]').prop('hidden', true);
|
$source.find('[data-source-reset]').prop('hidden', true);
|
||||||
}
|
}
|
||||||
for (const part of parts.values()) part.draft = part.original;
|
for (const [key, part] of parts) {
|
||||||
|
if (key === 'body' || key === 'hero') {
|
||||||
|
part.original = window.html_beautify?.(part.original, {indent_size: 2}) ?? part.original;
|
||||||
|
}
|
||||||
|
part.draft = part.original;
|
||||||
|
}
|
||||||
sourceParts = parts;
|
sourceParts = parts;
|
||||||
|
if (!sourceEditor && window.CodeMirror) {
|
||||||
|
sourceEditor = window.CodeMirror.fromTextArea($sourceCode.get(0), {
|
||||||
|
mode: {name: 'xml', htmlMode: true}, lineNumbers: true, lineWrapping: true,
|
||||||
|
indentUnit: 2, tabSize: 2, viewportMargin: 10,
|
||||||
|
});
|
||||||
|
sourceEditor.getInputField().setAttribute('aria-label', 'HTML 源码');
|
||||||
|
sourceEditor.on('change', (editor) => {
|
||||||
|
if (sourceParts) sourceParts.get($sourcePart.val()).draft = editor.getValue();
|
||||||
|
});
|
||||||
|
}
|
||||||
$sourcePart.empty();
|
$sourcePart.empty();
|
||||||
for (const [key, {label}] of parts) $('<option>', {value: key, text: label}).appendTo($sourcePart);
|
for (const [key, {label}] of parts) $('<option>', {value: key, text: label}).appendTo($sourcePart);
|
||||||
$sourcePart.prop('disabled', hero).triggerHandler('change');
|
$sourcePart.prop('disabled', hero).triggerHandler('change');
|
||||||
@@ -1581,11 +1642,18 @@ jQuery(function ($) {
|
|||||||
: '可编辑标题、简介和正文。区块外壳与动态文章列表由系统渲染。');
|
: '可编辑标题、简介和正文。区块外壳与动态文章列表由系统渲染。');
|
||||||
$sourceError.prop('hidden', true);
|
$sourceError.prop('hidden', true);
|
||||||
$source.get(0).showModal();
|
$source.get(0).showModal();
|
||||||
$sourceCode.trigger('focus');
|
if (sourceEditor) {
|
||||||
|
sourceEditor.refresh();
|
||||||
|
sourceEditor.focus();
|
||||||
|
} else $sourceCode.trigger('focus');
|
||||||
}
|
}
|
||||||
|
|
||||||
$sourcePart.on('change', () => {
|
$sourcePart.on('change', () => {
|
||||||
$sourceCode.val(sourceParts.get($sourcePart.val()).draft);
|
const draft = sourceParts.get($sourcePart.val()).draft;
|
||||||
|
if (sourceEditor) {
|
||||||
|
sourceEditor.setValue(draft);
|
||||||
|
sourceEditor.clearHistory();
|
||||||
|
} else $sourceCode.val(draft);
|
||||||
$sourceError.prop('hidden', true);
|
$sourceError.prop('hidden', true);
|
||||||
});
|
});
|
||||||
$sourceCode.on('input', () => { sourceParts.get($sourcePart.val()).draft = $sourceCode.val(); });
|
$sourceCode.on('input', () => { sourceParts.get($sourcePart.val()).draft = $sourceCode.val(); });
|
||||||
@@ -1791,7 +1859,7 @@ jQuery(function ($) {
|
|||||||
layerButton('down', !canDropLayer(node, adjacentLayer(node, 1), 'after')));
|
layerButton('down', !canDropLayer(node, adjacentLayer(node, 1), 'after')));
|
||||||
}
|
}
|
||||||
if (root && (entry || node.hasAttribute('data-studio-hero'))) $actions.append(layerButton('source'));
|
if (root && (entry || node.hasAttribute('data-studio-hero'))) $actions.append(layerButton('source'));
|
||||||
if (entry || layerContext(node) || node.hasAttribute('data-studio-hero')) $actions.append(layerButton('delete'));
|
if (entry || layerContext(node) || node.matches(pathGroups) || node.hasAttribute('data-studio-hero')) $actions.append(layerButton('delete'));
|
||||||
if (entry?.version != null) {
|
if (entry?.version != null) {
|
||||||
const icon = $layout.find('template[data-layer-icon="settings"]').get(0).content.cloneNode(true);
|
const icon = $layout.find('template[data-layer-icon="settings"]').get(0).content.cloneNode(true);
|
||||||
$('<a>', {class: 'button button-outline', href: $settings.attr('action') + '/' + entry.key,
|
$('<a>', {class: 'button button-outline', href: $settings.attr('action') + '/' + entry.key,
|
||||||
@@ -1937,10 +2005,11 @@ jQuery(function ($) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeModule(section, copy) {
|
async function changeModule(section, copy) {
|
||||||
if (!section) return;
|
if (!section) return;
|
||||||
if (!copy) {
|
if (!copy) {
|
||||||
if (window.confirm('删除此区块?保存页面后生效。')) {
|
const confirmed = await window.laySiteAction({title: '删除区块', message: '保存页面后生效,可在画布上撤销。', accept: '删除'});
|
||||||
|
if (confirmed && section.node.isConnected) {
|
||||||
removeSection(section);
|
removeSection(section);
|
||||||
$studio.find('[data-canvas-status]').text('区块已移除,保存页面后生效。');
|
$studio.find('[data-canvas-status]').text('区块已移除,保存页面后生效。');
|
||||||
}
|
}
|
||||||
@@ -1975,12 +2044,12 @@ jQuery(function ($) {
|
|||||||
const classes = node.getAttribute('class');
|
const classes = node.getAttribute('class');
|
||||||
setMediaWidth(node, 100);
|
setMediaWidth(node, 100);
|
||||||
const full = node.getBoundingClientRect();
|
const full = node.getBoundingClientRect();
|
||||||
setMediaWidth(node, 10);
|
setMediaWidth(node, minMediaWidth);
|
||||||
const narrow = node.getBoundingClientRect();
|
const narrow = node.getBoundingClientRect();
|
||||||
if (classes === null) node.removeAttribute('class');
|
if (classes === null) node.removeAttribute('class');
|
||||||
else node.setAttribute('class', classes);
|
else node.setAttribute('class', classes);
|
||||||
const fromLeft = getAlignment(node) === 'right';
|
const fromLeft = getAlignment(node) === 'right';
|
||||||
const edgeTravel = (fromLeft ? narrow.left - full.left : full.right - narrow.right) / .9;
|
const edgeTravel = (fromLeft ? narrow.left - full.left : full.right - narrow.right) / (1 - minMediaWidth / 100);
|
||||||
const available = edgeTravel > full.width * .15 ? edgeTravel : full.width;
|
const available = edgeTravel > full.width * .15 ? edgeTravel : full.width;
|
||||||
return {available, fromLeft, initialWidth: width || Math.round(100 * natural / (full.width || natural || 1))};
|
return {available, fromLeft, initialWidth: width || Math.round(100 * natural / (full.width || natural || 1))};
|
||||||
}
|
}
|
||||||
@@ -1988,7 +2057,7 @@ jQuery(function ($) {
|
|||||||
function resizeMedia(width) {
|
function resizeMedia(width) {
|
||||||
const node = sizingTarget();
|
const node = sizingTarget();
|
||||||
if (!node) return;
|
if (!node) return;
|
||||||
const next = width === null ? 0 : Math.round(Math.max(10, Math.min(100, width)));
|
const next = width === null ? 0 : Math.round(Math.max(minMediaWidth, Math.min(100, width)));
|
||||||
if (selectedMedia.hasAttribute('data-studio-hero-image')) pageInput('image_scale').val(next);
|
if (selectedMedia.hasAttribute('data-studio-hero-image')) pageInput('image_scale').val(next);
|
||||||
if (next !== currentMediaWidth(node)) setMediaWidth(node, next);
|
if (next !== currentMediaWidth(node)) setMediaWidth(node, next);
|
||||||
showMediaWidth(next);
|
showMediaWidth(next);
|
||||||
@@ -2019,7 +2088,7 @@ jQuery(function ($) {
|
|||||||
const step = event.shiftKey ? 10 : 1;
|
const step = event.shiftKey ? 10 : 1;
|
||||||
const {initialWidth} = measureMedia();
|
const {initialWidth} = measureMedia();
|
||||||
const increase = ['ArrowRight', 'ArrowUp'].includes(event.key);
|
const increase = ['ArrowRight', 'ArrowUp'].includes(event.key);
|
||||||
const next = {Home: 10, End: 100}[event.key] ?? initialWidth + (increase ? step : -step);
|
const next = {Home: minMediaWidth, End: 100}[event.key] ?? initialWidth + (increase ? step : -step);
|
||||||
resizeMedia(next);
|
resizeMedia(next);
|
||||||
});
|
});
|
||||||
$sizing.on('click', '[data-replace-media]', replaceMedia)
|
$sizing.on('click', '[data-replace-media]', replaceMedia)
|
||||||
@@ -2063,7 +2132,7 @@ jQuery(function ($) {
|
|||||||
$status.text('已插入' + $(this).text() + '。');
|
$status.text('已插入' + $(this).text() + '。');
|
||||||
};
|
};
|
||||||
if (this.dataset.elementMime) {
|
if (this.dataset.elementMime) {
|
||||||
openPicker(this.dataset.elementMime, (file) => add(mediaMarkup(file)));
|
openPicker(this.dataset.elementMime, async (file) => add(await mediaMarkup(file)));
|
||||||
} else {
|
} else {
|
||||||
add($presets.find('template[data-element="' + this.dataset.canvasElement + '"]').get(0).innerHTML);
|
add($presets.find('template[data-element="' + this.dataset.canvasElement + '"]').get(0).innerHTML);
|
||||||
}
|
}
|
||||||
@@ -2307,7 +2376,7 @@ jQuery(function ($) {
|
|||||||
const field = node.closest(canvasFields);
|
const field = node.closest(canvasFields);
|
||||||
const body = node.closest('[data-studio-part="body"]');
|
const body = node.closest('[data-studio-part="body"]');
|
||||||
const leaf = field || editableBodyElement(node);
|
const leaf = field || editableBodyElement(node);
|
||||||
const wrapper = node.closest('[data-studio-section], [data-studio-hero], [data-studio-navigation]');
|
const wrapper = node.closest('[data-studio-section], [data-studio-hero], ' + pathGroups);
|
||||||
selectBody(body);
|
selectBody(body);
|
||||||
selectElement(doc.getSelection()?.isCollapsed ? leaf || (body === node ? wrapper || body : body || wrapper) : null);
|
selectElement(doc.getSelection()?.isCollapsed ? leaf || (body === node ? wrapper || body : body || wrapper) : null);
|
||||||
});
|
});
|
||||||
@@ -2431,10 +2500,10 @@ jQuery(function ($) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$editor.on('mousedown', '[data-insert], [data-rich-media]', (event) => event.preventDefault());
|
$editor.on('mousedown', '[data-insert], [data-rich-media]', (event) => event.preventDefault());
|
||||||
$editor.on('click', '[data-insert]', function () {
|
$editor.on('click', '[data-insert]', async function () {
|
||||||
const command = $(this).data('insert');
|
const command = $(this).data('insert');
|
||||||
if (command === 'link') {
|
if (command === 'link') {
|
||||||
const href = window.prompt('输入链接地址', 'https://')?.trim();
|
const href = (await window.laySiteAction({title: '插入链接', label: '链接地址', value: 'https://', accept: '插入'}))?.trim();
|
||||||
if (!href) return;
|
if (!href) return;
|
||||||
if (!safeLink(href)) {
|
if (!safeLink(href)) {
|
||||||
$status.prop('hidden', false).text('请输入站内地址或有效的链接。');
|
$status.prop('hidden', false).text('请输入站内地址或有效的链接。');
|
||||||
@@ -2455,8 +2524,8 @@ jQuery(function ($) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$editor.on('click', '[data-rich-media]', function () {
|
$editor.on('click', '[data-rich-media]', function () {
|
||||||
openPicker('', (file) => {
|
openPicker('', async (file) => {
|
||||||
const markup = mediaMarkup(file);
|
const markup = await mediaMarkup(file);
|
||||||
if (markup) edit('insertHTML', markup);
|
if (markup) edit('insertHTML', markup);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (C) 2017 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
/* BASICS */.CodeMirror{/* Set height, width, borders, and global font properties here */font-family:monospace;height:300px;color:black;direction:ltr}/* PADDING */.CodeMirror-lines{padding:4px 0/* Vertical padding around content */}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px/* Horizontal padding of content */}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white/* The little square between H and V scrollbars */}/* GUTTER */.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumbers{}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}/* CURSOR */.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}/* Shown when moving in bi-directional text */.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line > span::selection,.cm-fat-cursor .CodeMirror-line > span > span::selection{background:transparent}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line > span::-moz-selection,.cm-fat-cursor .CodeMirror-line > span > span::-moz-selection{background:transparent}.cm-fat-cursor{caret-color:transparent}@-moz-keyframes blink{0%{}50%{background-color:transparent}100%{}}@-webkit-keyframes blink{0%{}50%{background-color:transparent}100%{}}@keyframes blink{0%{}50%{background-color:transparent}100%{}}/* Can style cursor different in overwrite (non-insert) mode */.CodeMirror-overwrite .CodeMirror-cursor{}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}/* DEFAULT THEME */.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable,.cm-s-default .cm-punctuation,.cm-s-default .cm-property,.cm-s-default .cm-operator{}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:#f00}.cm-invalidchar{color:#f00}.CodeMirror-composing{border-bottom:2px solid}/* Default styles for common addons */div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255, 150, 0, .3)}.CodeMirror-activeline-background{background:#e8f2ff}/* STOP *//* The rest of this file contains styles related to the mechanics of
|
||||||
|
the editor. You probably shouldn't touch them. */.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;/* Things will break if this is overridden *//* 50px is the magic margin used to hide the element's real scrollbars *//* See overflow: hidden in .CodeMirror */margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;/* Prevent dragging from highlighting the element */position:relative;z-index:0}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}/* The fake, visible scrollbars. Used to force redraw during scrolling
|
||||||
|
before actual scrolling happens, thus preventing shaking and
|
||||||
|
flickering artifacts. */.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none !important;border:none !important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px/* prevents collapsing before first draw */}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{/* Reset some styles that the rest of the page might have set */-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:0.1px/* Force widget margins to stay inside of the container */}.CodeMirror-widget{}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}/* Force content-box sizing for the elements where we expect it */.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line > span::selection,.CodeMirror-line > span > span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line > span::-moz-selection,.CodeMirror-line > span > span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255, 255, 0, .4)}/* Used to force a border model for a node */.cm-force-border{padding-right:.1px}@media print{/* Hide the cursor when printing */.CodeMirror div.CodeMirror-cursors{visibility:hidden}}/* See issue #2901 */.cm-tab-wrap-hack:after{content:''}/* Help users use markselection to safely style text background */span.CodeMirror-selectedtext{background:none}
|
||||||
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+9
@@ -0,0 +1,9 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user