mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-22 14:08:42 +00:00
refactor: new UOJForm class (#25)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
commit
847a34519d
@ -5,63 +5,66 @@ requirePHPLib('form');
|
||||
Auth::check() || redirectToLogin();
|
||||
UOJContest::userCanCreateContest(Auth::user()) || UOJResponse::page403();
|
||||
|
||||
$time_form = new UOJBs4Form('time');
|
||||
$time_form->addVInput(
|
||||
$time_form = new UOJForm('time');
|
||||
$time_form->addInput(
|
||||
'name',
|
||||
'text',
|
||||
UOJLocale::get('contests::new contest'),
|
||||
'New Contest',
|
||||
function ($name, &$vdata) {
|
||||
if ($name == '') {
|
||||
return '标题不能为空';
|
||||
}
|
||||
[
|
||||
'label' => '比赛标题',
|
||||
'default_value' => 'New Contest',
|
||||
'validator_php' => function ($name, &$vdata) {
|
||||
if ($name == '') {
|
||||
return '标题不能为空';
|
||||
}
|
||||
|
||||
if (strlen($name) > 100) {
|
||||
return '标题过长';
|
||||
}
|
||||
if (strlen($name) > 100) {
|
||||
return '标题过长';
|
||||
}
|
||||
|
||||
$name = HTML::escape($name);
|
||||
$name = HTML::escape($name);
|
||||
|
||||
if ($name === '') {
|
||||
return '无效编码';
|
||||
}
|
||||
if ($name === '') {
|
||||
return '无效编码';
|
||||
}
|
||||
|
||||
$vdata['name'] = $name;
|
||||
$vdata['name'] = $name;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
return '';
|
||||
},
|
||||
]
|
||||
);
|
||||
$time_form->addVInput(
|
||||
$time_form->addInput(
|
||||
'start_time',
|
||||
'text',
|
||||
UOJLocale::get('contests::start time'),
|
||||
date("Y-m-d H:i:s"),
|
||||
function ($str, &$vdata) {
|
||||
try {
|
||||
$vdata['start_time'] = new DateTime($str);
|
||||
} catch (Exception $e) {
|
||||
return '无效时间格式';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
null
|
||||
[
|
||||
'div_class' => 'mt-2',
|
||||
'label' => '开始时间',
|
||||
'default_value' => date("Y-m-d H:i:s"),
|
||||
'validator_php' => function ($str, &$vdata) {
|
||||
try {
|
||||
$vdata['start_time'] = new DateTime($str);
|
||||
} catch (Exception $e) {
|
||||
return '无效时间格式';
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
]
|
||||
);
|
||||
$time_form->addVInput(
|
||||
$time_form->addInput(
|
||||
'last_min',
|
||||
'text',
|
||||
'时长(单位:分钟)',
|
||||
180,
|
||||
function ($str, &$vdata) {
|
||||
if (!validateUInt($str)) {
|
||||
return '必须为一个整数';
|
||||
}
|
||||
[
|
||||
'div_class' => 'mt-2',
|
||||
'label' => '时长(单位:分钟)',
|
||||
'default_value' => '180',
|
||||
'validator_php' => function ($str, &$vdata) {
|
||||
if (!validateUInt($str)) {
|
||||
return '必须为一个整数';
|
||||
}
|
||||
|
||||
$vdata['last_min'] = $str;
|
||||
$vdata['last_min'] = $str;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
return '';
|
||||
},
|
||||
]
|
||||
);
|
||||
$time_form->handle = function (&$vdata) {
|
||||
$start_time_str = $vdata['start_time']->format('Y-m-d H:i:s');
|
||||
@ -75,6 +78,7 @@ $time_form->handle = function (&$vdata) {
|
||||
$time_form->succ_href = "/contests";
|
||||
$time_form->runAtServer();
|
||||
?>
|
||||
|
||||
<?php echoUOJPageHeader(UOJLocale::get('contests::add new contest')) ?>
|
||||
|
||||
<div class="row">
|
||||
@ -82,13 +86,12 @@ $time_form->runAtServer();
|
||||
<div class="col-lg-9">
|
||||
<div class="card card-default mb-2">
|
||||
<div class="card-body">
|
||||
|
||||
<h1 class="card-title">
|
||||
<?= UOJLocale::get('contests::add new contest') ?>
|
||||
</h1>
|
||||
|
||||
<div class="w-full" style="max-width: 400px">
|
||||
<?php $time_form->printHTML(); ?>
|
||||
<?php $time_form->printHTML() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -99,6 +102,7 @@ $time_form->runAtServer();
|
||||
<aside class="col-lg-3 mt-3 mt-lg-0">
|
||||
<?php uojIncludeView('sidebar') ?>
|
||||
</aside>
|
||||
<!-- end right col -->
|
||||
</div>
|
||||
|
||||
<?php echoUOJPageFooter() ?>
|
||||
|
@ -7,9 +7,9 @@ UOJContest::init(UOJRequest::get('id')) || UOJResponse::page404();
|
||||
UOJContest::cur()->userCanParticipateNow(Auth::user()) || UOJResponse::page403();
|
||||
UOJContest::cur()->userHasMarkedParticipated(Auth::user()) && redirectTo(UOJContest::cur()->getUri());
|
||||
|
||||
$confirm_form = new UOJBs4Form('confirm');
|
||||
$confirm_form->submit_button_config['class_str'] = 'btn btn-primary mt-3';
|
||||
$confirm_form->submit_button_config['text'] = '我已核对信息,确认参加比赛';
|
||||
$confirm_form = new UOJForm('confirm');
|
||||
$confirm_form->config['submit_button']['class'] = 'btn btn-primary';
|
||||
$confirm_form->config['submit_button']['text'] = '我已核对信息,确认参加比赛';
|
||||
$confirm_form->handle = function () {
|
||||
UOJContest::cur()->markUserAsParticipated(Auth::user());
|
||||
};
|
||||
@ -21,11 +21,15 @@ $confirm_form->runAtServer();
|
||||
|
||||
<div class="card mw-100 mx-auto" style="width:800px">
|
||||
<div class="card-body">
|
||||
<h1 class="card-title text-center mb-3">确认参赛</h1>
|
||||
<h1 class="card-title text-center mb-3">
|
||||
确认参赛
|
||||
</h1>
|
||||
|
||||
<p class="card-text text-center">您即将参加比赛 “<b><?= UOJContest::info('name') ?></b>”,请在正式参赛前仔细核对以下比赛信息:</p>
|
||||
<p class="card-text text-center">
|
||||
您即将参加比赛 “<b><?= UOJContest::info('name') ?></b>”,请在正式参赛前仔细核对以下比赛信息:
|
||||
</p>
|
||||
|
||||
<div class="table-responsive mx-auto" style="width:500px">
|
||||
<div class="table-responsive mx-auto" style="width: 500px">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -59,6 +59,7 @@ if (UOJContest::cur()->userCanStartFinalTest(Auth::user())) {
|
||||
$start_test_form->handle = function () {
|
||||
UOJContest::cur()->finalTest();
|
||||
};
|
||||
$start_test_form->config['submit_container']['class'] = 'mt-2';
|
||||
$start_test_form->config['submit_button']['class'] = 'btn btn-danger d-block w-100';
|
||||
$start_test_form->config['submit_button']['text'] = UOJContest::cur()->labelForFinalTest();
|
||||
$start_test_form->config['confirm']['smart'] = true;
|
||||
@ -69,6 +70,7 @@ if (UOJContest::cur()->userCanStartFinalTest(Auth::user())) {
|
||||
$publish_result_form->handle = function () {
|
||||
UOJContest::announceOfficialResults();
|
||||
};
|
||||
$publish_result_form->config['submit_container']['class'] = 'mt-2';
|
||||
$publish_result_form->config['submit_button']['class'] = 'btn btn-danger d-block w-100';
|
||||
$publish_result_form->config['submit_button']['text'] = '公布成绩';
|
||||
$publish_result_form->config['confirm']['smart'] = true;
|
||||
@ -78,12 +80,10 @@ if (UOJContest::cur()->userCanStartFinalTest(Auth::user())) {
|
||||
|
||||
if ($cur_tab == 'dashboard') {
|
||||
if ($contest['cur_progress'] <= CONTEST_IN_PROGRESS) {
|
||||
$post_question = new UOJBs4Form('post_question');
|
||||
$post_question->addVTextArea(
|
||||
'qcontent',
|
||||
'问题',
|
||||
'',
|
||||
function ($content, &$vdata) {
|
||||
$post_question = new UOJForm('post_question');
|
||||
$post_question->addTextArea('qcontent', [
|
||||
'label' => '问题',
|
||||
'validator_php' => function ($content, &$vdata) {
|
||||
if (!Auth::check()) {
|
||||
return '您尚未登录';
|
||||
}
|
||||
@ -98,12 +98,11 @@ if ($cur_tab == 'dashboard') {
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
]);
|
||||
$post_question->handle = function (&$vdata) use ($contest) {
|
||||
DB::insert([
|
||||
"insert into contests_asks",
|
||||
"(contest_id, question, answer, username, post_time, is_hidden)",
|
||||
DB::bracketed_fields(["contest_id", "question", "answer", "username", "post_time", "is_hidden"]),
|
||||
"values", DB::tuple([$contest['id'], $vdata['content'], '', Auth::id(), DB::now(), 1])
|
||||
]);
|
||||
};
|
||||
@ -113,13 +112,11 @@ if ($cur_tab == 'dashboard') {
|
||||
}
|
||||
} elseif ($cur_tab == 'backstage') {
|
||||
if ($is_manager) {
|
||||
$post_notice = new UOJBs4Form('post_notice');
|
||||
$post_notice->addInput(
|
||||
'title',
|
||||
'text',
|
||||
'标题',
|
||||
'',
|
||||
function ($title, &$vdata) {
|
||||
$post_notice = new UOJForm('post_notice');
|
||||
$post_notice->addInput('title', [
|
||||
'div_class' => 'mb-3',
|
||||
'label' => '标题',
|
||||
'validator_php' => function ($title, &$vdata) {
|
||||
if (!$title) {
|
||||
return '标题不能为空';
|
||||
}
|
||||
@ -128,13 +125,10 @@ if ($cur_tab == 'dashboard') {
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$post_notice->addTextArea(
|
||||
'content',
|
||||
'正文',
|
||||
'',
|
||||
function ($content, &$vdata) {
|
||||
]);
|
||||
$post_notice->addTextArea('content', [
|
||||
'label' => '正文',
|
||||
'validator_php' => function ($content, &$vdata) {
|
||||
if (!$content) {
|
||||
return '公告不能为空';
|
||||
}
|
||||
@ -143,8 +137,7 @@ if ($cur_tab == 'dashboard') {
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
]);
|
||||
$post_notice->handle = function (&$vdata) use ($contest) {
|
||||
DB::insert([
|
||||
"insert into contests_notice",
|
||||
@ -158,7 +151,7 @@ if ($cur_tab == 'dashboard') {
|
||||
}
|
||||
|
||||
if ($is_manager) {
|
||||
$reply_question = new UOJBs4Form('reply_question');
|
||||
$reply_question = new UOJForm('reply_question');
|
||||
$reply_question->addHidden(
|
||||
'rid',
|
||||
'0',
|
||||
@ -181,18 +174,21 @@ if ($cur_tab == 'dashboard') {
|
||||
},
|
||||
null
|
||||
);
|
||||
$reply_question->addVSelect('rtype', [
|
||||
'public' => '公开(如果该问题反复被不同人提出,或指出了题目中的错误,请选择该项)',
|
||||
'private' => '非公开',
|
||||
'statement' => '请仔细阅读题面(非公开)',
|
||||
'no_comment' => '无可奉告(非公开)',
|
||||
'no_play' => '请认真比赛(非公开)',
|
||||
], '回复类型', 'private');
|
||||
$reply_question->addVTextArea(
|
||||
'rcontent',
|
||||
'回复',
|
||||
'',
|
||||
function ($content, &$vdata) {
|
||||
$reply_question->addSelect('rtype', [
|
||||
'div_class' => 'mb-3',
|
||||
'label' => '回复类型',
|
||||
'default' => 'private',
|
||||
'options' => [
|
||||
'public' => '公开(如果该问题反复被不同人提出,或指出了题目中的错误,请选择该项)',
|
||||
'private' => '非公开',
|
||||
'statement' => '请仔细阅读题面(非公开)',
|
||||
'no_comment' => '无可奉告(非公开)',
|
||||
'no_play' => '请认真比赛(非公开)',
|
||||
],
|
||||
]);
|
||||
$reply_question->addTextArea('rcontent', [
|
||||
'label' => '回复',
|
||||
'validator_php' => function ($content, &$vdata) {
|
||||
if (!Auth::check()) {
|
||||
return '您尚未登录';
|
||||
}
|
||||
@ -207,9 +203,8 @@ if ($cur_tab == 'dashboard') {
|
||||
$vdata['content'] = HTML::escape($content);
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$reply_question->handle = function (&$vdata) use ($contest) {
|
||||
]);
|
||||
$reply_question->handle = function (&$vdata) {
|
||||
$content = $vdata['content'];
|
||||
$is_hidden = 1;
|
||||
switch ($_POST['rtype']) {
|
||||
@ -243,8 +238,8 @@ if ($cur_tab == 'dashboard') {
|
||||
}
|
||||
} elseif ($cur_tab == 'self_reviews') {
|
||||
if (UOJContest::cur()->userHasMarkedParticipated(Auth::user())) {
|
||||
$self_reviews_update_form = new UOJBs4Form('self_review_update');
|
||||
$self_reviews_update_form->ctrl_enter_submit = true;
|
||||
$self_reviews_update_form = new UOJForm('self_review_update');
|
||||
$self_reviews_update_form->config['ctrl_enter_submit'] = true;
|
||||
|
||||
$contest_problems = DB::selectAll([
|
||||
"select problem_id",
|
||||
@ -266,20 +261,18 @@ if ($cur_tab == 'dashboard') {
|
||||
"poster" => Auth::id(),
|
||||
],
|
||||
]);
|
||||
$self_reviews_update_form->addVTextArea(
|
||||
'self_review_update__problem_' . $contest_problems[$i]['problem']->getLetter(),
|
||||
'<b>' . $contest_problems[$i]['problem']->getLetter() . '</b>: ' . $contest_problems[$i]['problem']->info['title'],
|
||||
$content,
|
||||
function ($content) {
|
||||
$self_reviews_update_form->addTextArea('self_review_update__problem_' . $contest_problems[$i]['problem']->getLetter(), [
|
||||
'div_class' => 'mb-3',
|
||||
'label' => '<b>' . $contest_problems[$i]['problem']->getLetter() . '</b>: ' . $contest_problems[$i]['problem']->info['title'],
|
||||
'default_value' => $content,
|
||||
'validator_php' => function ($content) {
|
||||
if (strlen($content) > 200) {
|
||||
return '总结不能超过200字';
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
null,
|
||||
true
|
||||
);
|
||||
]);
|
||||
}
|
||||
|
||||
$content = DB::selectSingle([
|
||||
@ -291,20 +284,17 @@ if ($cur_tab == 'dashboard') {
|
||||
"poster" => Auth::id(),
|
||||
],
|
||||
]);
|
||||
$self_reviews_update_form->addVTextArea(
|
||||
'self_review_update__overall',
|
||||
'比赛总结',
|
||||
$content,
|
||||
function ($content) {
|
||||
$self_reviews_update_form->addTextArea('self_review_update__overall', [
|
||||
'label' => '比赛总结',
|
||||
'default_value' => $content,
|
||||
'validator_php' => function ($content) {
|
||||
if (strlen($content) > 200) {
|
||||
return '总结不能超过200字';
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
null,
|
||||
true
|
||||
);
|
||||
]);
|
||||
|
||||
$self_reviews_update_form->handle = function () use ($contest, $contest_problems) {
|
||||
for ($i = 0; $i < count($contest_problems); $i++) {
|
||||
|
@ -37,72 +37,73 @@ if (!isset($tabs_info[$cur_tab])) {
|
||||
}
|
||||
|
||||
if ($cur_tab == 'profile') {
|
||||
$profile_form = new UOJBs4Form('time');
|
||||
$profile_form->addVInput(
|
||||
$profile_form = new UOJForm('time');
|
||||
$profile_form->addInput(
|
||||
'name',
|
||||
'text',
|
||||
'比赛标题',
|
||||
$contest['name'],
|
||||
function ($name, &$vdata) {
|
||||
if ($name == '') {
|
||||
return '标题不能为空';
|
||||
}
|
||||
[
|
||||
'label' => '比赛标题',
|
||||
'default_value' => UOJContest::info('name'),
|
||||
'validator_php' => function ($name, &$vdata) {
|
||||
if ($name == '') {
|
||||
return '标题不能为空';
|
||||
}
|
||||
|
||||
if (strlen($name) > 100) {
|
||||
return '标题过长';
|
||||
}
|
||||
if (strlen($name) > 100) {
|
||||
return '标题过长';
|
||||
}
|
||||
|
||||
$name = HTML::escape($name);
|
||||
$name = HTML::escape($name);
|
||||
|
||||
if ($name === '') {
|
||||
return '无效编码';
|
||||
}
|
||||
if ($name === '') {
|
||||
return '无效编码';
|
||||
}
|
||||
|
||||
$vdata['name'] = $name;
|
||||
$vdata['name'] = $name;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
return '';
|
||||
},
|
||||
],
|
||||
);
|
||||
$profile_form->addVInput(
|
||||
$profile_form->addInput(
|
||||
'start_time',
|
||||
'text',
|
||||
'开始时间',
|
||||
$contest['start_time_str'],
|
||||
function ($str, &$vdata) {
|
||||
try {
|
||||
$vdata['start_time'] = new DateTime($str);
|
||||
} catch (Exception $e) {
|
||||
return '无效时间格式';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
null
|
||||
[
|
||||
'div_class' => 'mt-3',
|
||||
'label' => '开始时间',
|
||||
'default_value' => UOJContest::info('start_time_str'),
|
||||
'validator_php' => function ($start_time, &$vdata) {
|
||||
try {
|
||||
$vdata['start_time'] = new DateTime($start_time);
|
||||
} catch (Exception $e) {
|
||||
return '无效时间格式';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
]
|
||||
);
|
||||
$profile_form->addVInput(
|
||||
$profile_form->addInput(
|
||||
'last_min',
|
||||
'text',
|
||||
'时长(单位:分钟)',
|
||||
$contest['last_min'],
|
||||
function ($str, &$vdata) {
|
||||
if (!validateUInt($str)) {
|
||||
return '必须为一个整数';
|
||||
}
|
||||
|
||||
$vdata['last_min'] = $str;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
[
|
||||
'div_class' => 'mt-3',
|
||||
'label' => '时长',
|
||||
'help' => '单位为分钟。',
|
||||
'default_value' => UOJContest::info('last_min'),
|
||||
'validator_php' => function ($last_min, &$vdata) {
|
||||
if (!validateUInt($last_min)) {
|
||||
return '必须为一个整数';
|
||||
}
|
||||
$vdata['last_min'] = $last_min;
|
||||
return '';
|
||||
},
|
||||
]
|
||||
);
|
||||
$profile_form->handle = function (&$vdata) use ($contest) {
|
||||
$profile_form->handle = function (&$vdata) {
|
||||
DB::update([
|
||||
"update contests",
|
||||
"set", [
|
||||
"name" => $vdata['name'],
|
||||
"start_time" => $vdata['start_time']->format('Y-m-d H:i:s'),
|
||||
"start_time" => UOJTime::time2str($vdata['start_time']),
|
||||
"last_min" => $vdata['last_min'],
|
||||
], "where", ["id" => $contest['id']]
|
||||
], "where", ["id" => UOJContest::info('id')]
|
||||
]);
|
||||
|
||||
dieWithJsonData(['status' => 'success', 'message' => '修改成功']);
|
||||
@ -162,51 +163,58 @@ EOD);
|
||||
dieWithAlert('移除成功!');
|
||||
}
|
||||
|
||||
$add_problem_form = new UOJBs4Form('add_problem');
|
||||
$add_problem_form->addVInput(
|
||||
$add_problem_form = new UOJForm('add_problem');
|
||||
$add_problem_form->addInput(
|
||||
'problem_id',
|
||||
'text',
|
||||
'题目 ID',
|
||||
'',
|
||||
function ($problem_id, &$vdata) {
|
||||
$problem = UOJProblem::query($problem_id);
|
||||
if (!$problem) {
|
||||
return '题目不存在。';
|
||||
}
|
||||
[
|
||||
'label' => '题目 ID',
|
||||
'validator_php' => function ($problem_id, &$vdata) {
|
||||
$problem = UOJProblem::query($problem_id);
|
||||
if (!$problem) {
|
||||
return '题目不存在。';
|
||||
}
|
||||
|
||||
if (!$problem->userCanManage(Auth::user())) {
|
||||
return "无权添加此题目。";
|
||||
}
|
||||
if (!$problem->userCanManage(Auth::user())) {
|
||||
return "无权添加此题目。";
|
||||
}
|
||||
|
||||
if (UOJContest::cur()->hasProblem($problem)) {
|
||||
return "题目已经在本场比赛中。";
|
||||
}
|
||||
if (UOJContest::cur()->hasProblem($problem)) {
|
||||
return "题目已经在本场比赛中。";
|
||||
}
|
||||
|
||||
$vdata['problem_id'] = $problem_id;
|
||||
$vdata['problem_id'] = $problem_id;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
return '';
|
||||
},
|
||||
]
|
||||
);
|
||||
$add_problem_form->addVSelect('judge_config', [
|
||||
'default' => '默认',
|
||||
'sample' => '只测样例',
|
||||
'no-details' => '测试全部数据,对于每个测试点显示得分但不显示详情',
|
||||
'full' => '测试全部数据',
|
||||
], '评测设置', 'default');
|
||||
$add_problem_form->addVCheckboxes('bonus', ['0' => '否', '1' => '是'], '是否为 bonus 题(ACM 赛制)', '0');
|
||||
$add_problem_form->addSelect('judge_config', [
|
||||
'div_class' => 'mt-3',
|
||||
'label' => '评测设置',
|
||||
'options' => [
|
||||
'default' => '默认',
|
||||
'sample' => '只测样例',
|
||||
'no-details' => '测试全部数据,对于每个测试点显示得分但不显示详情',
|
||||
'full' => '测试全部数据',
|
||||
],
|
||||
'default_value' => 'default',
|
||||
]);
|
||||
$add_problem_form->addCheckbox('bonus', [
|
||||
'div_class' => 'form-check mt-3',
|
||||
'label' => '是否为 bonus 题(针对 ACM 赛制)',
|
||||
]);
|
||||
$add_problem_form->handle = function (&$vdata) use ($contest) {
|
||||
$level = DB::selectFirst([
|
||||
$level = DB::selectSingle([
|
||||
"select", "max(level)",
|
||||
"from", "contests_problems",
|
||||
"where", [
|
||||
"contest_id" => $contest['id'],
|
||||
"contest_id" => UOJContest::info('id'),
|
||||
]
|
||||
])["max(level)"];
|
||||
]);
|
||||
DB::insert([
|
||||
"insert ignore into contests_problems",
|
||||
"(contest_id, problem_id, level)",
|
||||
"values", DB::tuple([$contest['id'], $vdata['problem_id'], $level + 1])
|
||||
"values", DB::tuple([UOJContest::info('id'), $vdata['problem_id'], $level + 1])
|
||||
]);
|
||||
|
||||
$judge_type = $_POST['judge_config'];
|
||||
@ -220,13 +228,13 @@ EOD);
|
||||
DB::update([
|
||||
"update contests",
|
||||
"set", ["extra_config" => $esc_extra_config],
|
||||
"where", ["id" => $contest['id']]
|
||||
"where", ["id" => UOJContest::info('id')]
|
||||
]);
|
||||
|
||||
dieWithJsonData(['status' => 'success', 'message' => "题目 #{$vdata['problem_id']} 添加成功!"]);
|
||||
};
|
||||
$add_problem_form->submit_button_config['text'] = '添加';
|
||||
$add_problem_form->submit_button_config['class_str'] = 'btn btn-secondary mt-3';
|
||||
$add_problem_form->config['submit_button']['text'] = '添加';
|
||||
$add_problem_form->config['submit_button']['class'] = 'btn btn-secondary mt-3';
|
||||
$add_problem_form->setAjaxSubmit(<<<EOD
|
||||
function(res) {
|
||||
if (res.status === 'success') {
|
||||
@ -260,7 +268,6 @@ EOD);
|
||||
dieWithAlert('用户不是这场比赛的管理员。');
|
||||
}
|
||||
|
||||
|
||||
DB::delete([
|
||||
"delete from contests_permissions",
|
||||
"where", [
|
||||
@ -271,40 +278,40 @@ EOD);
|
||||
dieWithAlert('移除成功!');
|
||||
}
|
||||
|
||||
$add_manager_form = new UOJBs4Form('add_manager');
|
||||
$add_manager_form->addVInput(
|
||||
$add_manager_form = new UOJForm('add_manager');
|
||||
$add_manager_form->addInput(
|
||||
'username',
|
||||
'text',
|
||||
'用户名',
|
||||
'',
|
||||
function ($username, &$vdata) use ($contest) {
|
||||
$user = UOJUser::query($username);
|
||||
[
|
||||
'label' => '用户名',
|
||||
'validator_php' => function ($username, &$vdata) {
|
||||
$user = UOJUser::query($username);
|
||||
|
||||
if (!$user) {
|
||||
return '用户不存在';
|
||||
}
|
||||
if (!$user) {
|
||||
return '用户不存在';
|
||||
}
|
||||
|
||||
if (UOJContest::cur()->userCanManage($user)) {
|
||||
return '用户已经是这场比赛的管理员';
|
||||
}
|
||||
if (UOJContest::cur()->userCanManage($user)) {
|
||||
return '用户已经是这场比赛的管理员';
|
||||
}
|
||||
|
||||
$vdata['username'] = $username;
|
||||
$vdata['username'] = $username;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
return '';
|
||||
},
|
||||
]
|
||||
);
|
||||
$add_manager_form->handle = function (&$vdata) use ($contest) {
|
||||
$add_manager_form->handle = function (&$vdata) {
|
||||
DB::insert([
|
||||
"insert into contests_permissions",
|
||||
"(contest_id, username)",
|
||||
"values", DB::tuple([$contest['id'], $vdata['username']])
|
||||
DB::bracketed_fields(["contest_id", "username"]),
|
||||
"values",
|
||||
DB::tuple([UOJContest::info('id'), $vdata['username']])
|
||||
]);
|
||||
|
||||
dieWithJsonData(['status' => 'success', 'message' => '已将用户名为 ' . $vdata['username'] . ' 的用户设置为本场比赛的管理者。']);
|
||||
};
|
||||
$add_manager_form->submit_button_config['text'] = '添加';
|
||||
$add_manager_form->submit_button_config['class_str'] = 'btn btn-secondary mt-3';
|
||||
$add_manager_form->config['submit_button']['text'] = '添加';
|
||||
$add_manager_form->config['submit_button']['class'] = 'btn btn-secondary mt-3';
|
||||
$add_manager_form->setAjaxSubmit(<<<EOD
|
||||
function(res) {
|
||||
if (res.status === 'success') {
|
||||
@ -326,83 +333,68 @@ function(res) {
|
||||
EOD);
|
||||
$add_manager_form->runAtServer();
|
||||
} elseif ($cur_tab == 'others') {
|
||||
$version_form = new UOJBs4Form('version');
|
||||
$version_form->addVSelect('standings_version', [
|
||||
'1' => '1',
|
||||
'2' => '2',
|
||||
], '比赛排名版本', $contest['extra_config']['standings_version']);
|
||||
$version_form->handle = function () use ($contest) {
|
||||
$contest['extra_config']['standings_version'] = $_POST['standings_version'];
|
||||
$esc_extra_config = json_encode($contest['extra_config']);
|
||||
DB::update([
|
||||
"update contests",
|
||||
"set", ["extra_config" => $esc_extra_config],
|
||||
"where", ["id" => $contest['id']],
|
||||
]);
|
||||
|
||||
dieWithJsonData(['status' => 'success', 'message' => '修改成功']);
|
||||
};
|
||||
$version_form->setAjaxSubmit(<<<EOD
|
||||
function(res) {
|
||||
if (res.status === 'success') {
|
||||
$('#version-result-alert')
|
||||
.html('修改成功!')
|
||||
.addClass('alert-success')
|
||||
.removeClass('alert-danger')
|
||||
.show();
|
||||
} else {
|
||||
$('#version-result-alert')
|
||||
.html('修改失败。' + (res.message || ''))
|
||||
.removeClass('alert-success')
|
||||
.addClass('alert-danger')
|
||||
.show();
|
||||
}
|
||||
|
||||
$(window).scrollTop(0);
|
||||
}
|
||||
EOD);
|
||||
$version_form->runAtServer();
|
||||
|
||||
$rule_form = new UOJBs4Form('basic_rule');
|
||||
$rule_form->addVSelect('basic_rule', [
|
||||
'OI' => 'OI',
|
||||
'IOI' => 'IOI',
|
||||
'ACM' => 'ACM',
|
||||
], '比赛类型', $contest['extra_config']['basic_rule']);
|
||||
$rule_form->addVSelect('free_registration', [
|
||||
1 => '所有人都可以自由报名',
|
||||
0 => '只能由管理员帮选手报名'
|
||||
], "报名方式", $contest['extra_config']['free_registration']);
|
||||
$rule_form->addVCheckboxes('extra_registration', [
|
||||
'0' => '禁止',
|
||||
'1' => '允许'
|
||||
], '是否允许额外报名', isset($contest['extra_config']['extra_registration']) ? $contest['extra_config']['extra_registration'] : '1');
|
||||
$rule_form->addVSelect('individual_or_team', [
|
||||
'individual' => '个人赛',
|
||||
'team' => '团体赛'
|
||||
], "个人赛/团体赛", $contest['extra_config']['individual_or_team']);
|
||||
$rule_form->addVInput(
|
||||
'max_n_submissions_per_problem',
|
||||
'text',
|
||||
'每题最高提交次数(-1 表示不限制)',
|
||||
$contest['extra_config']['max_n_submissions_per_problem'],
|
||||
function ($str) {
|
||||
$rule_form = new UOJForm('basic_rule');
|
||||
$rule_form->addSelect('basic_rule', [
|
||||
'label' => '比赛类型',
|
||||
'options' => [
|
||||
'OI' => 'OI',
|
||||
'IOI' => 'IOI',
|
||||
'ACM' => 'ACM',
|
||||
],
|
||||
'default_value' => $contest['extra_config']['basic_rule'],
|
||||
]);
|
||||
$rule_form->addSelect('free_registration', [
|
||||
'div_class' => 'mt-3',
|
||||
'label' => '报名方式',
|
||||
'options' => [
|
||||
1 => '所有人都可以自由报名',
|
||||
0 => '只能由管理员帮选手报名'
|
||||
],
|
||||
'default_value' => $contest['extra_config']['free_registration'],
|
||||
]);
|
||||
$rule_form->addCheckbox('extra_registration', [
|
||||
'div_class' => 'form-check mt-3',
|
||||
'label' => '允许额外报名',
|
||||
'checked' => $contest['extra_config']['extra_registration'] ?: true,
|
||||
]);
|
||||
$rule_form->addSelect('individual_or_team', [
|
||||
'div_class' => 'mt-3',
|
||||
'label' => '个人赛/团体赛',
|
||||
'options' => [
|
||||
'individual' => '个人赛',
|
||||
'team' => '团体赛',
|
||||
],
|
||||
'default_value' => $contest['extra_config']['individual_or_team'],
|
||||
]);
|
||||
$rule_form->addInput('max_n_submissions_per_problem', [
|
||||
'div_class' => 'mt-3',
|
||||
'label' => '每题最高提交次数',
|
||||
'type' => 'number',
|
||||
'default_value' => $contest['extra_config']['max_n_submissions_per_problem'],
|
||||
'help' => '设为 -1 表示无限制(系统默认频率限制仍有效)。',
|
||||
'validator_php' => function ($str) {
|
||||
return !validateUInt($str) && $str !== '-1' ? '必须为一个非负整数或 -1' : '';
|
||||
},
|
||||
null
|
||||
);
|
||||
]);
|
||||
$rule_form->addSelect('standings_version', [
|
||||
'div_class' => 'mt-3',
|
||||
'label' => '比赛排名版本',
|
||||
'options' => [1 => 1, 2 => 2],
|
||||
'default_value' => $contest['extra_config']['standings_version'],
|
||||
]);
|
||||
$rule_form->handle = function () use ($contest) {
|
||||
$contest['extra_config']['basic_rule'] = $_POST['basic_rule'];
|
||||
$contest['extra_config']['free_registration'] = (int)$_POST['free_registration'];
|
||||
$contest['extra_config']['individual_or_team'] = $_POST['individual_or_team'];
|
||||
$contest['extra_config']['max_n_submissions_per_problem'] = (int)$_POST['max_n_submissions_per_problem'];
|
||||
$contest['extra_config']['extra_registration'] = (int)$_POST['extra_registration'];
|
||||
$contest['extra_config']['standings_version'] = (int)$_POST['standings_version'];
|
||||
|
||||
$esc_extra_config = json_encode($contest['extra_config']);
|
||||
DB::update([
|
||||
"update contests",
|
||||
"set", ["extra_config" => $esc_extra_config],
|
||||
"where", ["id" => $contest['id']]
|
||||
"where", ["id" => UOJContest::info('id')]
|
||||
]);
|
||||
|
||||
dieWithJsonData(['status' => 'success', 'message' => '修改成功']);
|
||||
@ -427,105 +419,6 @@ function(res) {
|
||||
}
|
||||
EOD);
|
||||
$rule_form->runAtServer();
|
||||
|
||||
$blog_link_contests = new UOJBs4Form('blog_link_contests');
|
||||
$blog_link_contests->addVInput(
|
||||
'blog_id',
|
||||
'text',
|
||||
'博客 ID',
|
||||
'',
|
||||
function ($blog_id, &$vdata) {
|
||||
if (!validateUInt($blog_id)) {
|
||||
return 'ID 不合法';
|
||||
}
|
||||
|
||||
if (!queryBlog($blog_id)) {
|
||||
return '博客不存在';
|
||||
}
|
||||
|
||||
$vdata['blog_id'] = $blog_id;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$blog_link_contests->addVInput(
|
||||
'title',
|
||||
'text',
|
||||
'名称',
|
||||
'',
|
||||
function ($title, &$vdata) {
|
||||
if ($title == '') {
|
||||
return '名称不能为空';
|
||||
}
|
||||
|
||||
if (strlen($title) > 40) {
|
||||
return '名称过长';
|
||||
}
|
||||
|
||||
$title = HTML::escape($title);
|
||||
if ($title === '') {
|
||||
return '无效编码';
|
||||
}
|
||||
|
||||
$vdata['title'] = $title;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$blog_link_contests->addVSelect('op_type', [
|
||||
'add' => '添加',
|
||||
'del' => '移除',
|
||||
], '操作类型', '');
|
||||
$blog_link_contests->handle = function ($vdata) use ($contest) {
|
||||
if ($_POST['op_type'] == 'add') {
|
||||
if (!isset($contest['extra_config']['links'])) {
|
||||
$contest['extra_config']['links'] = [];
|
||||
}
|
||||
|
||||
$contest['extra_config']['links'][] = [$vdata['title'], $vdata['blog_id']];
|
||||
} elseif ($_POST['op_type'] == 'del') {
|
||||
$n = count($contest['extra_config']['links']);
|
||||
for ($i = 0; $i < $n; $i++) {
|
||||
if ($contest['extra_config']['links'][$i][1] == $vdata['blog_id']) {
|
||||
$contest['extra_config']['links'][$i] = $contest['extra_config']['links'][$n - 1];
|
||||
unset($contest['extra_config']['links'][$n - 1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!count($contest['extra_config']['links'])) {
|
||||
unset($contest['extra_config']['links']);
|
||||
}
|
||||
}
|
||||
|
||||
$esc_extra_config = json_encode($contest['extra_config']);
|
||||
$esc_extra_config = DB::escape($esc_extra_config);
|
||||
DB::update("UPDATE contests set extra_config = '$esc_extra_config' where id = {$contest['id']}");
|
||||
|
||||
dieWithJsonData(['status' => 'success', 'message' => '修改成功']);
|
||||
};
|
||||
$blog_link_contests->setAjaxSubmit(<<<EOD
|
||||
function(res) {
|
||||
if (res.status === 'success') {
|
||||
$('#blogs-result-alert')
|
||||
.html('操作成功!')
|
||||
.addClass('alert-success')
|
||||
.removeClass('alert-danger')
|
||||
.show();
|
||||
} else {
|
||||
$('#blogs-result-alert')
|
||||
.html('操作失败。' + (res.message || ''))
|
||||
.removeClass('alert-success')
|
||||
.addClass('alert-danger')
|
||||
.show();
|
||||
}
|
||||
|
||||
$(window).scrollTop(0);
|
||||
}
|
||||
EOD);
|
||||
$blog_link_contests->runAtServer();
|
||||
}
|
||||
|
||||
?>
|
||||
@ -722,12 +615,6 @@ EOD);
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="#type" data-bs-toggle="tab" data-bs-target="#type">规则</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#standings-version" data-bs-toggle="tab" data-bs-target="#standings-version">排名版本</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#blogs" data-bs-toggle="tab" data-bs-target="#blogs">比赛资料</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="card-body tab-content">
|
||||
@ -751,34 +638,6 @@ EOD);
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="standings-version">
|
||||
<div id="version-result-alert" class="alert" role="alert" style="display: none"></div>
|
||||
<div class="row row-cols-1 row-cols-md-2">
|
||||
<div class="col">
|
||||
<?php $version_form->printHTML(); ?>
|
||||
</div>
|
||||
<div class="col mt-3 mt-md-0">
|
||||
<h5>注意事项</h5>
|
||||
<ul class="mb-0">
|
||||
<li>正常情况下无需调整此项设置。</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="blogs">
|
||||
<div id="blogs-result-alert" class="alert" role="alert" style="display: none"></div>
|
||||
<div class="row row-cols-1 row-cols-md-2">
|
||||
<div class="col">
|
||||
<?php $blog_link_contests->printHTML(); ?>
|
||||
</div>
|
||||
<div class="col mt-3 mt-md-0">
|
||||
<h5>注意事项</h5>
|
||||
<ul class="mb-0">
|
||||
<li>添加比赛资料前请确认博客是否处于公开状态。</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
@ -11,56 +11,56 @@ $is_manager = UOJContest::cur()->userCanManage(Auth::user());
|
||||
$show_ip = isSuperUser(Auth::user());
|
||||
|
||||
if ($is_manager) {
|
||||
$add_new_contestant_form = new UOJBs4Form('add_new_contestant_form');
|
||||
$add_new_contestant_form = new UOJForm('add_new_contestant_form');
|
||||
$add_new_contestant_form->addInput(
|
||||
'new_username',
|
||||
'text',
|
||||
'用户名',
|
||||
'',
|
||||
function ($username, &$vdata) {
|
||||
$user = UOJUser::query($username);
|
||||
[
|
||||
'placeholder' => '用户名',
|
||||
'validator_php' => function ($username, &$vdata) {
|
||||
$user = UOJUser::query($username);
|
||||
|
||||
if (!$user) {
|
||||
return '用户不存在';
|
||||
}
|
||||
if (!$user) {
|
||||
return '用户不存在';
|
||||
}
|
||||
|
||||
if (UOJContest::cur()->userHasRegistered($user)) {
|
||||
return '该用户已经报名';
|
||||
}
|
||||
if (UOJContest::cur()->userHasRegistered($user)) {
|
||||
return '该用户已经报名';
|
||||
}
|
||||
|
||||
$vdata['user'] = $user;
|
||||
$vdata['user'] = $user;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
return '';
|
||||
},
|
||||
]
|
||||
);
|
||||
$add_new_contestant_form->submit_button_config['align'] = 'compressed';
|
||||
$add_new_contestant_form->submit_button_config['text'] = '注册该用户';
|
||||
$add_new_contestant_form->config['submit_container']['class'] = 'mt-3 text-center';
|
||||
$add_new_contestant_form->config['submit_button']['class'] = 'btn btn-secondary';
|
||||
$add_new_contestant_form->config['submit_button']['text'] = '注册该用户';
|
||||
$add_new_contestant_form->handle = function (&$vdata) {
|
||||
UOJContest::cur()->userRegister($vdata['user']);
|
||||
};
|
||||
$add_new_contestant_form->runAtServer();
|
||||
|
||||
$add_group_to_contest_form = new UOJBs4Form('add_group_to_contest');
|
||||
$add_group_to_contest_form = new UOJForm('add_group_to_contest');
|
||||
$add_group_to_contest_form->addInput(
|
||||
'group_id',
|
||||
'text',
|
||||
'小组 ID',
|
||||
'',
|
||||
function ($group_id, &$vdata) {
|
||||
$group = UOJGroup::query($group_id);
|
||||
if (!$group) {
|
||||
return '小组不存在';
|
||||
}
|
||||
[
|
||||
'placeholder' => '小组 ID',
|
||||
'validator_php' => function ($group_id, &$vdata) {
|
||||
$group = UOJGroup::query($group_id);
|
||||
if (!$group) {
|
||||
return '小组不存在';
|
||||
}
|
||||
|
||||
$vdata['group'] = $group;
|
||||
$vdata['group'] = $group;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
return '';
|
||||
},
|
||||
]
|
||||
);
|
||||
$add_group_to_contest_form->submit_button_config['align'] = 'compressed';
|
||||
$add_group_to_contest_form->submit_button_config['text'] = '注册该小组中的用户';
|
||||
$add_group_to_contest_form->config['submit_container']['class'] = 'mt-3 text-center';
|
||||
$add_group_to_contest_form->config['submit_button']['class'] = 'btn btn-secondary';
|
||||
$add_group_to_contest_form->config['submit_button']['text'] = '注册该小组中的用户';
|
||||
$add_group_to_contest_form->handle = function (&$vdata) {
|
||||
$usernames = $vdata['group']->getUsernames();
|
||||
|
||||
@ -72,63 +72,61 @@ if ($is_manager) {
|
||||
};
|
||||
$add_group_to_contest_form->runAtServer();
|
||||
|
||||
$remove_user_from_contest_form = new UOJBs4Form('remove_user_from_contest');
|
||||
$remove_user_from_contest_form = new UOJForm('remove_user_from_contest');
|
||||
$remove_user_from_contest_form->addInput(
|
||||
'remove_username',
|
||||
'text',
|
||||
'用户名',
|
||||
'',
|
||||
function ($username, &$vdata) {
|
||||
$user = UOJUser::query($username);
|
||||
[
|
||||
'placeholder' => '用户名',
|
||||
'validator_php' => function ($username, &$vdata) {
|
||||
$user = UOJUser::query($username);
|
||||
|
||||
if (!$user) {
|
||||
return '用户不存在';
|
||||
}
|
||||
if (!$user) {
|
||||
return '用户不存在';
|
||||
}
|
||||
|
||||
if (!UOJContest::cur()->userHasRegistered($user)) {
|
||||
return '该用户未报名';
|
||||
}
|
||||
if (!UOJContest::cur()->userHasRegistered($user)) {
|
||||
return '该用户未报名';
|
||||
}
|
||||
|
||||
$vdata['user'] = $user;
|
||||
$vdata['user'] = $user;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
return '';
|
||||
},
|
||||
]
|
||||
);
|
||||
$remove_user_from_contest_form->submit_button_config['align'] = 'compressed';
|
||||
$remove_user_from_contest_form->submit_button_config['text'] = '移除该用户';
|
||||
$remove_user_from_contest_form->submit_button_config['class_str'] = 'mt-2 btn btn-danger';
|
||||
$remove_user_from_contest_form->config['submit_container']['class'] = 'mt-3 text-center';
|
||||
$remove_user_from_contest_form->config['submit_button']['class'] = 'btn btn-danger';
|
||||
$remove_user_from_contest_form->config['submit_button']['text'] = '移除该用户';
|
||||
$remove_user_from_contest_form->handle = function (&$vdata) {
|
||||
UOJContest::cur()->userUnregister($vdata['user']);
|
||||
};
|
||||
$remove_user_from_contest_form->runAtServer();
|
||||
|
||||
$force_set_user_participated_form = new UOJBs4Form('force_set_user_participated');
|
||||
$force_set_user_participated_form = new UOJForm('force_set_user_participated');
|
||||
$force_set_user_participated_form->addInput(
|
||||
'force_set_username',
|
||||
'text',
|
||||
'用户名',
|
||||
'',
|
||||
function ($username, &$vdata) {
|
||||
$user = UOJUser::query($username);
|
||||
[
|
||||
'placeholder' => '用户名',
|
||||
'validator_php' => function ($username, &$vdata) {
|
||||
$user = UOJUser::query($username);
|
||||
|
||||
if (!$user) {
|
||||
return '用户不存在';
|
||||
}
|
||||
if (!$user) {
|
||||
return '用户不存在';
|
||||
}
|
||||
|
||||
if (!UOJContest::cur()->userHasRegistered($user)) {
|
||||
return '该用户未报名';
|
||||
}
|
||||
if (!UOJContest::cur()->userHasRegistered($user)) {
|
||||
return '该用户未报名';
|
||||
}
|
||||
|
||||
$vdata['user'] = $user;
|
||||
$vdata['user'] = $user;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
return '';
|
||||
},
|
||||
]
|
||||
);
|
||||
$force_set_user_participated_form->submit_button_config['align'] = 'compressed';
|
||||
$force_set_user_participated_form->submit_button_config['text'] = '强制参赛';
|
||||
$force_set_user_participated_form->submit_button_config['class_str'] = 'mt-2 btn btn-warning';
|
||||
$force_set_user_participated_form->config['submit_container']['class'] = 'mt-3 text-center';
|
||||
$force_set_user_participated_form->config['submit_button']['class'] = 'btn btn-warning';
|
||||
$force_set_user_participated_form->config['submit_button']['text'] = '强制参赛';
|
||||
$force_set_user_participated_form->handle = function (&$vdata) {
|
||||
UOJContest::cur()->markUserAsParticipated($vdata['user']);
|
||||
};
|
||||
@ -140,39 +138,40 @@ if ($contest['cur_progress'] == CONTEST_NOT_STARTED) {
|
||||
|
||||
if ($iHasRegistered) {
|
||||
if ($iHasRegistered && UOJContest::cur()->freeRegistration()) {
|
||||
$unregister_form = new UOJBs4Form('unregister');
|
||||
$unregister_form = new UOJForm('unregister');
|
||||
$unregister_form->handle = function () {
|
||||
UOJContest::cur()->userUnregister(Auth::user());
|
||||
};
|
||||
$unregister_form->submit_button_config['class_str'] = 'btn btn-danger btn-xs';
|
||||
$unregister_form->submit_button_config['text'] = '取消报名';
|
||||
$unregister_form->config['submit_container']['class'] = 'text-end';
|
||||
$unregister_form->config['submit_button']['class'] = 'btn btn-danger btn-xs';
|
||||
$unregister_form->config['submit_button']['text'] = '取消报名';
|
||||
$unregister_form->succ_href = "/contests";
|
||||
|
||||
$unregister_form->runAtServer();
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php echoUOJPageHeader(HTML::stripTags($contest['name']) . ' - ' . UOJLocale::get('contests::contest registrants')) ?>
|
||||
<?php echoUOJPageHeader(HTML::stripTags(UOJContest::info('name')) . ' - ' . UOJLocale::get('contests::contest registrants')) ?>
|
||||
|
||||
<h1 class="text-center">
|
||||
<?= $contest['name'] ?>
|
||||
<?= UOJContest::info('name') ?>
|
||||
</h1>
|
||||
|
||||
<?php if ($contest['cur_progress'] == CONTEST_NOT_STARTED) : ?>
|
||||
<?php if (UOJContest::cur()->progress() == CONTEST_NOT_STARTED) : ?>
|
||||
<?php if ($iHasRegistered) : ?>
|
||||
<div class="row">
|
||||
<div class="row mb-3">
|
||||
<div class="col-6">
|
||||
<a class="text-decoration-none text-success">已报名</a>
|
||||
</div>
|
||||
<div class="col-6 text-end">
|
||||
<?php $unregister_form->printHTML(); ?>
|
||||
<div class="col-6">
|
||||
<?php $unregister_form->printHTML() ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div>当前尚未报名,您可以 <a class="text-decoration-none text-danger" href="/contest/<?= $contest['id'] ?>/register">报名</a>。</div>
|
||||
<div class="mb-3">
|
||||
当前尚未报名,您可以 <a class="text-decoration-none text-danger" href="/contest/<?= UOJContest::info('id') ?>/register">报名</a>。
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<div class="mt-2"></div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php
|
||||
@ -216,18 +215,50 @@ echoLongTable(
|
||||
);
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (isset($add_new_contestant_form)) {
|
||||
$add_new_contestant_form->printHTML();
|
||||
}
|
||||
if (isset($add_group_to_contest_form)) {
|
||||
$add_group_to_contest_form->printHTML();
|
||||
}
|
||||
if (isset($remove_user_from_contest_form)) {
|
||||
$remove_user_from_contest_form->printHTML();
|
||||
}
|
||||
if (isset($force_set_user_participated_form)) {
|
||||
$force_set_user_participated_form->printHTML();
|
||||
}
|
||||
?>
|
||||
<div class="row gy-2 gx-3 align-items-center">
|
||||
<?php if (isset($add_new_contestant_form)) : ?>
|
||||
<div class="col-auto">
|
||||
<div class="card">
|
||||
<div class="card-header fw-bold">添加参赛者</div>
|
||||
<div class="card-body">
|
||||
<?php $add_new_contestant_form->printHTML() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (isset($add_group_to_contest_form)) : ?>
|
||||
<div class="col-auto">
|
||||
<div class="card">
|
||||
<div class="card-header fw-bold">小组报名</div>
|
||||
<div class="card-body">
|
||||
<?php $add_group_to_contest_form->printHTML() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (isset($remove_user_from_contest_form)) : ?>
|
||||
<div class="col-auto">
|
||||
<div class="card border-danger">
|
||||
<div class="card-header fw-bold text-bg-danger">移除选手</div>
|
||||
<div class="card-body">
|
||||
<?php $remove_user_from_contest_form->printHTML() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (isset($force_set_user_participated_form)) : ?>
|
||||
<div class="col-auto">
|
||||
<div class="card">
|
||||
<div class="card-header fw-bold">强制参赛</div>
|
||||
<div class="card-body">
|
||||
<?php $force_set_user_participated_form->printHTML() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
|
||||
<?php echoUOJPageFooter() ?>
|
||||
|
@ -6,12 +6,12 @@ Auth::check() || redirectToLogin();
|
||||
UOJContest::init(UOJRequest::get('id')) || UOJResponse::page404();
|
||||
UOJContest::cur()->userCanRegister(Auth::user(), ['ensure' => true]);
|
||||
|
||||
$register_form = new UOJBs4Form('register');
|
||||
$register_form = new UOJForm('register');
|
||||
$register_form->handle = function () {
|
||||
UOJContest::cur()->userRegister(Auth::user());
|
||||
};
|
||||
$register_form->submit_button_config['class_str'] = 'btn btn-primary';
|
||||
$register_form->submit_button_config['text'] = '我已阅读规则,确认报名比赛';
|
||||
$register_form->config['submit_button']['class'] = 'btn btn-primary';
|
||||
$register_form->config['submit_button']['text'] = '我已阅读规则,确认报名比赛';
|
||||
|
||||
if (UOJContest::cur()->progress() == CONTEST_IN_PROGRESS) {
|
||||
$register_form->succ_href = '/contest/' . UOJContest::info('id') . '/confirm';
|
||||
@ -24,11 +24,15 @@ $register_form->runAtServer();
|
||||
|
||||
<?php echoUOJPageHeader('报名 - ' . UOJContest::info('name')) ?>
|
||||
|
||||
<div class="card mw-100 mx-auto" style="width:800px">
|
||||
<div class="card mw-100 mx-auto" style="width: 800px">
|
||||
<div class="card-body">
|
||||
<h1 class="card-title text-center mb-3">比赛规则</h1>
|
||||
<h1 class="card-title text-center mb-3">
|
||||
比赛规则
|
||||
</h1>
|
||||
|
||||
<p class="card-text">您即将报名比赛 “<b><?= UOJContest::info('name') ?></b>”,请在报名前仔细阅读以下比赛规则:</p>
|
||||
<p class="card-text">
|
||||
您即将报名比赛 “<b><?= UOJContest::info('name') ?></b>”,请在报名前仔细阅读以下比赛规则:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<?php if (UOJContest::cur()->progress() == CONTEST_IN_PROGRESS) : ?>
|
||||
|
@ -1,37 +1,38 @@
|
||||
<?php
|
||||
requireLib('bootstrap5');
|
||||
requirePHPLib('form');
|
||||
|
||||
use Gregwar\Captcha\PhraseBuilder;
|
||||
|
||||
$forgot_form = new UOJBs4Form('forgot');
|
||||
$forgot_form->addInput(
|
||||
'username',
|
||||
'text',
|
||||
'用户名',
|
||||
'',
|
||||
function ($username, &$vdata) {
|
||||
$forgot_form = new UOJForm('forgot');
|
||||
$forgot_form->addInput('username', [
|
||||
'div_class' => '',
|
||||
'label' => '用户名',
|
||||
'validator_php' => function ($username, &$vdata) {
|
||||
if (!validateUsername($username)) {
|
||||
return '用户名不合法';
|
||||
}
|
||||
|
||||
$vdata['user'] = UOJUser::query($username);
|
||||
|
||||
if (!$vdata['user']) {
|
||||
return '该用户不存在';
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
]);
|
||||
$enter_verification_code_text = UOJLocale::get('enter verification code');
|
||||
$forgot_form->appendHTML(<<<EOD
|
||||
<div id="div-captcha" class="form-group">
|
||||
<label for="input-captcha" class="col-sm-2 control-label">验证码</label>
|
||||
<div class="col-sm-3" style="max-width: 60%">
|
||||
<input type="text" class="form-control" id="input-captcha" name="captcha" placeholder="请输入验证码" maxlength="20" style="display: inline-block; width: 12em;" />
|
||||
<div style="display: inline-block; margin-left: 8px; position: relative; top: -2px; cursor: pointer;">
|
||||
<img id="captcha" src="" />
|
||||
<div id="div-captcha" class="form-group mt-3">
|
||||
<label for="input-captcha" class="col-sm-2 control-label">验证码</label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="input-captcha" name="captcha" placeholder="{$enter_verification_code_text}" maxlength="20" />
|
||||
<span class="input-group-text p-0">
|
||||
<img id="captcha" class="col w-100 h-100" src="/captcha">
|
||||
</span>
|
||||
</div>
|
||||
<span class="help-block" id="help-captcha" style="display: block"></span>
|
||||
</div>
|
||||
</div>
|
||||
EOD);
|
||||
$forgot_form->handle = function (&$vdata) {
|
||||
$user = $vdata['user'];
|
||||
@ -53,7 +54,7 @@ $forgot_form->handle = function (&$vdata) {
|
||||
$oj_name_short = UOJConfig::$data['profile']['oj-name-short'];
|
||||
$check_code = md5($user['username'] . "+" . $password . '+' . UOJTime::$time_now_str);
|
||||
$sufs = base64url_encode($user['username'] . "." . $check_code);
|
||||
$url = HTML::url("/reset-password", ['params' => ['p' => $sufs]]);
|
||||
$url = HTML::url("/reset_password", ['params' => ['p' => $sufs]]);
|
||||
$oj_url = HTML::url('/');
|
||||
$name = $user['username'];
|
||||
$remote_addr = UOJContext::remoteAddr();
|
||||
@ -85,9 +86,19 @@ EOD;
|
||||
$mailer->addAddress($user['email'], $user['username']);
|
||||
$mailer->Subject = $oj_name_short . " 密码找回";
|
||||
$mailer->msgHTML($html);
|
||||
if (!$mailer->send()) {
|
||||
error_log($mailer->ErrorInfo);
|
||||
becomeMsgPage('<div class="text-center"><h2>邮件发送失败,请重试!</h2></div>');
|
||||
|
||||
$res = retry_loop(function () use (&$mailer) {
|
||||
$res = $mailer->send();
|
||||
|
||||
if ($res) return true;
|
||||
|
||||
UOJLog::error($mailer->ErrorInfo);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
if (!$res) {
|
||||
becomeMsgPage('<div class="text-center"><h2>邮件发送失败,请重试!</h2><a href="">返回</a></div>');
|
||||
} else {
|
||||
DB::update([
|
||||
"update user_info",
|
||||
@ -102,13 +113,19 @@ EOD;
|
||||
becomeMsgPage('<div class="text-center"><h2>邮件发送成功,请检查收件箱!</h2><span>如果邮件未出现在收件箱中,请检查垃圾箱。</span></div>');
|
||||
}
|
||||
};
|
||||
$forgot_form->submit_button_config['align'] = 'offset';
|
||||
$forgot_form->runAtServer();
|
||||
?>
|
||||
|
||||
<?php echoUOJPageHeader('找回密码') ?>
|
||||
<h2 class="page-header">找回密码</h2>
|
||||
<h4>请输入需要找回密码的用户名:</h4>
|
||||
<?php $forgot_form->printHTML(); ?>
|
||||
|
||||
<div class="card mw-100 mx-auto" style="width:600px">
|
||||
<div class="card-body">
|
||||
<h1 class="text-center mb-3">找回密码</h1>
|
||||
|
||||
<?php $forgot_form->printHTML() ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function refreshCaptcha() {
|
||||
var timestamp = new Date().getTime();
|
||||
@ -116,11 +133,10 @@ $forgot_form->runAtServer();
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
refreshCaptcha();
|
||||
|
||||
$("#captcha").click(function(e) {
|
||||
refreshCaptcha();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php echoUOJPageFooter() ?>
|
||||
|
@ -31,13 +31,11 @@ if (!isset($tabs_info[$cur_tab])) {
|
||||
}
|
||||
|
||||
if ($cur_tab == 'profile') {
|
||||
$update_profile_form = new UOJBs4Form('update_profile');
|
||||
$update_profile_form->addVInput(
|
||||
'name',
|
||||
'text',
|
||||
'名称',
|
||||
UOJGroup::info('title'),
|
||||
function ($title, &$vdata) {
|
||||
$update_profile_form = new UOJForm('update_profile');
|
||||
$update_profile_form->addInput('name', [
|
||||
'label' => '名称',
|
||||
'default_value' => UOJGroup::info('title'),
|
||||
'validator_php' => function ($title, &$vdata) {
|
||||
if ($title == '') {
|
||||
return '名称不能为空';
|
||||
}
|
||||
@ -55,17 +53,26 @@ if ($cur_tab == 'profile') {
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$update_profile_form->addVCheckboxes('is_hidden', [
|
||||
'0' => '公开',
|
||||
'1' => '隐藏',
|
||||
], '可见性', UOJGroup::info('is_hidden'));
|
||||
$update_profile_form->addVTextArea(
|
||||
'announcement',
|
||||
'公告',
|
||||
UOJGroup::info('announcement'),
|
||||
function ($announcement, &$vdata) {
|
||||
]);
|
||||
$update_profile_form->addCheckboxes('is_hidden', [
|
||||
'div_class' => 'mt-3',
|
||||
'label' => '可见性',
|
||||
'label_class' => 'me-3',
|
||||
'options' => [
|
||||
0 => '公开',
|
||||
1 => '隐藏',
|
||||
],
|
||||
'select_class' => 'd-inline-block',
|
||||
'option_div_class' => 'form-check d-inline-block ms-2',
|
||||
'default_value' => UOJGroup::info('is_hidden'),
|
||||
]);
|
||||
$update_profile_form->addTextArea('announcement', [
|
||||
'div_class' => 'mt-3',
|
||||
'label' => '公告',
|
||||
'input_class' => 'form-control font-monospace',
|
||||
'default_value' => UOJGroup::info('announcement'),
|
||||
'help' => '公告支持 Markdown 语法。',
|
||||
'validator_php' => function ($announcement, &$vdata) {
|
||||
if (strlen($announcement) > 3000) {
|
||||
return '公告过长';
|
||||
}
|
||||
@ -74,8 +81,7 @@ if ($cur_tab == 'profile') {
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
]);
|
||||
$update_profile_form->handle = function ($vdata) {
|
||||
DB::update([
|
||||
"update `groups`",
|
||||
@ -92,26 +98,26 @@ if ($cur_tab == 'profile') {
|
||||
dieWithJsonData(['status' => 'success', 'message' => '修改成功']);
|
||||
};
|
||||
$update_profile_form->setAjaxSubmit(<<<EOD
|
||||
function(res) {
|
||||
if (res.status === 'success') {
|
||||
$('#result-alert')
|
||||
.html('小组信息修改成功!')
|
||||
.addClass('alert-success')
|
||||
.removeClass('alert-danger')
|
||||
.show();
|
||||
} else {
|
||||
$('#result-alert')
|
||||
.html('小组信息修改失败。' + (res.message || ''))
|
||||
.removeClass('alert-success')
|
||||
.addClass('alert-danger')
|
||||
.show();
|
||||
}
|
||||
function(res) {
|
||||
if (res.status === 'success') {
|
||||
$('#result-alert')
|
||||
.html('小组信息修改成功!')
|
||||
.addClass('alert-success')
|
||||
.removeClass('alert-danger')
|
||||
.show();
|
||||
} else {
|
||||
$('#result-alert')
|
||||
.html('小组信息修改失败。' + (res.message || ''))
|
||||
.removeClass('alert-success')
|
||||
.addClass('alert-danger')
|
||||
.show();
|
||||
}
|
||||
|
||||
$(window).scrollTop(0);
|
||||
}
|
||||
EOD);
|
||||
$update_profile_form->submit_button_config['class_str'] = 'btn btn-secondary mt-3';
|
||||
$update_profile_form->submit_button_config['text'] = '更新';
|
||||
$(window).scrollTop(0);
|
||||
}
|
||||
EOD);
|
||||
$update_profile_form->config['submit_button']['class'] = 'btn btn-secondary';
|
||||
$update_profile_form->config['submit_button']['text'] = '更新';
|
||||
$update_profile_form->runAtServer();
|
||||
} elseif ($cur_tab == 'assignments') {
|
||||
if (isset($_POST['submit-remove_assignment']) && $_POST['submit-remove_assignment'] == 'remove_assignment') {
|
||||
@ -133,13 +139,10 @@ EOD);
|
||||
dieWithAlert('移除成功!');
|
||||
}
|
||||
|
||||
$add_new_assignment_form = new UOJBs4Form('add_new_assignment');
|
||||
$add_new_assignment_form->addVInput(
|
||||
'new_assignment_list_id',
|
||||
'text',
|
||||
'题单 ID',
|
||||
'',
|
||||
function ($list_id, &$vdata) {
|
||||
$add_new_assignment_form = new UOJForm('add_new_assignment');
|
||||
$add_new_assignment_form->addInput('new_assignment_list_id', [
|
||||
'label' => '题单 ID',
|
||||
'validator_php' => function ($list_id, &$vdata) {
|
||||
if (!validateUInt($list_id)) {
|
||||
return '题单 ID 不合法';
|
||||
}
|
||||
@ -162,17 +165,11 @@ EOD);
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$default_end_time = new DateTime();
|
||||
$default_end_time->setTime(22, 30, 0);
|
||||
$default_end_time->add(new DateInterval("P7D"));
|
||||
$add_new_assignment_form->addVInput(
|
||||
'new_assignment_end_time',
|
||||
'text',
|
||||
'截止时间',
|
||||
$default_end_time->format('Y-m-d H:i'),
|
||||
function ($end_time, &$vdata) {
|
||||
]);
|
||||
$add_new_assignment_form->addInput('new_assignment_end_time', [
|
||||
'label' => '截止时间',
|
||||
'default_value' => UOJTime::time2str((new DateTime())->add(new DateInterval("P7D"))->setTime(22, 30, 0)),
|
||||
'validator_php' => function ($end_time, &$vdata) {
|
||||
try {
|
||||
$vdata['end_time'] = new DateTime($end_time);
|
||||
} catch (Exception $e) {
|
||||
@ -181,8 +178,7 @@ EOD);
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
]);
|
||||
$add_new_assignment_form->handle = function (&$vdata) {
|
||||
DB::insert([
|
||||
"insert into groups_assignments",
|
||||
@ -199,27 +195,27 @@ EOD);
|
||||
'message' => '题单 #' . $vdata['list_id'] . ' 已经被添加到作业列表中,结束时间为 ' . $vdata['end_time']->format('Y-m-d H:i:s') . '。'
|
||||
]);
|
||||
};
|
||||
$add_new_assignment_form->submit_button_config['class_str'] = 'btn btn-secondary mt-3';
|
||||
$add_new_assignment_form->submit_button_config['text'] = '添加';
|
||||
$add_new_assignment_form->config['submit_button']['class'] = 'btn btn-secondary';
|
||||
$add_new_assignment_form->config['submit_button']['text'] = '添加';
|
||||
$add_new_assignment_form->setAjaxSubmit(<<<EOD
|
||||
function(res) {
|
||||
if (res.status === 'success') {
|
||||
$('#result-alert')
|
||||
.html('作业添加成功!' + (res.message || ''))
|
||||
.addClass('alert-success')
|
||||
.removeClass('alert-danger')
|
||||
.show();
|
||||
} else {
|
||||
$('#result-alert')
|
||||
.html('作业添加失败。' + (res.message || ''))
|
||||
.removeClass('alert-success')
|
||||
.addClass('alert-danger')
|
||||
.show();
|
||||
}
|
||||
function(res) {
|
||||
if (res.status === 'success') {
|
||||
$('#result-alert')
|
||||
.html('作业添加成功!' + (res.message || ''))
|
||||
.addClass('alert-success')
|
||||
.removeClass('alert-danger')
|
||||
.show();
|
||||
} else {
|
||||
$('#result-alert')
|
||||
.html('作业添加失败。' + (res.message || ''))
|
||||
.removeClass('alert-success')
|
||||
.addClass('alert-danger')
|
||||
.show();
|
||||
}
|
||||
|
||||
$(window).scrollTop(0);
|
||||
}
|
||||
EOD);
|
||||
$(window).scrollTop(0);
|
||||
}
|
||||
EOD);
|
||||
$add_new_assignment_form->runAtServer();
|
||||
|
||||
$hidden_time = new DateTime();
|
||||
@ -247,13 +243,10 @@ EOD);
|
||||
dieWithAlert('移除成功!');
|
||||
}
|
||||
|
||||
$add_new_user_form = new UOJBs4Form('add_new_user');
|
||||
$add_new_user_form->addVInput(
|
||||
'new_username',
|
||||
'text',
|
||||
'用户名',
|
||||
'',
|
||||
function ($username, &$vdata) {
|
||||
$add_new_user_form = new UOJForm('add_new_user');
|
||||
$add_new_user_form->addInput('new_username', [
|
||||
'label' => '用户名',
|
||||
'validator_php' => function ($username, &$vdata) {
|
||||
$user = UOJUser::query($username);
|
||||
|
||||
if (!$user) {
|
||||
@ -268,10 +261,9 @@ EOD);
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$add_new_user_form->submit_button_config['class_str'] = 'btn btn-secondary mt-3';
|
||||
$add_new_user_form->submit_button_config['text'] = '添加';
|
||||
]);
|
||||
$add_new_user_form->config['submit_button']['class'] = 'btn btn-secondary';
|
||||
$add_new_user_form->config['submit_button']['text'] = '添加';
|
||||
$add_new_user_form->handle = function (&$vdata) {
|
||||
DB::insert([
|
||||
"insert into groups_users",
|
||||
@ -286,24 +278,24 @@ EOD);
|
||||
dieWithJsonData(['status' => 'success', 'message' => '已将用户名为 ' . $vdata['username'] . ' 的用户添加到本小组。']);
|
||||
};
|
||||
$add_new_user_form->setAjaxSubmit(<<<EOD
|
||||
function(res) {
|
||||
if (res.status === 'success') {
|
||||
$('#result-alert')
|
||||
.html('用户添加成功!' + (res.message || ''))
|
||||
.addClass('alert-success')
|
||||
.removeClass('alert-danger')
|
||||
.show();
|
||||
} else {
|
||||
$('#result-alert')
|
||||
.html('用户添加失败。' + (res.message || ''))
|
||||
.removeClass('alert-success')
|
||||
.addClass('alert-danger')
|
||||
.show();
|
||||
}
|
||||
function(res) {
|
||||
if (res.status === 'success') {
|
||||
$('#result-alert')
|
||||
.html('用户添加成功!' + (res.message || ''))
|
||||
.addClass('alert-success')
|
||||
.removeClass('alert-danger')
|
||||
.show();
|
||||
} else {
|
||||
$('#result-alert')
|
||||
.html('用户添加失败。' + (res.message || ''))
|
||||
.removeClass('alert-success')
|
||||
.addClass('alert-danger')
|
||||
.show();
|
||||
}
|
||||
|
||||
$(window).scrollTop(0);
|
||||
}
|
||||
EOD);
|
||||
$(window).scrollTop(0);
|
||||
}
|
||||
EOD);
|
||||
$add_new_user_form->runAtServer();
|
||||
}
|
||||
?>
|
||||
|
@ -7,14 +7,18 @@ requirePHPLib('data');
|
||||
Auth::check() || redirectToLogin();
|
||||
|
||||
if (UOJGroup::userCanCreateGroup(Auth::user())) {
|
||||
$new_group_form = new UOJBs4Form('new_group');
|
||||
$new_group_form = new UOJForm('new_group');
|
||||
$new_group_form->handle = function () {
|
||||
DB::query("insert into `groups` (title, is_hidden) values ('新小组', 1)");
|
||||
DB::insert([
|
||||
"insert into `groups`",
|
||||
DB::bracketed_fields(['title', 'is_hidden']),
|
||||
"values", DB::tuple(['新小组', 1]),
|
||||
]);
|
||||
};
|
||||
$new_group_form->submit_button_config['align'] = 'right';
|
||||
$new_group_form->submit_button_config['class_str'] = 'btn btn-primary';
|
||||
$new_group_form->submit_button_config['text'] = UOJLocale::get('add new group');
|
||||
$new_group_form->submit_button_config['smart_confirm'] = '';
|
||||
$new_group_form->config['submit_container']['class'] = 'text-end';
|
||||
$new_group_form->config['submit_button']['class'] = 'btn btn-primary';
|
||||
$new_group_form->config['submit_button']['text'] = UOJLocale::get('add new group');
|
||||
$new_group_form->config['confirm']['smart'] = true;
|
||||
$new_group_form->runAtServer();
|
||||
}
|
||||
?>
|
||||
@ -23,7 +27,7 @@ if (UOJGroup::userCanCreateGroup(Auth::user())) {
|
||||
|
||||
<div class="row">
|
||||
<!-- left col -->
|
||||
<div class="col-lg-9">
|
||||
<div class="col-md-9">
|
||||
<!-- title container -->
|
||||
<div class="d-flex justify-content-between">
|
||||
<h1>
|
||||
@ -31,11 +35,8 @@ if (UOJGroup::userCanCreateGroup(Auth::user())) {
|
||||
</h1>
|
||||
|
||||
<?php if (isset($new_group_form)) : ?>
|
||||
<div class="text-end">
|
||||
<?php $new_group_form->printHTML(); ?>
|
||||
</div>
|
||||
<?php $new_group_form->printHTML() ?>
|
||||
<?php endif ?>
|
||||
|
||||
</div>
|
||||
<!-- end title container -->
|
||||
|
||||
@ -91,11 +92,11 @@ if (UOJGroup::userCanCreateGroup(Auth::user())) {
|
||||
]
|
||||
);
|
||||
?>
|
||||
<!-- end left col -->
|
||||
</div>
|
||||
<!-- end left col -->
|
||||
|
||||
<!-- right col -->
|
||||
<aside class="col-lg-3 mt-3 mt-lg-0">
|
||||
<aside class="col-md-3 mt-3 mt-md-0">
|
||||
<?php uojIncludeView('sidebar') ?>
|
||||
</aside>
|
||||
<!-- end right col -->
|
||||
|
@ -17,23 +17,23 @@ if (UOJHack::cur()->setSubmission()) {
|
||||
}
|
||||
|
||||
if (UOJHack::cur()->userCanDelete(Auth::user())) {
|
||||
$delete_form = new UOJBs4Form('delete');
|
||||
$delete_form = new UOJForm('delete');
|
||||
$delete_form->handle = function () {
|
||||
DB::delete([
|
||||
"delete from hacks",
|
||||
"where", ["id" => UOJHack::info('id')]
|
||||
]);
|
||||
};
|
||||
$delete_form->submit_button_config['class_str'] = 'btn btn-danger';
|
||||
$delete_form->submit_button_config['text'] = '删除此 Hack';
|
||||
$delete_form->submit_button_config['align'] = 'end';
|
||||
$delete_form->submit_button_config['smart_confirm'] = '';
|
||||
$delete_form->config['submit_container']['class'] = 'text-end';
|
||||
$delete_form->config['submit_button']['class'] = 'btn btn-sm btn-danger';
|
||||
$delete_form->config['submit_button']['text'] = '删除此 Hack';
|
||||
$delete_form->config['confirm']['smart'] = true;
|
||||
$delete_form->succ_href = "/hacks";
|
||||
$delete_form->runAtServer();
|
||||
}
|
||||
|
||||
if (UOJHack::cur()->userCanReview(Auth::user())) {
|
||||
$addex_form = new UOJBs4Form('addex');
|
||||
$addex_form = new UOJForm('addex');
|
||||
$addex_form->handle = function () {
|
||||
$input = UOJContext::storagePath() . UOJHack::info('input');
|
||||
$new_in = "{$input}_in";
|
||||
@ -50,16 +50,17 @@ if (UOJHack::cur()->userCanReview(Auth::user())) {
|
||||
], "where", ['id' => UOJHack::info('id')]
|
||||
]);
|
||||
};
|
||||
$addex_form->submit_button_config['class_str'] = 'btn btn-danger mt-3';
|
||||
$addex_form->submit_button_config['text'] = '确认无误,添加到测试数据';
|
||||
$addex_form->submit_button_config['align'] = 'end';
|
||||
$addex_form->submit_button_config['smart_confirm'] = '';
|
||||
$addex_form->config['submit_button']['class'] = 'btn btn-sm btn-danger';
|
||||
$addex_form->config['submit_button']['text'] = '确认无误,添加到测试数据';
|
||||
$addex_form->config['submit_container']['class'] = 'mt-3 text-end';
|
||||
$addex_form->config['confirm']['text'] = '将这个 Hack 数据添加到测试数据中';
|
||||
$addex_form->succ_href = "/hacks";
|
||||
$addex_form->runAtServer();
|
||||
}
|
||||
|
||||
$perm = UOJHack::cur()->viewerCanSeeComponents(Auth::user());
|
||||
?>
|
||||
|
||||
<?php echoUOJPageHeader(UOJLocale::get('problems::hack') . ' #' . UOJHack::info('id')) ?>
|
||||
|
||||
<h1>
|
||||
|
@ -25,13 +25,11 @@ if (!isset($tabs_info[$cur_tab])) {
|
||||
}
|
||||
|
||||
if ($cur_tab == 'profile') {
|
||||
$update_profile_form = new UOJBs4Form('update_profile');
|
||||
$update_profile_form->addVInput(
|
||||
'name',
|
||||
'text',
|
||||
'标题',
|
||||
UOJList::info('title'),
|
||||
function ($title, &$vdata) {
|
||||
$update_profile_form = new UOJForm('update_profile');
|
||||
$update_profile_form->addInput('name', [
|
||||
'label' => '标题',
|
||||
'default_value' => UOJList::info('title'),
|
||||
'validator_php' => function ($title, &$vdata) {
|
||||
if ($title == '') {
|
||||
return '标题不能为空';
|
||||
}
|
||||
@ -49,18 +47,23 @@ if ($cur_tab == 'profile') {
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$update_profile_form->addVCheckboxes('is_hidden', [
|
||||
'0' => '公开',
|
||||
'1' => '隐藏',
|
||||
], '可见性', UOJList::info('is_hidden'));
|
||||
$update_profile_form->addVInput(
|
||||
'tags',
|
||||
'text',
|
||||
'标签(多个标签用逗号隔开)',
|
||||
implode(', ', UOJList::cur()->queryTags()),
|
||||
function ($tags_str, &$vdata) {
|
||||
]);
|
||||
$update_profile_form->addCheckboxes('is_hidden', [
|
||||
'div_class' => 'mt-3',
|
||||
'label' => '可见性',
|
||||
'label_class' => 'me-3',
|
||||
'select_class' => 'd-inline-block',
|
||||
'option_div_class' => 'form-check d-inline-block ms-2',
|
||||
'default_value' => UOJList::info('is_hidden'),
|
||||
'options' => [
|
||||
0 => '公开',
|
||||
1 => '隐藏',
|
||||
],
|
||||
]);
|
||||
$update_profile_form->addInput('tags', [
|
||||
'label' => '标签',
|
||||
'default_value' => implode(', ', UOJList::cur()->queryTags()),
|
||||
'validator_php' => function ($tags_str, &$vdata) {
|
||||
$tags_raw = explode(',', str_replace(',', ',', $tags_str));
|
||||
$tags = [];
|
||||
|
||||
@ -90,14 +93,13 @@ if ($cur_tab == 'profile') {
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$update_profile_form->addVTextArea(
|
||||
'content_md',
|
||||
'描述',
|
||||
UOJList::cur()->queryContent()['content_md'],
|
||||
function ($content_md, &$vdata) {
|
||||
if (strlen($content_md) > 3000) {
|
||||
'help' => '多个标签请使用逗号隔开。'
|
||||
]);
|
||||
$update_profile_form->addTextArea('content_md', [
|
||||
'label' => '描述',
|
||||
'default_value' => UOJList::cur()->queryContent()['content_md'],
|
||||
'validator_php' => function ($content_md, &$vdata) {
|
||||
if (strlen($content_md) > 5000) {
|
||||
return '描述过长';
|
||||
}
|
||||
|
||||
@ -105,8 +107,7 @@ if ($cur_tab == 'profile') {
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
]);
|
||||
$update_profile_form->handle = function ($vdata) {
|
||||
DB::update([
|
||||
"update lists",
|
||||
@ -135,26 +136,25 @@ if ($cur_tab == 'profile') {
|
||||
dieWithJsonData(['status' => 'success', 'message' => '修改成功']);
|
||||
};
|
||||
$update_profile_form->setAjaxSubmit(<<<EOD
|
||||
function(res) {
|
||||
if (res.status === 'success') {
|
||||
$('#result-alert')
|
||||
.html('题单信息修改成功!')
|
||||
.addClass('alert-success')
|
||||
.removeClass('alert-danger')
|
||||
.show();
|
||||
} else {
|
||||
$('#result-alert')
|
||||
.html('题单信息修改失败。' + (res.message || ''))
|
||||
.removeClass('alert-success')
|
||||
.addClass('alert-danger')
|
||||
.show();
|
||||
}
|
||||
function(res) {
|
||||
if (res.status === 'success') {
|
||||
$('#result-alert')
|
||||
.html('题单信息修改成功!')
|
||||
.addClass('alert-success')
|
||||
.removeClass('alert-danger')
|
||||
.show();
|
||||
} else {
|
||||
$('#result-alert')
|
||||
.html('题单信息修改失败。' + (res.message || ''))
|
||||
.removeClass('alert-success')
|
||||
.addClass('alert-danger')
|
||||
.show();
|
||||
}
|
||||
|
||||
$(window).scrollTop(0);
|
||||
}
|
||||
EOD);
|
||||
$update_profile_form->submit_button_config['class_str'] = 'btn btn-secondary mt-3';
|
||||
$update_profile_form->submit_button_config['text'] = '更新';
|
||||
$(window).scrollTop(0);
|
||||
}
|
||||
EOD);
|
||||
$update_profile_form->config['submit_button']['text'] = '更新';
|
||||
$update_profile_form->runAtServer();
|
||||
} elseif ($cur_tab == 'problems') {
|
||||
if (isset($_POST['submit-remove_problem']) && $_POST['submit-remove_problem'] == 'remove_problem') {
|
||||
@ -189,13 +189,10 @@ EOD);
|
||||
],
|
||||
]);
|
||||
|
||||
$add_new_problem_form = new UOJBs4Form('add_new_problem');
|
||||
$add_new_problem_form->addVInput(
|
||||
'problem_id',
|
||||
'text',
|
||||
'题目 ID',
|
||||
'',
|
||||
function ($problem_id, &$vdata) {
|
||||
$add_new_problem_form = new UOJForm('add_new_problem');
|
||||
$add_new_problem_form->addInput('problem_id', [
|
||||
'label' => '题目 ID',
|
||||
'validator_php' => function ($problem_id, &$vdata) {
|
||||
$problem = UOJProblem::query($problem_id);
|
||||
|
||||
if (!$problem || !$problem->userCanView(Auth::user())) {
|
||||
@ -210,10 +207,8 @@ EOD);
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$add_new_problem_form->submit_button_config['class_str'] = 'btn btn-secondary mt-3';
|
||||
$add_new_problem_form->submit_button_config['text'] = '添加';
|
||||
]);
|
||||
$add_new_problem_form->config['submit_button']['text'] = '添加';
|
||||
$add_new_problem_form->handle = function ($vdata) {
|
||||
DB::insert([
|
||||
"insert into lists_problems",
|
||||
@ -224,24 +219,24 @@ EOD);
|
||||
dieWithJsonData(['status' => 'success', 'message' => '已将题目 #' . $vdata['problem']->info['id'] . ' 添加到题单 #' . UOJList::info('id') . ' 中']);
|
||||
};
|
||||
$add_new_problem_form->setAjaxSubmit(<<<EOD
|
||||
function(res) {
|
||||
if (res.status === 'success') {
|
||||
$('#result-alert')
|
||||
.html('题目添加成功!' + (res.message || ''))
|
||||
.addClass('alert-success')
|
||||
.removeClass('alert-danger')
|
||||
.show();
|
||||
} else {
|
||||
$('#result-alert')
|
||||
.html('题目添加失败。' + (res.message || ''))
|
||||
.removeClass('alert-success')
|
||||
.addClass('alert-danger')
|
||||
.show();
|
||||
}
|
||||
function(res) {
|
||||
if (res.status === 'success') {
|
||||
$('#result-alert')
|
||||
.html('题目添加成功!' + (res.message || ''))
|
||||
.addClass('alert-success')
|
||||
.removeClass('alert-danger')
|
||||
.show();
|
||||
} else {
|
||||
$('#result-alert')
|
||||
.html('题目添加失败。' + (res.message || ''))
|
||||
.removeClass('alert-success')
|
||||
.addClass('alert-danger')
|
||||
.show();
|
||||
}
|
||||
|
||||
$(window).scrollTop(0);
|
||||
}
|
||||
EOD);
|
||||
$(window).scrollTop(0);
|
||||
}
|
||||
EOD);
|
||||
$add_new_problem_form->runAtServer();
|
||||
}
|
||||
?>
|
||||
|
@ -135,8 +135,8 @@ if (isset($_POST['login'])) {
|
||||
$('#help-username, #help-passwor, #help-captcha').html('');
|
||||
|
||||
if (msg == 'ok') {
|
||||
var prevUrl = document.referrer;
|
||||
if (prevUrl == '' || /.*\/login.*/.test(prevUrl) || /.*\/logout.*/.test(prevUrl) || /.*\/register.*/.test(prevUrl) || /.*\/reset-password.*/.test(prevUrl)) {
|
||||
var prevUrl = new URLSearchParams(location.search).get('to') || document.referrer;
|
||||
if (prevUrl == '' || /.*\/login.*/.test(prevUrl) || /.*\/logout.*/.test(prevUrl) || /.*\/register.*/.test(prevUrl) || /.*\/reset_password.*/.test(prevUrl)) {
|
||||
prevUrl = '/';
|
||||
};
|
||||
window.location.href = prevUrl;
|
||||
@ -165,7 +165,7 @@ if (isset($_POST['login'])) {
|
||||
$('#div-username > .form-floating, #input-username').addClass('is-invalid');
|
||||
$('#div-password').addClass('has-validation');
|
||||
$('#div-password > .form-floating, #input-password').addClass('is-invalid');
|
||||
$('#help-password').html('用户名或密码错误。<a href="/forgot-password">忘记密码?</a>');
|
||||
$('#help-password').html('用户名或密码错误。<a href="/forgot_password">忘记密码?</a>');
|
||||
refreshCaptcha();
|
||||
}
|
||||
});
|
||||
|
@ -155,9 +155,7 @@ if ($custom_test_enabled) {
|
||||
}
|
||||
return '';
|
||||
};
|
||||
$custom_test_form->ctrl_enter_submit = true;
|
||||
$custom_test_form->setAjaxSubmit(
|
||||
<<<EOD
|
||||
$custom_test_form->setAjaxSubmit(<<<EOD
|
||||
function(response_text) {
|
||||
custom_test_onsubmit(
|
||||
response_text,
|
||||
@ -165,9 +163,8 @@ if ($custom_test_enabled) {
|
||||
'{$_SERVER['REQUEST_URI']}?get=custom-test-status-details'
|
||||
)
|
||||
}
|
||||
EOD
|
||||
);
|
||||
$custom_test_form->submit_button_config['text'] = UOJLocale::get('problems::run');
|
||||
EOD);
|
||||
$custom_test_form->config['submit_button']['text'] = UOJLocale::get('problems::run');
|
||||
$custom_test_form->runAtServer();
|
||||
}
|
||||
|
||||
|
@ -126,11 +126,9 @@ if ($_POST['problem_settings_file_submit'] == 'submit') {
|
||||
}
|
||||
|
||||
|
||||
$info_form = new UOJBs4Form('info');
|
||||
$http_host = HTML::escape(UOJContext::httpHost());
|
||||
$info_form = new UOJForm('info');
|
||||
$attachment_url = UOJProblem::cur()->getAttachmentUri();
|
||||
$info_form->appendHTML(
|
||||
<<<EOD
|
||||
$info_form->appendHTML(<<<EOD
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 control-label">problem_{$problem['id']}_attachment.zip</label>
|
||||
<div class="col-sm-9">
|
||||
@ -139,11 +137,9 @@ $info_form->appendHTML(
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
EOD
|
||||
);
|
||||
EOD);
|
||||
$download_url = UOJProblem::cur()->getMainDataUri();
|
||||
$info_form->appendHTML(
|
||||
<<<EOD
|
||||
$info_form->appendHTML(<<<EOD
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 control-label">problem_{$problem['id']}.zip</label>
|
||||
<div class="col-sm-9">
|
||||
@ -152,92 +148,80 @@ $info_form->appendHTML(
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
EOD
|
||||
);
|
||||
$info_form->appendHTML(
|
||||
<<<EOD
|
||||
EOD);
|
||||
$info_form->appendHTML(<<<EOD
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 control-label">testlib.h</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="form-control-static">
|
||||
<a class="text-decoration-none" href="/download.php?type=testlib.h">下载</a>
|
||||
<a class="text-decoration-none" href="/download/testlib.h">下载</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
EOD
|
||||
);
|
||||
EOD);
|
||||
|
||||
$esc_submission_requirement = HTML::escape(json_encode(json_decode($problem['submission_requirement']), JSON_PRETTY_PRINT));
|
||||
$info_form->appendHTML(
|
||||
<<<EOD
|
||||
$info_form->appendHTML(<<<EOD
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 control-label">提交文件配置</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="form-control-static"><pre class="uoj-pre bg-light rounded">
|
||||
<pre class="uoj-pre bg-light rounded">
|
||||
$esc_submission_requirement
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
EOD
|
||||
);
|
||||
EOD);
|
||||
$esc_extra_config = HTML::escape(json_encode(json_decode($problem['extra_config']), JSON_PRETTY_PRINT));
|
||||
$info_form->appendHTML(
|
||||
<<<EOD
|
||||
$info_form->appendHTML(<<<EOD
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 control-label">其它配置</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="form-control-static"><pre class="uoj-pre bg-light rounded">
|
||||
<pre class="uoj-pre bg-light rounded">
|
||||
$esc_extra_config
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
EOD
|
||||
);
|
||||
EOD);
|
||||
if (isSuperUser(Auth::user())) {
|
||||
$info_form->addVInput(
|
||||
'submission_requirement',
|
||||
'text',
|
||||
'提交文件配置',
|
||||
$problem['submission_requirement'],
|
||||
function ($submission_requirement, &$vdata) {
|
||||
$info_form->addTextArea('submission_requirement', [
|
||||
'label' => '提交文件配置',
|
||||
'input_class' => 'form-control font-monospace',
|
||||
'default_value' => $problem['submission_requirement'],
|
||||
'validator_php' => function ($submission_requirement, &$vdata) {
|
||||
$submission_requirement = json_decode($submission_requirement, true);
|
||||
if ($submission_requirement === null) {
|
||||
return '不是合法的JSON';
|
||||
}
|
||||
$vdata['submission_requirement'] = json_encode($submission_requirement);
|
||||
},
|
||||
null
|
||||
);
|
||||
$info_form->addVInput(
|
||||
'extra_config',
|
||||
'text',
|
||||
'其它配置',
|
||||
$problem['extra_config'],
|
||||
function ($extra_config, &$vdata) {
|
||||
]);
|
||||
$info_form->addTextArea('extra_config', [
|
||||
'label' => '其他配置',
|
||||
'input_class' => 'form-control font-monospace',
|
||||
'default_value' => $problem['extra_config'],
|
||||
'validator_php' => function ($extra_config, &$vdata) {
|
||||
$extra_config = json_decode($extra_config, true);
|
||||
if ($extra_config === null) {
|
||||
return '不是合法的JSON';
|
||||
}
|
||||
$vdata['extra_config'] = json_encode($extra_config);
|
||||
},
|
||||
null
|
||||
);
|
||||
]);
|
||||
$info_form->handle = function (&$vdata) use ($problem) {
|
||||
DB::update([
|
||||
"update problems",
|
||||
"set", [
|
||||
"submission_requirement" => $vdata['submission_requirement'],
|
||||
"extra_config" => $vdata['extra_config']
|
||||
], "where", ["id" => $problem['id']]
|
||||
"extra_config" => $vdata['extra_config'],
|
||||
], "where", [
|
||||
"id" => $problem['id'],
|
||||
]
|
||||
]);
|
||||
};
|
||||
} else {
|
||||
$info_form->no_submit = true;
|
||||
$info_form->config['no_submit'] = true;
|
||||
}
|
||||
|
||||
$problem_conf = getUOJConf("$data_dir/problem.conf");
|
||||
$info_form->runAtServer();
|
||||
|
||||
function displayProblemConf(UOJProblemDataDisplayer $self) {
|
||||
global $info_form;
|
||||
@ -250,8 +234,8 @@ function displayProblemConf(UOJProblemDataDisplayer $self) {
|
||||
$self->echoFilePre('problem.conf');
|
||||
}
|
||||
|
||||
function addTestsTab(UOJProblemDataDisplayer $disp, array $problem_conf) {
|
||||
$n_tests = getUOJConfVal($problem_conf, 'n_tests', 10);
|
||||
function addTestsTab(UOJProblemDataDisplayer $disp, UOJProblemConf $problem_conf) {
|
||||
$n_tests = $problem_conf->getVal('n_tests', 10);
|
||||
if (!validateUInt($n_tests)) {
|
||||
$disp->setProblemConfRowStatus('n_tests', 'danger');
|
||||
return false;
|
||||
@ -260,8 +244,8 @@ function addTestsTab(UOJProblemDataDisplayer $disp, array $problem_conf) {
|
||||
$inputs = [];
|
||||
$outputs = [];
|
||||
for ($num = 1; $num <= $n_tests; $num++) {
|
||||
$inputs[$num] = getUOJProblemInputFileName($problem_conf, $num);
|
||||
$outputs[$num] = getUOJProblemOutputFileName($problem_conf, $num);
|
||||
$inputs[$num] = $problem_conf->getInputFileName($num);
|
||||
$outputs[$num] = $problem_conf->getOutputFileName($num);
|
||||
unset($disp->rest_data_files[$inputs[$num]]);
|
||||
unset($disp->rest_data_files[$outputs[$num]]);
|
||||
}
|
||||
@ -281,14 +265,14 @@ function addTestsTab(UOJProblemDataDisplayer $disp, array $problem_conf) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function addExTestsTab(UOJProblemDataDisplayer $disp, array $problem_conf) {
|
||||
$has_extra_tests = !(isset($problem_conf['submit_answer']) && $problem_conf['submit_answer'] == 'on');
|
||||
function addExTestsTab(UOJProblemDataDisplayer $disp, UOJProblemConf $problem_conf) {
|
||||
$has_extra_tests = $problem_conf->getNonTraditionalJudgeType() != 'submit_answer';
|
||||
|
||||
if (!$has_extra_tests) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$n_ex_tests = getUOJConfVal($problem_conf, 'n_ex_tests', 0);
|
||||
$n_ex_tests = $problem_conf->getVal('n_ex_tests', 0);
|
||||
if (!validateUInt($n_ex_tests)) {
|
||||
$disp->setProblemConfRowStatus('n_ex_tests', 'danger');
|
||||
return false;
|
||||
@ -301,8 +285,8 @@ function addExTestsTab(UOJProblemDataDisplayer $disp, array $problem_conf) {
|
||||
$inputs = [];
|
||||
$outputs = [];
|
||||
for ($num = 1; $num <= $n_ex_tests; $num++) {
|
||||
$inputs[$num] = getUOJProblemExtraInputFileName($problem_conf, $num);
|
||||
$outputs[$num] = getUOJProblemExtraOutputFileName($problem_conf, $num);
|
||||
$inputs[$num] = $problem_conf->getExtraInputFileName($num);
|
||||
$outputs[$num] = $problem_conf->getExtraOutputFileName($num);
|
||||
unset($disp->rest_data_files[$inputs[$num]]);
|
||||
unset($disp->rest_data_files[$outputs[$num]]);
|
||||
}
|
||||
@ -341,7 +325,7 @@ function addSrcTab(UOJProblemDataDisplayer $disp, $tab_name, string $name) {
|
||||
function getDataDisplayer() {
|
||||
$disp = new UOJProblemDataDisplayer(UOJProblem::cur());
|
||||
|
||||
$problem_conf = UOJProblem::cur()->getProblemConfArray();
|
||||
$problem_conf = UOJProblem::cur()->getProblemConf();
|
||||
if ($problem_conf === -1) {
|
||||
return $disp->addTab('problem.conf', function ($self) {
|
||||
global $info_form;
|
||||
@ -365,18 +349,18 @@ function getDataDisplayer() {
|
||||
});
|
||||
}
|
||||
|
||||
$disp->setProblemConf($problem_conf);
|
||||
$disp->setProblemConf($problem_conf->conf);
|
||||
unset($disp->rest_data_files['problem.conf']);
|
||||
unset($disp->rest_data_files['download.zip']);
|
||||
$disp->addTab('problem.conf', 'displayProblemConf');
|
||||
addTestsTab($disp, $problem_conf);
|
||||
addExTestsTab($disp, $problem_conf);
|
||||
|
||||
$judger_name = getUOJConfVal($problem_conf, 'use_builtin_judger', null);
|
||||
$judger_name = $problem_conf->getVal('use_builtin_judger', null);
|
||||
if ($judger_name === null) {
|
||||
return $disp;
|
||||
} elseif ($judger_name === 'on') {
|
||||
if (!isset($problem_conf['interaction_mode'])) {
|
||||
if ($problem_conf->isOn('interaction_mode')) {
|
||||
if (isset($problem_conf['use_builtin_checker'])) {
|
||||
$disp->addTab('checker', function ($self) {
|
||||
echo '<h4>use builtin checker : ', $self->problem_conf['use_builtin_checker']['val'], '</h4>';
|
||||
@ -389,7 +373,7 @@ function getDataDisplayer() {
|
||||
addSrcTab($disp, 'standard', 'std');
|
||||
addSrcTab($disp, 'validator', 'val');
|
||||
}
|
||||
if (isset($problem_conf['interaction_mode'])) {
|
||||
if (isset($problem_conf->conf['interaction_mode'])) {
|
||||
addSrcTab($disp, 'interactor', 'interactor');
|
||||
}
|
||||
return $disp;
|
||||
@ -409,7 +393,7 @@ if (isset($_GET['display_file'])) {
|
||||
die();
|
||||
}
|
||||
|
||||
$hackable_form = new UOJBs4Form('hackable');
|
||||
$hackable_form = new UOJForm('hackable');
|
||||
$hackable_form->handle = function () use ($problem) {
|
||||
$problem['hackable'] = !$problem['hackable'];
|
||||
$ret = dataSyncProblemData($problem);
|
||||
@ -424,11 +408,13 @@ $hackable_form->handle = function () use ($problem) {
|
||||
"where", ["id" => $problem['id']]
|
||||
]);
|
||||
};
|
||||
$hackable_form->submit_button_config['class_str'] = 'btn btn-warning d-block w-100';
|
||||
$hackable_form->submit_button_config['text'] = $problem['hackable'] ? '禁用 Hack 功能' : '启用 Hack 功能';
|
||||
$hackable_form->submit_button_config['smart_confirm'] = '';
|
||||
$hackable_form->config['submit_container']['class'] = '';
|
||||
$hackable_form->config['submit_button']['class'] = 'btn btn-warning d-block w-100';
|
||||
$hackable_form->config['submit_button']['text'] = $problem['hackable'] ? '禁用 Hack 功能' : '启用 Hack 功能';
|
||||
$hackable_form->config['confirm']['smart'] = true;
|
||||
$hackable_form->runAtServer();
|
||||
|
||||
$data_form = new UOJBs4Form('data');
|
||||
$data_form = new UOJForm('data');
|
||||
$data_form->handle = function () use ($problem) {
|
||||
set_time_limit(60 * 5);
|
||||
$ret = dataSyncProblemData($problem, Auth::user());
|
||||
@ -436,39 +422,46 @@ $data_form->handle = function () use ($problem) {
|
||||
becomeMsgPage('<div>' . $ret . '</div><a href="/problem/' . $problem['id'] . '/manage/data">返回</a>');
|
||||
}
|
||||
};
|
||||
$data_form->submit_button_config['class_str'] = 'btn btn-danger d-block w-100';
|
||||
$data_form->submit_button_config['text'] = '检验配置并同步数据';
|
||||
$data_form->submit_button_config['smart_confirm'] = '';
|
||||
$data_form->config['submit_container']['class'] = '';
|
||||
$data_form->config['submit_button']['class'] = 'btn btn-danger d-block w-100';
|
||||
$data_form->config['submit_button']['text'] = '检验配置并同步数据';
|
||||
$data_form->config['confirm']['smart'] = true;
|
||||
$data_form->runAtServer();
|
||||
|
||||
$clear_data_form = new UOJBs4Form('clear_data');
|
||||
$clear_data_form->handle = function () {
|
||||
global $problem;
|
||||
$clear_data_form = new UOJForm('clear_data');
|
||||
$clear_data_form->handle = function () use ($problem) {
|
||||
dataClearProblemData($problem);
|
||||
};
|
||||
$clear_data_form->submit_button_config['class_str'] = 'btn btn-danger d-block w-100';
|
||||
$clear_data_form->submit_button_config['text'] = '清空题目数据';
|
||||
$clear_data_form->submit_button_config['smart_confirm'] = '';
|
||||
$clear_data_form->config['submit_container']['class'] = '';
|
||||
$clear_data_form->config['submit_button']['class'] = 'btn btn-danger d-block w-100';
|
||||
$clear_data_form->config['submit_button']['text'] = '清空题目数据';
|
||||
$clear_data_form->config['confirm']['smart'] = true;
|
||||
$clear_data_form->runAtServer();
|
||||
|
||||
$rejudge_form = new UOJBs4Form('rejudge');
|
||||
$rejudge_form = new UOJForm('rejudge');
|
||||
$rejudge_form->handle = function () {
|
||||
UOJSubmission::rejudgeProblem(UOJProblem::cur());
|
||||
};
|
||||
$rejudge_form->succ_href = "/submissions?problem_id={$problem['id']}";
|
||||
$rejudge_form->submit_button_config['class_str'] = 'btn btn-danger d-block w-100';
|
||||
$rejudge_form->submit_button_config['text'] = '重测该题';
|
||||
$rejudge_form->submit_button_config['smart_confirm'] = '';
|
||||
$rejudge_form->config['submit_container']['class'] = '';
|
||||
$rejudge_form->config['submit_button']['class'] = 'btn btn-danger d-block w-100';
|
||||
$rejudge_form->config['submit_button']['text'] = '重测该题';
|
||||
$rejudge_form->config['confirm']['smart'] = true;
|
||||
$rejudge_form->runAtServer();
|
||||
|
||||
$rejudgege97_form = new UOJBs4Form('rejudgege97');
|
||||
$rejudgege97_form = new UOJForm('rejudgege97');
|
||||
$rejudgege97_form->handle = function () {
|
||||
UOJSubmission::rejudgeProblemGe97(UOJProblem::cur());
|
||||
};
|
||||
$rejudgege97_form->succ_href = "/submissions?problem_id={$problem['id']}";
|
||||
$rejudgege97_form->submit_button_config['class_str'] = 'btn btn-danger d-block w-100';
|
||||
$rejudgege97_form->submit_button_config['text'] = '重测 >=97 的程序';
|
||||
$rejudgege97_form->submit_button_config['smart_confirm'] = '';
|
||||
$rejudgege97_form->config['submit_container']['class'] = '';
|
||||
$rejudgege97_form->config['submit_button']['class'] = 'btn btn-danger d-block w-100';
|
||||
$rejudgege97_form->config['submit_button']['text'] = '重测 >=97 的程序';
|
||||
$rejudgege97_form->config['confirm']['smart'] = true;
|
||||
$rejudgege97_form->runAtServer();
|
||||
|
||||
if ($problem['hackable']) {
|
||||
$test_std_form = new UOJBs4Form('test_std');
|
||||
$test_std_form = new UOJForm('test_std');
|
||||
$test_std_form->handle = function () use ($problem, $data_disp) {
|
||||
$user_std = UOJUser::query('std');
|
||||
if (!$user_std) {
|
||||
@ -480,7 +473,7 @@ if ($problem['hackable']) {
|
||||
|
||||
$src_std = UOJLang::findSourceCode('std', '', [$data_disp, 'isFile']);
|
||||
if ($src_std === false) {
|
||||
UOJResponse::message('未找到std!');
|
||||
UOJResponse::message('未找到 std!');
|
||||
}
|
||||
|
||||
$zip_file_name = FS::randomAvailableSubmissionFileName();
|
||||
@ -526,41 +519,35 @@ if ($problem['hackable']) {
|
||||
]);
|
||||
};
|
||||
$test_std_form->succ_href = "/submissions?problem_id={$problem['id']}";
|
||||
$test_std_form->submit_button_config['class_str'] = 'btn btn-danger d-block w-100';
|
||||
$test_std_form->submit_button_config['text'] = '检验数据正确性';
|
||||
$test_std_form->config['submit_container']['class'] = '';
|
||||
$test_std_form->config['submit_button']['class'] = 'btn btn-warning d-block w-100';
|
||||
$test_std_form->config['submit_button']['text'] = '检验数据正确性';
|
||||
$test_std_form->runAtServer();
|
||||
}
|
||||
|
||||
$hackable_form->runAtServer();
|
||||
$data_form->runAtServer();
|
||||
$clear_data_form->runAtServer();
|
||||
$rejudge_form->runAtServer();
|
||||
$rejudgege97_form->runAtServer();
|
||||
$info_form->runAtServer();
|
||||
?>
|
||||
|
||||
<?php echoUOJPageHeader(HTML::stripTags($problem['title']) . ' - 数据 - 题目管理') ?>
|
||||
<?php echoUOJPageHeader('数据管理 - ' . UOJProblem::cur()->getTitle(['with' => 'id'])) ?>
|
||||
|
||||
<div class="row">
|
||||
<!-- left col -->
|
||||
<div class="col-12 col-lg-9">
|
||||
<h1>
|
||||
#<?= $problem['id'] ?>. <?= $problem['title'] ?> 管理
|
||||
<?= UOJProblem::cur()->getTitle(['with' => 'id']) ?> 管理
|
||||
</h1>
|
||||
|
||||
<ul class="nav nav-pills my-3" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/problem/<?= $problem['id'] ?>/manage/statement" role="tab">
|
||||
<a class="nav-link" href="<?= UOJProblem::cur()->getUri('/manage/statement') ?>" role="tab">
|
||||
题面
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/problem/<?= $problem['id'] ?>/manage/managers" role="tab">
|
||||
<a class="nav-link" href="<?= UOJProblem::cur()->getUri('/manage/managers') ?>" role="tab">
|
||||
管理者
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="/problem/<?= $problem['id'] ?>/manage/data" role="tab">
|
||||
<a class="nav-link active" href="<?= UOJProblem::cur()->getUri('/manage/data') ?>" role="tab">
|
||||
数据
|
||||
</a>
|
||||
</li>
|
||||
@ -607,7 +594,6 @@ $info_form->runAtServer();
|
||||
|
||||
<!-- right col -->
|
||||
<aside class="col-12 col-lg-3 mt-3 mt-lg-0 d-flex flex-column">
|
||||
|
||||
<div class="card card-default mt-3 mt-lg-0 mb-2 order-2 order-lg-1">
|
||||
<ul class="nav nav-pills nav-fill flex-column" role="tablist">
|
||||
<li class="nav-item text-start">
|
||||
@ -717,6 +703,8 @@ $info_form->runAtServer();
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $problem_conf = UOJProblem::cur()->getProblemConf() ?>
|
||||
|
||||
<div class="modal fade" id="ProblemSettingsFileModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
@ -729,7 +717,7 @@ $info_form->runAtServer();
|
||||
<div class="form-group row">
|
||||
<label for="use_builtin_checker" class="col-sm-5 control-label">比对函数</label>
|
||||
<div class="col-sm-7">
|
||||
<?php $checker_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'use_builtin_checker', 'ownchk') : ""; ?>
|
||||
<?php $checker_value = $problem_conf instanceof UOJProblemConf ? $problem_conf->getVal('use_builtin_checker', 'ownchk') : ""; ?>
|
||||
<select class="form-select" id="use_builtin_checker" name="use_builtin_checker">
|
||||
<option value="ncmp" <?= $checker_value == "ncmp" ? 'selected' : '' ?>>ncmp: 整数序列</option>
|
||||
<option value="wcmp" <?= $checker_value == "wcmp" ? 'selected' : '' ?>>wcmp: 字符串序列</option>
|
||||
@ -748,63 +736,63 @@ $info_form->runAtServer();
|
||||
<div class="form-group row">
|
||||
<label for="n_tests" class="col-sm-5 control-label">n_tests</label>
|
||||
<div class="col-sm-7">
|
||||
<?php $n_tests_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'n_tests', '') : ""; ?>
|
||||
<?php $n_tests_value = $problem_conf instanceof UOJProblemConf ? $problem_conf->getVal('n_tests', '') : ""; ?>
|
||||
<input type="number" class="form-control" id="n_tests" name="n_tests" placeholder="数据点个数(必填)" value="<?= $n_tests_value ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="n_ex_tests" class="col-sm-5 control-label">n_ex_tests</label>
|
||||
<div class="col-sm-7">
|
||||
<?php $n_ex_tests_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'n_ex_tests', 0) : ""; ?>
|
||||
<?php $n_ex_tests_value = $problem_conf instanceof UOJProblemConf ? $problem_conf->getVal('n_ex_tests', 0) : ""; ?>
|
||||
<input type="number" class="form-control" id="n_ex_tests" name="n_ex_tests" placeholder="额外数据点个数(默认为 0)" value="<?= $n_ex_tests_value ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="n_sample_tests" class="col-sm-5 control-label">n_sample_tests</label>
|
||||
<div class="col-sm-7">
|
||||
<?php $n_sample_tests_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'n_sample_tests', 0) : ""; ?>
|
||||
<?php $n_sample_tests_value = $problem_conf instanceof UOJProblemConf ? $problem_conf->getVal('n_sample_tests', 0) : ""; ?>
|
||||
<input type="number" class="form-control" id="n_sample_tests" name="n_sample_tests" placeholder="样例测试点个数(默认为 0)" value="<?= $n_sample_tests_value ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="input_pre" class="col-sm-5 control-label">input_pre</label>
|
||||
<div class="col-sm-7">
|
||||
<?php $input_pre_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'input_pre', 'input') : ""; ?>
|
||||
<?php $input_pre_value = $problem_conf instanceof UOJProblemConf ? $problem_conf->getVal('input_pre', 'input') : ""; ?>
|
||||
<input type="text" class="form-control" id="input_pre" name="input_pre" placeholder="输入文件名称(默认为 input)" value="<?= $input_pre_value ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="input_suf" class="col-sm-5 control-label">input_suf</label>
|
||||
<div class="col-sm-7">
|
||||
<?php $input_suf_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'input_suf', 'txt') : ""; ?>
|
||||
<?php $input_suf_value = $problem_conf instanceof UOJProblemConf ? $problem_conf->getVal('input_suf', 'txt') : ""; ?>
|
||||
<input type="text" class="form-control" id="input_suf" name="input_suf" placeholder="输入文件后缀(默认为 txt)" value="<?= $input_suf_value ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="output_pre" class="col-sm-5 control-label">output_pre</label>
|
||||
<div class="col-sm-7">
|
||||
<?php $output_pre_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'output_pre', 'output') : ""; ?>
|
||||
<?php $output_pre_value = $problem_conf instanceof UOJProblemConf ? $problem_conf->getVal('output_pre', 'output') : ''; ?>
|
||||
<input type="text" class="form-control" id="output_pre" name="output_pre" placeholder="输出文件名称(默认为 output)" value="<?= $output_pre_value ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="output_suf" class="col-sm-5 control-label">output_suf</label>
|
||||
<div class="col-sm-7">
|
||||
<?php $output_suf_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'output_suf', 'txt') : ""; ?>
|
||||
<?php $output_suf_value = $problem_conf instanceof UOJProblemConf ? $problem_conf->getVal('output_suf', 'txt') : ""; ?>
|
||||
<input type="text" class="form-control" id="output_suf" name="output_suf" placeholder="输出文件后缀(默认为 txt)" value="<?= $output_suf_value ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="time_limit" class="col-sm-5 control-label">time_limit</label>
|
||||
<div class="col-sm-7">
|
||||
<?php $time_limit_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'time_limit', 1) : ""; ?>
|
||||
<?php $time_limit_value = $problem_conf instanceof UOJProblemConf ? $problem_conf->getVal('time_limit', 1) : ""; ?>
|
||||
<input type="text" class="form-control" id="time_limit" name="time_limit" placeholder="时间限制(默认为 1s)" value="<?= $time_limit_value ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="memory_limit" class="col-sm-5 control-label">memory_limit</label>
|
||||
<div class="col-sm-7">
|
||||
<?php $memory_limit_value = is_array($problem_conf) ? getUOJConfVal($problem_conf, 'memory_limit', 256) : ""; ?>
|
||||
<?php $memory_limit_value = $problem_conf instanceof UOJProblemConf ? $problem_conf->getVal('memory_limit', 256) : ""; ?>
|
||||
<input type="number" class="form-control" id="memory_limit" name="memory_limit" placeholder="内存限制(默认为 256 MB)" value="<?= $memory_limit_value ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
@ -32,26 +32,35 @@ $managers_form = newAddDelCmdForm(
|
||||
$managers_form->runAtServer();
|
||||
|
||||
if (isSuperUser(Auth::user())) {
|
||||
$update_uploader_form = new UOJBs4Form('update_uploader');
|
||||
$update_uploader_form = new UOJForm('update_uploader');
|
||||
$update_uploader_form->appendHTML(
|
||||
HTML::tag(
|
||||
'div',
|
||||
['class' => 'col-auto'],
|
||||
HTML::tag('label', ['class' => 'col-form-label'], '上传者')
|
||||
)
|
||||
);
|
||||
$update_uploader_form->addInput(
|
||||
'new_uploader_username',
|
||||
'text',
|
||||
'用户名',
|
||||
UOJProblem::info('uploader') ?: 'root',
|
||||
function ($username, &$vdata) {
|
||||
if (!UOJUser::query($username)) {
|
||||
return '用户不存在';
|
||||
}
|
||||
[
|
||||
'div_class' => 'col-auto',
|
||||
'default_value' => UOJProblem::info('uploader') ?: 'root',
|
||||
'validator_php' => function ($username, &$vdata) {
|
||||
if (!UOJUser::query($username)) {
|
||||
return '用户不存在';
|
||||
}
|
||||
|
||||
$vdata['username'] = $username;
|
||||
$vdata['username'] = $username;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
return '';
|
||||
},
|
||||
]
|
||||
);
|
||||
$update_uploader_form->submit_button_config['align'] = 'compressed';
|
||||
$update_uploader_form->submit_button_config['text'] = '修改上传者';
|
||||
$update_uploader_form->submit_button_config['class_str'] = 'mt-2 btn btn-warning';
|
||||
$update_uploader_form->config['form']['class'] = 'mt-2 row g-3 align-items-center';
|
||||
$update_uploader_form->config['submit_container']['class'] = 'col-auto';
|
||||
$update_uploader_form->config['submit_button']['class'] = 'btn btn-warning';
|
||||
$update_uploader_form->config['submit_button']['text'] = '修改上传者';
|
||||
$update_uploader_form->config['confirm']['smart'] = true;
|
||||
$update_uploader_form->handle = function (&$vdata) {
|
||||
DB::update([
|
||||
"update problems",
|
||||
|
@ -80,7 +80,7 @@ EOD;
|
||||
$new_problem_form->config['submit_container']['class'] = '';
|
||||
$new_problem_form->config['submit_button']['class'] = 'bg-transparent border-0 d-block w-100 px-3 py-2 text-start';
|
||||
$new_problem_form->config['submit_button']['text'] = '<i class="bi bi-plus-lg"></i> 新建本地题目';
|
||||
$new_problem_form->config['confirm']['text'] = '添加新题';
|
||||
$new_problem_form->config['confirm']['text'] = '你真的要添加新题吗?';
|
||||
$new_problem_form->runAtServer();
|
||||
}
|
||||
|
||||
|
@ -54,50 +54,51 @@ if (UOJRequest::post('submit-remove_solution') === 'remove_solution') {
|
||||
}
|
||||
|
||||
if (UOJProblem::cur()->userCanManage(Auth::user()) || UOJProblem::cur()->userPermissionCodeCheck(Auth::user(), UOJProblem::cur()->getExtraConfig('submit_solution_type'))) {
|
||||
$add_new_solution_form = new UOJBs4Form('add_new_solution');
|
||||
$add_new_solution_form->addVInput(
|
||||
$add_new_solution_form = new UOJForm('add_new_solution');
|
||||
$add_new_solution_form->addInput(
|
||||
'blog_id_2',
|
||||
'text',
|
||||
'博客 ID',
|
||||
'',
|
||||
function ($blog_id) {
|
||||
$blog = UOJBlog::query($blog_id);
|
||||
if (!$blog) {
|
||||
return '博客不存在';
|
||||
}
|
||||
[
|
||||
'placeholder' => '博客 ID',
|
||||
'validator_php' => function ($blog_id, &$vdata) {
|
||||
$blog = UOJBlog::query($blog_id);
|
||||
|
||||
if (!$blog->userCanManage(Auth::user())) {
|
||||
if ($blog->info['poster'] != Auth::id()) {
|
||||
if ($blog->info['is_hidden']) {
|
||||
return '博客不存在';
|
||||
if (!$blog) {
|
||||
return '博客不存在';
|
||||
}
|
||||
|
||||
if (!$blog->userCanManage(Auth::user())) {
|
||||
if ($blog->info['poster'] != Auth::id()) {
|
||||
if ($blog->info['is_hidden']) {
|
||||
return '博客不存在';
|
||||
}
|
||||
|
||||
return '只能提交本人撰写的博客';
|
||||
}
|
||||
|
||||
return '只能提交本人撰写的博客';
|
||||
}
|
||||
}
|
||||
|
||||
if (!UOJProblem::cur()->userCanManage(Auth::user())) {
|
||||
if ($blog->info['is_hidden']) {
|
||||
return '只能提交公开的博客';
|
||||
if (!UOJProblem::cur()->userCanManage(Auth::user())) {
|
||||
if ($blog->info['is_hidden']) {
|
||||
return '只能提交公开的博客';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($problem_id = $blog->getSolutionProblemId()) {
|
||||
return "该博客已经是题目 #$problem_id 的题解";
|
||||
}
|
||||
if ($problem_id = $blog->getSolutionProblemId()) {
|
||||
return "该博客已经是题目 #$problem_id 的题解";
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
$vdata['blog'] = $blog;
|
||||
|
||||
return '';
|
||||
},
|
||||
]
|
||||
);
|
||||
$add_new_solution_form->submit_button_config['text'] = '发布';
|
||||
$add_new_solution_form->submit_button_config['align'] = 'center';
|
||||
$add_new_solution_form->submit_button_config['class_str'] = 'btn btn-secondary';
|
||||
$add_new_solution_form->handle = function () {
|
||||
$add_new_solution_form->config['submit_button']['text'] = '发布';
|
||||
$add_new_solution_form->config['submit_button']['class'] = 'btn btn-secondary';
|
||||
$add_new_solution_form->handle = function (&$vdata) {
|
||||
DB::insert([
|
||||
"insert into problems_solutions",
|
||||
DB::bracketed_fields(["problem_id", "blog_id"]),
|
||||
"values", DB::tuple([UOJProblem::info('id'), $_POST['blog_id_2']]),
|
||||
"values", DB::tuple([UOJProblem::info('id'), $vdata['blog']->info['id']]),
|
||||
]);
|
||||
};
|
||||
$add_new_solution_form->runAtServer();
|
||||
|
@ -20,12 +20,10 @@ function getCommentContentToDisplay($comment) {
|
||||
}
|
||||
}
|
||||
|
||||
$comment_form = new UOJBs4Form('comment');
|
||||
$comment_form->addVTextArea(
|
||||
'comment',
|
||||
'内容',
|
||||
'',
|
||||
function ($comment) {
|
||||
$comment_form = new UOJForm('comment');
|
||||
$comment_form->addTextArea('comment', [
|
||||
'label' => '内容',
|
||||
'validator_php' => function ($comment) {
|
||||
if (!Auth::check()) {
|
||||
return '请先登录';
|
||||
}
|
||||
@ -37,10 +35,9 @@ $comment_form->addVTextArea(
|
||||
}
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
]);
|
||||
$comment_form->handle = function () {
|
||||
global $myUser, $blog, $comment_form;
|
||||
global $blog, $comment_form;
|
||||
$comment = HTML::escape($_POST['comment']);
|
||||
|
||||
list($comment, $referrers) = uojHandleAtSign($comment, "/post/{$blog['id']}");
|
||||
@ -78,10 +75,10 @@ $comment_form->handle = function () {
|
||||
UOJBlog::cur()->updateActiveTime();
|
||||
$comment_form->succ_href = getLongTablePageRawUri($page);
|
||||
};
|
||||
$comment_form->ctrl_enter_submit = true;
|
||||
$comment_form->config['ctrl_enter_submit'] = true;
|
||||
$comment_form->runAtServer();
|
||||
|
||||
$reply_form = new UOJBs4Form('reply');
|
||||
$reply_form = new UOJForm('reply');
|
||||
$reply_form->addHidden(
|
||||
'reply_id',
|
||||
'0',
|
||||
@ -99,11 +96,9 @@ $reply_form->addHidden(
|
||||
},
|
||||
null
|
||||
);
|
||||
$reply_form->addVTextArea(
|
||||
'reply_comment',
|
||||
'内容',
|
||||
'',
|
||||
function ($comment) {
|
||||
$reply_form->addTextArea('reply_comment', [
|
||||
'label' => '内容',
|
||||
'validator_php' => function ($comment) {
|
||||
if (!Auth::check()) {
|
||||
return '请先登录';
|
||||
}
|
||||
@ -115,10 +110,9 @@ $reply_form->addVTextArea(
|
||||
}
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
]);
|
||||
$reply_form->handle = function (&$vdata) {
|
||||
global $myUser, $blog, $reply_form;
|
||||
global $blog, $reply_form;
|
||||
$comment = HTML::escape($_POST['reply_comment']);
|
||||
|
||||
list($comment, $referrers) = uojHandleAtSign($comment, "/post/{$blog['id']}");
|
||||
@ -167,8 +161,7 @@ $reply_form->handle = function (&$vdata) {
|
||||
|
||||
$reply_form->succ_href = getLongTablePageRawUri($page);
|
||||
};
|
||||
$reply_form->ctrl_enter_submit = true;
|
||||
|
||||
$reply_form->config['ctrl_enter_submit'] = true;
|
||||
$reply_form->runAtServer();
|
||||
|
||||
$comments_pag = new Paginator([
|
||||
|
@ -8,20 +8,19 @@ UOJBlog::init(UOJRequest::get('id')) || UOJResponse::page404();
|
||||
UOJBlog::cur()->belongsToUserBlog() || UOJResponse::page404();
|
||||
UOJBlog::cur()->userCanManage(Auth::user()) || UOJResponse::page403();
|
||||
|
||||
$delete_form = new UOJBs4Form('delete');
|
||||
$delete_form = new UOJForm('delete');
|
||||
$delete_form->handle = function () {
|
||||
UOJBlog::cur()->delete();
|
||||
};
|
||||
$delete_form->submit_button_config['class_str'] = 'btn btn-danger';
|
||||
$delete_form->submit_button_config['text'] = '是的,我确定要删除';
|
||||
$delete_form->config['submit_button']['class'] = 'btn btn-danger';
|
||||
$delete_form->config['submit_button']['text'] = '是的,我确定要删除';
|
||||
$delete_form->succ_href = HTML::blog_url(UOJBlog::info('poster'), '/archive');
|
||||
|
||||
$delete_form->runAtServer();
|
||||
?>
|
||||
<?php echoUOJPageHeader('删除博客 - ' . HTML::stripTags(UOJBlog::info('title'))) ?>
|
||||
|
||||
<h1 class="h2 text-center">
|
||||
您真的要删除博客 “<?= UOJBlog::info('title') ?>” <span class="fs-5">(博客 ID:<?= UOJBlog::info('id') ?>)</span>吗?该操作不可逆!
|
||||
您真的要删除博客 “<?= UOJBlog::info('title') ?>” <span class="fs-5">(博客 ID: <?= UOJBlog::info('id') ?>)</span>吗?该操作不可逆!
|
||||
</h1>
|
||||
|
||||
<?php $delete_form->printHTML(); ?>
|
||||
|
@ -32,7 +32,7 @@ $submission_result = UOJSubmission::cur()->getResult();
|
||||
$problem = UOJProblem::info();
|
||||
|
||||
if ($can_see_minor) {
|
||||
$minor_rejudge_form = new UOJBs4Form('minor_rejudge');
|
||||
$minor_rejudge_form = new UOJForm('minor_rejudge');
|
||||
$minor_rejudge_form->handle = function () {
|
||||
UOJSubmission::rejudgeById(UOJSubmission::info('id'), [
|
||||
'reason_text' => '管理员偷偷重测该提交记录',
|
||||
@ -41,24 +41,26 @@ if ($can_see_minor) {
|
||||
$tid = DB::insert_id();
|
||||
redirectTo(UOJSubmission::cur()->getUriForNewTID($tid));
|
||||
};
|
||||
$minor_rejudge_form->submit_button_config['class_str'] = 'btn btn-sm btn-primary';
|
||||
$minor_rejudge_form->submit_button_config['text'] = '偷偷重新测试';
|
||||
$minor_rejudge_form->submit_button_config['align'] = 'right';
|
||||
$minor_rejudge_form->config['submit_button']['class'] = 'btn btn-sm btn-primary';
|
||||
$minor_rejudge_form->config['submit_button']['text'] = '偷偷重新测试';
|
||||
$minor_rejudge_form->config['submit_container']['class'] = 'd-inline-block text-end';
|
||||
$minor_rejudge_form->runAtServer();
|
||||
}
|
||||
|
||||
if (UOJSubmission::cur()->isLatest()) {
|
||||
if (UOJSubmission::cur()->preHackCheck()) {
|
||||
$hack_form = new UOJBs4Form('hack');
|
||||
|
||||
$hack_form->addTextFileInput('input', '输入数据');
|
||||
$hack_form->addCheckBox('use_formatter', '帮我整理文末回车、行末空格、换行符', true);
|
||||
$hack_form = new UOJForm('hack');
|
||||
$hack_form->addTextFileInput('input', ['filename' => 'input.txt']);
|
||||
$hack_form->addCheckBox('use_formatter', [
|
||||
'label' => '帮我整理文末回车、行末空格、换行符',
|
||||
'checked' => true,
|
||||
]);
|
||||
$hack_form->handle = function (&$vdata) {
|
||||
global $problem, $submission;
|
||||
Auth::check() || redirectToLogin();
|
||||
|
||||
if ($_POST["input_upload_type"] == 'file') {
|
||||
$tmp_name = UOJBs4Form::uploadedFileTmpName("input_file");
|
||||
$tmp_name = UOJForm::uploadedFileTmpName("input_file");
|
||||
if ($tmp_name == null) {
|
||||
UOJResponse::message('你在干啥……怎么什么都没交过来……?');
|
||||
}
|
||||
@ -81,46 +83,45 @@ if (UOJSubmission::cur()->isLatest()) {
|
||||
])
|
||||
]);
|
||||
};
|
||||
$hack_form->max_post_size = 25 * 1024 * 1024;
|
||||
$hack_form->max_file_size_mb = 20;
|
||||
$hack_form->config['max_post_size'] = 25 * 1024 * 1024;
|
||||
$hack_form->config['max_file_size_mb'] = 25;
|
||||
$hack_form->succ_href = "/hacks";
|
||||
|
||||
$hack_form->runAtServer();
|
||||
}
|
||||
|
||||
if (UOJSubmission::cur()->userCanRejudge(Auth::user())) {
|
||||
$rejudge_form = new UOJBs4Form('rejudge');
|
||||
$rejudge_form = new UOJForm('rejudge');
|
||||
$rejudge_form->handle = function () {
|
||||
UOJSubmission::rejudgeById(UOJSubmission::info('id'));
|
||||
};
|
||||
$rejudge_form->submit_button_config['class_str'] = 'btn btn-sm btn-primary';
|
||||
$rejudge_form->submit_button_config['text'] = '重新测试';
|
||||
$rejudge_form->submit_button_config['align'] = 'end';
|
||||
$rejudge_form->config['submit_button']['class'] = 'btn btn-sm btn-primary';
|
||||
$rejudge_form->config['submit_button']['text'] = '重新测试';
|
||||
$rejudge_form->config['submit_container']['class'] = 'text-end d-inline-block';
|
||||
$rejudge_form->runAtServer();
|
||||
}
|
||||
|
||||
if (UOJSubmission::cur()->userCanDelete(Auth::user())) {
|
||||
$delete_form = new UOJBs4Form('delete');
|
||||
$delete_form = new UOJForm('delete');
|
||||
$delete_form->handle = function () {
|
||||
UOJSubmission::cur()->delete();
|
||||
};
|
||||
$delete_form->submit_button_config['class_str'] = 'btn btn-sm btn-danger';
|
||||
$delete_form->submit_button_config['text'] = '删除此提交记录';
|
||||
$delete_form->submit_button_config['align'] = 'end';
|
||||
$delete_form->submit_button_config['smart_confirm'] = '';
|
||||
$delete_form->config['submit_button']['class'] = 'btn btn-sm btn-danger';
|
||||
$delete_form->config['submit_button']['text'] = '删除此提交记录';
|
||||
$delete_form->config['submit_container']['class'] = 'text-end d-inline-block';
|
||||
$delete_form->config['confirm']['smart'] = true;
|
||||
$delete_form->succ_href = "/submissions";
|
||||
$delete_form->runAtServer();
|
||||
}
|
||||
} else {
|
||||
if (UOJSubmission::cur()->userCanDelete(Auth::user()) && !UOJSubmission::cur()->isMajor()) {
|
||||
$delete_form = new UOJBs4Form('delete');
|
||||
$delete_form = new UOJForm('delete');
|
||||
$delete_form->handle = function () {
|
||||
UOJSubmission::cur()->deleteThisMinorVersion();
|
||||
};
|
||||
$delete_form->submit_button_config['class_str'] = 'btn btn-sm btn-danger';
|
||||
$delete_form->submit_button_config['text'] = '删除当前历史记录(保留其他历史记录)';
|
||||
$delete_form->submit_button_config['align'] = 'end';
|
||||
$delete_form->submit_button_config['smart_confirm'] = '';
|
||||
$delete_form->config['submit_button']['class'] = 'btn btn-sm btn-danger';
|
||||
$delete_form->config['submit_button']['text'] = '删除当前历史记录(保留其他历史记录)';
|
||||
$delete_form->config['submit_container']['class'] = 'text-end d-inline-block';
|
||||
$delete_form->config['confirm']['smart'] = true;
|
||||
$delete_form->succ_href = UOJSubmission::cur()->getUriForLatest();
|
||||
$delete_form->runAtServer();
|
||||
}
|
||||
@ -174,13 +175,16 @@ if ($perm['manager_view']) {
|
||||
|
||||
<?php if (isset($hack_form)) : ?>
|
||||
<p class="text-center">
|
||||
这程序好像有点Bug,我给组数据试试? <button id="button-display-hack" type="button" class="btn btn-danger btn-xs">Hack!</button>
|
||||
这程序好像有点 Bug,我给组数据试试? <button id="button-display-hack" type="button" class="btn btn-danger btn-xs">Hack!</button>
|
||||
</p>
|
||||
<div id="div-form-hack" style="display:none" class="mb-3">
|
||||
<p class="text-center text-danger">
|
||||
<div class="card mb-3" id="div-form-hack" style="display: none">
|
||||
<div class="card-header">提交 Hack</div>
|
||||
<div class="card-body">
|
||||
<?php $hack_form->printHTML() ?>
|
||||
</div>
|
||||
<div class="card-footer bg-transparent small text-center text-danger">
|
||||
Hack 功能是给大家互相查错用的。请勿故意提交错误代码,然后自己 Hack 自己、贼喊捉贼哦(故意贼喊捉贼会予以封禁处理)
|
||||
</p>
|
||||
<?php $hack_form->printHTML() ?>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
|
@ -83,13 +83,11 @@ if ($cur_tab == 'index') {
|
||||
"order by level desc, important_blogs.blog_id desc",
|
||||
]);
|
||||
|
||||
$add_announcement_form = new UOJBs4Form('add_announcement');
|
||||
$add_announcement_form->addInput(
|
||||
'blog_id',
|
||||
'text',
|
||||
'博客 ID',
|
||||
'',
|
||||
function ($id, &$vdata) {
|
||||
$add_announcement_form = new UOJForm('add_announcement');
|
||||
$add_announcement_form->addInput('blog_id', [
|
||||
'div_class' => 'col-auto',
|
||||
'label' => '博客 ID',
|
||||
'validator_php' => function ($id, &$vdata) {
|
||||
if (!validateUInt($id)) {
|
||||
return '博客 ID 无效';
|
||||
}
|
||||
@ -102,14 +100,12 @@ if ($cur_tab == 'index') {
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$add_announcement_form->addInput(
|
||||
'blog_level',
|
||||
'text',
|
||||
'置顶级别',
|
||||
'0',
|
||||
function ($x, &$vdata) {
|
||||
]);
|
||||
$add_announcement_form->addInput('blog_level', [
|
||||
'div_class' => 'col-auto',
|
||||
'label' => '置顶级别',
|
||||
'default_value' => '0',
|
||||
'validator_php' => function ($x, &$vdata) {
|
||||
if (!validateUInt($x)) {
|
||||
return '数字不合法';
|
||||
}
|
||||
@ -122,8 +118,7 @@ if ($cur_tab == 'index') {
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
]);
|
||||
$add_announcement_form->handle = function (&$vdata) {
|
||||
$blog_id = $vdata['blog_id'];
|
||||
$blog_level = $vdata['level'];
|
||||
@ -152,8 +147,9 @@ if ($cur_tab == 'index') {
|
||||
]);
|
||||
}
|
||||
};
|
||||
$add_announcement_form->submit_button_config['align'] = 'compressed';
|
||||
$add_announcement_form->submit_button_config['text'] = '提交';
|
||||
$add_announcement_form->config['form']['class'] = 'row gy-2 gx-3 align-items-end';
|
||||
$add_announcement_form->config['submit_container']['class'] = 'col-auto';
|
||||
$add_announcement_form->config['submit_button']['text'] = '提交';
|
||||
$add_announcement_form->succ_href = '/super_manage/index#announcements';
|
||||
$add_announcement_form->runAtServer();
|
||||
|
||||
@ -183,13 +179,11 @@ if ($cur_tab == 'index') {
|
||||
"order by end_time asc",
|
||||
]);
|
||||
|
||||
$add_countdown_form = new UOJBs4Form('add_countdown');
|
||||
$add_countdown_form->addInput(
|
||||
'countdown_title',
|
||||
'text',
|
||||
'标题',
|
||||
'',
|
||||
function ($title, &$vdata) {
|
||||
$add_countdown_form = new UOJForm('add_countdown');
|
||||
$add_countdown_form->addInput('countdown_title', [
|
||||
'div_class' => 'col-auto',
|
||||
'label' => '标题',
|
||||
'validator_php' => function ($title, &$vdata) {
|
||||
if ($title == '') {
|
||||
return '标题不能为空';
|
||||
}
|
||||
@ -198,14 +192,12 @@ if ($cur_tab == 'index') {
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$add_countdown_form->addInput(
|
||||
'countdown_end_time',
|
||||
'text',
|
||||
'结束时间',
|
||||
date("Y-m-d H:i:s"),
|
||||
function ($end_time, &$vdata) {
|
||||
]);
|
||||
$add_countdown_form->addInput('countdown_end_time', [
|
||||
'div_class' => 'col-auto',
|
||||
'label' => '结束时间',
|
||||
'default_value' => UOJTime::$time_now_str,
|
||||
'validator_php' => function ($end_time, &$vdata) {
|
||||
try {
|
||||
$vdata['end_time'] = new DateTime($end_time);
|
||||
} catch (Exception $e) {
|
||||
@ -214,8 +206,7 @@ if ($cur_tab == 'index') {
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
]);
|
||||
$add_countdown_form->handle = function (&$vdata) {
|
||||
DB::insert([
|
||||
"insert into countdowns",
|
||||
@ -224,8 +215,9 @@ if ($cur_tab == 'index') {
|
||||
DB::tuple([$vdata['title'], $vdata['end_time']->format('Y-m-d H:i:s')]),
|
||||
]);
|
||||
};
|
||||
$add_countdown_form->submit_button_config['align'] = 'compressed';
|
||||
$add_countdown_form->submit_button_config['text'] = '添加';
|
||||
$add_countdown_form->config['form']['class'] = 'row gy-2 gx-3 align-items-end';
|
||||
$add_countdown_form->config['submit_container']['class'] = 'col-auto';
|
||||
$add_countdown_form->config['submit_button']['text'] = '添加';
|
||||
$add_countdown_form->succ_href = '/super_manage/index#countdowns';
|
||||
$add_countdown_form->runAtServer();
|
||||
|
||||
@ -255,13 +247,11 @@ if ($cur_tab == 'index') {
|
||||
"order by level desc, id asc",
|
||||
]);
|
||||
|
||||
$add_link_form = new UOJBs4Form('add_link');
|
||||
$add_link_form->addInput(
|
||||
'link_title',
|
||||
'text',
|
||||
'标题',
|
||||
'',
|
||||
function ($title, &$vdata) {
|
||||
$add_link_form = new UOJForm('add_link');
|
||||
$add_link_form->addInput('link_title', [
|
||||
'div_class' => 'col-auto',
|
||||
'label' => '标题',
|
||||
'validator_php' => function ($title, &$vdata) {
|
||||
if ($title == '') {
|
||||
return '标题不能为空';
|
||||
}
|
||||
@ -270,14 +260,11 @@ if ($cur_tab == 'index') {
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$add_link_form->addInput(
|
||||
'link_url',
|
||||
'text',
|
||||
'链接',
|
||||
'',
|
||||
function ($url, &$vdata) {
|
||||
]);
|
||||
$add_link_form->addInput('link_url', [
|
||||
'div_class' => 'col-auto',
|
||||
'label' => '链接',
|
||||
'validator_php' => function ($url, &$vdata) {
|
||||
if (!validateURL($url)) {
|
||||
return '链接不合法';
|
||||
}
|
||||
@ -286,14 +273,12 @@ if ($cur_tab == 'index') {
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$add_link_form->addInput(
|
||||
'link_level',
|
||||
'text',
|
||||
'权重',
|
||||
'10',
|
||||
function ($level, &$vdata) {
|
||||
]);
|
||||
$add_link_form->addInput('link_level', [
|
||||
'div_class' => 'col-auto',
|
||||
'label' => '权重',
|
||||
'default_value' => '10',
|
||||
'validator_php' => function ($level, &$vdata) {
|
||||
if (!validateUInt($level)) {
|
||||
return '数字不合法';
|
||||
}
|
||||
@ -302,8 +287,7 @@ if ($cur_tab == 'index') {
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
]);
|
||||
$add_link_form->handle = function (&$vdata) {
|
||||
DB::insert([
|
||||
"insert into friend_links",
|
||||
@ -312,8 +296,9 @@ if ($cur_tab == 'index') {
|
||||
DB::tuple([$vdata['title'], $vdata['url'], $vdata['level']]),
|
||||
]);
|
||||
};
|
||||
$add_link_form->submit_button_config['align'] = 'compressed';
|
||||
$add_link_form->submit_button_config['text'] = '添加';
|
||||
$add_link_form->config['form']['class'] = 'row gy-2 gx-3 align-items-end';
|
||||
$add_link_form->config['submit_container']['class'] = 'col-auto';
|
||||
$add_link_form->config['submit_button']['text'] = '添加';
|
||||
$add_link_form->succ_href = '/super_manage/index#links';
|
||||
$add_link_form->runAtServer();
|
||||
} elseif ($cur_tab == 'users') {
|
||||
@ -332,13 +317,10 @@ if ($cur_tab == 'index') {
|
||||
$user_list_cond = '1';
|
||||
}
|
||||
|
||||
$register_form = new UOJBs4Form('register');
|
||||
$register_form->addVInput(
|
||||
'new_username',
|
||||
'text',
|
||||
'用户名',
|
||||
'',
|
||||
function ($username, &$vdata) {
|
||||
$register_form = new UOJForm('register');
|
||||
$register_form->addInput('new_username', [
|
||||
'label' => '用户名',
|
||||
'validator_php' => function ($username, &$vdata) {
|
||||
if (!validateUsername($username)) {
|
||||
return '用户名不合法';
|
||||
}
|
||||
@ -351,27 +333,24 @@ if ($cur_tab == 'index') {
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$register_form->addVInput(
|
||||
'new_password',
|
||||
'password',
|
||||
'密码',
|
||||
'',
|
||||
function ($password, &$vdata) {
|
||||
]);
|
||||
$register_form->addInput('new_password', [
|
||||
'div_class' => 'mt-3',
|
||||
'type' => 'password',
|
||||
'label' => '密码',
|
||||
'validator_php' => function ($password, &$vdata) {
|
||||
$vdata['password'] = $password;
|
||||
|
||||
return '';
|
||||
},
|
||||
'validatePassword'
|
||||
);
|
||||
$register_form->addVInput(
|
||||
'new_email',
|
||||
'text',
|
||||
'电子邮件(选填)',
|
||||
'',
|
||||
function ($email, &$vdata) {
|
||||
if ($email && !validateEmail($email)) {
|
||||
'validator_js' => 'validatePassword',
|
||||
]);
|
||||
$register_form->addInput('new_email', [
|
||||
'div_class' => 'mt-3',
|
||||
'label' => '电子邮件',
|
||||
'help' => '选填项。填写电子邮件后用户可自主进行密码重置。',
|
||||
'validator_php' => function ($email, &$vdata) {
|
||||
if (!validateEmail($email)) {
|
||||
return '邮件地址不合法';
|
||||
}
|
||||
|
||||
@ -379,32 +358,27 @@ if ($cur_tab == 'index') {
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$register_form->addVInput(
|
||||
'new_realname',
|
||||
'text',
|
||||
'真实姓名(选填)',
|
||||
'',
|
||||
function ($realname, &$vdata) {
|
||||
]);
|
||||
$register_form->addInput('new_realname', [
|
||||
'div_class' => 'mt-3',
|
||||
'label' => '真实姓名',
|
||||
'help' => '选填项。',
|
||||
'validator_php' => function ($realname, &$vdata) {
|
||||
$vdata['realname'] = $realname;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$register_form->addVInput(
|
||||
'new_school',
|
||||
'text',
|
||||
'学校名称(选填)',
|
||||
'',
|
||||
function ($school, &$vdata) {
|
||||
]);
|
||||
$register_form->addInput('new_school', [
|
||||
'div_class' => 'mt-3',
|
||||
'label' => '学校名称',
|
||||
'help' => '选填项。常用名称:<code>石家庄市第二中学</code>、<code>石家庄二中实验学校</code>。',
|
||||
'validator_php' => function ($school, &$vdata) {
|
||||
$vdata['school'] = $school;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
]);
|
||||
$register_form->handle = function (&$vdata) {
|
||||
$user = [
|
||||
'username' => $vdata['username'],
|
||||
@ -436,16 +410,13 @@ if ($cur_tab == 'index') {
|
||||
|
||||
$(window).scrollTop(0);
|
||||
}
|
||||
EOD);
|
||||
EOD);
|
||||
$register_form->runAtServer();
|
||||
|
||||
$register_tmp_user_form = new UOJBs4Form('register_tmp_user');
|
||||
$register_tmp_user_form->addVInput(
|
||||
'new_tmp_username',
|
||||
'text',
|
||||
'用户名',
|
||||
'',
|
||||
function ($username, &$vdata) {
|
||||
$register_tmp_user_form = new UOJForm('register_tmp_user');
|
||||
$register_tmp_user_form->addInput('new_tmp_username', [
|
||||
'label' => '用户名',
|
||||
'validator_php' => function ($username, &$vdata) {
|
||||
if (!validateUsername($username)) {
|
||||
return '用户名不合法';
|
||||
}
|
||||
@ -458,26 +429,23 @@ EOD);
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$register_tmp_user_form->addVInput(
|
||||
'new_tmp_password',
|
||||
'password',
|
||||
'密码',
|
||||
'',
|
||||
function ($password, &$vdata) {
|
||||
]);
|
||||
$register_tmp_user_form->addInput('new_tmp_password', [
|
||||
'div_class' => 'mt-3',
|
||||
'type' => 'password',
|
||||
'label' => '密码',
|
||||
'validator_php' => function ($password, &$vdata) {
|
||||
$vdata['password'] = $password;
|
||||
|
||||
return '';
|
||||
},
|
||||
'validatePassword'
|
||||
);
|
||||
$register_tmp_user_form->addVInput(
|
||||
'new_tmp_email',
|
||||
'text',
|
||||
'电子邮件(选填)',
|
||||
'',
|
||||
function ($email, &$vdata) {
|
||||
'validator_js' => 'validatePassword',
|
||||
]);
|
||||
$register_tmp_user_form->addInput('new_tmp_email', [
|
||||
'div_class' => 'mt-3',
|
||||
'label' => '电子邮件',
|
||||
'help' => '选填项。',
|
||||
'validator_php' => function ($email, &$vdata) {
|
||||
if ($email && !validateEmail($email)) {
|
||||
return '邮件地址不合法';
|
||||
}
|
||||
@ -486,48 +454,42 @@ EOD);
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$register_tmp_user_form->addVInput(
|
||||
'new_tmp_realname',
|
||||
'text',
|
||||
'真实姓名(选填)',
|
||||
'',
|
||||
function ($realname, &$vdata) {
|
||||
]);
|
||||
$register_tmp_user_form->addInput('new_tmp_realname', [
|
||||
'div_class' => 'mt-3',
|
||||
'label' => '真实姓名',
|
||||
'help' => '选填项。',
|
||||
'validator_php' => function ($realname, &$vdata) {
|
||||
$vdata['realname'] = $realname;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$register_tmp_user_form->addVInput(
|
||||
'new_tmp_school',
|
||||
'text',
|
||||
'学校名称(选填)',
|
||||
'',
|
||||
function ($school, &$vdata) {
|
||||
]);
|
||||
$register_tmp_user_form->addInput('new_tmp_school', [
|
||||
'div_class' => 'mt-3',
|
||||
'label' => '学校名称',
|
||||
'help' => '选填项。',
|
||||
'validator_php' => function ($school, &$vdata) {
|
||||
$vdata['school'] = $school;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$register_tmp_user_form->addVInput(
|
||||
'new_tmp_expiration_time',
|
||||
'text',
|
||||
'过期时间',
|
||||
UOJTime::time2str((new DateTime())->add(new DateInterval('P7D'))->setTime(0, 0, 0)),
|
||||
function ($str, &$vdata) {
|
||||
]);
|
||||
$register_tmp_user_form->addInput('new_tmp_expiration_time', [
|
||||
'div_class' => 'mt-3',
|
||||
'label' => '过期时间',
|
||||
'help' => '选填项。默认过期时间为 7 天后。',
|
||||
'default_value' => UOJTime::time2str((new DateTime())->add(new DateInterval('P7D'))->setTime(0, 0, 0)),
|
||||
'validator_php' => function ($expiration_time, &$vdata) {
|
||||
try {
|
||||
$vdata['expiration_time'] = new DateTime($str);
|
||||
$vdata['expiration_time'] = new DateTime($expiration_time);
|
||||
} catch (Exception $e) {
|
||||
return '无效时间格式';
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
]);
|
||||
$register_tmp_user_form->handle = function (&$vdata) {
|
||||
$user = [
|
||||
'username' => $vdata['username'],
|
||||
@ -560,15 +522,13 @@ EOD);
|
||||
|
||||
$(window).scrollTop(0);
|
||||
}
|
||||
EOD);
|
||||
EOD);
|
||||
$register_tmp_user_form->runAtServer();
|
||||
|
||||
$change_password_form = new UOJBs4Form('change_password');
|
||||
$change_password_form->addVInput(
|
||||
'p_username',
|
||||
'text',
|
||||
'用户名',
|
||||
'',
|
||||
$change_password_form = new UOJForm('change_password');
|
||||
$change_password_form->addInput('p_username', [
|
||||
'label' => '用户名',
|
||||
'validator_php' =>
|
||||
function ($username, &$vdata) {
|
||||
if (!validateUsername($username)) {
|
||||
return '用户名不合法';
|
||||
@ -582,20 +542,18 @@ EOD);
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$change_password_form->addVInput(
|
||||
'p_password',
|
||||
'password',
|
||||
'密码',
|
||||
'',
|
||||
function ($password, &$vdata) {
|
||||
]);
|
||||
$change_password_form->addInput('p_password', [
|
||||
'div_class' => 'mt-3',
|
||||
'type' => 'password',
|
||||
'label' => '密码',
|
||||
'validator_php' => function ($password, &$vdata) {
|
||||
$vdata['password'] = $password;
|
||||
|
||||
return '';
|
||||
},
|
||||
'validatePassword'
|
||||
);
|
||||
'validator_js' => 'validatePassword',
|
||||
]);
|
||||
$change_password_form->handle = function (&$vdata) {
|
||||
$password = hash_hmac('md5', $vdata['password'], getPasswordClientSalt());
|
||||
|
||||
@ -611,8 +569,9 @@ EOD);
|
||||
|
||||
dieWithJsonData(['status' => 'success', 'message' => '用户 ' . $vdata['username'] . ' 的密码已经被成功重置。']);
|
||||
};
|
||||
$change_password_form->submit_button_config['class_str'] = 'btn btn-secondary mt-3';
|
||||
$change_password_form->submit_button_config['text'] = '重置';
|
||||
$change_password_form->config['submit_button']['class'] = 'btn btn-secondary';
|
||||
$change_password_form->config['submit_button']['text'] = '重置密码';
|
||||
$change_password_form->config['confirm']['smart'] = true;
|
||||
$change_password_form->setAjaxSubmit(<<<EOD
|
||||
function(res) {
|
||||
if (res.status === 'success') {
|
||||
@ -631,16 +590,13 @@ EOD);
|
||||
|
||||
$(window).scrollTop(0);
|
||||
}
|
||||
EOD);
|
||||
EOD);
|
||||
$change_password_form->runAtServer();
|
||||
|
||||
$change_usergroup_form = new UOJBs4Form('change_usergroup');
|
||||
$change_usergroup_form->addVInput(
|
||||
'username',
|
||||
'text',
|
||||
'用户名',
|
||||
'',
|
||||
function ($username, &$vdata) {
|
||||
$change_usergroup_form = new UOJForm('change_usergroup');
|
||||
$change_usergroup_form->addInput('username', [
|
||||
'label' => '用户名',
|
||||
'validator_php' => function ($username, &$vdata) {
|
||||
if (!validateUsername($username)) {
|
||||
return '用户名不合法';
|
||||
}
|
||||
@ -653,14 +609,17 @@ EOD);
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$change_usergroup_form->addVSelect('op_type', [
|
||||
'banneduser' => '设为封禁用户',
|
||||
'tempuser' => '设为临时用户',
|
||||
'normaluser' => '设为普通用户',
|
||||
'superuser' => '设为超级用户',
|
||||
], '操作类型', '');
|
||||
]);
|
||||
$change_usergroup_form->addSelect('op_type', [
|
||||
'div_class' => 'mt-3',
|
||||
'label' => '操作类型',
|
||||
'options' => [
|
||||
'banneduser' => '设为封禁用户',
|
||||
'tempuser' => '设为临时用户',
|
||||
'normaluser' => '设为普通用户',
|
||||
'superuser' => '设为超级用户',
|
||||
],
|
||||
]);
|
||||
$change_usergroup_form->handle = function ($vdata) {
|
||||
$username = $vdata['username'];
|
||||
$usergroup = '';
|
||||
@ -679,7 +638,9 @@ EOD);
|
||||
],
|
||||
]);
|
||||
$usergroup = '被封禁的用户,该用户将无法再次登录系统';
|
||||
|
||||
break;
|
||||
|
||||
case 'tempuser':
|
||||
DB::update([
|
||||
"update user_info",
|
||||
@ -693,7 +654,9 @@ EOD);
|
||||
],
|
||||
]);
|
||||
$usergroup = '临时用户,请前往个人信息编辑页面修改过期时间';
|
||||
|
||||
break;
|
||||
|
||||
case 'normaluser':
|
||||
DB::update([
|
||||
"update user_info",
|
||||
@ -707,6 +670,7 @@ EOD);
|
||||
],
|
||||
]);
|
||||
$usergroup = '普通用户';
|
||||
|
||||
break;
|
||||
case 'superuser':
|
||||
DB::update([
|
||||
@ -720,7 +684,9 @@ EOD);
|
||||
"username" => $username,
|
||||
],
|
||||
]);
|
||||
|
||||
$usergroup = '超级用户';
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -744,7 +710,7 @@ EOD);
|
||||
|
||||
$(window).scrollTop(0);
|
||||
}
|
||||
EOD);
|
||||
EOD);
|
||||
$change_usergroup_form->runAtServer();
|
||||
|
||||
$users_default_permissions = UOJContext::getMeta('users_default_permissions');
|
||||
@ -903,7 +869,7 @@ EOD);
|
||||
|
||||
$(window).scrollTop(0);
|
||||
}
|
||||
EOD);
|
||||
EOD);
|
||||
$update_users_default_permissions_form->config['confirm']['text'] = '你确定要修改所有用户的默认权限吗?';
|
||||
$update_users_default_permissions_form->handle = function () {
|
||||
$new_permissions = [
|
||||
@ -958,64 +924,65 @@ EOD);
|
||||
'page_len' => 10
|
||||
]);
|
||||
|
||||
$custom_test_deleter = new UOJBs4Form('custom_test_deleter');
|
||||
$custom_test_deleter->addInput(
|
||||
'last',
|
||||
'text',
|
||||
'删除末尾记录',
|
||||
'5',
|
||||
function ($x, &$vdata) {
|
||||
$custom_test_deleter = new UOJForm('custom_test_deleter');
|
||||
$custom_test_deleter->addInput('last', [
|
||||
'div_class' => 'col-auto',
|
||||
'label' => '删除末尾记录',
|
||||
'default_value' => '5',
|
||||
'validator_php' => function ($x, &$vdata) {
|
||||
if (!validateUInt($x)) {
|
||||
return '不合法';
|
||||
}
|
||||
|
||||
$vdata['last'] = $x;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
]);
|
||||
$custom_test_deleter->handle = function (&$vdata) {
|
||||
$all = DB::selectAll("select * from custom_test_submissions order by id asc limit {$vdata['last']}");
|
||||
|
||||
foreach ($all as $submission) {
|
||||
$content = json_decode($submission['content'], true);
|
||||
unlink(UOJContext::storagePath() . $content['file_name']);
|
||||
}
|
||||
|
||||
DB::delete("delete from custom_test_submissions order by id asc limit {$vdata['last']}");
|
||||
};
|
||||
$custom_test_deleter->submit_button_config['align'] = 'compressed';
|
||||
$custom_test_deleter->config['form']['class'] = 'row gy-2 gx-3 align-items-end';
|
||||
$custom_test_deleter->config['submit_container']['class'] = 'col-auto';
|
||||
$custom_test_deleter->runAtServer();
|
||||
} elseif ($cur_tab == 'judger') {
|
||||
$judger_adder = new UOJBs4Form('judger_adder');
|
||||
$judger_adder->addInput(
|
||||
'judger_adder_name',
|
||||
'text',
|
||||
'评测机名称',
|
||||
'',
|
||||
function ($x, &$vdata) {
|
||||
$judger_adder = new UOJForm('judger_adder');
|
||||
$judger_adder->addInput('judger_adder_name', [
|
||||
'div_class' => 'col-auto',
|
||||
'label' => '评测机名称',
|
||||
'validator_php' => function ($x, &$vdata) {
|
||||
if (!validateUsername($x)) {
|
||||
return '不合法';
|
||||
}
|
||||
|
||||
if (DB::selectCount("select count(*) from judger_info where judger_name='$x'") != 0) {
|
||||
return '不合法';
|
||||
}
|
||||
|
||||
$vdata['name'] = $x;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
]);
|
||||
$judger_adder->handle = function (&$vdata) {
|
||||
$password = uojRandString(32);
|
||||
DB::insert("insert into judger_info (judger_name,password) values('{$vdata['name']}','{$password}')");
|
||||
DB::insert("insert into judger_info (judger_name, password) values('{$vdata['name']}', '{$password}')");
|
||||
};
|
||||
$judger_adder->submit_button_config['align'] = 'compressed';
|
||||
$judger_adder->config['form']['class'] = 'row gy-2 gx-3 align-items-end';
|
||||
$judger_adder->config['submit_container']['class'] = 'col-auto';
|
||||
$judger_adder->runAtServer();
|
||||
|
||||
$judger_deleter = new UOJBs4Form('judger_deleter');
|
||||
$judger_deleter->addInput(
|
||||
'judger_deleter_name',
|
||||
'text',
|
||||
'评测机名称',
|
||||
'',
|
||||
function ($x, &$vdata) {
|
||||
$judger_deleter = new UOJForm('judger_deleter');
|
||||
$judger_deleter->addInput('judger_deleter_name', [
|
||||
'div_class' => 'col-auto',
|
||||
'label' => '评测机名称', 'validator_php' => function ($x, &$vdata) {
|
||||
if (!validateUsername($x)) {
|
||||
return '不合法';
|
||||
}
|
||||
@ -1025,12 +992,12 @@ EOD);
|
||||
$vdata['name'] = $x;
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
]);
|
||||
$judger_deleter->handle = function (&$vdata) {
|
||||
DB::delete("delete from judger_info where judger_name='{$vdata['name']}'");
|
||||
};
|
||||
$judger_deleter->submit_button_config['align'] = 'compressed';
|
||||
$judger_deleter->config['form']['class'] = 'row gy-2 gx-3 align-items-end';
|
||||
$judger_deleter->config['submit_container']['class'] = 'col-auto';
|
||||
$judger_deleter->runAtServer();
|
||||
} elseif ($cur_tab == 'image_hosting') {
|
||||
if (isset($_POST['submit-delete_image']) && $_POST['submit-delete_image'] == 'delete_image') {
|
||||
@ -1052,14 +1019,10 @@ EOD);
|
||||
dieWithAlert('删除成功!');
|
||||
}
|
||||
|
||||
$change_user_image_total_size_limit_form = new UOJBs4Form('change_user_image_total_size_limit');
|
||||
$change_user_image_total_size_limit_form->submit_button_config['align'] = 'compressed';
|
||||
$change_user_image_total_size_limit_form->addInput(
|
||||
'change_user_image_total_size_limit_username',
|
||||
'text',
|
||||
'用户名',
|
||||
'',
|
||||
function ($x, &$vdata) {
|
||||
$change_user_image_total_size_limit_form = new UOJForm('change_user_image_total_size_limit');
|
||||
$change_user_image_total_size_limit_form->addInput('change_user_image_total_size_limit_username', [
|
||||
'label' => '用户名',
|
||||
'validator_php' => function ($x, &$vdata) {
|
||||
if (!validateUsername($x)) {
|
||||
return '用户名不合法';
|
||||
}
|
||||
@ -1072,14 +1035,13 @@ EOD);
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$change_user_image_total_size_limit_form->addInput(
|
||||
'change_user_image_total_size_limit_limit',
|
||||
'text',
|
||||
'存储限制(单位:Byte)',
|
||||
'104857600',
|
||||
function ($x, &$vdata) {
|
||||
]);
|
||||
$change_user_image_total_size_limit_form->addInput('change_user_image_total_size_limit_limit', [
|
||||
'div_class' => 'mt-3',
|
||||
'label' => '存储限制',
|
||||
'default_value' => '104857600',
|
||||
'help' => '限制单位为 Byte。',
|
||||
'validator_php' => function ($x, &$vdata) {
|
||||
if (!validateUInt($x, 10)) {
|
||||
return '限制不合法';
|
||||
}
|
||||
@ -1092,8 +1054,7 @@ EOD);
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
]);
|
||||
$change_user_image_total_size_limit_form->handle = function (&$vdata) {
|
||||
DB::update([
|
||||
"update user_info",
|
||||
@ -1117,7 +1078,6 @@ EOD);
|
||||
<?= UOJLocale::get('system manage') ?>
|
||||
</h1>
|
||||
|
||||
|
||||
<div class="row mt-4">
|
||||
<!-- left col -->
|
||||
<div class="col-md-3">
|
||||
|
@ -37,7 +37,7 @@ if (!isset($tabs_info[$cur_tab])) {
|
||||
}
|
||||
|
||||
if ($cur_tab == 'profile') {
|
||||
$update_profile_form = new UOJBs4Form('update_profile');
|
||||
$update_profile_form = new UOJForm('update_profile');
|
||||
$username = UOJLocale::get('username');
|
||||
$avatar = UOJLocale::get('avatar');
|
||||
$update_profile_form->appendHTML(<<<EOD
|
||||
@ -48,17 +48,18 @@ if ($cur_tab == 'profile') {
|
||||
</div>
|
||||
EOD);
|
||||
if (isSuperUser(Auth::user())) {
|
||||
$update_profile_form->addVInput(
|
||||
$update_profile_form->addInput(
|
||||
'realname',
|
||||
'text',
|
||||
UOJLocale::get('user::real name'),
|
||||
$user['realname'],
|
||||
function ($realname, &$vdata) {
|
||||
$vdata['realname'] = $realname;
|
||||
[
|
||||
'div_class' => 'mb-3',
|
||||
'label' => UOJLocale::get('user::real name'),
|
||||
'default_value' => $user['realname'],
|
||||
'validator_php' => function ($realname, &$vdata) {
|
||||
$vdata['realname'] = $realname;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
return '';
|
||||
},
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$real_name = UOJLocale::get('user::real name');
|
||||
@ -72,21 +73,22 @@ EOD);
|
||||
}
|
||||
if (isTmpUser($user)) {
|
||||
if (isSuperUser(Auth::user())) {
|
||||
$update_profile_form->addVInput(
|
||||
$update_profile_form->addInput(
|
||||
'expiration_time',
|
||||
'text',
|
||||
UOJLocale::get('user::expiration time'),
|
||||
$user['expiration_time'],
|
||||
function ($str, &$vdata) {
|
||||
try {
|
||||
$vdata['expiration_time'] = new DateTime($str);
|
||||
} catch (Exception $e) {
|
||||
return '无效时间格式';
|
||||
}
|
||||
[
|
||||
'div_class' => 'mb-3',
|
||||
'label' => UOJLocale::get('user::expiration time'),
|
||||
'default_value' => $user['expiration_time'],
|
||||
'validator_php' => function ($str, &$vdata) {
|
||||
try {
|
||||
$vdata['expiration_time'] = new DateTime($str);
|
||||
} catch (Exception $e) {
|
||||
return '无效时间格式';
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
return '';
|
||||
},
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$expiration_time = UOJLocale::get('user::expiration time');
|
||||
@ -98,77 +100,97 @@ EOD);
|
||||
</div>
|
||||
EOD);
|
||||
}
|
||||
}
|
||||
$update_profile_form->addVCheckboxes('avatar_source', [
|
||||
'gravatar' => 'Gravatar',
|
||||
'qq' => 'QQ',
|
||||
], UOJLocale::get('user::avatar source'), $extra['avatar_source'] ?: 'gravatar');
|
||||
$change_avatar_help = UOJLocale::get('change avatar help');
|
||||
$update_profile_form->appendHTML(<<<EOD
|
||||
<div style="margin-top: -1.25rem;" class="mb-3 small text-muted">
|
||||
$change_avatar_help
|
||||
</div>
|
||||
} else {
|
||||
$expiration_time = UOJLocale::get('user::expiration time');
|
||||
$expiration_help_text = isSuperUser(Auth::user())
|
||||
? '只有用户组别为「临时用户」的用户才能被修改过期时间。'
|
||||
: '只有管理员才能修改用户的账号过期时间。';
|
||||
$update_profile_form->appendHTML(<<<EOD
|
||||
<div class="mb-3">
|
||||
<label for="input-expiration_time" class="form-label">$expiration_time</label>
|
||||
<input type="text" class="form-control" id="input-expiration_time" aria-describedby="help-expiration_time" value="永不过期" disabled>
|
||||
<div id="help-expiration_time" class="form-text">$expiration_help_text</div>
|
||||
</div>
|
||||
EOD);
|
||||
$update_profile_form->addVInput(
|
||||
}
|
||||
$update_profile_form->addCheckboxes('avatar_source', [
|
||||
'div_class' => 'mb-3',
|
||||
'label' => UOJLocale::get('user::avatar source'),
|
||||
'label_class' => 'me-3',
|
||||
'default_value' => $extra['avatar_source'] ?: 'gravatar',
|
||||
'select_class' => 'd-inline-block',
|
||||
'option_div_class' => 'form-check d-inline-block ms-2',
|
||||
'options' => [
|
||||
'gravatar' => 'Gravatar',
|
||||
'qq' => 'QQ',
|
||||
],
|
||||
'help' => UOJLocale::get('change avatar help'),
|
||||
]);
|
||||
$update_profile_form->addInput(
|
||||
'email',
|
||||
'email',
|
||||
UOJLocale::get('email'),
|
||||
$user['email'] ?: '',
|
||||
function ($email, &$vdata) {
|
||||
if ($email && !validateEmail($email)) {
|
||||
return 'Email 格式不合法。';
|
||||
}
|
||||
[
|
||||
'div_class' => 'mb-3',
|
||||
'type' => 'email',
|
||||
'label' => UOJLocale::get('email'),
|
||||
'default_value' => $user['email'] ?: '',
|
||||
'validator_php' => function ($email, &$vdata) {
|
||||
if (!validateEmail($email)) {
|
||||
return 'Email 格式不合法。';
|
||||
}
|
||||
|
||||
$vdata['email'] = $email;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$update_profile_form->addVInput(
|
||||
'qq',
|
||||
'text',
|
||||
UOJLocale::get('QQ'),
|
||||
$user['qq'] == 0 ? '' : $user['qq'],
|
||||
function ($qq, &$vdata) {
|
||||
if ($qq && !validateQQ($qq)) {
|
||||
return 'QQ 格式不合法。';
|
||||
}
|
||||
|
||||
$vdata['qq'] = $qq;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
$update_profile_form->addVInput(
|
||||
'github',
|
||||
'text',
|
||||
'GitHub',
|
||||
$extra['social']['github'] ?: '',
|
||||
function ($github, &$vdata) {
|
||||
if ($github && !validateGitHubUsername($github)) {
|
||||
return 'GitHub 用户名不合法。';
|
||||
}
|
||||
|
||||
$vdata['github'] = $github;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
if (isSuperUser(Auth::user())) {
|
||||
$update_profile_form->addVInput(
|
||||
'school',
|
||||
'text',
|
||||
UOJLocale::get('school'),
|
||||
$user['school'] ?: '',
|
||||
function ($school, &$vdata) {
|
||||
$vdata['school'] = $school;
|
||||
$vdata['email'] = $email;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
]
|
||||
);
|
||||
$update_profile_form->addInput(
|
||||
'qq',
|
||||
[
|
||||
'div_class' => 'mb-3',
|
||||
'label' => UOJLocale::get('QQ'),
|
||||
'default_value' => $user['qq'] == 0 ? '' : $user['qq'],
|
||||
'validator_php' => function ($qq, &$vdata) {
|
||||
if ($qq && !validateQQ($qq)) {
|
||||
return 'QQ 格式不合法。';
|
||||
}
|
||||
|
||||
$vdata['qq'] = $qq;
|
||||
|
||||
return '';
|
||||
},
|
||||
]
|
||||
);
|
||||
$update_profile_form->addInput(
|
||||
'github',
|
||||
[
|
||||
'div_class' => 'mb-3',
|
||||
'label' => 'GitHub',
|
||||
'default_value' => $extra['social']['github'] ?: '',
|
||||
'validator_php' => function ($github, &$vdata) {
|
||||
if ($github && !validateGitHubUsername($github)) {
|
||||
return 'GitHub 用户名不合法。';
|
||||
}
|
||||
|
||||
$vdata['github'] = $github;
|
||||
|
||||
return '';
|
||||
},
|
||||
]
|
||||
);
|
||||
if (isSuperUser(Auth::user())) {
|
||||
$update_profile_form->addInput(
|
||||
'school',
|
||||
[
|
||||
'div_class' => 'mb-3',
|
||||
'label' => UOJLocale::get('school'),
|
||||
'default_value' => $user['school'] ?: '',
|
||||
'validator_php' => function ($school, &$vdata) {
|
||||
$vdata['school'] = $school;
|
||||
|
||||
return '';
|
||||
},
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$school = UOJLocale::get('school');
|
||||
@ -180,58 +202,69 @@ EOD);
|
||||
</div>
|
||||
EOD);
|
||||
}
|
||||
$update_profile_form->addVCheckboxes('sex', [
|
||||
'U' => UOJLocale::get('refuse to answer'),
|
||||
'M' => UOJLocale::get('male'),
|
||||
'F' => UOJLocale::get('female'),
|
||||
], UOJLocale::get('sex'), $user['sex']);
|
||||
$update_profile_form->addVInput(
|
||||
$update_profile_form->addCheckboxes('sex', [
|
||||
'div_class' => 'mb-3',
|
||||
'label' => UOJLocale::get('sex'),
|
||||
'label_class' => 'me-3',
|
||||
'default_value' => $user['sex'],
|
||||
'select_class' => 'd-inline-block',
|
||||
'option_div_class' => 'form-check d-inline-block ms-2',
|
||||
'options' => [
|
||||
'U' => UOJLocale::get('refuse to answer'),
|
||||
'M' => UOJLocale::get('male'),
|
||||
'F' => UOJLocale::get('female'),
|
||||
],
|
||||
]);
|
||||
$update_profile_form->addInput(
|
||||
'motto',
|
||||
'text',
|
||||
UOJLocale::get('motto'),
|
||||
$user['motto'] ?: '',
|
||||
function ($motto, &$vdata) {
|
||||
if (!validateMotto($motto)) {
|
||||
return '格言格式不合法';
|
||||
}
|
||||
[
|
||||
'div_class' => 'mb-3',
|
||||
'label' => UOJLocale::get('motto'),
|
||||
'default_value' => $user['motto'] ?: '',
|
||||
'validator_php' => function ($motto, &$vdata) {
|
||||
if (!validateMotto($motto)) {
|
||||
return '格言格式不合法';
|
||||
}
|
||||
|
||||
$vdata['motto'] = $motto;
|
||||
$vdata['motto'] = $motto;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
return '';
|
||||
},
|
||||
]
|
||||
);
|
||||
$update_profile_form->addVInput(
|
||||
$update_profile_form->addInput(
|
||||
'codeforces',
|
||||
'text',
|
||||
UOJLocale::get('codeforces handle'),
|
||||
$extra['social']['codeforces'] ?: '',
|
||||
function ($codeforces, &$vdata) {
|
||||
if ($codeforces && !validateUsername($codeforces)) {
|
||||
return 'Codeforces 用户名格式不合法。';
|
||||
}
|
||||
[
|
||||
'div_class' => 'mb-3',
|
||||
'label' => UOJLocale::get('codeforces handle'),
|
||||
'default_value' => $extra['social']['codeforces'] ?: '',
|
||||
'validator_php' => function ($codeforces, &$vdata) {
|
||||
if ($codeforces && !validateUsername($codeforces)) {
|
||||
return 'Codeforces 用户名格式不合法。';
|
||||
}
|
||||
|
||||
$vdata['codeforces'] = $codeforces;
|
||||
$vdata['codeforces'] = $codeforces;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
return '';
|
||||
},
|
||||
]
|
||||
);
|
||||
$update_profile_form->addVInput(
|
||||
$update_profile_form->addInput(
|
||||
'website',
|
||||
'text',
|
||||
UOJLocale::get('user::website'),
|
||||
$extra['social']['website'] ?: '',
|
||||
function ($url, &$vdata) {
|
||||
if ($url && !validateURL($url)) {
|
||||
return '链接格式不合法。';
|
||||
}
|
||||
[
|
||||
'div_class' => 'mb-3',
|
||||
'label' => UOJLocale::get('user::website'),
|
||||
'default_value' => $extra['social']['website'] ?: '',
|
||||
'validator_php' => function ($url, &$vdata) {
|
||||
if ($url && !validateURL($url)) {
|
||||
return '链接格式不合法。';
|
||||
}
|
||||
|
||||
$vdata['website'] = $url;
|
||||
$vdata['website'] = $url;
|
||||
|
||||
return '';
|
||||
},
|
||||
null
|
||||
return '';
|
||||
},
|
||||
]
|
||||
);
|
||||
if ($user['usergroup'] == 'B') {
|
||||
$update_profile_form->appendHTML(<<<EOD
|
||||
@ -256,14 +289,19 @@ EOD);
|
||||
$additional_colors['#9d3dcf'] = '紫色 - #9d3dcf';
|
||||
}
|
||||
|
||||
$update_profile_form->addVSelect('username_color', $additional_colors + [
|
||||
'#0d6efd' => '蓝色 - #0d6efd',
|
||||
'#2da44e' => '绿色 - #2da44e',
|
||||
'#e85aad' => '粉色 - #e85aad',
|
||||
'#f32a38' => '红色 - #f32a38',
|
||||
'#f57c00' => '橙色 - #f57c00',
|
||||
'#00acc1' => '青色 - #00acc1',
|
||||
], '用户名颜色', $extra['username_color']);
|
||||
$update_profile_form->addSelect('username_color', [
|
||||
'div_class' => 'mb-3',
|
||||
'label' => '用户名颜色',
|
||||
'default_value' => $extra['username_color'],
|
||||
'options' => $additional_colors + [
|
||||
'#0d6efd' => '蓝色 - #0d6efd',
|
||||
'#2da44e' => '绿色 - #2da44e',
|
||||
'#e85aad' => '粉色 - #e85aad',
|
||||
'#f32a38' => '红色 - #f32a38',
|
||||
'#f57c00' => '橙色 - #f57c00',
|
||||
'#00acc1' => '青色 - #00acc1',
|
||||
],
|
||||
]);
|
||||
}
|
||||
$update_profile_form->handle = function (&$vdata) use ($user) {
|
||||
$data = [
|
||||
@ -310,8 +348,9 @@ EOD);
|
||||
|
||||
dieWithJsonData(['status' => 'success']);
|
||||
};
|
||||
$update_profile_form->submit_button_config['class_str'] = 'btn btn-secondary mt-3';
|
||||
$update_profile_form->submit_button_config['text'] = '更新';
|
||||
$update_profile_form->config['submit_container']['class'] = 'text-center mt-3';
|
||||
$update_profile_form->config['submit_button']['class'] = 'btn btn-secondary';
|
||||
$update_profile_form->config['submit_button']['text'] = '更新';
|
||||
$update_profile_form->setAjaxSubmit(<<<EOD
|
||||
function(res) {
|
||||
if (res.status === 'success') {
|
||||
|
@ -13,8 +13,7 @@ if (!isSuperUser(Auth::user()) && Auth::id() != $user['username']) {
|
||||
}
|
||||
|
||||
function newDeleteSystemMsgForm($id) {
|
||||
$form = new UOJBs4Form('remove_system_msg_' . $id);
|
||||
|
||||
$form = new UOJForm('remove_system_msg_' . $id);
|
||||
$form->addHidden("msg_id", $id, function ($msg_id) {
|
||||
global $user;
|
||||
|
||||
@ -33,10 +32,10 @@ function newDeleteSystemMsgForm($id) {
|
||||
$msg_id = $_POST["msg_id"];
|
||||
DB::delete("delete from user_system_msg where id = {$msg_id}");
|
||||
};
|
||||
$form->submit_button_config['text'] = '删除';
|
||||
$form->submit_button_config['class_str'] = 'btn btn-link text-decoration-none text-danger p-0 mt-0';
|
||||
$form->submit_button_config['align'] = 'inline';
|
||||
$form->submit_button_config['smart_confirm'] = '';
|
||||
$form->config['submit_button']['class'] = 'btn btn-link text-decoration-none text-danger p-0';
|
||||
$form->config['submit_button']['text'] = '删除';
|
||||
$form->config['submit_container']['class'] = 'd-inline';
|
||||
$form->config['confirm']['smart'] = true;
|
||||
|
||||
return $form;
|
||||
}
|
||||
@ -98,7 +97,7 @@ foreach ($pag->get() as $idx => $msg) {
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
<?php if ($pag->isEmpty()) : ?>
|
||||
<div class="text-center">
|
||||
<div class="text-center my-4">
|
||||
<?= UOJLocale::get('none') ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
@ -1,653 +1,12 @@
|
||||
<?php
|
||||
define('SCRIPT_REFRESH_AS_GET', '<script>;window.location = window.location.origin + window.location.pathname + (window.location.search.length ? window.location.search + "&" : "?") + "_refresh_" + (+new Date()) + "=" + (+new Date()) + window.location.hash;</script>');
|
||||
|
||||
class UOJBs4Form {
|
||||
public $form_name;
|
||||
public $succ_href;
|
||||
public $back_href = null;
|
||||
public $no_submit = false;
|
||||
public $ctrl_enter_submit = false;
|
||||
public $extra_validator = null;
|
||||
public $is_big = false;
|
||||
public $has_file = false;
|
||||
public $ajax_submit_js = null;
|
||||
public $run_at_server_handler = array();
|
||||
private $data = array();
|
||||
private $vdata = array();
|
||||
private $main_html = '';
|
||||
public $max_post_size = 15728640; // 15M
|
||||
public $max_file_size_mb = 10; // 10M
|
||||
|
||||
public $handle;
|
||||
|
||||
public $submit_button_config = [];
|
||||
public $control_label_config = ['class' => 'col-sm-2'];
|
||||
public $input_config = ['class' => 'col-sm-3'];
|
||||
public $textarea_config = ['class' => 'col-sm-10'];
|
||||
|
||||
public function __construct($form_name) {
|
||||
$this->form_name = $form_name;
|
||||
$this->succ_href = UOJContext::requestURI();
|
||||
$this->handle = function (&$vdata) {
|
||||
};
|
||||
|
||||
$this->run_at_server_handler["check-{$this->form_name}"] = function () {
|
||||
die(json_encode($this->validateAtServer()));
|
||||
};
|
||||
$this->run_at_server_handler["submit-{$this->form_name}"] = function () {
|
||||
if ($this->no_submit) {
|
||||
UOJResponse::page404();
|
||||
}
|
||||
foreach ($this->data as $field) {
|
||||
if (!isset($field['no_val']) && !isset($_POST[$field['name']])) {
|
||||
UOJResponse::message('The form is incomplete.');
|
||||
}
|
||||
}
|
||||
|
||||
if (UOJContext::requestMethod() == 'POST') {
|
||||
$len = UOJContext::contentLength();
|
||||
if ($len === null) {
|
||||
UOJResponse::page403();
|
||||
} elseif ($len > $this->max_post_size) {
|
||||
UOJResponse::message('The form is too large.');
|
||||
}
|
||||
}
|
||||
|
||||
crsf_defend();
|
||||
$errors = $this->validateAtServer();
|
||||
if ($errors) {
|
||||
$err_str = '';
|
||||
foreach ($errors as $name => $err) {
|
||||
$esc_err = htmlspecialchars($err);
|
||||
$err_str .= "$name: $esc_err<br />";
|
||||
}
|
||||
UOJResponse::message($err_str);
|
||||
}
|
||||
$fun = $this->handle;
|
||||
$fun($this->vdata);
|
||||
|
||||
if ($this->succ_href !== 'none') {
|
||||
redirectTo($this->succ_href);
|
||||
}
|
||||
die();
|
||||
};
|
||||
}
|
||||
|
||||
public function setAjaxSubmit($js) {
|
||||
$GLOBALS['REQUIRE_LIB']['jquery.form'] = '';
|
||||
$this->ajax_submit_js = $js;
|
||||
}
|
||||
|
||||
public function add($name, $html, $validator_php, $validator_js) {
|
||||
$this->main_html .= $html;
|
||||
$this->data[] = array(
|
||||
'name' => $name,
|
||||
'validator_php' => $validator_php,
|
||||
'validator_js' => $validator_js
|
||||
);
|
||||
}
|
||||
public function appendHTML($html) {
|
||||
$this->main_html .= $html;
|
||||
}
|
||||
|
||||
public function addNoVal($name, $html) {
|
||||
$this->main_html .= $html;
|
||||
$this->data[] = array(
|
||||
'name' => $name,
|
||||
'validator_js' => 'always_ok',
|
||||
'no_val' => ''
|
||||
);
|
||||
}
|
||||
|
||||
public function addHidden($name, $default_value, $validator_php, $validator_js) {
|
||||
$default_value = htmlspecialchars($default_value);
|
||||
$html = <<<EOD
|
||||
<input type="hidden" name="$name" id="input-$name" value="$default_value" />
|
||||
EOD;
|
||||
$this->add($name, $html, $validator_php, $validator_js);
|
||||
}
|
||||
|
||||
public function addInput($name, $type, $label_text, $default_value, $validator_php, $validator_js) {
|
||||
$default_value = htmlspecialchars($default_value);
|
||||
$html = <<<EOD
|
||||
<div class="form-group" id="div-$name">
|
||||
<label for="input-$name" class="{$this->control_label_config['class']} control-label">$label_text</label>
|
||||
<div class="{$this->input_config['class']}">
|
||||
<input class="form-control" type="$type" class="form-control" name="$name" id="input-$name" value="$default_value" />
|
||||
<span class="help-block" id="help-$name"></span>
|
||||
</div>
|
||||
</div>
|
||||
EOD;
|
||||
$this->add($name, $html, $validator_php, $validator_js);
|
||||
}
|
||||
public function addSelect($name, $options, $label_text, $default_value) {
|
||||
$default_value = htmlspecialchars($default_value);
|
||||
$html = <<<EOD
|
||||
<div id="div-$name">
|
||||
<label for="input-$name" class="{$this->control_label_config['class']} control-label">$label_text</label>
|
||||
<div class="{$this->input_config['class']}">
|
||||
<select class="form-select" id="input-content" name="$name">
|
||||
|
||||
EOD;
|
||||
foreach ($options as $opt_name => $opt_label) {
|
||||
if ($opt_name != $default_value) {
|
||||
$html .= <<<EOD
|
||||
<option value="$opt_name">$opt_label</option>
|
||||
|
||||
EOD;
|
||||
} else {
|
||||
$html .= <<<EOD
|
||||
<option value="$opt_name" selected="selected">$opt_label</option>
|
||||
|
||||
EOD;
|
||||
}
|
||||
}
|
||||
$html .= <<<EOD
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
EOD;
|
||||
$this->add(
|
||||
$name,
|
||||
$html,
|
||||
function ($opt) use ($options) {
|
||||
return isset($options[$opt]) ? '' : "无效选项";
|
||||
},
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
public function addVInput($name, $type, $label_text, $default_value, $validator_php, $validator_js) {
|
||||
$html = HTML::div_vinput($name, $type, $label_text, $default_value);
|
||||
$this->add($name, $html, $validator_php, $validator_js);
|
||||
}
|
||||
public function addVSelect($name, $options, $label_text, $default_value) {
|
||||
$default_value = htmlspecialchars($default_value);
|
||||
$html = <<<EOD
|
||||
<div id="div-$name">
|
||||
<label for="input-$name" class="form-label">$label_text</label>
|
||||
<select class="form-select" id="input-{$name}" name="$name">
|
||||
|
||||
EOD;
|
||||
foreach ($options as $opt_name => $opt_label) {
|
||||
if ($opt_name != $default_value) {
|
||||
$html .= <<<EOD
|
||||
<option value="$opt_name">$opt_label</option>
|
||||
|
||||
EOD;
|
||||
} else {
|
||||
$html .= <<<EOD
|
||||
<option value="$opt_name" selected="selected">$opt_label</option>
|
||||
|
||||
EOD;
|
||||
}
|
||||
}
|
||||
$html .= <<<EOD
|
||||
</select>
|
||||
</div>
|
||||
EOD;
|
||||
$this->add(
|
||||
$name,
|
||||
$html,
|
||||
function ($opt) use ($options) {
|
||||
return isset($options[$opt]) ? '' : "无效选项";
|
||||
},
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
public function addTextArea($name, $label_text, $default_value, $validator_php, $validator_js) {
|
||||
$default_value = htmlspecialchars($default_value);
|
||||
$this->is_big = true;
|
||||
$html = <<<EOD
|
||||
<div id="div-$name" class="form-group">
|
||||
<label for="input-$name" class="{$this->control_label_config['class']} control-label">$label_text</label>
|
||||
<div class="{$this->textarea_config['class']}">
|
||||
<textarea class="form-control" name="$name" id="input-$name">$default_value</textarea>
|
||||
<span class="invalid-feedback" id="help-$name"></span>
|
||||
</div>
|
||||
</div>
|
||||
EOD;
|
||||
$this->add($name, $html, $validator_php, $validator_js);
|
||||
}
|
||||
public function addVTextArea($name, $label_text, $default_value, $validator_php, $validator_js) {
|
||||
$default_value = htmlspecialchars($default_value);
|
||||
$this->is_big = true;
|
||||
$html = <<<EOD
|
||||
<div id="div-$name">
|
||||
<label for="input-$name" class="form-label">$label_text</label>
|
||||
<textarea class="form-control" name="$name" id="input-$name">$default_value</textarea>
|
||||
<span class="invalid-feedback" id="help-$name"></span>
|
||||
</div>
|
||||
EOD;
|
||||
$this->add($name, $html, $validator_php, $validator_js);
|
||||
}
|
||||
public function addCheckBox($name, $label_text, $default_value) {
|
||||
$default_value = htmlspecialchars($default_value);
|
||||
$status = $default_value ? 'checked="checked" ' : '';
|
||||
$html = <<<EOD
|
||||
<div class="form-checkbox">
|
||||
<input class="form-check-input" type="checkbox" id="input-$name" name="$name" $status/>
|
||||
<label class="form-check-label" for="input-$name">
|
||||
$label_text
|
||||
</label>
|
||||
</div>
|
||||
EOD;
|
||||
$this->addNoVal($name, $html);
|
||||
}
|
||||
public function addVCheckboxes($name, $options, $label_text, $default_value) {
|
||||
$default_value = htmlspecialchars($default_value);
|
||||
$html = <<<EOD
|
||||
<div id="div-$name" class="input-group mb-3">
|
||||
<label class="form-label me-3">$label_text</label>
|
||||
EOD;
|
||||
foreach ($options as $opt_name => $opt_label) {
|
||||
$html .= <<<EOD
|
||||
<div class="form-check ms-2">
|
||||
EOD;
|
||||
if ($opt_name != $default_value) {
|
||||
$html .= <<<EOD
|
||||
<input class="form-check-input" type="radio" id="input-$name-$opt_name" name="$name" value="$opt_name">
|
||||
EOD;
|
||||
} else {
|
||||
$html .= <<<EOD
|
||||
<input class="form-check-input" type="radio" id="input-$name-$opt_name" name="$name" value="$opt_name" checked="checked">
|
||||
EOD;
|
||||
}
|
||||
$html .= <<<EOD
|
||||
<label class="form-check-label" for="input-$name-$opt_name">$opt_label</label>
|
||||
</div>
|
||||
EOD;
|
||||
}
|
||||
$html .= <<<EOD
|
||||
</div>
|
||||
EOD;
|
||||
$this->add(
|
||||
$name,
|
||||
$html,
|
||||
function ($opt) use ($options) {
|
||||
return isset($options[$opt]) ? '' : "无效选项";
|
||||
},
|
||||
null
|
||||
);
|
||||
}
|
||||
public function addCKEditor($name, $label_text, $default_value, $validator_php, $validator_js) {
|
||||
$default_value = htmlspecialchars($default_value);
|
||||
global $REQUIRE_LIB;
|
||||
$REQUIRE_LIB['ckeditor'] = '';
|
||||
|
||||
$this->is_big = true;
|
||||
|
||||
$html = <<<EOD
|
||||
<div id="div-$name">
|
||||
<label for="input-$name" class="control-label">$label_text</label>
|
||||
<textarea class="ckeditor" name="$name" id="input-$name">$default_value</textarea>
|
||||
<span class="help-block" id="help-$name"></span>
|
||||
</div>
|
||||
EOD;
|
||||
$this->add($name, $html, $validator_php, $validator_js);
|
||||
}
|
||||
|
||||
static public function uploadedFileTmpName($name) {
|
||||
if (isset($_FILES[$name]) && is_uploaded_file($_FILES[$name]['tmp_name'])) {
|
||||
return $_FILES[$name]['tmp_name'];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public function addSourceCodeInput($name, $text, $languages, $preferred_lang = null) {
|
||||
$this->add(
|
||||
"{$name}_upload_type",
|
||||
'',
|
||||
function ($type, &$vdata) use ($name) {
|
||||
if ($type == 'editor') {
|
||||
if (!isset($_POST["{$name}_editor"])) {
|
||||
return '你在干啥……怎么什么都没交过来……?';
|
||||
}
|
||||
} elseif ($type == 'file') {
|
||||
} else {
|
||||
return '……居然既不是用编辑器上传也不是用文件上传的……= =……';
|
||||
}
|
||||
},
|
||||
'always_ok'
|
||||
);
|
||||
$this->addNoVal("{$name}_editor", '');
|
||||
$this->addNoVal("{$name}_file", '');
|
||||
$this->add(
|
||||
"{$name}_language",
|
||||
'',
|
||||
function ($lang) use ($languages) {
|
||||
if (!isset($languages[$lang])) {
|
||||
return '该语言不被支持';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
'always_ok'
|
||||
);
|
||||
|
||||
if ($preferred_lang == null || !isset($languages[$preferred_lang])) {
|
||||
$preferred_lang = Cookie::get('uoj_preferred_language');
|
||||
}
|
||||
if ($preferred_lang == null || !isset($languages[$preferred_lang])) {
|
||||
$preferred_lang = UOJLang::$default_preferred_language;
|
||||
}
|
||||
|
||||
$langs_options_str = '';
|
||||
foreach ($languages as $lang_code => $lang_display) {
|
||||
$langs_options_str .= '<option';
|
||||
$langs_options_str .= ' value="' . $lang_code . '"';
|
||||
if ($lang_code == $preferred_lang) {
|
||||
$langs_options_str .= ' selected="selected"';
|
||||
}
|
||||
$langs_options_str .= ">$lang_display</option>";
|
||||
}
|
||||
$langs_options_json = json_encode($langs_options_str);
|
||||
$this->appendHTML(
|
||||
<<<EOD
|
||||
<div class="form-group" id="form-group-$name"></div>
|
||||
<script type="text/javascript">
|
||||
$('#form-group-$name').source_code_form_group('$name', '$text', $langs_options_json);
|
||||
</script>
|
||||
EOD
|
||||
);
|
||||
|
||||
$this->is_big = true;
|
||||
$this->has_file = true;
|
||||
}
|
||||
public function addTextFileInput($name, $text) {
|
||||
$this->add(
|
||||
"{$name}_upload_type",
|
||||
'',
|
||||
function ($type, &$vdata) use ($name) {
|
||||
if ($type == 'editor') {
|
||||
if (!isset($_POST["{$name}_editor"])) {
|
||||
return '你在干啥……怎么什么都没交过来……?';
|
||||
}
|
||||
} elseif ($type == 'file') {
|
||||
} else {
|
||||
return '……居然既不是用编辑器上传也不是用文件上传的……= =……';
|
||||
}
|
||||
},
|
||||
'always_ok'
|
||||
);
|
||||
$this->addNoVal("{$name}_editor", '');
|
||||
$this->addNoVal("{$name}_file", '');
|
||||
|
||||
$this->appendHTML(
|
||||
<<<EOD
|
||||
<div class="form-group" id="form-group-$name"></div>
|
||||
<script type="text/javascript">
|
||||
$('#form-group-$name').text_file_form_group('$name', '$text');
|
||||
</script>
|
||||
EOD
|
||||
);
|
||||
|
||||
$this->is_big = true;
|
||||
$this->has_file = true;
|
||||
}
|
||||
|
||||
public function printHTML() {
|
||||
$form_entype_str = $this->is_big ? ' enctype="multipart/form-data"' : '';
|
||||
|
||||
$form_class = "form-horizontal";
|
||||
if ($this->submit_button_config['align'] == 'inline') {
|
||||
$form_class .= " uoj-bs4-form-inline";
|
||||
}
|
||||
if ($this->submit_button_config['align'] == 'compressed') {
|
||||
$form_class .= " uoj-bs4-form-compressed";
|
||||
}
|
||||
echo '<form action="', $_SERVER['REQUEST_URI'], '" method="post" class="', $form_class, '" id="form-', $this->form_name, '"', $form_entype_str, '>';
|
||||
echo HTML::hiddenToken();
|
||||
echo $this->main_html;
|
||||
|
||||
if (!$this->no_submit) {
|
||||
if (!isset($this->submit_button_config['align'])) {
|
||||
$this->submit_button_config['align'] = 'center';
|
||||
}
|
||||
if (!isset($this->submit_button_config['text'])) {
|
||||
$this->submit_button_config['text'] = UOJLocale::get('submit');
|
||||
}
|
||||
if (!isset($this->submit_button_config['class_str'])) {
|
||||
$this->submit_button_config['class_str'] = 'btn btn-secondary mt-2';
|
||||
}
|
||||
if ($this->submit_button_config['align'] == 'offset') {
|
||||
echo '<div class="form-group">';
|
||||
echo '<div class="col-sm-offset-2 col-sm-3">';
|
||||
} else {
|
||||
echo '<div class="text-', $this->submit_button_config['align'], '">';
|
||||
}
|
||||
|
||||
if ($this->back_href !== null) {
|
||||
echo '<div class="btn-toolbar">';
|
||||
}
|
||||
echo HTML::tag('button', [
|
||||
'type' => 'submit', 'id' => "button-submit-{$this->form_name}", 'name' => "submit-{$this->form_name}",
|
||||
'value' => $this->form_name, 'class' => $this->submit_button_config['class_str']
|
||||
], $this->submit_button_config['text']);
|
||||
if ($this->back_href !== null) {
|
||||
echo HTML::tag('a', [
|
||||
'class' => 'btn btn-secondary', 'href' => $this->back_href
|
||||
], '返回');
|
||||
}
|
||||
if ($this->back_href !== null) {
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
if ($this->submit_button_config['align'] == 'offset') {
|
||||
echo '</div>';
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo '</form>';
|
||||
|
||||
if ($this->no_submit) {
|
||||
return;
|
||||
}
|
||||
|
||||
echo <<<EOD
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
|
||||
EOD;
|
||||
if ($this->ctrl_enter_submit) {
|
||||
echo <<<EOD
|
||||
$('#form-{$this->form_name}').keydown(function(e) {
|
||||
if (e.keyCode == 13 && e.ctrlKey) {
|
||||
$('#button-submit-{$this->form_name}').click();
|
||||
}
|
||||
});
|
||||
|
||||
EOD;
|
||||
}
|
||||
echo <<<EOD
|
||||
$('#form-{$this->form_name}').submit(function(e) {
|
||||
var ok = true;
|
||||
|
||||
EOD;
|
||||
$need_ajax = false;
|
||||
if ($this->extra_validator) {
|
||||
$need_ajax = true;
|
||||
}
|
||||
foreach ($this->data as $field) {
|
||||
if ($field['validator_js'] != null) {
|
||||
if ($field['validator_js'] != 'always_ok') {
|
||||
echo <<<EOD
|
||||
var {$field['name']}_err = ({$field['validator_js']})($('#input-{$field['name']}').val());
|
||||
|
||||
EOD;
|
||||
}
|
||||
} else {
|
||||
$need_ajax = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($need_ajax) {
|
||||
echo <<<EOD
|
||||
var post_data = {};
|
||||
|
||||
EOD;
|
||||
foreach ($this->data as $field) {
|
||||
if ($field['validator_js'] == null) {
|
||||
echo <<<EOD
|
||||
var {$field['name']}_err = 'Unknown error';
|
||||
post_data.{$field['name']} = $('#input-{$field['name']}').val();
|
||||
|
||||
EOD;
|
||||
}
|
||||
}
|
||||
echo <<<EOD
|
||||
post_data['check-{$this->form_name}'] = "";
|
||||
$.ajax({
|
||||
url : '{$_SERVER['REQUEST_URI']}',
|
||||
type : 'POST',
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
|
||||
data : post_data,
|
||||
success : function(data) {
|
||||
|
||||
EOD;
|
||||
foreach ($this->data as $field) {
|
||||
if ($field['validator_js'] == null) {
|
||||
echo <<<EOD
|
||||
{$field['name']}_err = data.${field['name']};
|
||||
|
||||
EOD;
|
||||
}
|
||||
}
|
||||
echo <<<EOD
|
||||
if (data.extra != undefined) {
|
||||
alert(data.extra);
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
EOD;
|
||||
}
|
||||
|
||||
foreach ($this->data as $field) {
|
||||
if ($field['validator_js'] != 'always_ok') {
|
||||
echo <<<EOD
|
||||
if (${field['name']}_err) {
|
||||
$('#div-${field['name']}').addClass('has-validation has-error');
|
||||
$('#div-${field['name']}').addClass('is-invalid');
|
||||
$('#input-${field['name']}').addClass('is-invalid');
|
||||
$('#help-${field['name']}').text(${field['name']}_err);
|
||||
ok = false;
|
||||
} else {
|
||||
$('#div-${field['name']}').removeClass('has-validation has-error');
|
||||
$('#div-${field['name']}').removeClass('is-invalid');
|
||||
$('#input-${field['name']}').removeClass('is-invalid');
|
||||
$('#help-${field['name']}').text('');
|
||||
}
|
||||
|
||||
EOD;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->submit_button_config['smart_confirm'])) {
|
||||
$this->submit_button_config['confirm_text'] = '你真的要' . $this->submit_button_config['text'] . '吗?';
|
||||
}
|
||||
if (isset($this->submit_button_config['confirm_text'])) {
|
||||
echo <<<EOD
|
||||
if (!confirm('{$this->submit_button_config['confirm_text']}')) {
|
||||
ok = false;
|
||||
}
|
||||
|
||||
EOD;
|
||||
}
|
||||
if ($this->has_file) {
|
||||
echo <<<EOD
|
||||
$(this).find("input[type='file']").each(function() {
|
||||
for (var i = 0; i < this.files.length; i++) {
|
||||
if (this.files[i].size > {$this->max_file_size_mb} * 1024 * 1024) {
|
||||
$('#div-' + $(this).attr('name')).addClass('has-error');
|
||||
$('#help-' + $(this).attr('name')).text('文件大小不能超过{$this->max_file_size_mb}M');
|
||||
ok = false;
|
||||
} else {
|
||||
$('#div-' + $(this).attr('name')).removeClass('has-error');
|
||||
$('#help-' + $(this).attr('name')).text('');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
EOD;
|
||||
}
|
||||
|
||||
if ($this->ajax_submit_js !== null) {
|
||||
echo <<<EOD
|
||||
e.preventDefault();
|
||||
if (ok) {
|
||||
$(this).ajaxSubmit({
|
||||
beforeSubmit: function(formData) {
|
||||
formData.push({name: 'submit-{$this->form_name}', value: '{$this->form_name}', type: 'submit'});
|
||||
},
|
||||
success : {$this->ajax_submit_js}
|
||||
});
|
||||
}
|
||||
|
||||
EOD;
|
||||
} else {
|
||||
echo <<<EOD
|
||||
return ok;
|
||||
|
||||
EOD;
|
||||
}
|
||||
echo <<<EOD
|
||||
});
|
||||
});
|
||||
</script>
|
||||
EOD;
|
||||
}
|
||||
|
||||
private function validateAtServer() {
|
||||
$errors = array();
|
||||
if ($this->extra_validator) {
|
||||
$fun = $this->extra_validator;
|
||||
$err = $fun();
|
||||
if ($err) {
|
||||
$errors['extra'] = $err;
|
||||
}
|
||||
}
|
||||
foreach ($this->data as $field) {
|
||||
if (!isset($field['no_val']) && isset($_POST[$field['name']])) {
|
||||
$fun = $field['validator_php'];
|
||||
$ret = $fun($_POST[$field['name']], $this->vdata, $field['name']);
|
||||
if (is_array($ret) && isset($ret['error'])) {
|
||||
$err = $ret['error'];
|
||||
} else {
|
||||
$err = $ret;
|
||||
}
|
||||
if ($err) {
|
||||
$errors[$field['name']] = $err;
|
||||
}
|
||||
if (is_array($ret) && isset($ret['store'])) {
|
||||
$this->vdata[$field['name']] = $ret['store'];
|
||||
}
|
||||
}
|
||||
}
|
||||
return $errors;
|
||||
}
|
||||
|
||||
public function runAtServer() {
|
||||
foreach ($this->run_at_server_handler as $type => $handler) {
|
||||
if (isset($_POST[$type])) {
|
||||
$handler();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function newAddDelCmdForm($form_name, $validate, $handle, $final = null) {
|
||||
$form = new UOJBs4Form($form_name);
|
||||
$form->addVTextArea(
|
||||
$form_name . '_cmds',
|
||||
'命令',
|
||||
'',
|
||||
function ($str, &$vdata) use ($validate) {
|
||||
$form = new UOJForm($form_name);
|
||||
$form->addTextArea("{$form_name}_cmds", [
|
||||
'label' => '命令',
|
||||
'input_class' => 'form-control font-monospace',
|
||||
'validator_php' => function ($str, &$vdata) use ($validate) {
|
||||
$cmds = array();
|
||||
foreach (explode("\n", $str) as $line_id => $raw_line) {
|
||||
$line = trim($raw_line);
|
||||
@ -667,8 +26,7 @@ function newAddDelCmdForm($form_name, $validate, $handle, $final = null) {
|
||||
$vdata['cmds'] = $cmds;
|
||||
return '';
|
||||
},
|
||||
null
|
||||
);
|
||||
]);
|
||||
if (!isset($final)) {
|
||||
$form->handle = function (&$vdata) use ($handle) {
|
||||
foreach ($vdata['cmds'] as $cmd) {
|
||||
@ -687,13 +45,18 @@ function newAddDelCmdForm($form_name, $validate, $handle, $final = null) {
|
||||
}
|
||||
|
||||
function newSubmissionForm($form_name, $requirement, $zip_file_name_gen, $handle) {
|
||||
$form = new UOJBs4Form($form_name);
|
||||
$form = new UOJForm($form_name);
|
||||
foreach ($requirement as $req) {
|
||||
if ($req['type'] == "source code") {
|
||||
$languages = UOJLang::getAvailableLanguages(isset($req['languages']) ? $req['languages'] : null);
|
||||
$form->addSourceCodeInput("{$form_name}_{$req['name']}", UOJLocale::get('problems::source code') . ':' . $req['name'], $languages);
|
||||
} elseif ($req['type'] == "text") {
|
||||
$form->addTextFileInput("{$form_name}_{$req['name']}", UOJLocale::get('problems::text file') . ':' . $req['file_name']);
|
||||
$form->addSourceCodeInput("{$form_name}_{$req['name']}", [
|
||||
'filename' => $req['name'],
|
||||
'languages' => $languages,
|
||||
]);
|
||||
} else if ($req['type'] == "text") {
|
||||
$form->addTextFileInput("{$form_name}_{$req['name']}", [
|
||||
'filename' => $req['file_name'],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -712,9 +75,9 @@ function newSubmissionForm($form_name, $requirement, $zip_file_name_gen, $handle
|
||||
UOJResponse::message('提交失败');
|
||||
}
|
||||
|
||||
$content = array();
|
||||
$content = [];
|
||||
$content['file_name'] = $zip_file_name;
|
||||
$content['config'] = array();
|
||||
$content['config'] = [];
|
||||
foreach ($requirement as $req) {
|
||||
if ($req['type'] == "source code") {
|
||||
$content['config'][] = ["{$req['name']}_language", $_POST["{$form_name}_{$req['name']}_language"]];
|
||||
@ -725,7 +88,7 @@ function newSubmissionForm($form_name, $requirement, $zip_file_name_gen, $handle
|
||||
if ($_POST["{$form_name}_{$req['name']}_upload_type"] == 'editor') {
|
||||
$zip_file->addFromString($req['file_name'], $_POST["{$form_name}_{$req['name']}_editor"]);
|
||||
} else {
|
||||
$tmp_name = UOJBs4Form::uploadedFileTmpName("{$form_name}_{$req['name']}_file");
|
||||
$tmp_name = UOJForm::uploadedFileTmpName("{$form_name}_{$req['name']}_file");
|
||||
if ($tmp_name == null) {
|
||||
$zip_file->addFromString($req['file_name'], '');
|
||||
} else {
|
||||
@ -739,7 +102,7 @@ function newSubmissionForm($form_name, $requirement, $zip_file_name_gen, $handle
|
||||
if ($stat['size'] > $max_size * 1024) {
|
||||
$zip_file->close();
|
||||
unlink(UOJContext::storagePath() . $zip_file_name);
|
||||
UOJResponse::message("源代码长度不能超过 {$max_size}KB。");
|
||||
UOJResponse::message("源代码长度不能超过 {$max_size} kB。");
|
||||
}
|
||||
}
|
||||
|
||||
@ -752,29 +115,21 @@ function newSubmissionForm($form_name, $requirement, $zip_file_name_gen, $handle
|
||||
};
|
||||
return $form;
|
||||
}
|
||||
|
||||
function newZipSubmissionForm($form_name, $requirement, $zip_file_name_gen, $handle) {
|
||||
$form = new UOJBs4Form($form_name);
|
||||
$form = new UOJForm($form_name);
|
||||
$name = "zip_ans_{$form_name}";
|
||||
$text = UOJLocale::get('problems::zip file upload introduction', implode(', ', array_map(fn ($req) => $req['file_name'], $requirement)));
|
||||
$browse_text = UOJLocale::get('browse');
|
||||
$html = <<<EOD
|
||||
<div id="div-{$name}">
|
||||
<label for="input-{$name}">$text</label>
|
||||
<input type="file" id="input-{$name}" name="{$name}" style="display:none;" onchange="$('#input-{$name}_path').val($('#input-{$name}').val());" />
|
||||
<div class="input-group bot-buffer-md">
|
||||
<input id="input-{$name}_path" class="form-control" type="text" readonly="readonly" />
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-primary" style="width:100px; !important" onclick="$('#input-{$name}').click();"><span class="glyphicon glyphicon-folder-open"></span> $browse_text</button>
|
||||
</span>
|
||||
</div>
|
||||
<span class="help-block invalid-feedback" id="help-{$name}"></span>
|
||||
<label class="form-label" for="input-{$name}">$text</label>
|
||||
<input class="form-control" type="file" id="input-{$name}" name="{$name}" />
|
||||
<span class="help-block invalid-feedback" id="help-{$name}"></span>
|
||||
</div>
|
||||
EOD;
|
||||
|
||||
$form->addNoVal($name, $html);
|
||||
$form->is_big = true;
|
||||
$form->has_file = true;
|
||||
|
||||
$form->config['is_big'] = true;
|
||||
$form->config['has_file'] = true;
|
||||
$form->handle = function () use ($name, $requirement, $zip_file_name_gen, $handle) {
|
||||
global $myUser;
|
||||
|
||||
|
@ -69,9 +69,9 @@ function permanentlyRedirectToHTTP() {
|
||||
}
|
||||
function redirectToLogin() {
|
||||
if (UOJContext::isAjax()) {
|
||||
die('please <a href="' . HTML::url('/login') . '">login</a>');
|
||||
die('please <a href="' . HTML::url('/login', ['params' => ['to' => UOJContext::requestPath()]]) . '">login</a>');
|
||||
} else {
|
||||
header('Location: ' . HTML::url('/login'));
|
||||
header('Location: ' . HTML::url('/login', ['params' => ['to' => UOJContext::requestPath()]]));
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
@ -22,10 +22,10 @@ return [
|
||||
'statistics' => '统计',
|
||||
'solutions' => '题解',
|
||||
'run' => '运行',
|
||||
'source code' => '源文件',
|
||||
'source code' => '源代码',
|
||||
'text file' => '文本文件',
|
||||
'zip file upload introduction' => function($str) {
|
||||
return "上传一个zip压缩文件,包含 {$str}:";
|
||||
return "上传一个 zip 压缩文件,包含 {$str}:";
|
||||
},
|
||||
'or upload files one by one' => '或者逐个上传:',
|
||||
'accepted submissions' => '满分提交',
|
||||
|
@ -167,6 +167,52 @@ class UOJForm {
|
||||
$this->add($name, $html, $config['validator_php'], $config['validator_js']);
|
||||
}
|
||||
|
||||
public function addTextArea($name, $config) {
|
||||
$config += [
|
||||
'type' => 'text',
|
||||
'div_class' => '',
|
||||
'input_class' => 'form-control',
|
||||
'default_value' => '',
|
||||
'label' => '',
|
||||
'label_class' => 'form-label',
|
||||
'placeholder' => '',
|
||||
'help' => '',
|
||||
'help_class' => 'form-text',
|
||||
'validator_php' => function ($x) {
|
||||
return '';
|
||||
},
|
||||
'validator_js' => null,
|
||||
];
|
||||
|
||||
$html = '';
|
||||
$html .= HTML::tag_begin('div', ['class' => $config['div_class'], 'id' => "div-$name"]);
|
||||
|
||||
if ($config['label']) {
|
||||
$html .= HTML::tag('label', [
|
||||
'class' => $config['label_class'],
|
||||
'for' => "input-$name",
|
||||
'id' => "label-$name"
|
||||
], $config['label']);
|
||||
}
|
||||
|
||||
$html .= HTML::tag('textarea', [
|
||||
'class' => $config['input_class'],
|
||||
'type' => $config['type'],
|
||||
'name' => $name,
|
||||
'id' => "input-$name",
|
||||
'placeholder' => $config['placeholder'],
|
||||
], HTML::escape($config['default_value']));
|
||||
$html .= HTML::tag('div', ['class' => 'invalid-feedback', 'id' => "help-$name"], '');
|
||||
|
||||
if ($config['help']) {
|
||||
$html .= HTML::tag('div', ['class' => $config['help_class']], $config['help']);
|
||||
}
|
||||
|
||||
$html .= HTML::tag_end('div');
|
||||
|
||||
$this->add($name, $html, $config['validator_php'], $config['validator_js']);
|
||||
}
|
||||
|
||||
public function addCheckbox($name, $config) {
|
||||
$config += [
|
||||
'checked' => false,
|
||||
@ -181,7 +227,7 @@ class UOJForm {
|
||||
];
|
||||
|
||||
$html = '';
|
||||
$html .= HTML::tag_begin('div', ['class' => $config['div_class']]);
|
||||
$html .= HTML::tag_begin('div', ['class' => $config['div_class'], 'id' => "div-$name"]);
|
||||
$html .= HTML::empty_tag('input', [
|
||||
'class' => $config['input_class'],
|
||||
'type' => 'checkbox',
|
||||
@ -259,6 +305,188 @@ class UOJForm {
|
||||
);
|
||||
}
|
||||
|
||||
public function addCheckboxes($name, $config) {
|
||||
$config += [
|
||||
'div_class' => '',
|
||||
'select_class' => '',
|
||||
'label' => '',
|
||||
'label_class' => 'form-check-label',
|
||||
'options' => [],
|
||||
'default_value' => '',
|
||||
'option_div_class' => 'form-check',
|
||||
'option_class' => 'form-check-input',
|
||||
'option_label_class' => 'form-check-label',
|
||||
'help' => '',
|
||||
'help_class' => 'form-text',
|
||||
'disabled' => false,
|
||||
];
|
||||
|
||||
$html = '';
|
||||
$html .= HTML::tag_begin('div', ['id' => "div-$name", 'class' => $config['div_class']]);
|
||||
|
||||
// Label
|
||||
if ($config['label']) {
|
||||
$html .= HTML::tag('label', [
|
||||
'class' => $config['label_class'],
|
||||
'for' => "input-$name",
|
||||
], $config['label']);
|
||||
}
|
||||
|
||||
// Select
|
||||
$html .= HTML::tag_begin('div', ['class' => $config['select_class']]);
|
||||
|
||||
foreach ($config['options'] as $opt_name => $opt_label) {
|
||||
$html .= HTML::tag_begin('div', ['class' => $config['option_div_class']]);
|
||||
|
||||
if ($opt_name == $config['default_value']) {
|
||||
$html .= HTML::empty_tag('input', [
|
||||
'name' => $name,
|
||||
'id' => "input-$name-$opt_name",
|
||||
'class' => $config['option_class'],
|
||||
'type' => 'radio',
|
||||
'value' => $opt_name,
|
||||
'checked' => 'checked',
|
||||
]);
|
||||
} else {
|
||||
$html .= HTML::empty_tag('input', [
|
||||
'name' => $name,
|
||||
'id' => "input-$name-$opt_name",
|
||||
'class' => $config['option_class'],
|
||||
'type' => 'radio',
|
||||
'value' => $opt_name,
|
||||
]);
|
||||
}
|
||||
|
||||
$html .= HTML::tag('label', [
|
||||
'class' => $config['option_label_class'],
|
||||
'for' => "input-$name-$opt_name",
|
||||
], $opt_label);
|
||||
|
||||
$html .= HTML::tag_end('div');
|
||||
}
|
||||
|
||||
$html .= HTML::tag_end('div');
|
||||
|
||||
// Help text
|
||||
if ($config['help']) {
|
||||
$html .= HTML::tag('div', ['class' => $config['help_class']], $config['help']);
|
||||
}
|
||||
|
||||
$html .= HTML::tag_end('div');
|
||||
|
||||
$this->add(
|
||||
$name,
|
||||
$html,
|
||||
function ($opt) use ($config) {
|
||||
return isset($config['options'][$opt]) ? '' : "无效选项";
|
||||
},
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
public function addSourceCodeInput($name, $config) {
|
||||
$config += [
|
||||
'filename' => '',
|
||||
'languages' => UOJLang::getAvailableLanguages(),
|
||||
'preferred_lang' => null,
|
||||
];
|
||||
|
||||
$this->add(
|
||||
"{$name}_upload_type",
|
||||
'',
|
||||
function ($type) use ($name) {
|
||||
if ($type == 'editor') {
|
||||
if (!isset($_POST["{$name}_editor"])) {
|
||||
return '你在干啥……怎么什么都没交过来……?';
|
||||
}
|
||||
} elseif ($type == 'file') {
|
||||
} else {
|
||||
return '……居然既不是用编辑器上传也不是用文件上传的……= =……';
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
'always_ok'
|
||||
);
|
||||
$this->addNoVal("{$name}_editor", '');
|
||||
$this->addNoVal("{$name}_file", '');
|
||||
$this->add(
|
||||
"{$name}_language",
|
||||
'',
|
||||
function ($lang) use ($config) {
|
||||
if (!isset($config['languages'][$lang])) {
|
||||
return '该语言不被支持';
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
'always_ok'
|
||||
);
|
||||
|
||||
if ($config['preferred_lang'] == null || !isset($languages[$config['preferred_lang']])) {
|
||||
$preferred_lang = Cookie::get('uoj_preferred_language');
|
||||
}
|
||||
|
||||
if ($config['preferred_lang'] == null || !isset($languages[$config['preferred_lang']])) {
|
||||
$preferred_lang = UOJLang::$default_preferred_language;
|
||||
}
|
||||
|
||||
$langs_options_str = '';
|
||||
foreach ($config['languages'] as $lang_code => $lang_display) {
|
||||
$langs_options_str .= HTML::option($lang_code, $lang_display, $lang_code === $preferred_lang);
|
||||
}
|
||||
|
||||
$text = json_encode(UOJLocale::get('problems::source code') . ': ' . HTML::tag('code', [], $config['filename']));
|
||||
$langs_options_json = json_encode($langs_options_str);
|
||||
|
||||
$this->appendHTML(<<<EOD
|
||||
<div class="form-group mb-3" id="form-group-$name"></div>
|
||||
<script type="text/javascript">
|
||||
$('#form-group-$name').source_code_form_group('$name', $text, $langs_options_json);
|
||||
</script>
|
||||
EOD);
|
||||
|
||||
$this->config['is_big'] = true;
|
||||
$this->config['has_file'] = true;
|
||||
}
|
||||
|
||||
public function addTextFileInput($name, $config) {
|
||||
$config += [
|
||||
'filename' => '',
|
||||
];
|
||||
|
||||
$this->add(
|
||||
"{$name}_upload_type",
|
||||
'',
|
||||
function ($type, &$vdata) use ($name) {
|
||||
if ($type == 'editor') {
|
||||
if (!isset($_POST["{$name}_editor"])) {
|
||||
return '你在干啥……怎么什么都没交过来……?';
|
||||
}
|
||||
} elseif ($type == 'file') {
|
||||
} else {
|
||||
return '……居然既不是用编辑器上传也不是用文件上传的……= =……';
|
||||
}
|
||||
},
|
||||
'always_ok'
|
||||
);
|
||||
|
||||
$this->addNoVal("{$name}_editor", '');
|
||||
$this->addNoVal("{$name}_file", '');
|
||||
|
||||
$text = json_encode(UOJLocale::get('problems::text file') . ': ' . HTML::tag('code', [], $config['filename']));
|
||||
|
||||
$this->appendHTML(<<<EOD
|
||||
<div class="form-group mb-3" id="form-group-$name"></div>
|
||||
<script type="text/javascript">
|
||||
$('#form-group-$name').text_file_form_group('$name', $text);
|
||||
</script>
|
||||
EOD);
|
||||
|
||||
$this->config['is_big'] = true;
|
||||
$this->config['has_file'] = true;
|
||||
}
|
||||
|
||||
public function printHTML() {
|
||||
echo HTML::tag_begin('form', [
|
||||
'action' => UOJContext::requestURI(),
|
||||
@ -376,17 +604,17 @@ class UOJForm {
|
||||
foreach ($this->data as $field) {
|
||||
if ($field['validator_js'] != 'always_ok') {
|
||||
echo <<<EOD
|
||||
if (${field['name']}_err) {
|
||||
$('#div-${field['name']}').addClass('has-validation has-error');
|
||||
$('#div-${field['name']}').addClass('is-invalid');
|
||||
$('#input-${field['name']}').addClass('is-invalid');
|
||||
$('#help-${field['name']}').text(${field['name']}_err);
|
||||
if ({$field['name']}_err) {
|
||||
$('#div-{$field['name']}').addClass('has-validation has-error');
|
||||
$('#div-{$field['name']}').addClass('is-invalid');
|
||||
$('#input-{$field['name']}').addClass('is-invalid');
|
||||
$('#help-{$field['name']}').text({$field['name']}_err);
|
||||
ok = false;
|
||||
} else {
|
||||
$('#div-${field['name']}').removeClass('has-validation has-error');
|
||||
$('#div-${field['name']}').removeClass('is-invalid');
|
||||
$('#input-${field['name']}').removeClass('is-invalid');
|
||||
$('#help-${field['name']}').text('');
|
||||
$('#div-{$field['name']}').removeClass('has-validation has-error');
|
||||
$('#div-{$field['name']}').removeClass('is-invalid');
|
||||
$('#input-{$field['name']}').removeClass('is-invalid');
|
||||
$('#help-{$field['name']}').text('');
|
||||
}
|
||||
EOD;
|
||||
}
|
||||
@ -483,4 +711,12 @@ class UOJForm {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static public function uploadedFileTmpName($name) {
|
||||
if (isset($_FILES[$name]) && is_uploaded_file($_FILES[$name]['tmp_name'])) {
|
||||
return $_FILES[$name]['tmp_name'];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -690,7 +690,9 @@ class UOJProblem {
|
||||
|
||||
public function getProblemConfArray(string $where = 'data') {
|
||||
if ($where === 'data') {
|
||||
return getUOJConf($this->getDataFilePath('problem.conf'));
|
||||
$conf = UOJProblemConf::getFromFile($this->getDataFilePath('problem.conf'));
|
||||
|
||||
return $conf instanceof UOJProblemConf ? $conf->conf : $conf;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
class UOJProblemConf {
|
||||
public array $conf;
|
||||
|
||||
|
||||
static function getFromFile($file_name) {
|
||||
$reader = new StrictFileReader($file_name);
|
||||
if ($reader->failed()) {
|
||||
@ -30,7 +30,7 @@ class UOJProblemConf {
|
||||
$reader->close();
|
||||
return new UOJProblemConf($conf);
|
||||
}
|
||||
|
||||
|
||||
public function __construct($conf) {
|
||||
$this->conf = $conf;
|
||||
}
|
||||
@ -58,6 +58,22 @@ class UOJProblemConf {
|
||||
return $default_val;
|
||||
}
|
||||
|
||||
public function getInputFileName($num) {
|
||||
return $this->getVal('input_pre', 'input') . $num . '.' . $this->getVal('input_suf', 'txt');
|
||||
}
|
||||
|
||||
public function getOutputFileName($num) {
|
||||
return $this->getVal('output_pre', 'output') . $num . '.' . $this->getVal('output_suf', 'txt');
|
||||
}
|
||||
|
||||
public function getExtraInputFileName($num) {
|
||||
return 'ex_' . $this->getInputFileName($num);
|
||||
}
|
||||
|
||||
public function getExtraOutputFileName($num) {
|
||||
return 'ex_' . $this->getOutputFileName($num);
|
||||
}
|
||||
|
||||
public function isOn($key) {
|
||||
return isset($this->conf[$key]) && $this->conf[$key] == 'on';
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ Route::group(
|
||||
Route::any('/problem/{id}/manage/statement', '/problem_statement_manage.php');
|
||||
Route::any('/problem/{id}/manage/managers', '/problem_managers_manage.php');
|
||||
Route::any('/problem/{id}/manage/data', '/problem_data_manage.php');
|
||||
Route::any('/download/testlib.h', '/download.php?type=testlib.h');
|
||||
Route::any('/download/problem/{id}/data.zip', '/download.php?type=problem');
|
||||
Route::any('/download/problem/{id}/attachment.zip', '/download.php?type=attachment');
|
||||
|
||||
@ -79,8 +80,8 @@ Route::group(
|
||||
Route::any('/login', '/login.php');
|
||||
Route::any('/logout', '/logout.php');
|
||||
Route::any('/register', '/register.php');
|
||||
Route::any('/forgot-password', '/forgot_pw.php');
|
||||
Route::any('/reset-password', '/reset_pw.php');
|
||||
Route::any('/forgot_password', '/forgot_pw.php');
|
||||
Route::any('/reset_password', '/reset_pw.php');
|
||||
|
||||
Route::any('/user/{username}', '/user_info.php');
|
||||
Route::any('/user/{username}/edit(?:/{tab})?', '/user_info_edit.php');
|
||||
|
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["out-editor/vs/base/common/worker/simpleWorker.nls.de.js"],"sourcesContent":["/*!-----------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Version: 0.34.1(0316a754aa4c25208bef91937efbce2ab1e3ce37)\n * Released under the MIT license\n * https://github.com/microsoft/vscode/blob/main/LICENSE.txt\n *-----------------------------------------------------------*/\n\ndefine(\"vs/base/common/worker/simpleWorker.nls.de\", {\n\t\"vs/base/common/platform\": [\n\t\t\"_\",\n\t]\n});"],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+DAOA,OAAO,4CAA6C,CACnD,0BAA2B,CAC1B","names":[],"file":"simpleWorker.nls.de.js"}
|
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["out-editor/vs/base/common/worker/simpleWorker.nls.es.js"],"sourcesContent":["/*!-----------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Version: 0.34.1(0316a754aa4c25208bef91937efbce2ab1e3ce37)\n * Released under the MIT license\n * https://github.com/microsoft/vscode/blob/main/LICENSE.txt\n *-----------------------------------------------------------*/\n\ndefine(\"vs/base/common/worker/simpleWorker.nls.es\", {\n\t\"vs/base/common/platform\": [\n\t\t\"_\",\n\t]\n});"],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+DAOA,OAAO,4CAA6C,CACnD,0BAA2B,CAC1B","names":[],"file":"simpleWorker.nls.es.js"}
|
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["out-editor/vs/base/common/worker/simpleWorker.nls.fr.js"],"sourcesContent":["/*!-----------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Version: 0.34.1(0316a754aa4c25208bef91937efbce2ab1e3ce37)\n * Released under the MIT license\n * https://github.com/microsoft/vscode/blob/main/LICENSE.txt\n *-----------------------------------------------------------*/\n\ndefine(\"vs/base/common/worker/simpleWorker.nls.fr\", {\n\t\"vs/base/common/platform\": [\n\t\t\"_\",\n\t]\n});"],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+DAOA,OAAO,4CAA6C,CACnD,0BAA2B,CAC1B","names":[],"file":"simpleWorker.nls.fr.js"}
|
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["out-editor/vs/base/common/worker/simpleWorker.nls.it.js"],"sourcesContent":["/*!-----------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Version: 0.34.1(0316a754aa4c25208bef91937efbce2ab1e3ce37)\n * Released under the MIT license\n * https://github.com/microsoft/vscode/blob/main/LICENSE.txt\n *-----------------------------------------------------------*/\n\ndefine(\"vs/base/common/worker/simpleWorker.nls.it\", {\n\t\"vs/base/common/platform\": [\n\t\t\"_\",\n\t]\n});"],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+DAOA,OAAO,4CAA6C,CACnD,0BAA2B,CAC1B","names":[],"file":"simpleWorker.nls.it.js"}
|
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["out-editor/vs/base/common/worker/simpleWorker.nls.ja.js"],"sourcesContent":["/*!-----------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Version: 0.34.1(0316a754aa4c25208bef91937efbce2ab1e3ce37)\n * Released under the MIT license\n * https://github.com/microsoft/vscode/blob/main/LICENSE.txt\n *-----------------------------------------------------------*/\n\ndefine(\"vs/base/common/worker/simpleWorker.nls.ja\", {\n\t\"vs/base/common/platform\": [\n\t\t\"_\",\n\t]\n});"],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+DAOA,OAAO,4CAA6C,CACnD,0BAA2B,CAC1B","names":[],"file":"simpleWorker.nls.ja.js"}
|
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["out-editor/vs/base/common/worker/simpleWorker.nls.js"],"sourcesContent":["/*!-----------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Version: 0.34.1(0316a754aa4c25208bef91937efbce2ab1e3ce37)\n * Released under the MIT license\n * https://github.com/microsoft/vscode/blob/main/LICENSE.txt\n *-----------------------------------------------------------*/\n\n/*---------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\ndefine(\"vs/base/common/worker/simpleWorker.nls\", {\n\t\"vs/base/common/platform\": [\n\t\t\"_\"\n\t]\n});"],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+DAUA,OAAO,yCAA0C,CAChD,0BAA2B,CAC1B","names":[],"file":"simpleWorker.nls.js"}
|
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["out-editor/vs/base/common/worker/simpleWorker.nls.ko.js"],"sourcesContent":["/*!-----------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Version: 0.34.1(0316a754aa4c25208bef91937efbce2ab1e3ce37)\n * Released under the MIT license\n * https://github.com/microsoft/vscode/blob/main/LICENSE.txt\n *-----------------------------------------------------------*/\n\ndefine(\"vs/base/common/worker/simpleWorker.nls.ko\", {\n\t\"vs/base/common/platform\": [\n\t\t\"_\",\n\t]\n});"],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+DAOA,OAAO,4CAA6C,CACnD,0BAA2B,CAC1B","names":[],"file":"simpleWorker.nls.ko.js"}
|
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["out-editor/vs/base/common/worker/simpleWorker.nls.ru.js"],"sourcesContent":["/*!-----------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Version: 0.34.1(0316a754aa4c25208bef91937efbce2ab1e3ce37)\n * Released under the MIT license\n * https://github.com/microsoft/vscode/blob/main/LICENSE.txt\n *-----------------------------------------------------------*/\n\ndefine(\"vs/base/common/worker/simpleWorker.nls.ru\", {\n\t\"vs/base/common/platform\": [\n\t\t\"_\",\n\t]\n});"],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+DAOA,OAAO,4CAA6C,CACnD,0BAA2B,CAC1B","names":[],"file":"simpleWorker.nls.ru.js"}
|
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["out-editor/vs/base/common/worker/simpleWorker.nls.zh-cn.js"],"sourcesContent":["/*!-----------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Version: 0.34.1(0316a754aa4c25208bef91937efbce2ab1e3ce37)\n * Released under the MIT license\n * https://github.com/microsoft/vscode/blob/main/LICENSE.txt\n *-----------------------------------------------------------*/\n\ndefine(\"vs/base/common/worker/simpleWorker.nls.zh-cn\", {\n\t\"vs/base/common/platform\": [\n\t\t\"_\",\n\t]\n});"],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+DAOA,OAAO,+CAAgD,CACtD,0BAA2B,CAC1B","names":[],"file":"simpleWorker.nls.zh-cn.js"}
|
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["out-editor/vs/base/common/worker/simpleWorker.nls.zh-tw.js"],"sourcesContent":["/*!-----------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Version: 0.34.1(0316a754aa4c25208bef91937efbce2ab1e3ce37)\n * Released under the MIT license\n * https://github.com/microsoft/vscode/blob/main/LICENSE.txt\n *-----------------------------------------------------------*/\n\ndefine(\"vs/base/common/worker/simpleWorker.nls.zh-tw\", {\n\t\"vs/base/common/platform\": [\n\t\t\"_\",\n\t]\n});"],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+DAOA,OAAO,+CAAgD,CACtD,0BAA2B,CAC1B","names":[],"file":"simpleWorker.nls.zh-tw.js"}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
web/js/monaco-editor/min-maps/vs/loader.js.map
Normal file
1
web/js/monaco-editor/min-maps/vs/loader.js.map
Normal file
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
/*!-----------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(0316a754aa4c25208bef91937efbce2ab1e3ce37)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------*/define("vs/base/common/worker/simpleWorker.nls.de",{"vs/base/common/platform":["_"]});
|
||||
|
||||
//# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.de.js.map
|
@ -0,0 +1,8 @@
|
||||
/*!-----------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(0316a754aa4c25208bef91937efbce2ab1e3ce37)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------*/define("vs/base/common/worker/simpleWorker.nls.es",{"vs/base/common/platform":["_"]});
|
||||
|
||||
//# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.es.js.map
|
@ -0,0 +1,8 @@
|
||||
/*!-----------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(0316a754aa4c25208bef91937efbce2ab1e3ce37)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------*/define("vs/base/common/worker/simpleWorker.nls.fr",{"vs/base/common/platform":["_"]});
|
||||
|
||||
//# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.fr.js.map
|
@ -0,0 +1,8 @@
|
||||
/*!-----------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(0316a754aa4c25208bef91937efbce2ab1e3ce37)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------*/define("vs/base/common/worker/simpleWorker.nls.it",{"vs/base/common/platform":["_"]});
|
||||
|
||||
//# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.it.js.map
|
@ -0,0 +1,8 @@
|
||||
/*!-----------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(0316a754aa4c25208bef91937efbce2ab1e3ce37)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------*/define("vs/base/common/worker/simpleWorker.nls.ja",{"vs/base/common/platform":["_"]});
|
||||
|
||||
//# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.ja.js.map
|
@ -0,0 +1,8 @@
|
||||
/*!-----------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(0316a754aa4c25208bef91937efbce2ab1e3ce37)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------*/define("vs/base/common/worker/simpleWorker.nls",{"vs/base/common/platform":["_"]});
|
||||
|
||||
//# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.js.map
|
@ -0,0 +1,8 @@
|
||||
/*!-----------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(0316a754aa4c25208bef91937efbce2ab1e3ce37)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------*/define("vs/base/common/worker/simpleWorker.nls.ko",{"vs/base/common/platform":["_"]});
|
||||
|
||||
//# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.ko.js.map
|
@ -0,0 +1,8 @@
|
||||
/*!-----------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(0316a754aa4c25208bef91937efbce2ab1e3ce37)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------*/define("vs/base/common/worker/simpleWorker.nls.ru",{"vs/base/common/platform":["_"]});
|
||||
|
||||
//# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.ru.js.map
|
@ -0,0 +1,8 @@
|
||||
/*!-----------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(0316a754aa4c25208bef91937efbce2ab1e3ce37)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------*/define("vs/base/common/worker/simpleWorker.nls.zh-cn",{"vs/base/common/platform":["_"]});
|
||||
|
||||
//# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.zh-cn.js.map
|
@ -0,0 +1,8 @@
|
||||
/*!-----------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(0316a754aa4c25208bef91937efbce2ab1e3ce37)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------*/define("vs/base/common/worker/simpleWorker.nls.zh-tw",{"vs/base/common/platform":["_"]});
|
||||
|
||||
//# sourceMappingURL=../../../../../min-maps/vs/base/common/worker/simpleWorker.nls.zh-tw.js.map
|
24
web/js/monaco-editor/min/vs/base/worker/workerMain.js
Normal file
24
web/js/monaco-editor/min/vs/base/worker/workerMain.js
Normal file
File diff suppressed because one or more lines are too long
10
web/js/monaco-editor/min/vs/basic-languages/abap/abap.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/abap/abap.js
Normal file
File diff suppressed because one or more lines are too long
10
web/js/monaco-editor/min/vs/basic-languages/apex/apex.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/apex/apex.js
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/apex/apex", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var i=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var d=(e,t)=>{for(var s in t)i(e,s,{get:t[s],enumerable:!0})},g=(e,t,s,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of c(t))!l.call(e,o)&&o!==s&&i(e,o,{get:()=>t[o],enumerable:!(a=r(t,o))||a.enumerable});return e};var p=e=>g(i({},"__esModule",{value:!0}),e);var h={};d(h,{conf:()=>m,language:()=>b});var m={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),end:new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")}}},u=["abstract","activate","and","any","array","as","asc","assert","autonomous","begin","bigdecimal","blob","boolean","break","bulk","by","case","cast","catch","char","class","collect","commit","const","continue","convertcurrency","decimal","default","delete","desc","do","double","else","end","enum","exception","exit","export","extends","false","final","finally","float","for","from","future","get","global","goto","group","having","hint","if","implements","import","in","inner","insert","instanceof","int","interface","into","join","last_90_days","last_month","last_n_days","last_week","like","limit","list","long","loop","map","merge","native","new","next_90_days","next_month","next_n_days","next_week","not","null","nulls","number","object","of","on","or","outer","override","package","parallel","pragma","private","protected","public","retrieve","return","returning","rollback","savepoint","search","select","set","short","sort","stat","static","strictfp","super","switch","synchronized","system","testmethod","then","this","this_month","this_week","throw","throws","today","tolabel","tomorrow","transaction","transient","trigger","true","try","type","undelete","update","upsert","using","virtual","void","volatile","webservice","when","where","while","yesterday"],f=e=>e.charAt(0).toUpperCase()+e.substr(1),n=[];u.forEach(e=>{n.push(e),n.push(e.toUpperCase()),n.push(f(e))});var b={defaultToken:"",tokenPostfix:".apex",keywords:n,operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,tokenizer:{root:[[/[a-z_$][\w$]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],[/[A-Z][\w\$]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"type.identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,"annotation"],[/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)[fFdD]/,"number.float"],[/(@digits)[lL]?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@apexdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],apexdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}};return p(h);})();
|
||||
return moduleExports;
|
||||
});
|
10
web/js/monaco-editor/min/vs/basic-languages/azcli/azcli.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/azcli/azcli.js
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/azcli/azcli", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var s=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var c=(t,e)=>{for(var o in e)s(t,o,{get:e[o],enumerable:!0})},k=(t,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of r(e))!l.call(t,n)&&n!==o&&s(t,n,{get:()=>e[n],enumerable:!(a=i(e,n))||a.enumerable});return t};var p=t=>k(s({},"__esModule",{value:!0}),t);var d={};c(d,{conf:()=>f,language:()=>g});var f={comments:{lineComment:"#"}},g={defaultToken:"keyword",ignoreCase:!0,tokenPostfix:".azcli",str:/[^#\s]/,tokenizer:{root:[{include:"@comment"},[/\s-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}],[/^-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}]],type:[{include:"@comment"},[/-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":"key.identifier"}}],[/@str+\s*/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}]],comment:[[/#.*$/,{cases:{"@eos":{token:"comment",next:"@popall"}}}]]}};return p(d);})();
|
||||
return moduleExports;
|
||||
});
|
10
web/js/monaco-editor/min/vs/basic-languages/bat/bat.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/bat/bat.js
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/bat/bat", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var n=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var g=(o,e)=>{for(var t in e)n(o,t,{get:e[t],enumerable:!0})},c=(o,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of l(e))!i.call(o,s)&&s!==t&&n(o,s,{get:()=>e[s],enumerable:!(a=r(e,s))||a.enumerable});return o};var p=o=>c(n({},"__esModule",{value:!0}),o);var k={};g(k,{conf:()=>d,language:()=>m});var d={comments:{lineComment:"REM"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],folding:{markers:{start:new RegExp("^\\s*(::\\s*|REM\\s+)#region"),end:new RegExp("^\\s*(::\\s*|REM\\s+)#endregion")}}},m={defaultToken:"",ignoreCase:!0,tokenPostfix:".bat",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"}],keywords:/call|defined|echo|errorlevel|exist|for|goto|if|pause|set|shift|start|title|not|pushd|popd/,symbols:/[=><!~?&|+\-*\/\^;\.,]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/^(\s*)(rem(?:\s.*|))$/,["","comment"]],[/(\@?)(@keywords)(?!\w)/,[{token:"keyword"},{token:"keyword.$2"}]],[/[ \t\r\n]+/,""],[/setlocal(?!\w)/,"keyword.tag-setlocal"],[/endlocal(?!\w)/,"keyword.tag-setlocal"],[/[a-zA-Z_]\w*/,""],[/:\w*/,"metatag"],[/%[^%]+%/,"variable"],[/%%[\w]+(?!\w)/,"variable"],[/[{}()\[\]]/,"@brackets"],[/@symbols/,"delimiter"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F_]*[0-9a-fA-F]/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],string:[[/[^\\"'%]+/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/%[\w ]+%/,"variable"],[/%%[\w]+(?!\w)/,"variable"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}],[/$/,"string","@popall"]]}};return p(k);})();
|
||||
return moduleExports;
|
||||
});
|
11
web/js/monaco-editor/min/vs/basic-languages/bicep/bicep.js
Normal file
11
web/js/monaco-editor/min/vs/basic-languages/bicep/bicep.js
Normal file
@ -0,0 +1,11 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/bicep/bicep", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var r=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var g=(e,n)=>{for(var o in n)r(e,o,{get:n[o],enumerable:!0})},l=(e,n,o,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of c(n))!a.call(e,t)&&t!==o&&r(e,t,{get:()=>n[t],enumerable:!(i=s(n,t))||i.enumerable});return e};var m=e=>l(r({},"__esModule",{value:!0}),e);var y={};g(y,{conf:()=>$,language:()=>w});var p=e=>`\\b${e}\\b`,k="[_a-zA-Z]",x="[_a-zA-Z0-9]",u=p(`${k}${x}*`),d=["targetScope","resource","module","param","var","output","for","in","if","existing"],b=["true","false","null"],f="[ \\t\\r\\n]",C="[0-9]+",$={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'"},{open:"'''",close:"'''"}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:"'''",close:"'''",notIn:["string","comment"]}],autoCloseBefore:`:.,=}])'
|
||||
`,indentationRules:{increaseIndentPattern:new RegExp("^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$"),decreaseIndentPattern:new RegExp("^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$")}},w={defaultToken:"",tokenPostfix:".bicep",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],symbols:/[=><!~?:&|+\-*/^%]+/,keywords:d,namedLiterals:b,escapes:"\\\\(u{[0-9A-Fa-f]+}|n|r|t|\\\\|'|\\${)",tokenizer:{root:[{include:"@expression"},{include:"@whitespace"}],stringVerbatim:[{regex:"(|'|'')[^']",action:{token:"string"}},{regex:"'''",action:{token:"string.quote",next:"@pop"}}],stringLiteral:[{regex:"\\${",action:{token:"delimiter.bracket",next:"@bracketCounting"}},{regex:"[^\\\\'$]+",action:{token:"string"}},{regex:"@escapes",action:{token:"string.escape"}},{regex:"\\\\.",action:{token:"string.escape.invalid"}},{regex:"'",action:{token:"string",next:"@pop"}}],bracketCounting:[{regex:"{",action:{token:"delimiter.bracket",next:"@bracketCounting"}},{regex:"}",action:{token:"delimiter.bracket",next:"@pop"}},{include:"expression"}],comment:[{regex:"[^\\*]+",action:{token:"comment"}},{regex:"\\*\\/",action:{token:"comment",next:"@pop"}},{regex:"[\\/*]",action:{token:"comment"}}],whitespace:[{regex:f},{regex:"\\/\\*",action:{token:"comment",next:"@comment"}},{regex:"\\/\\/.*$",action:{token:"comment"}}],expression:[{regex:"'''",action:{token:"string.quote",next:"@stringVerbatim"}},{regex:"'",action:{token:"string.quote",next:"@stringLiteral"}},{regex:C,action:{token:"number"}},{regex:u,action:{cases:{"@keywords":{token:"keyword"},"@namedLiterals":{token:"keyword"},"@default":{token:"identifier"}}}}]}};return m(y);})();
|
||||
return moduleExports;
|
||||
});
|
@ -0,0 +1,10 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/cameligo/cameligo", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var s=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var c=(o,e)=>{for(var n in e)s(o,n,{get:e[n],enumerable:!0})},m=(o,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of a(e))!l.call(o,t)&&t!==n&&s(o,t,{get:()=>e[t],enumerable:!(r=i(e,t))||r.enumerable});return o};var p=o=>m(s({},"__esModule",{value:!0}),o);var u={};c(u,{conf:()=>d,language:()=>g});var d={comments:{lineComment:"//",blockComment:["(*","*)"]},brackets:[["{","}"],["[","]"],["(",")"],["<",">"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'},{open:"(*",close:"*)"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'},{open:"(*",close:"*)"}]},g={defaultToken:"",tokenPostfix:".cameligo",ignoreCase:!0,brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],keywords:["abs","assert","block","Bytes","case","Crypto","Current","else","failwith","false","for","fun","if","in","let","let%entry","let%init","List","list","Map","map","match","match%nat","mod","not","operation","Operation","of","record","Set","set","sender","skip","source","String","then","to","true","type","with"],typeKeywords:["int","unit","string","tz","nat","bool"],operators:["=",">","<","<=",">=","<>",":",":=","and","mod","or","+","-","*","/","@","&","^","%","->","<-","&&","||"],symbols:/[=><:@\^&|+\-*\/\^%]+/,tokenizer:{root:[[/[a-zA-Z_][\w]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/\$[0-9a-fA-F]{1,16}/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'/,"string","@string"],[/'[^\\']'/,"string"],[/'/,"string.invalid"],[/\#\d+/,"string"]],comment:[[/[^\(\*]+/,"comment"],[/\*\)/,"comment","@pop"],[/\(\*/,"comment"]],string:[[/[^\\']+/,"string"],[/\\./,"string.escape.invalid"],[/'/,{token:"string.quote",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,"white"],[/\(\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}};return p(u);})();
|
||||
return moduleExports;
|
||||
});
|
File diff suppressed because one or more lines are too long
10
web/js/monaco-editor/min/vs/basic-languages/coffee/coffee.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/coffee/coffee.js
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/coffee/coffee", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var s=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var l=(n,e)=>{for(var t in e)s(n,t,{get:e[t],enumerable:!0})},p=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of g(e))!a.call(n,r)&&r!==t&&s(n,r,{get:()=>e[r],enumerable:!(o=i(e,r))||o.enumerable});return n};var c=n=>p(s({},"__esModule",{value:!0}),n);var m={};l(m,{conf:()=>d,language:()=>x});var d={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{blockComment:["###","###"],lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},x={defaultToken:"",ignoreCase:!0,tokenPostfix:".coffee",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],regEx:/\/(?!\/\/)(?:[^\/\\]|\\.)*\/[igm]*/,keywords:["and","or","is","isnt","not","on","yes","@","no","off","true","false","null","this","new","delete","typeof","in","instanceof","return","throw","break","continue","debugger","if","else","switch","for","while","do","try","catch","finally","class","extends","super","undefined","then","unless","until","loop","of","by","when"],symbols:/[=><!~?&%|+\-*\/\^\.,\:]+/,escapes:/\\(?:[abfnrtv\\"'$]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/\@[a-zA-Z_]\w*/,"variable.predefined"],[/[a-zA-Z_]\w*/,{cases:{this:"variable.predefined","@keywords":{token:"keyword.$0"},"@default":""}}],[/[ \t\r\n]+/,""],[/###/,"comment","@comment"],[/#.*$/,"comment"],["///",{token:"regexp",next:"@hereregexp"}],[/^(\s*)(@regEx)/,["","regexp"]],[/(\()(\s*)(@regEx)/,["@brackets","","regexp"]],[/(\,)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\=)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\:)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\[)(\s*)(@regEx)/,["@brackets","","regexp"]],[/(\!)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\&)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\|)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\?)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\{)(\s*)(@regEx)/,["@brackets","","regexp"]],[/(\;)(\s*)(@regEx)/,["","","regexp"]],[/}/,{cases:{"$S2==interpolatedstring":{token:"string",next:"@pop"},"@default":"@brackets"}}],[/[{}()\[\]]/,"@brackets"],[/@symbols/,"delimiter"],[/\d+[eE]([\-+]?\d+)?/,"number.float"],[/\d+\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+/,"number.hex"],[/0[0-7]+(?!\d)/,"number.octal"],[/\d+/,"number"],[/[,.]/,"delimiter"],[/"""/,"string",'@herestring."""'],[/'''/,"string","@herestring.'''"],[/"/,{cases:{"@eos":"string","@default":{token:"string",next:'@string."'}}}],[/'/,{cases:{"@eos":"string","@default":{token:"string",next:"@string.'"}}}]],string:[[/[^"'\#\\]+/,"string"],[/@escapes/,"string.escape"],[/\./,"string.escape.invalid"],[/\./,"string.escape.invalid"],[/#{/,{cases:{'$S2=="':{token:"string",next:"root.interpolatedstring"},"@default":"string"}}],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}],[/#/,"string"]],herestring:[[/("""|''')/,{cases:{"$1==$S2":{token:"string",next:"@pop"},"@default":"string"}}],[/[^#\\'"]+/,"string"],[/['"]+/,"string"],[/@escapes/,"string.escape"],[/\./,"string.escape.invalid"],[/#{/,{token:"string.quote",next:"root.interpolatedstring"}],[/#/,"string"]],comment:[[/[^#]+/,"comment"],[/###/,"comment","@pop"],[/#/,"comment"]],hereregexp:[[/[^\\\/#]+/,"regexp"],[/\\./,"regexp"],[/#.*$/,"comment"],["///[igm]*",{token:"regexp",next:"@pop"}],[/\//,"regexp"]]}};return c(m);})();
|
||||
return moduleExports;
|
||||
});
|
10
web/js/monaco-editor/min/vs/basic-languages/cpp/cpp.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/cpp/cpp.js
Normal file
File diff suppressed because one or more lines are too long
10
web/js/monaco-editor/min/vs/basic-languages/csharp/csharp.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/csharp/csharp.js
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/csharp/csharp", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var s=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var o in e)s(t,o,{get:e[o],enumerable:!0})},p=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of a(e))!c.call(t,n)&&n!==o&&s(t,n,{get:()=>e[n],enumerable:!(i=r(e,n))||i.enumerable});return t};var g=t=>p(s({},"__esModule",{value:!0}),t);var u={};l(u,{conf:()=>d,language:()=>m});var d={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},m={defaultToken:"",tokenPostfix:".cs",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],keywords:["extern","alias","using","bool","decimal","sbyte","byte","short","ushort","int","uint","long","ulong","char","float","double","object","dynamic","string","assembly","is","as","ref","out","this","base","new","typeof","void","checked","unchecked","default","delegate","var","const","if","else","switch","case","while","do","for","foreach","in","break","continue","goto","return","throw","try","catch","finally","lock","yield","from","let","where","join","on","equals","into","orderby","ascending","descending","select","group","by","namespace","partial","class","field","event","method","param","public","protected","internal","private","abstract","sealed","static","struct","readonly","volatile","virtual","override","params","get","set","add","remove","operator","true","false","implicit","explicit","interface","enum","null","async","await","fixed","sizeof","stackalloc","unsafe","nameof","when"],namespaceFollows:["namespace","using"],parenFollows:["if","for","while","switch","foreach","using","catch","when"],operators:["=","??","||","&&","|","^","&","==","!=","<=",">=","<<","+","-","*","/","%","!","~","++","--","+=","-=","*=","/=","%=","&=","|=","^=","<<=",">>=",">>","=>"],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/\@?[a-zA-Z_]\w*/,{cases:{"@namespaceFollows":{token:"keyword.$0",next:"@namespace"},"@keywords":{token:"keyword.$0",next:"@qualified"},"@default":{token:"identifier",next:"@qualified"}}}],{include:"@whitespace"},[/}/,{cases:{"$S2==interpolatedstring":{token:"string.quote",next:"@pop"},"$S2==litinterpstring":{token:"string.quote",next:"@pop"},"@default":"@brackets"}}],[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/[0-9_]*\.[0-9_]+([eE][\-+]?\d+)?[fFdD]?/,"number.float"],[/0[xX][0-9a-fA-F_]+/,"number.hex"],[/0[bB][01_]+/,"number.hex"],[/[0-9_]+/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,{token:"string.quote",next:"@string"}],[/\$\@"/,{token:"string.quote",next:"@litinterpstring"}],[/\@"/,{token:"string.quote",next:"@litstring"}],[/\$"/,{token:"string.quote",next:"@interpolatedstring"}],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],qualified:[[/[a-zA-Z_][\w]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],[/\./,"delimiter"],["","","@pop"]],namespace:[{include:"@whitespace"},[/[A-Z]\w*/,"namespace"],[/[\.=]/,"delimiter"],["","","@pop"]],comment:[[/[^\/*]+/,"comment"],["\\*/","comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",next:"@pop"}]],litstring:[[/[^"]+/,"string"],[/""/,"string.escape"],[/"/,{token:"string.quote",next:"@pop"}]],litinterpstring:[[/[^"{]+/,"string"],[/""/,"string.escape"],[/{{/,"string.escape"],[/}}/,"string.escape"],[/{/,{token:"string.quote",next:"root.litinterpstring"}],[/"/,{token:"string.quote",next:"@pop"}]],interpolatedstring:[[/[^\\"{]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/{{/,"string.escape"],[/}}/,"string.escape"],[/{/,{token:"string.quote",next:"root.interpolatedstring"}],[/"/,{token:"string.quote",next:"@pop"}]],whitespace:[[/^[ \t\v\f]*#((r)|(load))(?=\s)/,"directive.csx"],[/^[ \t\v\f]*#\w.*$/,"namespace.cpp"],[/[ \t\v\f\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}};return g(u);})();
|
||||
return moduleExports;
|
||||
});
|
10
web/js/monaco-editor/min/vs/basic-languages/csp/csp.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/csp/csp.js
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/csp/csp", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var o=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var a=(r,t)=>{for(var s in t)o(r,s,{get:t[s],enumerable:!0})},c=(r,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of u(t))!g.call(r,e)&&e!==s&&o(r,e,{get:()=>t[e],enumerable:!(n=i(t,e))||n.enumerable});return r};var q=r=>c(o({},"__esModule",{value:!0}),r);var p={};a(p,{conf:()=>f,language:()=>l});var f={brackets:[],autoClosingPairs:[],surroundingPairs:[]},l={keywords:[],typeKeywords:[],tokenPostfix:".csp",operators:[],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/child-src/,"string.quote"],[/connect-src/,"string.quote"],[/default-src/,"string.quote"],[/font-src/,"string.quote"],[/frame-src/,"string.quote"],[/img-src/,"string.quote"],[/manifest-src/,"string.quote"],[/media-src/,"string.quote"],[/object-src/,"string.quote"],[/script-src/,"string.quote"],[/style-src/,"string.quote"],[/worker-src/,"string.quote"],[/base-uri/,"string.quote"],[/plugin-types/,"string.quote"],[/sandbox/,"string.quote"],[/disown-opener/,"string.quote"],[/form-action/,"string.quote"],[/frame-ancestors/,"string.quote"],[/report-uri/,"string.quote"],[/report-to/,"string.quote"],[/upgrade-insecure-requests/,"string.quote"],[/block-all-mixed-content/,"string.quote"],[/require-sri-for/,"string.quote"],[/reflected-xss/,"string.quote"],[/referrer/,"string.quote"],[/policy-uri/,"string.quote"],[/'self'/,"string.quote"],[/'unsafe-inline'/,"string.quote"],[/'unsafe-eval'/,"string.quote"],[/'strict-dynamic'/,"string.quote"],[/'unsafe-hashed-attributes'/,"string.quote"]]}};return q(p);})();
|
||||
return moduleExports;
|
||||
});
|
12
web/js/monaco-editor/min/vs/basic-languages/css/css.js
Normal file
12
web/js/monaco-editor/min/vs/basic-languages/css/css.js
Normal file
@ -0,0 +1,12 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/css/css", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var r=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var m=(t,e)=>{for(var o in e)r(t,o,{get:e[o],enumerable:!0})},c=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of s(e))!l.call(t,n)&&n!==o&&r(t,n,{get:()=>e[n],enumerable:!(i=a(e,n))||i.enumerable});return t};var d=t=>c(r({},"__esModule",{value:!0}),t);var k={};m(k,{conf:()=>u,language:()=>p});var u={wordPattern:/(#?-?\d*\.\d\w*%?)|((::|[@#.!:])?[\w-?]+%?)|::|[@#.!:]/g,comments:{blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),end:new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")}}},p={defaultToken:"",tokenPostfix:".css",ws:`[
|
||||
\r\f]*`,identifier:"-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",brackets:[{open:"{",close:"}",token:"delimiter.bracket"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{root:[{include:"@selector"}],selector:[{include:"@comments"},{include:"@import"},{include:"@strings"},["[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)",{token:"keyword",next:"@keyframedeclaration"}],["[@](page|content|font-face|-moz-document)",{token:"keyword"}],["[@](charset|namespace)",{token:"keyword",next:"@declarationbody"}],["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@selectorname"},["[\\*]","tag"],["[>\\+,]","delimiter"],["\\[",{token:"delimiter.bracket",next:"@selectorattribute"}],["{",{token:"delimiter.bracket",next:"@selectorbody"}]],selectorbody:[{include:"@comments"},["[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))","attribute.name","@rulevalue"],["}",{token:"delimiter.bracket",next:"@pop"}]],selectorname:[["(\\.|#(?=[^{])|%|(@identifier)|:)+","tag"]],selectorattribute:[{include:"@term"},["]",{token:"delimiter.bracket",next:"@pop"}]],term:[{include:"@comments"},["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@functioninvocation"},{include:"@numbers"},{include:"@name"},{include:"@strings"},["([<>=\\+\\-\\*\\/\\^\\|\\~,])","delimiter"],[",","delimiter"]],rulevalue:[{include:"@comments"},{include:"@strings"},{include:"@term"},["!important","keyword"],[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],warndebug:[["[@](warn|debug)",{token:"keyword",next:"@declarationbody"}]],import:[["[@](import)",{token:"keyword",next:"@declarationbody"}]],urldeclaration:[{include:"@strings"},[`[^)\r
|
||||
]+`,"string"],["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],parenthizedterm:[{include:"@term"},["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],declarationbody:[{include:"@term"},[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],comments:[["\\/\\*","comment","@comment"],["\\/\\/+.*","comment"]],comment:[["\\*\\/","comment","@pop"],[/[^*/]+/,"comment"],[/./,"comment"]],name:[["@identifier","attribute.value"]],numbers:[["-?(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?",{token:"attribute.value.number",next:"@units"}],["#[0-9a-fA-F_]+(?!\\w)","attribute.value.hex"]],units:[["(em|ex|ch|rem|fr|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?","attribute.value.unit","@pop"]],keyframedeclaration:[["@identifier","attribute.value"],["{",{token:"delimiter.bracket",switchTo:"@keyframebody"}]],keyframebody:[{include:"@term"},["{",{token:"delimiter.bracket",next:"@selectorbody"}],["}",{token:"delimiter.bracket",next:"@pop"}]],functioninvocation:[["@identifier\\(",{token:"attribute.value",next:"@functionarguments"}]],functionarguments:[["\\$@identifier@ws:","attribute.name"],["[,]","delimiter"],{include:"@term"},["\\)",{token:"attribute.value",next:"@pop"}]],strings:[['~?"',{token:"string",next:"@stringenddoublequote"}],["~?'",{token:"string",next:"@stringendquote"}]],stringenddoublequote:[["\\\\.","string"],['"',{token:"string",next:"@pop"}],[/[^\\"]+/,"string"],[".","string"]],stringendquote:[["\\\\.","string"],["'",{token:"string",next:"@pop"}],[/[^\\']+/,"string"],[".","string"]]}};return d(k);})();
|
||||
return moduleExports;
|
||||
});
|
10
web/js/monaco-editor/min/vs/basic-languages/cypher/cypher.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/cypher/cypher.js
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/cypher/cypher", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var s=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var c=(i,e)=>{for(var n in e)s(i,n,{get:e[n],enumerable:!0})},g=(i,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of a(e))!l.call(i,t)&&t!==n&&s(i,t,{get:()=>e[t],enumerable:!(o=r(e,t))||o.enumerable});return i};var p=i=>g(s({},"__esModule",{value:!0}),i);var u={};c(u,{conf:()=>d,language:()=>m});var d={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}]},m={defaultToken:"",tokenPostfix:".cypher",ignoreCase:!0,brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:["ALL","AND","AS","ASC","ASCENDING","BY","CALL","CASE","CONTAINS","CREATE","DELETE","DESC","DESCENDING","DETACH","DISTINCT","ELSE","END","ENDS","EXISTS","IN","IS","LIMIT","MANDATORY","MATCH","MERGE","NOT","ON","ON","OPTIONAL","OR","ORDER","REMOVE","RETURN","SET","SKIP","STARTS","THEN","UNION","UNWIND","WHEN","WHERE","WITH","XOR","YIELD"],builtinLiterals:["true","TRUE","false","FALSE","null","NULL"],builtinFunctions:["abs","acos","asin","atan","atan2","avg","ceil","coalesce","collect","cos","cot","count","degrees","e","endNode","exists","exp","floor","head","id","keys","labels","last","left","length","log","log10","lTrim","max","min","nodes","percentileCont","percentileDisc","pi","properties","radians","rand","range","relationships","replace","reverse","right","round","rTrim","sign","sin","size","split","sqrt","startNode","stDev","stDevP","substring","sum","tail","tan","timestamp","toBoolean","toFloat","toInteger","toLower","toString","toUpper","trim","type"],operators:["+","-","*","/","%","^","=","<>","<",">","<=",">=","->","<-","-->","<--"],escapes:/\\(?:[tbnrf\\"'`]|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+/,octaldigits:/[0-7]+/,hexdigits:/[0-9a-fA-F]+/,tokenizer:{root:[[/[{}[\]()]/,"@brackets"],{include:"common"}],common:[{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},[/:[a-zA-Z_][\w]*/,"type.identifier"],[/[a-zA-Z_][\w]*(?=\()/,{cases:{"@builtinFunctions":"predefined.function"}}],[/[a-zA-Z_$][\w$]*/,{cases:{"@keywords":"keyword","@builtinLiterals":"predefined.literal","@default":"identifier"}}],[/`/,"identifier.escape","@identifierBacktick"],[/[;,.:|]/,"delimiter"],[/[<>=%+\-*/^]+/,{cases:{"@operators":"delimiter","@default":""}}]],numbers:[[/-?(@digits)[eE](-?(@digits))?/,"number.float"],[/-?(@digits)?\.(@digits)([eE]-?(@digits))?/,"number.float"],[/-?0x(@hexdigits)/,"number.hex"],[/-?0(@octaldigits)/,"number.octal"],[/-?(@digits)/,"number"]],strings:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@stringDouble"],[/'/,"string","@stringSingle"]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/\/\/.*/,"comment"],[/[^/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[/*]/,"comment"]],stringDouble:[[/[^\\"]+/,"string"],[/@escapes/,"string"],[/\\./,"string.invalid"],[/"/,"string","@pop"]],stringSingle:[[/[^\\']+/,"string"],[/@escapes/,"string"],[/\\./,"string.invalid"],[/'/,"string","@pop"]],identifierBacktick:[[/[^\\`]+/,"identifier.escape"],[/@escapes/,"identifier.escape"],[/\\./,"identifier.escape.invalid"],[/`/,"identifier.escape","@pop"]]}};return p(u);})();
|
||||
return moduleExports;
|
||||
});
|
10
web/js/monaco-editor/min/vs/basic-languages/dart/dart.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/dart/dart.js
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/dart/dart", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var r=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var p=(n,e)=>{for(var t in e)r(n,t,{get:e[t],enumerable:!0})},g=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of c(e))!a.call(n,o)&&o!==t&&r(n,o,{get:()=>e[o],enumerable:!(s=i(e,o))||s.enumerable});return n};var l=n=>g(r({},"__esModule",{value:!0}),n);var x={};p(x,{conf:()=>d,language:()=>m});var d={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:"(",close:")"},{open:'"',close:'"'},{open:"`",close:"`"}],folding:{markers:{start:/^\s*\s*#?region\b/,end:/^\s*\s*#?endregion\b/}}},m={defaultToken:"invalid",tokenPostfix:".dart",keywords:["abstract","dynamic","implements","show","as","else","import","static","assert","enum","in","super","async","export","interface","switch","await","extends","is","sync","break","external","library","this","case","factory","mixin","throw","catch","false","new","true","class","final","null","try","const","finally","on","typedef","continue","for","operator","var","covariant","Function","part","void","default","get","rethrow","while","deferred","hide","return","with","do","if","set","yield"],typeKeywords:["int","double","String","bool"],operators:["+","-","*","/","~/","%","++","--","==","!=",">","<",">=","<=","=","-=","/=","%=",">>=","^=","+=","*=","~/=","<<=","&=","!=","||","&&","&","|","^","~","<<",">>","!",">>>","??","?",":","|="],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/,tokenizer:{root:[[/[{}]/,"delimiter.bracket"],{include:"common"}],common:[[/[a-z_$][\w$]*/,{cases:{"@typeKeywords":"type.identifier","@keywords":"keyword","@default":"identifier"}}],[/[A-Z_$][\w\$]*/,"type.identifier"],{include:"@whitespace"},[/\/(?=([^\\\/]|\\.)+\/([gimsuy]*)(\s*)(\.|;|,|\)|\]|\}|$))/,{token:"regexp",bracket:"@open",next:"@regexp"}],[/@[a-zA-Z]+/,"annotation"],[/[()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/!(?=([^=]|$))/,"delimiter"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/,"number.float"],[/0[xX](@hexdigits)n?/,"number.hex"],[/0[oO]?(@octaldigits)n?/,"number.octal"],[/0[bB](@binarydigits)n?/,"number.binary"],[/(@digits)n?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string_double"],[/'/,"string","@string_single"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@jsdoc"],[/\/\*/,"comment","@comment"],[/\/\/\/.*$/,"comment.doc"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],jsdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["regexp.escape.control","regexp.escape.control"]],[/[()]/,"regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],[/(\/)([gimsuy]*)/,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"\$]+/,"string"],[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"],[/\$\w+/,"identifier"]],string_single:[[/[^\\'\$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"],[/\$\w+/,"identifier"]]}};return l(x);})();
|
||||
return moduleExports;
|
||||
});
|
@ -0,0 +1,10 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/dockerfile/dockerfile", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var a=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var p=(o,e)=>{for(var s in e)a(o,s,{get:e[s],enumerable:!0})},g=(o,e,s,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of r(e))!i.call(o,n)&&n!==s&&a(o,n,{get:()=>e[n],enumerable:!(t=l(e,n))||t.enumerable});return o};var c=o=>g(a({},"__esModule",{value:!0}),o);var k={};p(k,{conf:()=>u,language:()=>d});var u={brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},d={defaultToken:"",tokenPostfix:".dockerfile",variable:/\${?[\w]+}?/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/(ONBUILD)(\s+)/,["keyword",""]],[/(ENV)(\s+)([\w]+)/,["keyword","",{token:"variable",next:"@arguments"}]],[/(FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|ARG|VOLUME|LABEL|USER|WORKDIR|COPY|CMD|STOPSIGNAL|SHELL|HEALTHCHECK|ENTRYPOINT)/,{token:"keyword",next:"@arguments"}]],arguments:[{include:"@whitespace"},{include:"@strings"},[/(@variable)/,{cases:{"@eos":{token:"variable",next:"@popall"},"@default":"variable"}}],[/\\/,{cases:{"@eos":"","@default":""}}],[/./,{cases:{"@eos":{token:"",next:"@popall"},"@default":""}}]],whitespace:[[/\s+/,{cases:{"@eos":{token:"",next:"@popall"},"@default":""}}]],comment:[[/(^#.*$)/,"comment","@popall"]],strings:[[/\\'$/,"","@popall"],[/\\'/,""],[/'$/,"string","@popall"],[/'/,"string","@stringBody"],[/"$/,"string","@popall"],[/"/,"string","@dblStringBody"]],stringBody:[[/[^\\\$']/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}],[/\\./,"string.escape"],[/'$/,"string","@popall"],[/'/,"string","@pop"],[/(@variable)/,"variable"],[/\\$/,"string"],[/$/,"string","@popall"]],dblStringBody:[[/[^\\\$"]/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}],[/\\./,"string.escape"],[/"$/,"string","@popall"],[/"/,"string","@pop"],[/(@variable)/,"variable"],[/\\$/,"string"],[/$/,"string","@popall"]]}};return c(k);})();
|
||||
return moduleExports;
|
||||
});
|
10
web/js/monaco-editor/min/vs/basic-languages/ecl/ecl.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/ecl/ecl.js
Normal file
File diff suppressed because one or more lines are too long
10
web/js/monaco-editor/min/vs/basic-languages/elixir/elixir.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/elixir/elixir.js
Normal file
File diff suppressed because one or more lines are too long
10
web/js/monaco-editor/min/vs/basic-languages/flow9/flow9.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/flow9/flow9.js
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/flow9/flow9", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var s=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var c=(o,e)=>{for(var t in e)s(o,t,{get:e[t],enumerable:!0})},m=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of a(e))!l.call(o,n)&&n!==t&&s(o,n,{get:()=>e[n],enumerable:!(i=r(e,n))||i.enumerable});return o};var p=o=>m(s({},"__esModule",{value:!0}),o);var u={};c(u,{conf:()=>g,language:()=>f});var g={comments:{blockComment:["/*","*/"],lineComment:"//"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string"]},{open:"[",close:"]",notIn:["string"]},{open:"(",close:")",notIn:["string"]},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}]},f={defaultToken:"",tokenPostfix:".flow",keywords:["import","require","export","forbid","native","if","else","cast","unsafe","switch","default"],types:["io","mutable","bool","int","double","string","flow","void","ref","true","false","with"],operators:["=",">","<","<=",">=","==","!","!=",":=","::=","&&","||","+","-","*","/","@","&","%",":","->","\\","$","??","^"],symbols:/[@$=><!~?:&|+\-*\\\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/[a-zA-Z_]\w*/,{cases:{"@keywords":"keyword","@types":"type","@default":"identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"delimiter"],[/[<>](?!@symbols)/,"delimiter"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]]}};return p(u);})();
|
||||
return moduleExports;
|
||||
});
|
File diff suppressed because one or more lines are too long
10
web/js/monaco-editor/min/vs/basic-languages/fsharp/fsharp.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/fsharp/fsharp.js
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/fsharp/fsharp", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var s=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var c=(n,e)=>{for(var o in e)s(n,o,{get:e[o],enumerable:!0})},g=(n,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of a(e))!l.call(n,t)&&t!==o&&s(n,t,{get:()=>e[t],enumerable:!(i=r(e,t))||i.enumerable});return n};var f=n=>g(s({},"__esModule",{value:!0}),n);var d={};c(d,{conf:()=>m,language:()=>u});var m={comments:{lineComment:"//",blockComment:["(*","*)"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*//\\s*#region\\b|^\\s*\\(\\*\\s*#region(.*)\\*\\)"),end:new RegExp("^\\s*//\\s*#endregion\\b|^\\s*\\(\\*\\s*#endregion\\s*\\*\\)")}}},u={defaultToken:"",tokenPostfix:".fs",keywords:["abstract","and","atomic","as","assert","asr","base","begin","break","checked","component","const","constraint","constructor","continue","class","default","delegate","do","done","downcast","downto","elif","else","end","exception","eager","event","external","extern","false","finally","for","fun","function","fixed","functor","global","if","in","include","inherit","inline","interface","internal","land","lor","lsl","lsr","lxor","lazy","let","match","member","mod","module","mutable","namespace","method","mixin","new","not","null","of","open","or","object","override","private","parallel","process","protected","pure","public","rec","return","static","sealed","struct","sig","then","to","true","tailcall","trait","try","type","upcast","use","val","void","virtual","volatile","when","while","with","yield"],symbols:/[=><!~?:&|+\-*\^%;\.,\/]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,integersuffix:/[uU]?[yslnLI]?/,floatsuffix:/[fFmM]?/,tokenizer:{root:[[/[a-zA-Z_]\w*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],{include:"@whitespace"},[/\[<.*>\]/,"annotation"],[/^#(if|else|endif)/,"keyword"],[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,"delimiter"],[/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/,"number.float"],[/0x[0-9a-fA-F]+LF/,"number.float"],[/0x[0-9a-fA-F]+(@integersuffix)/,"number.hex"],[/0b[0-1]+(@integersuffix)/,"number.bin"],[/\d+(@integersuffix)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"""/,"string",'@string."""'],[/"/,"string",'@string."'],[/\@"/,{token:"string.quote",next:"@litstring"}],[/'[^\\']'B?/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\(\*(?!\))/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^*(]+/,"comment"],[/\*\)/,"comment","@pop"],[/\*/,"comment"],[/\(\*\)/,"comment"],[/\(/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/("""|"B?)/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]],litstring:[[/[^"]+/,"string"],[/""/,"string.escape"],[/"/,{token:"string.quote",next:"@pop"}]]}};return f(d);})();
|
||||
return moduleExports;
|
||||
});
|
10
web/js/monaco-editor/min/vs/basic-languages/go/go.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/go/go.js
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/go/go", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var s=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var m=(n,e)=>{for(var t in e)s(n,t,{get:e[t],enumerable:!0})},l=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of a(e))!c.call(n,o)&&o!==t&&s(n,o,{get:()=>e[o],enumerable:!(r=i(e,o))||r.enumerable});return n};var g=n=>l(s({},"__esModule",{value:!0}),n);var d={};m(d,{conf:()=>p,language:()=>u});var p={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"`",close:"`",notIn:["string"]},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"`",close:"`"},{open:'"',close:'"'},{open:"'",close:"'"}]},u={defaultToken:"",tokenPostfix:".go",keywords:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var","bool","true","false","uint8","uint16","uint32","uint64","int8","int16","int32","int64","float32","float64","complex64","complex128","byte","rune","uint","int","uintptr","string","nil"],operators:["+","-","*","/","%","&","|","^","<<",">>","&^","+=","-=","*=","/=","%=","&=","|=","^=","<<=",">>=","&^=","&&","||","<-","++","--","==","<",">","=","!","!=","<=",">=",":=","...","(",")","","]","{","}",",",";",".",":"],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/[a-zA-Z_]\w*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],{include:"@whitespace"},[/\[\[.*\]\]/,"annotation"],[/^\s*#\w+/,"keyword"],[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\d+[eE]([\-+]?\d+)?/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F]/,"number.hex"],[/0[0-7']*[0-7]/,"number.octal"],[/0[bB][0-1']*[0-1]/,"number.binary"],[/\d[\d']*/,"number"],[/\d/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/`/,"string","@rawstring"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],doccomment:[[/[^\/*]+/,"comment.doc"],[/\/\*/,"comment.doc.invalid"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],rawstring:[[/[^\`]/,"string"],[/`/,"string","@pop"]]}};return g(d);})();
|
||||
return moduleExports;
|
||||
});
|
@ -0,0 +1,10 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/graphql/graphql", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var s=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var c=(n,e)=>{for(var t in e)s(n,t,{get:e[t],enumerable:!0})},d=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of i(e))!l.call(n,o)&&o!==t&&s(n,o,{get:()=>e[o],enumerable:!(r=a(e,o))||r.enumerable});return n};var p=n=>d(s({},"__esModule",{value:!0}),n);var u={};c(u,{conf:()=>g,language:()=>I});var g={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"""',close:'"""',notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"""',close:'"""'},{open:'"',close:'"'}],folding:{offSide:!0}},I={defaultToken:"invalid",tokenPostfix:".gql",keywords:["null","true","false","query","mutation","subscription","extend","schema","directive","scalar","type","interface","union","enum","input","implements","fragment","on"],typeKeywords:["Int","Float","String","Boolean","ID"],directiveLocations:["SCHEMA","SCALAR","OBJECT","FIELD_DEFINITION","ARGUMENT_DEFINITION","INTERFACE","UNION","ENUM","ENUM_VALUE","INPUT_OBJECT","INPUT_FIELD_DEFINITION","QUERY","MUTATION","SUBSCRIPTION","FIELD","FRAGMENT_DEFINITION","FRAGMENT_SPREAD","INLINE_FRAGMENT","VARIABLE_DEFINITION"],operators:["=","!","?",":","&","|"],symbols:/[=!?:&|]+/,escapes:/\\(?:["\\\/bfnrt]|u[0-9A-Fa-f]{4})/,tokenizer:{root:[[/[a-z_][\w$]*/,{cases:{"@keywords":"keyword","@default":"key.identifier"}}],[/[$][\w$]*/,{cases:{"@keywords":"keyword","@default":"argument.identifier"}}],[/[A-Z][\w\$]*/,{cases:{"@typeKeywords":"keyword","@default":"type.identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/@symbols/,{cases:{"@operators":"operator","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,{token:"annotation",log:"annotation token: $0"}],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/"""/,{token:"string",next:"@mlstring",nextEmbedded:"markdown"}],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,{token:"string.quote",bracket:"@open",next:"@string"}]],mlstring:[[/[^"]+/,"string"],['"""',{token:"string",next:"@pop",nextEmbedded:"@pop"}]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[/#.*$/,"comment"]]}};return p(u);})();
|
||||
return moduleExports;
|
||||
});
|
File diff suppressed because one or more lines are too long
10
web/js/monaco-editor/min/vs/basic-languages/hcl/hcl.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/hcl/hcl.js
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/hcl/hcl", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var r=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var o in e)r(t,o,{get:e[o],enumerable:!0})},d=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of i(e))!c.call(t,s)&&s!==o&&r(t,s,{get:()=>e[s],enumerable:!(n=a(e,s))||n.enumerable});return t};var m=t=>d(r({},"__esModule",{value:!0}),t);var f={};l(f,{conf:()=>p,language:()=>g});var p={comments:{lineComment:"#",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}]},g={defaultToken:"",tokenPostfix:".hcl",keywords:["var","local","path","for_each","any","string","number","bool","true","false","null","if ","else ","endif ","for ","in","endfor"],operators:["=",">=","<=","==","!=","+","-","*","/","%","&&","||","!","<",">","?","...",":"],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,terraformFunctions:/(abs|ceil|floor|log|max|min|pow|signum|chomp|format|formatlist|indent|join|lower|regex|regexall|replace|split|strrev|substr|title|trimspace|upper|chunklist|coalesce|coalescelist|compact|concat|contains|distinct|element|flatten|index|keys|length|list|lookup|map|matchkeys|merge|range|reverse|setintersection|setproduct|setunion|slice|sort|transpose|values|zipmap|base64decode|base64encode|base64gzip|csvdecode|jsondecode|jsonencode|urlencode|yamldecode|yamlencode|abspath|dirname|pathexpand|basename|file|fileexists|fileset|filebase64|templatefile|formatdate|timeadd|timestamp|base64sha256|base64sha512|bcrypt|filebase64sha256|filebase64sha512|filemd5|filemd1|filesha256|filesha512|md5|rsadecrypt|sha1|sha256|sha512|uuid|uuidv5|cidrhost|cidrnetmask|cidrsubnet|tobool|tolist|tomap|tonumber|toset|tostring)/,terraformMainBlocks:/(module|data|terraform|resource|provider|variable|output|locals)/,tokenizer:{root:[[/^@terraformMainBlocks([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)(\{)/,["type","","string","","string","","@brackets"]],[/(\w+[ \t]+)([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)(\{)/,["identifier","","string","","string","","@brackets"]],[/(\w+[ \t]+)([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)([\w-]+|"[\w-]+"|)(=)(\{)/,["identifier","","string","","operator","","@brackets"]],{include:"@terraform"}],terraform:[[/@terraformFunctions(\()/,["type","@brackets"]],[/[a-zA-Z_]\w*-*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"variable"}}],{include:"@whitespace"},{include:"@heredoc"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"operator","@default":""}}],[/\d*\d+[eE]([\-+]?\d+)?/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/\d[\d']*/,"number"],[/\d/,"number"],[/[;,.]/,"delimiter"],[/"/,"string","@string"],[/'/,"invalid"]],heredoc:[[/<<[-]*\s*["]?([\w\-]+)["]?/,{token:"string.heredoc.delimiter",next:"@heredocBody.$1"}]],heredocBody:[[/([\w\-]+)$/,{cases:{"$1==$S2":[{token:"string.heredoc.delimiter",next:"@popall"}],"@default":"string.heredoc"}}],[/./,"string.heredoc"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"],[/#.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],string:[[/\$\{/,{token:"delimiter",next:"@stringExpression"}],[/[^\\"\$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@popall"]],stringInsideExpression:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],stringExpression:[[/\}/,{token:"delimiter",next:"@pop"}],[/"/,"string","@stringInsideExpression"],{include:"@terraform"}]}};return m(f);})();
|
||||
return moduleExports;
|
||||
});
|
10
web/js/monaco-editor/min/vs/basic-languages/html/html.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/html/html.js
Normal file
File diff suppressed because one or more lines are too long
10
web/js/monaco-editor/min/vs/basic-languages/ini/ini.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/ini/ini.js
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/ini/ini", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var t=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var c=(n,e)=>{for(var s in e)t(n,s,{get:e[s],enumerable:!0})},l=(n,e,s,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of r(e))!g.call(n,o)&&o!==s&&t(n,o,{get:()=>e[o],enumerable:!(a=i(e,o))||a.enumerable});return n};var p=n=>l(t({},"__esModule",{value:!0}),n);var f={};c(f,{conf:()=>u,language:()=>m});var u={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},m={defaultToken:"",tokenPostfix:".ini",escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/^\[[^\]]*\]/,"metatag"],[/(^\w+)(\s*)(\=)/,["key","","delimiter"]],{include:"@whitespace"},[/\d+/,"number"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],whitespace:[[/[ \t\r\n]+/,""],[/^\s*[#;].*$/,"comment"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}};return p(f);})();
|
||||
return moduleExports;
|
||||
});
|
10
web/js/monaco-editor/min/vs/basic-languages/java/java.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/java/java.js
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/java/java", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var s=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var o in e)s(t,o,{get:e[o],enumerable:!0})},d=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of r(e))!c.call(t,n)&&n!==o&&s(t,n,{get:()=>e[n],enumerable:!(i=a(e,n))||i.enumerable});return t};var g=t=>d(s({},"__esModule",{value:!0}),t);var f={};l(f,{conf:()=>m,language:()=>p});var m={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),end:new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")}}},p={defaultToken:"",tokenPostfix:".java",keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false","yield","record","sealed","non-sealed","permits"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,tokenizer:{root:[["non-sealed","keyword.non-sealed"],[/[a-zA-Z_$][\w$]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,"annotation"],[/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/,"number.float"],[/0[xX](@hexdigits)[Ll]?/,"number.hex"],[/0(@octaldigits)[Ll]?/,"number.octal"],[/0[bB](@binarydigits)[Ll]?/,"number.binary"],[/(@digits)[fFdD]/,"number.float"],[/(@digits)[lL]?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"""/,"string","@multistring"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@javadoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],javadoc:[[/[^\/*]+/,"comment.doc"],[/\/\*/,"comment.doc.invalid"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],multistring:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"""/,"string","@pop"],[/./,"string"]]}};return g(f);})();
|
||||
return moduleExports;
|
||||
});
|
File diff suppressed because one or more lines are too long
10
web/js/monaco-editor/min/vs/basic-languages/julia/julia.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/julia/julia.js
Normal file
File diff suppressed because one or more lines are too long
10
web/js/monaco-editor/min/vs/basic-languages/kotlin/kotlin.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/kotlin/kotlin.js
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/kotlin/kotlin", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var o=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var l=(n,e)=>{for(var i in e)o(n,i,{get:e[i],enumerable:!0})},d=(n,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of r(e))!c.call(n,t)&&t!==i&&o(n,t,{get:()=>e[t],enumerable:!(s=a(e,t))||s.enumerable});return n};var g=n=>d(o({},"__esModule",{value:!0}),n);var f={};l(f,{conf:()=>m,language:()=>p});var m={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),end:new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")}}},p={defaultToken:"",tokenPostfix:".kt",keywords:["as","as?","break","class","continue","do","else","false","for","fun","if","in","!in","interface","is","!is","null","object","package","return","super","this","throw","true","try","typealias","val","var","when","while","by","catch","constructor","delegate","dynamic","field","file","finally","get","import","init","param","property","receiver","set","setparam","where","actual","abstract","annotation","companion","const","crossinline","data","enum","expect","external","final","infix","inline","inner","internal","lateinit","noinline","open","operator","out","override","private","protected","public","reified","sealed","suspend","tailrec","vararg","field","it"],operators:["+","-","*","/","%","=","+=","-=","*=","/=","%=","++","--","&&","||","!","==","!=","===","!==",">","<","<=",">=","[","]","!!","?.","?:","::","..",":","?","->","@",";","$","_"],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,tokenizer:{root:[[/[A-Z][\w\$]*/,"type.identifier"],[/[a-zA-Z_$][\w$]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,"annotation"],[/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/,"number.float"],[/0[xX](@hexdigits)[Ll]?/,"number.hex"],[/0(@octaldigits)[Ll]?/,"number.octal"],[/0[bB](@binarydigits)[Ll]?/,"number.binary"],[/(@digits)[fFdD]/,"number.float"],[/(@digits)[lL]?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"""/,"string","@multistring"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@javadoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\/\*/,"comment","@comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],javadoc:[[/[^\/*]+/,"comment.doc"],[/\/\*/,"comment.doc","@push"],[/\/\*/,"comment.doc.invalid"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],multistring:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"""/,"string","@pop"],[/./,"string"]]}};return g(f);})();
|
||||
return moduleExports;
|
||||
});
|
11
web/js/monaco-editor/min/vs/basic-languages/less/less.js
Normal file
11
web/js/monaco-editor/min/vs/basic-languages/less/less.js
Normal file
@ -0,0 +1,11 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/less/less", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var r=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var d=(t,e)=>{for(var i in e)r(t,i,{get:e[i],enumerable:!0})},u=(t,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of a(e))!l.call(t,n)&&n!==i&&r(t,n,{get:()=>e[n],enumerable:!(o=s(e,n))||o.enumerable});return t};var c=t=>u(r({},"__esModule",{value:!0}),t);var p={};d(p,{conf:()=>m,language:()=>g});var m={wordPattern:/(#?-?\d*\.\d\w*%?)|([@#!.:]?[\w-?]+%?)|[@#!.]/g,comments:{blockComment:["/*","*/"],lineComment:"//"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),end:new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")}}},g={defaultToken:"",tokenPostfix:".less",identifier:"-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",identifierPlus:"-?-?([a-zA-Z:.]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-:.]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{root:[{include:"@nestedJSBegin"},["[ \\t\\r\\n]+",""],{include:"@comments"},{include:"@keyword"},{include:"@strings"},{include:"@numbers"},["[*_]?[a-zA-Z\\-\\s]+(?=:.*(;|(\\\\$)))","attribute.name","@attribute"],["url(\\-prefix)?\\(",{token:"tag",next:"@urldeclaration"}],["[{}()\\[\\]]","@brackets"],["[,:;]","delimiter"],["#@identifierPlus","tag.id"],["&","tag"],["\\.@identifierPlus(?=\\()","tag.class","@attribute"],["\\.@identifierPlus","tag.class"],["@identifierPlus","tag"],{include:"@operators"},["@(@identifier(?=[:,\\)]))","variable","@attribute"],["@(@identifier)","variable"],["@","key","@atRules"]],nestedJSBegin:[["``","delimiter.backtick"],["`",{token:"delimiter.backtick",next:"@nestedJSEnd",nextEmbedded:"text/javascript"}]],nestedJSEnd:[["`",{token:"delimiter.backtick",next:"@pop",nextEmbedded:"@pop"}]],operators:[["[<>=\\+\\-\\*\\/\\^\\|\\~]","operator"]],keyword:[["(@[\\s]*import|![\\s]*important|true|false|when|iscolor|isnumber|isstring|iskeyword|isurl|ispixel|ispercentage|isem|hue|saturation|lightness|alpha|lighten|darken|saturate|desaturate|fadein|fadeout|fade|spin|mix|round|ceil|floor|percentage)\\b","keyword"]],urldeclaration:[{include:"@strings"},[`[^)\r
|
||||
]+`,"string"],["\\)",{token:"tag",next:"@pop"}]],attribute:[{include:"@nestedJSBegin"},{include:"@comments"},{include:"@strings"},{include:"@numbers"},{include:"@keyword"},["[a-zA-Z\\-]+(?=\\()","attribute.value","@attribute"],[">","operator","@pop"],["@identifier","attribute.value"],{include:"@operators"},["@(@identifier)","variable"],["[)\\}]","@brackets","@pop"],["[{}()\\[\\]>]","@brackets"],["[;]","delimiter","@pop"],["[,=:]","delimiter"],["\\s",""],[".","attribute.value"]],comments:[["\\/\\*","comment","@comment"],["\\/\\/+.*","comment"]],comment:[["\\*\\/","comment","@pop"],[".","comment"]],numbers:[["(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?",{token:"attribute.value.number",next:"@units"}],["#[0-9a-fA-F_]+(?!\\w)","attribute.value.hex"]],units:[["(em|ex|ch|rem|fr|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?","attribute.value.unit","@pop"]],strings:[['~?"',{token:"string.delimiter",next:"@stringsEndDoubleQuote"}],["~?'",{token:"string.delimiter",next:"@stringsEndQuote"}]],stringsEndDoubleQuote:[['\\\\"',"string"],['"',{token:"string.delimiter",next:"@popall"}],[".","string"]],stringsEndQuote:[["\\\\'","string"],["'",{token:"string.delimiter",next:"@popall"}],[".","string"]],atRules:[{include:"@comments"},{include:"@strings"},["[()]","delimiter"],["[\\{;]","delimiter","@pop"],[".","key"]]}};return c(p);})();
|
||||
return moduleExports;
|
||||
});
|
10
web/js/monaco-editor/min/vs/basic-languages/lexon/lexon.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/lexon/lexon.js
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/lexon/lexon", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var n=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var i in e)n(t,i,{get:e[i],enumerable:!0})},p=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of d(e))!a.call(t,o)&&o!==i&&n(t,o,{get:()=>e[o],enumerable:!(r=s(e,o))||r.enumerable});return t};var c=t=>p(n({},"__esModule",{value:!0}),t);var k={};l(k,{conf:()=>m,language:()=>u});var m={comments:{lineComment:"COMMENT"},brackets:[["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:":",close:"."}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"`",close:"`"},{open:'"',close:'"'},{open:"'",close:"'"},{open:":",close:"."}],folding:{markers:{start:new RegExp("^\\s*(::\\s*|COMMENT\\s+)#region"),end:new RegExp("^\\s*(::\\s*|COMMENT\\s+)#endregion")}}},u={tokenPostfix:".lexon",ignoreCase:!0,keywords:["lexon","lex","clause","terms","contracts","may","pay","pays","appoints","into","to"],typeKeywords:["amount","person","key","time","date","asset","text"],operators:["less","greater","equal","le","gt","or","and","add","added","subtract","subtracted","multiply","multiplied","times","divide","divided","is","be","certified"],symbols:/[=><!~?:&|+\-*\/\^%]+/,tokenizer:{root:[[/^(\s*)(comment:?(?:\s.*|))$/,["","comment"]],[/"/,{token:"identifier.quote",bracket:"@open",next:"@quoted_identifier"}],["LEX$",{token:"keyword",bracket:"@open",next:"@identifier_until_period"}],["LEXON",{token:"keyword",bracket:"@open",next:"@semver"}],[":",{token:"delimiter",bracket:"@open",next:"@identifier_until_period"}],[/[a-z_$][\w$]*/,{cases:{"@operators":"operator","@typeKeywords":"keyword.type","@keywords":"keyword","@default":"identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,"delimiter"],[/\d*\.\d*\.\d*/,"number.semver"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"]],quoted_identifier:[[/[^\\"]+/,"identifier"],[/"/,{token:"identifier.quote",bracket:"@close",next:"@pop"}]],space_identifier_until_period:[[":","delimiter"],[" ",{token:"white",next:"@identifier_rest"}]],identifier_until_period:[{include:"@whitespace"},[":",{token:"delimiter",next:"@identifier_rest"}],[/[^\\.]+/,"identifier"],[/\./,{token:"delimiter",bracket:"@close",next:"@pop"}]],identifier_rest:[[/[^\\.]+/,"identifier"],[/\./,{token:"delimiter",bracket:"@close",next:"@pop"}]],semver:[{include:"@whitespace"},[":","delimiter"],[/\d*\.\d*\.\d*/,{token:"number.semver",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,"white"]]}};return c(k);})();
|
||||
return moduleExports;
|
||||
});
|
10
web/js/monaco-editor/min/vs/basic-languages/liquid/liquid.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/liquid/liquid.js
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/liquid/liquid", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var p=Object.create;var a=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var f=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,i)=>(typeof require!="undefined"?require:t)[i]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var b=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),T=(e,t)=>{for(var i in t)a(e,i,{get:t[i],enumerable:!0})},r=(e,t,i,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of w(t))!q.call(e,o)&&o!==i&&a(e,o,{get:()=>t[o],enumerable:!(l=g(t,o))||l.enumerable});return e},d=(e,t,i)=>(r(e,t,"default"),i&&r(i,t,"default")),s=(e,t,i)=>(i=e!=null?p(h(e)):{},r(t||!e||!e.__esModule?a(i,"default",{value:e,enumerable:!0}):i,e)),k=e=>r(a({},"__esModule",{value:!0}),e);var c=b((y,u)=>{var _=s(f("vs/editor/editor.api"));u.exports=_});var $={};T($,{conf:()=>x,language:()=>S});var n={};d(n,s(c()));var m=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],x={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,brackets:[["<!--","-->"],["<",">"],["{{","}}"],["{%","%}"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"%",close:"%"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${m.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:n.languages.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${m.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:n.languages.IndentAction.Indent}}]},S={defaultToken:"",tokenPostfix:"",builtinTags:["if","else","elseif","endif","render","assign","capture","endcapture","case","endcase","comment","endcomment","cycle","decrement","for","endfor","include","increment","layout","raw","endraw","render","tablerow","endtablerow","unless","endunless"],builtinFilters:["abs","append","at_least","at_most","capitalize","ceil","compact","date","default","divided_by","downcase","escape","escape_once","first","floor","join","json","last","lstrip","map","minus","modulo","newline_to_br","plus","prepend","remove","remove_first","replace","replace_first","reverse","round","rstrip","size","slice","sort","sort_natural","split","strip","strip_html","strip_newlines","times","truncate","truncatewords","uniq","upcase","url_decode","url_encode","where"],constants:["true","false"],operators:["==","!=",">","<",">=","<="],symbol:/[=><!]+/,identifier:/[a-zA-Z_][\w]*/,tokenizer:{root:[[/\{\%\s*comment\s*\%\}/,"comment.start.liquid","@comment"],[/\{\{/,{token:"@rematch",switchTo:"@liquidState.root"}],[/\{\%/,{token:"@rematch",switchTo:"@liquidState.root"}],[/(<)([\w\-]+)(\/>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)([\w\-]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/</,"delimiter.html"],[/\{/,"delimiter.html"],[/[^<{]+/]],comment:[[/\{\%\s*endcomment\s*\%\}/,"comment.end.liquid","@pop"],[/./,"comment.content.liquid"]],otherTag:[[/\{\{/,{token:"@rematch",switchTo:"@liquidState.otherTag"}],[/\{\%/,{token:"@rematch",switchTo:"@liquidState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],liquidState:[[/\{\{/,"delimiter.output.liquid"],[/\}\}/,{token:"delimiter.output.liquid",switchTo:"@$S2.$S3"}],[/\{\%/,"delimiter.tag.liquid"],[/raw\s*\%\}/,"delimiter.tag.liquid","@liquidRaw"],[/\%\}/,{token:"delimiter.tag.liquid",switchTo:"@$S2.$S3"}],{include:"liquidRoot"}],liquidRaw:[[/^(?!\{\%\s*endraw\s*\%\}).+/],[/\{\%/,"delimiter.tag.liquid"],[/@identifier/],[/\%\}/,{token:"delimiter.tag.liquid",next:"@root"}]],liquidRoot:[[/\d+(\.\d+)?/,"number.liquid"],[/"[^"]*"/,"string.liquid"],[/'[^']*'/,"string.liquid"],[/\s+/],[/@symbol/,{cases:{"@operators":"operator.liquid","@default":""}}],[/\./],[/@identifier/,{cases:{"@constants":"keyword.liquid","@builtinFilters":"predefined.liquid","@builtinTags":"predefined.liquid","@default":"variable.liquid"}}],[/[^}|%]/,"variable.liquid"]]}};return k($);})();
|
||||
return moduleExports;
|
||||
});
|
10
web/js/monaco-editor/min/vs/basic-languages/lua/lua.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/lua/lua.js
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/lua/lua", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var s=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var c=(o,e)=>{for(var t in e)s(o,t,{get:e[t],enumerable:!0})},m=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of i(e))!l.call(o,n)&&n!==t&&s(o,n,{get:()=>e[n],enumerable:!(r=a(e,n))||r.enumerable});return o};var p=o=>m(s({},"__esModule",{value:!0}),o);var u={};c(u,{conf:()=>d,language:()=>g});var d={comments:{lineComment:"--",blockComment:["--[[","]]"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},g={defaultToken:"",tokenPostfix:".lua",keywords:["and","break","do","else","elseif","end","false","for","function","goto","if","in","local","nil","not","or","repeat","return","then","true","until","while"],brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.array",open:"[",close:"]"},{token:"delimiter.parenthesis",open:"(",close:")"}],operators:["+","-","*","/","%","^","#","==","~=","<=",">=","<",">","=",";",":",",",".","..","..."],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/[a-zA-Z_]\w*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],{include:"@whitespace"},[/(,)(\s*)([a-zA-Z_]\w*)(\s*)(:)(?!:)/,["delimiter","","key","","delimiter"]],[/({)(\s*)([a-zA-Z_]\w*)(\s*)(:)(?!:)/,["@brackets","","key","","delimiter"]],[/[{}()\[\]]/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F_]*[0-9a-fA-F]/,"number.hex"],[/\d+?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],whitespace:[[/[ \t\r\n]+/,""],[/--\[([=]*)\[/,"comment","@comment.$1"],[/--.*$/,"comment"]],comment:[[/[^\]]+/,"comment"],[/\]([=]*)\]/,{cases:{"$1==$S2":{token:"comment",next:"@pop"},"@default":"comment"}}],[/./,"comment"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}};return p(u);})();
|
||||
return moduleExports;
|
||||
});
|
10
web/js/monaco-editor/min/vs/basic-languages/m3/m3.js
Normal file
10
web/js/monaco-editor/min/vs/basic-languages/m3/m3.js
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";/*!-----------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||||
* Released under the MIT license
|
||||
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||||
*-----------------------------------------------------------------------------*/
|
||||
define("vs/basic-languages/m3/m3", ["require","require"],(require)=>{
|
||||
var moduleExports=(()=>{var r=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var R=(o,e)=>{for(var s in e)r(o,s,{get:e[s],enumerable:!0})},c=(o,e,s,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of a(e))!i.call(o,t)&&t!==s&&r(o,t,{get:()=>e[t],enumerable:!(n=E(e,t))||n.enumerable});return o};var m=o=>c(r({},"__esModule",{value:!0}),o);var N={};R(N,{conf:()=>A,language:()=>p});var A={comments:{blockComment:["(*","*)"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"[",close:"]"},{open:"{",close:"}"},{open:"(",close:")"},{open:"(*",close:"*)"},{open:"<*",close:"*>"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]}]},p={defaultToken:"",tokenPostfix:".m3",brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["AND","ANY","ARRAY","AS","BEGIN","BITS","BRANDED","BY","CASE","CONST","DIV","DO","ELSE","ELSIF","END","EVAL","EXCEPT","EXCEPTION","EXIT","EXPORTS","FINALLY","FOR","FROM","GENERIC","IF","IMPORT","IN","INTERFACE","LOCK","LOOP","METHODS","MOD","MODULE","NOT","OBJECT","OF","OR","OVERRIDES","PROCEDURE","RAISE","RAISES","READONLY","RECORD","REF","REPEAT","RETURN","REVEAL","SET","THEN","TO","TRY","TYPE","TYPECASE","UNSAFE","UNTIL","UNTRACED","VALUE","VAR","WHILE","WITH"],reservedConstNames:["ABS","ADR","ADRSIZE","BITSIZE","BYTESIZE","CEILING","DEC","DISPOSE","FALSE","FIRST","FLOAT","FLOOR","INC","ISTYPE","LAST","LOOPHOLE","MAX","MIN","NARROW","NEW","NIL","NUMBER","ORD","ROUND","SUBARRAY","TRUE","TRUNC","TYPECODE","VAL"],reservedTypeNames:["ADDRESS","ANY","BOOLEAN","CARDINAL","CHAR","EXTENDED","INTEGER","LONGCARD","LONGINT","LONGREAL","MUTEX","NULL","REAL","REFANY","ROOT","TEXT"],operators:["+","-","*","/","&","^","."],relations:["=","#","<","<=",">",">=","<:",":"],delimiters:["|","..","=>",",",";",":="],symbols:/[>=<#.,:;+\-*/&^]+/,escapes:/\\(?:[\\fnrt"']|[0-7]{3})/,tokenizer:{root:[[/_\w*/,"invalid"],[/[a-zA-Z][a-zA-Z0-9_]*/,{cases:{"@keywords":{token:"keyword.$0"},"@reservedConstNames":{token:"constant.reserved.$0"},"@reservedTypeNames":{token:"type.reserved.$0"},"@default":"identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[0-9]+\.[0-9]+(?:[DdEeXx][\+\-]?[0-9]+)?/,"number.float"],[/[0-9]+(?:\_[0-9a-fA-F]+)?L?/,"number"],[/@symbols/,{cases:{"@operators":"operators","@relations":"operators","@delimiters":"delimiter","@default":"invalid"}}],[/'[^\\']'/,"string.char"],[/(')(@escapes)(')/,["string.char","string.escape","string.char"]],[/'/,"invalid"],[/"([^"\\]|\\.)*$/,"invalid"],[/"/,"string.text","@text"]],text:[[/[^\\"]+/,"string.text"],[/@escapes/,"string.escape"],[/\\./,"invalid"],[/"/,"string.text","@pop"]],comment:[[/\(\*/,"comment","@push"],[/\*\)/,"comment","@pop"],[/./,"comment"]],pragma:[[/<\*/,"keyword.pragma","@push"],[/\*>/,"keyword.pragma","@pop"],[/./,"keyword.pragma"]],whitespace:[[/[ \t\r\n]+/,"white"],[/\(\*/,"comment","@comment"],[/<\*/,"keyword.pragma","@pragma"]]}};return m(N);})();
|
||||
return moduleExports;
|
||||
});
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user