mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 05:54:19 +01:00
Core beta (#2314)
* Install the core-beta theme into the CTFd repo git-subtree-dir: CTFd/themes/core-beta git-subtree-split: 9126d77d1a858e10c25ce028a35d42efaa0f49c0
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
CTFd/themes/**/vendor/
|
CTFd/themes/**/vendor/
|
||||||
|
CTFd/themes/core-beta/**/*
|
||||||
*.html
|
*.html
|
||||||
*.njk
|
*.njk
|
||||||
*.png
|
*.png
|
||||||
|
|||||||
30
CTFd/themes/core-beta/.github/workflows/build.yml
vendored
Normal file
30
CTFd/themes/core-beta/.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
name: build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
static:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||||
|
ref: ${{ github.event.pull_request.head.ref }}
|
||||||
|
- name: Setup node.js
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: '16.x'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: yarn --frozen-lockfile
|
||||||
|
- name: Format
|
||||||
|
run: yarn format
|
||||||
|
- name: Build
|
||||||
|
run: yarn build
|
||||||
|
- name: Push built files
|
||||||
|
uses: EndBug/add-and-commit@v9
|
||||||
|
with:
|
||||||
|
default_author: github_actions
|
||||||
|
message: "chore: yarn build"
|
||||||
21
CTFd/themes/core-beta/.github/workflows/prettier.yml
vendored
Normal file
21
CTFd/themes/core-beta/.github/workflows/prettier.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
name: prettier
|
||||||
|
|
||||||
|
on: [ pull_request ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||||
|
ref: ${{ github.event.pull_request.head.ref }}
|
||||||
|
- name: Setup node.js
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: '16.x'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: yarn --frozen-lockfile
|
||||||
|
- name: Lint with prettier
|
||||||
|
run: yarn lint
|
||||||
24
CTFd/themes/core-beta/.gitignore
vendored
Normal file
24
CTFd/themes/core-beta/.gitignore
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
|
||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
dist-ssr
|
||||||
|
*.local
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/extensions.json
|
||||||
|
.idea
|
||||||
|
.DS_Store
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw?
|
||||||
2
CTFd/themes/core-beta/.prettierignore
Normal file
2
CTFd/themes/core-beta/.prettierignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
static
|
||||||
|
**/*.html
|
||||||
4
CTFd/themes/core-beta/.prettierrc.json
Normal file
4
CTFd/themes/core-beta/.prettierrc.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"printWidth": 88,
|
||||||
|
"arrowParens": "avoid"
|
||||||
|
}
|
||||||
201
CTFd/themes/core-beta/LICENSE
Normal file
201
CTFd/themes/core-beta/LICENSE
Normal file
@@ -0,0 +1,201 @@
|
|||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright 2022 CTFd LLC
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
21
CTFd/themes/core-beta/README.md
Normal file
21
CTFd/themes/core-beta/README.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# core-beta
|
||||||
|
|
||||||
|
Rewritten version of the CTFd core theme to use Bootstrap 5, Alpine.js, and vite to improve upon the existing CTFd theme structure.
|
||||||
|
|
||||||
|
## Subtree Installation
|
||||||
|
|
||||||
|
### Add repo to themes folder
|
||||||
|
|
||||||
|
```
|
||||||
|
git subtree add --prefix CTFd/themes/core-beta git@github.com:CTFd/core-beta.git main --squash
|
||||||
|
```
|
||||||
|
|
||||||
|
### Pull latest changes to subtree
|
||||||
|
```
|
||||||
|
git subtree pull --prefix CTFd/themes/core-beta git@github.com:CTFd/core-beta.git main --squash
|
||||||
|
```
|
||||||
|
|
||||||
|
## Todo
|
||||||
|
|
||||||
|
- Document how we are using Vite
|
||||||
|
- Create a cookie cutter template package to use with Vite
|
||||||
BIN
CTFd/themes/core-beta/assets/img/favicon.ico
Normal file
BIN
CTFd/themes/core-beta/assets/img/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
253
CTFd/themes/core-beta/assets/js/challenges.js
Normal file
253
CTFd/themes/core-beta/assets/js/challenges.js
Normal file
@@ -0,0 +1,253 @@
|
|||||||
|
import Alpine from "alpinejs";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
|
import CTFd from "./index";
|
||||||
|
|
||||||
|
import { Modal, Tab } from "bootstrap";
|
||||||
|
import highlight from "./theme/highlight";
|
||||||
|
|
||||||
|
function addTargetBlank(html) {
|
||||||
|
let dom = new DOMParser();
|
||||||
|
let view = dom.parseFromString(html, "text/html");
|
||||||
|
let links = view.querySelectorAll('a[href*="://"]');
|
||||||
|
links.forEach(link => {
|
||||||
|
link.setAttribute("target", "_blank");
|
||||||
|
});
|
||||||
|
return view.documentElement.outerHTML;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.Alpine = Alpine;
|
||||||
|
|
||||||
|
Alpine.store("challenge", {
|
||||||
|
data: {
|
||||||
|
view: "",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
Alpine.data("Hint", () => ({
|
||||||
|
id: null,
|
||||||
|
html: null,
|
||||||
|
|
||||||
|
async showHint(event) {
|
||||||
|
if (event.target.open) {
|
||||||
|
let response = await CTFd.pages.challenge.loadHint(this.id);
|
||||||
|
let hint = response.data;
|
||||||
|
if (hint.content) {
|
||||||
|
this.html = addTargetBlank(hint.html);
|
||||||
|
} else {
|
||||||
|
let answer = await CTFd.pages.challenge.displayUnlock(this.id);
|
||||||
|
if (answer) {
|
||||||
|
let unlock = await CTFd.pages.challenge.loadUnlock(this.id);
|
||||||
|
|
||||||
|
if (unlock.success) {
|
||||||
|
let response = await CTFd.pages.challenge.loadHint(this.id);
|
||||||
|
let hint = response.data;
|
||||||
|
this.html = addTargetBlank(hint.html);
|
||||||
|
} else {
|
||||||
|
event.target.open = false;
|
||||||
|
CTFd._functions.challenge.displayUnlockError(unlock);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
event.target.open = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
Alpine.data("Challenge", () => ({
|
||||||
|
id: null,
|
||||||
|
next_id: null,
|
||||||
|
submission: "",
|
||||||
|
tab: null,
|
||||||
|
solves: [],
|
||||||
|
response: null,
|
||||||
|
|
||||||
|
async init() {
|
||||||
|
highlight();
|
||||||
|
},
|
||||||
|
|
||||||
|
getStyles() {
|
||||||
|
let styles = {
|
||||||
|
"modal-dialog": true,
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
let size = CTFd.config.themeSettings.challenge_window_size;
|
||||||
|
switch (size) {
|
||||||
|
case "sm":
|
||||||
|
styles["modal-sm"] = true;
|
||||||
|
break;
|
||||||
|
case "lg":
|
||||||
|
styles["modal-lg"] = true;
|
||||||
|
break;
|
||||||
|
case "xl":
|
||||||
|
styles["modal-xl"] = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
// Ignore errors with challenge window size
|
||||||
|
console.log("Error processing challenge_window_size");
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
return styles;
|
||||||
|
},
|
||||||
|
|
||||||
|
async init() {
|
||||||
|
highlight();
|
||||||
|
},
|
||||||
|
|
||||||
|
async showChallenge() {
|
||||||
|
new Tab(this.$el).show();
|
||||||
|
},
|
||||||
|
|
||||||
|
async showSolves() {
|
||||||
|
this.solves = await CTFd.pages.challenge.loadSolves(this.id);
|
||||||
|
this.solves.forEach(solve => {
|
||||||
|
solve.date = dayjs(solve.date).format("MMMM Do, h:mm:ss A");
|
||||||
|
return solve;
|
||||||
|
});
|
||||||
|
new Tab(this.$el).show();
|
||||||
|
},
|
||||||
|
|
||||||
|
getNextId() {
|
||||||
|
let data = Alpine.store("challenge").data;
|
||||||
|
return data.next_id;
|
||||||
|
},
|
||||||
|
|
||||||
|
async nextChallenge() {
|
||||||
|
let modal = Modal.getOrCreateInstance("[x-ref='challengeWindow']");
|
||||||
|
|
||||||
|
// TODO: Get rid of this private attribute access
|
||||||
|
// See https://github.com/twbs/bootstrap/issues/31266
|
||||||
|
modal._element.addEventListener(
|
||||||
|
"hidden.bs.modal",
|
||||||
|
event => {
|
||||||
|
// Dispatch load-challenge event to call loadChallenge in the ChallengeBoard
|
||||||
|
Alpine.nextTick(() => {
|
||||||
|
this.$dispatch("load-challenge", this.getNextId());
|
||||||
|
});
|
||||||
|
},
|
||||||
|
{ once: true }
|
||||||
|
);
|
||||||
|
modal.hide();
|
||||||
|
},
|
||||||
|
|
||||||
|
async submitChallenge() {
|
||||||
|
this.response = await CTFd.pages.challenge.submitChallenge(
|
||||||
|
this.id,
|
||||||
|
this.submission
|
||||||
|
);
|
||||||
|
|
||||||
|
await this.renderSubmissionResponse();
|
||||||
|
},
|
||||||
|
|
||||||
|
async renderSubmissionResponse() {
|
||||||
|
if (this.response.data.status === "correct") {
|
||||||
|
this.submission = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dispatch load-challenges event to call loadChallenges in the ChallengeBoard
|
||||||
|
this.$dispatch("load-challenges");
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
Alpine.data("ChallengeBoard", () => ({
|
||||||
|
loaded: false,
|
||||||
|
challenges: [],
|
||||||
|
challenge: null,
|
||||||
|
|
||||||
|
async init() {
|
||||||
|
this.challenges = await CTFd.pages.challenges.getChallenges();
|
||||||
|
this.loaded = true;
|
||||||
|
|
||||||
|
if (window.location.hash) {
|
||||||
|
let chalHash = decodeURIComponent(window.location.hash.substring(1));
|
||||||
|
let idx = chalHash.lastIndexOf("-");
|
||||||
|
if (idx >= 0) {
|
||||||
|
let pieces = [chalHash.slice(0, idx), chalHash.slice(idx + 1)];
|
||||||
|
let id = pieces[1];
|
||||||
|
await this.loadChallenge(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
getCategories() {
|
||||||
|
const categories = [];
|
||||||
|
|
||||||
|
this.challenges.forEach(challenge => {
|
||||||
|
const { category } = challenge;
|
||||||
|
|
||||||
|
if (!categories.includes(category)) {
|
||||||
|
categories.push(category);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
const f = CTFd.config.themeSettings.challenge_category_order;
|
||||||
|
if (f) {
|
||||||
|
const getSort = new Function(`return (${f})`);
|
||||||
|
categories.sort(getSort());
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
// Ignore errors with theme category sorting
|
||||||
|
console.log("Error running challenge_category_order function");
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
|
||||||
|
return categories;
|
||||||
|
},
|
||||||
|
|
||||||
|
getChallenges(category) {
|
||||||
|
let challenges = this.challenges;
|
||||||
|
|
||||||
|
if (category) {
|
||||||
|
challenges = this.challenges.filter(challenge => challenge.category === category);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const f = CTFd.config.themeSettings.challenge_order;
|
||||||
|
if (f) {
|
||||||
|
const getSort = new Function(`return (${f})`);
|
||||||
|
challenges.sort(getSort());
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
// Ignore errors with theme challenge sorting
|
||||||
|
console.log("Error running challenge_order function");
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
|
||||||
|
return challenges;
|
||||||
|
},
|
||||||
|
|
||||||
|
async loadChallenges() {
|
||||||
|
this.challenges = await CTFd.pages.challenges.getChallenges();
|
||||||
|
},
|
||||||
|
|
||||||
|
async loadChallenge(challengeId) {
|
||||||
|
await CTFd.pages.challenge.displayChallenge(challengeId, challenge => {
|
||||||
|
challenge.data.view = addTargetBlank(challenge.data.view);
|
||||||
|
Alpine.store("challenge").data = challenge.data;
|
||||||
|
|
||||||
|
// nextTick is required here because we're working in a callback
|
||||||
|
Alpine.nextTick(() => {
|
||||||
|
let modal = Modal.getOrCreateInstance("[x-ref='challengeWindow']");
|
||||||
|
// TODO: Get rid of this private attribute access
|
||||||
|
// See https://github.com/twbs/bootstrap/issues/31266
|
||||||
|
modal._element.addEventListener(
|
||||||
|
"hidden.bs.modal",
|
||||||
|
event => {
|
||||||
|
// Remove location hash
|
||||||
|
history.replaceState(null, null, " ");
|
||||||
|
},
|
||||||
|
{ once: true }
|
||||||
|
);
|
||||||
|
modal.show();
|
||||||
|
history.replaceState(null, null, `#${challenge.data.name}-${challengeId}`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
Alpine.start();
|
||||||
35
CTFd/themes/core-beta/assets/js/index.js
Normal file
35
CTFd/themes/core-beta/assets/js/index.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import CTFd from "@ctfdio/ctfd-js";
|
||||||
|
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
import advancedFormat from "dayjs/plugin/advancedFormat";
|
||||||
|
|
||||||
|
import times from "./theme/times";
|
||||||
|
import styles from "./theme/styles";
|
||||||
|
import highlight from "./theme/highlight";
|
||||||
|
|
||||||
|
import alerts from "./utils/alerts";
|
||||||
|
import tooltips from "./utils/tooltips";
|
||||||
|
import collapse from "./utils/collapse";
|
||||||
|
|
||||||
|
import eventAlerts from "./utils/notifications/alerts";
|
||||||
|
import eventToasts from "./utils/notifications/toasts";
|
||||||
|
import eventRead from "./utils/notifications/read";
|
||||||
|
|
||||||
|
dayjs.extend(advancedFormat);
|
||||||
|
CTFd.init(window.init);
|
||||||
|
|
||||||
|
(() => {
|
||||||
|
styles();
|
||||||
|
times();
|
||||||
|
highlight();
|
||||||
|
|
||||||
|
alerts();
|
||||||
|
tooltips();
|
||||||
|
collapse();
|
||||||
|
|
||||||
|
eventRead();
|
||||||
|
eventAlerts();
|
||||||
|
eventToasts();
|
||||||
|
})();
|
||||||
|
|
||||||
|
export default CTFd;
|
||||||
33
CTFd/themes/core-beta/assets/js/notifications.js
Normal file
33
CTFd/themes/core-beta/assets/js/notifications.js
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import Alpine from "alpinejs";
|
||||||
|
import CTFd from "./index";
|
||||||
|
|
||||||
|
window.CTFd = CTFd;
|
||||||
|
window.Alpine = Alpine;
|
||||||
|
|
||||||
|
// Get unread notifications from server
|
||||||
|
let lastId = CTFd.events.counter.read.getLast();
|
||||||
|
CTFd.fetch(`/api/v1/notifications?since_id=${lastId}`)
|
||||||
|
.then(response => {
|
||||||
|
return response.json();
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
// Get notifications from server and mark them as read
|
||||||
|
let notifications = response.data;
|
||||||
|
let read = CTFd.events.counter.read.getAll();
|
||||||
|
notifications.forEach(n => {
|
||||||
|
read.push(n.id);
|
||||||
|
});
|
||||||
|
CTFd.events.counter.read.setAll(read);
|
||||||
|
|
||||||
|
// Mark all unread as read
|
||||||
|
CTFd.events.counter.unread.readAll();
|
||||||
|
|
||||||
|
// Broadcast our new count (which should be 0)
|
||||||
|
let count = CTFd.events.counter.unread.getAll().length;
|
||||||
|
CTFd.events.controller.broadcast("counter", {
|
||||||
|
count: count,
|
||||||
|
});
|
||||||
|
Alpine.store("unread_count", count);
|
||||||
|
});
|
||||||
|
|
||||||
|
Alpine.start();
|
||||||
7
CTFd/themes/core-beta/assets/js/page.js
Normal file
7
CTFd/themes/core-beta/assets/js/page.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import Alpine from "alpinejs";
|
||||||
|
import CTFd from "./index";
|
||||||
|
|
||||||
|
window.CTFd = CTFd;
|
||||||
|
window.Alpine = Alpine;
|
||||||
|
|
||||||
|
Alpine.start();
|
||||||
20
CTFd/themes/core-beta/assets/js/scoreboard.js
Normal file
20
CTFd/themes/core-beta/assets/js/scoreboard.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import Alpine from "alpinejs";
|
||||||
|
import CTFd from "./index";
|
||||||
|
import { getOption } from "./utils/graphs/echarts/scoreboard";
|
||||||
|
import { embed } from "./utils/graphs/echarts";
|
||||||
|
|
||||||
|
window.Alpine = Alpine;
|
||||||
|
window.CTFd = CTFd;
|
||||||
|
|
||||||
|
Alpine.data("ScoreboardDetail", () => ({
|
||||||
|
data: null,
|
||||||
|
|
||||||
|
async init() {
|
||||||
|
this.data = await CTFd.pages.scoreboard.getScoreboardDetail(10);
|
||||||
|
|
||||||
|
let option = getOption(CTFd.config.userMode, this.data);
|
||||||
|
embed(this.$refs.scoregraph, option);
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
Alpine.start();
|
||||||
100
CTFd/themes/core-beta/assets/js/settings.js
Normal file
100
CTFd/themes/core-beta/assets/js/settings.js
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
import Alpine from "alpinejs";
|
||||||
|
import { Modal } from "bootstrap";
|
||||||
|
import { serializeJSON } from "@ctfdio/ctfd-js/forms";
|
||||||
|
|
||||||
|
import CTFd from "./index";
|
||||||
|
import { copyToClipboard } from "./utils/clipboard";
|
||||||
|
|
||||||
|
window.Alpine = Alpine;
|
||||||
|
|
||||||
|
Alpine.data("SettingsForm", () => ({
|
||||||
|
success: null,
|
||||||
|
error: null,
|
||||||
|
initial: null,
|
||||||
|
errors: [],
|
||||||
|
|
||||||
|
init() {
|
||||||
|
this.initial = serializeJSON(this.$el);
|
||||||
|
},
|
||||||
|
|
||||||
|
async updateProfile() {
|
||||||
|
this.success = null;
|
||||||
|
this.error = null;
|
||||||
|
this.errors = [];
|
||||||
|
|
||||||
|
let data = serializeJSON(this.$el, this.initial, true);
|
||||||
|
|
||||||
|
// Process fields[id] to fields: {}
|
||||||
|
data.fields = [];
|
||||||
|
for (const property in data) {
|
||||||
|
if (property.match(/fields\[\d+\]/)) {
|
||||||
|
let field = {};
|
||||||
|
let id = parseInt(property.slice(7, -1));
|
||||||
|
field["field_id"] = id;
|
||||||
|
field["value"] = data[property];
|
||||||
|
data.fields.push(field);
|
||||||
|
delete data[property];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send API request
|
||||||
|
const response = await CTFd.pages.settings.updateSettings(data);
|
||||||
|
if (response.success) {
|
||||||
|
this.success = true;
|
||||||
|
this.error = false;
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
this.success = null;
|
||||||
|
this.error = null;
|
||||||
|
}, 3000);
|
||||||
|
} else {
|
||||||
|
this.success = false;
|
||||||
|
this.error = true;
|
||||||
|
|
||||||
|
Object.keys(response.errors).map(error => {
|
||||||
|
const error_msg = response.errors[error];
|
||||||
|
this.errors.push(error_msg);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
Alpine.data("TokensForm", () => ({
|
||||||
|
token: null,
|
||||||
|
|
||||||
|
async generateToken() {
|
||||||
|
const data = serializeJSON(this.$el);
|
||||||
|
|
||||||
|
if (!data.expiration) {
|
||||||
|
delete data.expiration;
|
||||||
|
}
|
||||||
|
const response = await CTFd.pages.settings.generateToken(data);
|
||||||
|
this.token = response.data.value;
|
||||||
|
|
||||||
|
new Modal(this.$refs.tokenModal).show();
|
||||||
|
},
|
||||||
|
|
||||||
|
copyToken() {
|
||||||
|
copyToClipboard(this.$refs.token);
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
Alpine.data("Tokens", () => ({
|
||||||
|
selectedTokenId: null,
|
||||||
|
|
||||||
|
async deleteTokenModal(tokenId) {
|
||||||
|
this.selectedTokenId = tokenId;
|
||||||
|
new Modal(this.$refs.confirmModal).show();
|
||||||
|
},
|
||||||
|
|
||||||
|
async deleteSelectedToken() {
|
||||||
|
await CTFd.pages.settings.deleteToken(this.selectedTokenId);
|
||||||
|
const $token = this.$refs[`token-${this.selectedTokenId}`];
|
||||||
|
|
||||||
|
if ($token) {
|
||||||
|
$token.remove();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
Alpine.start();
|
||||||
145
CTFd/themes/core-beta/assets/js/setup.js
Normal file
145
CTFd/themes/core-beta/assets/js/setup.js
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
import Alpine from "alpinejs";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
import { Tab } from "bootstrap";
|
||||||
|
|
||||||
|
import CTFd from "./index";
|
||||||
|
|
||||||
|
window.Alpine = Alpine;
|
||||||
|
|
||||||
|
Alpine.data("SetupForm", () => ({
|
||||||
|
init() {
|
||||||
|
// Bind Enter on any input to clicking the Next button
|
||||||
|
this.$root.querySelectorAll("input").forEach(i =>
|
||||||
|
i.addEventListener("keypress", e => {
|
||||||
|
if (e.key == "Enter") {
|
||||||
|
e.preventDefault();
|
||||||
|
e.target.closest(".tab-pane").querySelector("button[data-href]").click();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
// Register storage listener for MLC integration
|
||||||
|
window.addEventListener("storage", function (event) {
|
||||||
|
if (event.key == "integrations" && event.newValue) {
|
||||||
|
let integration = JSON.parse(event.newValue);
|
||||||
|
if (integration["name"] == "mlc") {
|
||||||
|
$("#integration-mlc").text("Already Configured").attr("disabled", true);
|
||||||
|
window.focus();
|
||||||
|
localStorage.removeItem("integrations");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
validateFileSize(e, limit) {
|
||||||
|
if (e.target.files[0].size > limit) {
|
||||||
|
if (
|
||||||
|
!confirm(
|
||||||
|
`This image file is larger than ${
|
||||||
|
limit / 1000
|
||||||
|
}KB which may result in increased load times. Are you sure you'd like to use this file?`
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
e.target.value = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
switchTab(e) {
|
||||||
|
// Handle tab validation
|
||||||
|
let valid_tab = true;
|
||||||
|
let inputs = e.target
|
||||||
|
.closest('[role="tabpanel"]')
|
||||||
|
.querySelectorAll("input,textarea");
|
||||||
|
|
||||||
|
inputs.forEach(e => {
|
||||||
|
if (e.checkValidity() === false) {
|
||||||
|
valid_tab = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (valid_tab == false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let target = e.target.dataset.href;
|
||||||
|
let tab = this.$root.querySelector(`[data-bs-target="${target}"]`);
|
||||||
|
Tab.getOrCreateInstance(tab).show();
|
||||||
|
},
|
||||||
|
|
||||||
|
setThemeColor(e) {
|
||||||
|
document.querySelector("#config-color-input").value = e.target.value;
|
||||||
|
},
|
||||||
|
|
||||||
|
resetThemeColor(_e) {
|
||||||
|
document.querySelector("#config-color-input").value = "";
|
||||||
|
document.querySelector("#config-color-picker").value = "";
|
||||||
|
},
|
||||||
|
|
||||||
|
processDateTime(datetime) {
|
||||||
|
return function (_event) {
|
||||||
|
let date_picker = document.querySelector(`#${datetime}-date`);
|
||||||
|
let time_picker = document.querySelector(`#${datetime}-time`);
|
||||||
|
let unix_time = dayjs(
|
||||||
|
`${date_picker.value} ${time_picker.value}`,
|
||||||
|
"YYYY-MM-DD HH:mm"
|
||||||
|
).unix();
|
||||||
|
|
||||||
|
if (isNaN(unix_time)) {
|
||||||
|
document.querySelector(`#${datetime}-preview`).value = "";
|
||||||
|
} else {
|
||||||
|
document.querySelector(`#${datetime}-preview`).value = unix_time;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
mlcSetup() {
|
||||||
|
let q = document.querySelector;
|
||||||
|
let r = CTFd.config.urlRoot;
|
||||||
|
let params = {
|
||||||
|
name: q("#ctf_name").value,
|
||||||
|
type: "jeopardy",
|
||||||
|
description: q("#ctf_description").value,
|
||||||
|
user_mode: q("#user_mode").value,
|
||||||
|
event_url: window.location.origin + r,
|
||||||
|
redirect_url: window.location.origin + r + "/redirect",
|
||||||
|
integration_setup_url: window.location.origin + r + "/setup/integrations",
|
||||||
|
start: q("#start-preview").value,
|
||||||
|
end: q("#end-preview").value,
|
||||||
|
platform: "CTFd",
|
||||||
|
state: window.STATE,
|
||||||
|
};
|
||||||
|
|
||||||
|
const ret = [];
|
||||||
|
for (let p in params) {
|
||||||
|
ret.push(encodeURIComponent(p) + "=" + encodeURIComponent(params[p]));
|
||||||
|
}
|
||||||
|
window.open(
|
||||||
|
"https://www.majorleaguecyber.org/events/new?" + ret.join("&"),
|
||||||
|
"_blank"
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
submitSetup(e) {
|
||||||
|
if (document.querySelector("#newsletter-checkbox").checked) {
|
||||||
|
let email = e.target.querySelector("input[name=email]").value;
|
||||||
|
let params = {
|
||||||
|
email: email,
|
||||||
|
b_38e27f7d496889133d2214208_d7c3ed71f9: "",
|
||||||
|
c: "jsonp_callback_" + Math.round(10000 * Math.random()),
|
||||||
|
};
|
||||||
|
const ret = [];
|
||||||
|
for (let p in params) {
|
||||||
|
ret.push(encodeURIComponent(p) + "=" + encodeURIComponent(params[p]));
|
||||||
|
}
|
||||||
|
|
||||||
|
var script = document.createElement("script");
|
||||||
|
script.src =
|
||||||
|
"https://newsletters.ctfd.io/lists/ot889gr1sa0e1/subscribe/post-json?" +
|
||||||
|
ret.join("&");
|
||||||
|
document.head.appendChild(script);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
Alpine.start();
|
||||||
7
CTFd/themes/core-beta/assets/js/teams/list.js
Normal file
7
CTFd/themes/core-beta/assets/js/teams/list.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import Alpine from "alpinejs";
|
||||||
|
import CTFd from "../index";
|
||||||
|
|
||||||
|
window.CTFd = CTFd;
|
||||||
|
window.Alpine = Alpine;
|
||||||
|
|
||||||
|
Alpine.start();
|
||||||
201
CTFd/themes/core-beta/assets/js/teams/private.js
Normal file
201
CTFd/themes/core-beta/assets/js/teams/private.js
Normal file
@@ -0,0 +1,201 @@
|
|||||||
|
import Alpine from "alpinejs";
|
||||||
|
import CTFd from "../index";
|
||||||
|
import { Modal } from "bootstrap";
|
||||||
|
import { serializeJSON } from "@ctfdio/ctfd-js/forms";
|
||||||
|
import { copyToClipboard } from "../utils/clipboard";
|
||||||
|
import { colorHash } from "@ctfdio/ctfd-js/ui";
|
||||||
|
import { getOption as getUserScoreOption } from "../utils/graphs/echarts/userscore";
|
||||||
|
import { embed } from "../utils/graphs/echarts";
|
||||||
|
|
||||||
|
window.Alpine = Alpine;
|
||||||
|
window.CTFd = CTFd;
|
||||||
|
|
||||||
|
Alpine.store("inviteToken", "");
|
||||||
|
|
||||||
|
Alpine.data("TeamEditModal", () => ({
|
||||||
|
success: null,
|
||||||
|
error: null,
|
||||||
|
initial: null,
|
||||||
|
errors: [],
|
||||||
|
|
||||||
|
init() {
|
||||||
|
this.initial = serializeJSON(this.$el.querySelector("form"));
|
||||||
|
},
|
||||||
|
|
||||||
|
async updateProfile() {
|
||||||
|
let data = serializeJSON(this.$el, this.initial, true);
|
||||||
|
|
||||||
|
data.fields = [];
|
||||||
|
|
||||||
|
for (const property in data) {
|
||||||
|
if (property.match(/fields\[\d+\]/)) {
|
||||||
|
let field = {};
|
||||||
|
let id = parseInt(property.slice(7, -1));
|
||||||
|
field["field_id"] = id;
|
||||||
|
field["value"] = data[property];
|
||||||
|
data.fields.push(field);
|
||||||
|
delete data[property];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let response = await CTFd.pages.teams.updateTeamSettings(data);
|
||||||
|
if (response.success) {
|
||||||
|
this.success = true;
|
||||||
|
this.error = false;
|
||||||
|
setTimeout(() => {
|
||||||
|
this.success = null;
|
||||||
|
this.error = null;
|
||||||
|
}, 3000);
|
||||||
|
} else {
|
||||||
|
this.success = false;
|
||||||
|
this.error = true;
|
||||||
|
Object.keys(response.errors).map(error => {
|
||||||
|
const error_msg = response.errors[error];
|
||||||
|
this.errors.push(error_msg);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
Alpine.data("TeamCaptainModal", () => ({
|
||||||
|
success: null,
|
||||||
|
error: null,
|
||||||
|
errors: [],
|
||||||
|
|
||||||
|
async updateCaptain() {
|
||||||
|
let data = serializeJSON(this.$el, null, true);
|
||||||
|
let response = await CTFd.pages.teams.updateTeamSettings(data);
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
window.location.reload();
|
||||||
|
} else {
|
||||||
|
this.success = false;
|
||||||
|
this.error = true;
|
||||||
|
Object.keys(response.errors).map(error => {
|
||||||
|
const error_msg = response.errors[error];
|
||||||
|
this.errors.push(error_msg);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
Alpine.data("TeamInviteModal", () => ({
|
||||||
|
copy() {
|
||||||
|
copyToClipboard(this.$refs.link);
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
Alpine.data("TeamDisbandModal", () => ({
|
||||||
|
errors: [],
|
||||||
|
|
||||||
|
async disbandTeam() {
|
||||||
|
let response = await CTFd.pages.teams.disbandTeam();
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
window.location.reload();
|
||||||
|
} else {
|
||||||
|
this.errors = response.errors[""];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
Alpine.data("CaptainMenu", () => ({
|
||||||
|
captain: false,
|
||||||
|
|
||||||
|
editTeam() {
|
||||||
|
this.teamEditModal = new Modal(document.getElementById("team-edit-modal"));
|
||||||
|
this.teamEditModal.show();
|
||||||
|
},
|
||||||
|
|
||||||
|
chooseCaptain() {
|
||||||
|
this.teamCaptainModal = new Modal(document.getElementById("team-captain-modal"));
|
||||||
|
this.teamCaptainModal.show();
|
||||||
|
},
|
||||||
|
|
||||||
|
async inviteMembers() {
|
||||||
|
const response = await CTFd.pages.teams.getInviteToken();
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
const code = response.data.code;
|
||||||
|
const url = `${window.location.origin}${CTFd.config.urlRoot}/teams/invite?code=${code}`;
|
||||||
|
|
||||||
|
document.querySelector("#team-invite-modal input[name=link]").value = url;
|
||||||
|
this.$store.inviteToken = url;
|
||||||
|
this.teamInviteModal = new Modal(document.getElementById("team-invite-modal"));
|
||||||
|
this.teamInviteModal.show();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
disbandTeam() {
|
||||||
|
this.teamDisbandModal = new Modal(document.getElementById("team-disband-modal"));
|
||||||
|
this.teamDisbandModal.show();
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
Alpine.data("TeamGraphs", () => ({
|
||||||
|
solves: null,
|
||||||
|
fails: null,
|
||||||
|
awards: null,
|
||||||
|
solveCount: 0,
|
||||||
|
failCount: 0,
|
||||||
|
awardCount: 0,
|
||||||
|
|
||||||
|
getSolvePercentage() {
|
||||||
|
return ((this.solveCount / (this.solveCount + this.failCount)) * 100).toFixed(2);
|
||||||
|
},
|
||||||
|
|
||||||
|
getFailPercentage() {
|
||||||
|
return ((this.failCount / (this.solveCount + this.failCount)) * 100).toFixed(2);
|
||||||
|
},
|
||||||
|
|
||||||
|
getCategoryBreakdown() {
|
||||||
|
const categories = [];
|
||||||
|
const breakdown = {};
|
||||||
|
|
||||||
|
this.solves.data.map(solve => {
|
||||||
|
categories.push(solve.challenge.category);
|
||||||
|
});
|
||||||
|
|
||||||
|
categories.forEach(category => {
|
||||||
|
if (category in breakdown) {
|
||||||
|
breakdown[category] += 1;
|
||||||
|
} else {
|
||||||
|
breakdown[category] = 1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const data = [];
|
||||||
|
for (const property in breakdown) {
|
||||||
|
data.push({
|
||||||
|
name: property,
|
||||||
|
count: breakdown[property],
|
||||||
|
percent: (breakdown[property] / categories.length) * 100,
|
||||||
|
color: colorHash(property),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
},
|
||||||
|
|
||||||
|
async init() {
|
||||||
|
this.solves = await CTFd.pages.teams.teamSolves("me");
|
||||||
|
this.fails = await CTFd.pages.teams.teamFails("me");
|
||||||
|
this.awards = await CTFd.pages.teams.teamAwards("me");
|
||||||
|
|
||||||
|
this.solveCount = this.solves.meta.count;
|
||||||
|
this.failCount = this.fails.meta.count;
|
||||||
|
this.awardCount = this.awards.meta.count;
|
||||||
|
|
||||||
|
embed(
|
||||||
|
this.$refs.scoregraph,
|
||||||
|
getUserScoreOption(
|
||||||
|
CTFd.team.id,
|
||||||
|
CTFd.team.name,
|
||||||
|
this.solves.data,
|
||||||
|
this.awards.data
|
||||||
|
)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
Alpine.start();
|
||||||
76
CTFd/themes/core-beta/assets/js/teams/public.js
Normal file
76
CTFd/themes/core-beta/assets/js/teams/public.js
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
import CTFd from "../index";
|
||||||
|
|
||||||
|
import Alpine from "alpinejs";
|
||||||
|
import { colorHash } from "@ctfdio/ctfd-js/ui";
|
||||||
|
import { getOption as getUserScoreOption } from "../utils/graphs/echarts/userscore";
|
||||||
|
import { embed } from "../utils/graphs/echarts";
|
||||||
|
|
||||||
|
window.Alpine = Alpine;
|
||||||
|
|
||||||
|
Alpine.data("TeamGraphs", () => ({
|
||||||
|
solves: null,
|
||||||
|
fails: null,
|
||||||
|
awards: null,
|
||||||
|
solveCount: 0,
|
||||||
|
failCount: 0,
|
||||||
|
awardCount: 0,
|
||||||
|
|
||||||
|
getSolvePercentage() {
|
||||||
|
return ((this.solveCount / (this.solveCount + this.failCount)) * 100).toFixed(2);
|
||||||
|
},
|
||||||
|
|
||||||
|
getFailPercentage() {
|
||||||
|
return ((this.failCount / (this.solveCount + this.failCount)) * 100).toFixed(2);
|
||||||
|
},
|
||||||
|
|
||||||
|
getCategoryBreakdown() {
|
||||||
|
const categories = [];
|
||||||
|
const breakdown = {};
|
||||||
|
|
||||||
|
this.solves.data.map(solve => {
|
||||||
|
categories.push(solve.challenge.category);
|
||||||
|
});
|
||||||
|
|
||||||
|
categories.forEach(category => {
|
||||||
|
if (category in breakdown) {
|
||||||
|
breakdown[category] += 1;
|
||||||
|
} else {
|
||||||
|
breakdown[category] = 1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const data = [];
|
||||||
|
for (const property in breakdown) {
|
||||||
|
data.push({
|
||||||
|
name: property,
|
||||||
|
count: breakdown[property],
|
||||||
|
percent: ((breakdown[property] / categories.length) * 100).toFixed(2),
|
||||||
|
color: colorHash(property),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
},
|
||||||
|
|
||||||
|
async init() {
|
||||||
|
this.solves = await CTFd.pages.teams.teamSolves(window.TEAM.id);
|
||||||
|
this.fails = await CTFd.pages.teams.teamFails(window.TEAM.id);
|
||||||
|
this.awards = await CTFd.pages.teams.teamAwards(window.TEAM.id);
|
||||||
|
|
||||||
|
this.solveCount = this.solves.meta.count;
|
||||||
|
this.failCount = this.fails.meta.count;
|
||||||
|
this.awardCount = this.awards.meta.count;
|
||||||
|
|
||||||
|
embed(
|
||||||
|
this.$refs.scoregraph,
|
||||||
|
getUserScoreOption(
|
||||||
|
window.TEAM.id,
|
||||||
|
window.TEAM.name,
|
||||||
|
this.solves.data,
|
||||||
|
this.awards.data
|
||||||
|
)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
Alpine.start();
|
||||||
12
CTFd/themes/core-beta/assets/js/theme/highlight.js
Normal file
12
CTFd/themes/core-beta/assets/js/theme/highlight.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import CTFd from "../index";
|
||||||
|
import lolight from "lolight";
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
if (
|
||||||
|
// default to true if config is not defined yet
|
||||||
|
!CTFd.config.themeSettings.hasOwnProperty("use_builtin_code_highlighter") ||
|
||||||
|
CTFd.config.themeSettings.use_builtin_code_highlighter === true
|
||||||
|
) {
|
||||||
|
lolight("pre code");
|
||||||
|
}
|
||||||
|
};
|
||||||
27
CTFd/themes/core-beta/assets/js/theme/styles.js
Normal file
27
CTFd/themes/core-beta/assets/js/theme/styles.js
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
export default () => {
|
||||||
|
document.querySelectorAll(".form-control").forEach($el => {
|
||||||
|
$el.addEventListener("onfocus", () => {
|
||||||
|
$el.classList.remove("input-filled-invalid");
|
||||||
|
$el.classList.add("input-filled-valid");
|
||||||
|
});
|
||||||
|
|
||||||
|
$el.addEventListener("onblur", () => {
|
||||||
|
if ($el.nodeValue === "") {
|
||||||
|
$el.classList.remove("input-filled-valid");
|
||||||
|
$el.classList.remove("input-filled-invalid");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if ($el.nodeValue) {
|
||||||
|
$el.classList.add("input-filled-valid");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
document.querySelectorAll(".page-select").forEach($el => {
|
||||||
|
if ($el.nodeValue) {
|
||||||
|
const url = new URL(window.location);
|
||||||
|
url.searchParams.set("page", $el.nodeValue);
|
||||||
|
window.location.href = url.toString();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
12
CTFd/themes/core-beta/assets/js/theme/times.js
Normal file
12
CTFd/themes/core-beta/assets/js/theme/times.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import dayjs from "dayjs";
|
||||||
|
import advancedFormat from "dayjs/plugin/advancedFormat";
|
||||||
|
|
||||||
|
dayjs.extend(advancedFormat);
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
document.querySelectorAll("[data-time]").forEach($el => {
|
||||||
|
const time = $el.getAttribute("data-time");
|
||||||
|
const format = $el.getAttribute("data-time-format") || "MMMM Do, h:mm:ss A";
|
||||||
|
$el.innerText = dayjs(time).format(format);
|
||||||
|
});
|
||||||
|
};
|
||||||
7
CTFd/themes/core-beta/assets/js/users/list.js
Normal file
7
CTFd/themes/core-beta/assets/js/users/list.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import Alpine from "alpinejs";
|
||||||
|
import CTFd from "../index";
|
||||||
|
|
||||||
|
window.CTFd = CTFd;
|
||||||
|
window.Alpine = Alpine;
|
||||||
|
|
||||||
|
Alpine.start();
|
||||||
79
CTFd/themes/core-beta/assets/js/users/private.js
Normal file
79
CTFd/themes/core-beta/assets/js/users/private.js
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
import Alpine from "alpinejs";
|
||||||
|
import CTFd from "../index";
|
||||||
|
import { colorHash } from "@ctfdio/ctfd-js/ui";
|
||||||
|
import { getOption as getUserScoreOption } from "../utils/graphs/echarts/userscore";
|
||||||
|
import { embed } from "../utils/graphs/echarts";
|
||||||
|
|
||||||
|
window.Alpine = Alpine;
|
||||||
|
|
||||||
|
Alpine.data("UserGraphs", () => ({
|
||||||
|
solves: null,
|
||||||
|
fails: null,
|
||||||
|
awards: null,
|
||||||
|
solveCount: 0,
|
||||||
|
failCount: 0,
|
||||||
|
awardCount: 0,
|
||||||
|
|
||||||
|
getSolvePercentage() {
|
||||||
|
return ((this.solveCount / (this.solveCount + this.failCount)) * 100).toFixed(2);
|
||||||
|
},
|
||||||
|
|
||||||
|
getFailPercentage() {
|
||||||
|
return ((this.failCount / (this.solveCount + this.failCount)) * 100).toFixed(2);
|
||||||
|
},
|
||||||
|
|
||||||
|
getCategoryBreakdown() {
|
||||||
|
const categories = [];
|
||||||
|
const breakdown = {};
|
||||||
|
|
||||||
|
this.solves.data.map(solve => {
|
||||||
|
categories.push(solve.challenge.category);
|
||||||
|
});
|
||||||
|
|
||||||
|
categories.forEach(category => {
|
||||||
|
if (category in breakdown) {
|
||||||
|
breakdown[category] += 1;
|
||||||
|
} else {
|
||||||
|
breakdown[category] = 1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const data = [];
|
||||||
|
for (const property in breakdown) {
|
||||||
|
const percent = Number((breakdown[property] / categories.length) * 100).toFixed(
|
||||||
|
2
|
||||||
|
);
|
||||||
|
|
||||||
|
data.push({
|
||||||
|
name: property,
|
||||||
|
count: breakdown[property],
|
||||||
|
color: colorHash(property),
|
||||||
|
percent,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
},
|
||||||
|
|
||||||
|
async init() {
|
||||||
|
this.solves = await CTFd.pages.users.userSolves("me");
|
||||||
|
this.fails = await CTFd.pages.users.userFails("me");
|
||||||
|
this.awards = await CTFd.pages.users.userAwards("me");
|
||||||
|
|
||||||
|
this.solveCount = this.solves.meta.count;
|
||||||
|
this.failCount = this.fails.meta.count;
|
||||||
|
this.awardCount = this.awards.meta.count;
|
||||||
|
|
||||||
|
embed(
|
||||||
|
this.$refs.scoregraph,
|
||||||
|
getUserScoreOption(
|
||||||
|
CTFd.user.id,
|
||||||
|
CTFd.user.name,
|
||||||
|
this.solves.data,
|
||||||
|
this.awards.data
|
||||||
|
)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
Alpine.start();
|
||||||
79
CTFd/themes/core-beta/assets/js/users/public.js
Normal file
79
CTFd/themes/core-beta/assets/js/users/public.js
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
import CTFd from "../index";
|
||||||
|
|
||||||
|
import Alpine from "alpinejs";
|
||||||
|
import { colorHash } from "@ctfdio/ctfd-js/ui";
|
||||||
|
import { getOption as getUserScoreOption } from "../utils/graphs/echarts/userscore";
|
||||||
|
import { embed } from "../utils/graphs/echarts";
|
||||||
|
|
||||||
|
window.Alpine = Alpine;
|
||||||
|
|
||||||
|
Alpine.data("UserGraphs", () => ({
|
||||||
|
solves: null,
|
||||||
|
fails: null,
|
||||||
|
awards: null,
|
||||||
|
solveCount: 0,
|
||||||
|
failCount: 0,
|
||||||
|
awardCount: 0,
|
||||||
|
|
||||||
|
getSolvePercentage() {
|
||||||
|
return ((this.solveCount / (this.solveCount + this.failCount)) * 100).toFixed(2);
|
||||||
|
},
|
||||||
|
|
||||||
|
getFailPercentage() {
|
||||||
|
return ((this.failCount / (this.solveCount + this.failCount)) * 100).toFixed(2);
|
||||||
|
},
|
||||||
|
|
||||||
|
getCategoryBreakdown() {
|
||||||
|
const categories = [];
|
||||||
|
const breakdown = {};
|
||||||
|
|
||||||
|
this.solves.data.map(solve => {
|
||||||
|
categories.push(solve.challenge.category);
|
||||||
|
});
|
||||||
|
|
||||||
|
categories.forEach(category => {
|
||||||
|
if (category in breakdown) {
|
||||||
|
breakdown[category] += 1;
|
||||||
|
} else {
|
||||||
|
breakdown[category] = 1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const data = [];
|
||||||
|
for (const property in breakdown) {
|
||||||
|
const percent = Number((breakdown[property] / categories.length) * 100).toFixed(
|
||||||
|
2
|
||||||
|
);
|
||||||
|
data.push({
|
||||||
|
name: property,
|
||||||
|
count: breakdown[property],
|
||||||
|
color: colorHash(property),
|
||||||
|
percent,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
},
|
||||||
|
|
||||||
|
async init() {
|
||||||
|
this.solves = await CTFd.pages.users.userSolves(window.USER.id);
|
||||||
|
this.fails = await CTFd.pages.users.userFails(window.USER.id);
|
||||||
|
this.awards = await CTFd.pages.users.userAwards(window.USER.id);
|
||||||
|
|
||||||
|
this.solveCount = this.solves.meta.count;
|
||||||
|
this.failCount = this.fails.meta.count;
|
||||||
|
this.awardCount = this.awards.meta.count;
|
||||||
|
|
||||||
|
embed(
|
||||||
|
this.$refs.scoregraph,
|
||||||
|
getUserScoreOption(
|
||||||
|
window.USER.id,
|
||||||
|
window.USER.name,
|
||||||
|
this.solves.data,
|
||||||
|
this.awards.data
|
||||||
|
)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
Alpine.start();
|
||||||
8
CTFd/themes/core-beta/assets/js/utils/alerts.js
Normal file
8
CTFd/themes/core-beta/assets/js/utils/alerts.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import { Alert } from "bootstrap";
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
const alertList = [].slice.call(document.querySelectorAll(".alert"));
|
||||||
|
alertList.map(function (element) {
|
||||||
|
return new Alert(element);
|
||||||
|
});
|
||||||
|
};
|
||||||
15
CTFd/themes/core-beta/assets/js/utils/clipboard.js
Normal file
15
CTFd/themes/core-beta/assets/js/utils/clipboard.js
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import { Tooltip } from "bootstrap";
|
||||||
|
|
||||||
|
export function copyToClipboard($input) {
|
||||||
|
const tooltip = new Tooltip($input, {
|
||||||
|
title: "Copied!",
|
||||||
|
trigger: "manual",
|
||||||
|
});
|
||||||
|
|
||||||
|
navigator.clipboard.writeText($input.value).then(() => {
|
||||||
|
tooltip.show();
|
||||||
|
setTimeout(() => {
|
||||||
|
tooltip.hide();
|
||||||
|
}, 1500);
|
||||||
|
});
|
||||||
|
}
|
||||||
8
CTFd/themes/core-beta/assets/js/utils/collapse.js
Normal file
8
CTFd/themes/core-beta/assets/js/utils/collapse.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import { Collapse } from "bootstrap";
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
const collapseList = [].slice.call(document.querySelectorAll(".collapse"));
|
||||||
|
collapseList.map(element => {
|
||||||
|
return new Collapse(element, { toggle: false });
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
import { colorHash } from "@ctfdio/ctfd-js/ui";
|
||||||
|
|
||||||
|
export function getOption(solves) {
|
||||||
|
let option = {
|
||||||
|
title: {
|
||||||
|
left: "center",
|
||||||
|
text: "Category Breakdown",
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: "item",
|
||||||
|
},
|
||||||
|
toolbox: {
|
||||||
|
show: true,
|
||||||
|
feature: {
|
||||||
|
saveAsImage: {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
type: "scroll",
|
||||||
|
orient: "vertical",
|
||||||
|
top: "middle",
|
||||||
|
right: 0,
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: "Category Breakdown",
|
||||||
|
type: "pie",
|
||||||
|
radius: ["30%", "50%"],
|
||||||
|
avoidLabelOverlap: false,
|
||||||
|
label: {
|
||||||
|
show: false,
|
||||||
|
position: "center",
|
||||||
|
},
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
formatter: function (data) {
|
||||||
|
return `${data.percent}% (${data.value})`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
labelLine: {
|
||||||
|
show: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
emphasis: {
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: "center",
|
||||||
|
textStyle: {
|
||||||
|
fontSize: "14",
|
||||||
|
fontWeight: "normal",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
emphasis: {
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
fontSize: "30",
|
||||||
|
fontWeight: "bold",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
labelLine: {
|
||||||
|
show: false,
|
||||||
|
},
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
const categories = [];
|
||||||
|
|
||||||
|
for (let i = 0; i < solves.length; i++) {
|
||||||
|
categories.push(solves[i].challenge.category);
|
||||||
|
}
|
||||||
|
|
||||||
|
const keys = categories.filter((elem, pos) => {
|
||||||
|
return categories.indexOf(elem) == pos;
|
||||||
|
});
|
||||||
|
|
||||||
|
const counts = [];
|
||||||
|
for (let i = 0; i < keys.length; i++) {
|
||||||
|
let count = 0;
|
||||||
|
for (let x = 0; x < categories.length; x++) {
|
||||||
|
if (categories[x] == keys[i]) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
counts.push(count);
|
||||||
|
}
|
||||||
|
|
||||||
|
keys.forEach((category, index) => {
|
||||||
|
option.legend.data.push(category);
|
||||||
|
option.series[0].data.push({
|
||||||
|
value: counts[index],
|
||||||
|
name: category,
|
||||||
|
itemStyle: { color: colorHash(category) },
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return option;
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import * as echarts from "echarts/core";
|
||||||
|
import { LineChart } from "echarts/charts";
|
||||||
|
import {
|
||||||
|
TitleComponent,
|
||||||
|
TooltipComponent,
|
||||||
|
GridComponent,
|
||||||
|
DatasetComponent,
|
||||||
|
TransformComponent,
|
||||||
|
LegendComponent,
|
||||||
|
ToolboxComponent,
|
||||||
|
DataZoomComponent,
|
||||||
|
} from "echarts/components";
|
||||||
|
// Features like Universal Transition and Label Layout
|
||||||
|
import { LabelLayout, UniversalTransition } from "echarts/features";
|
||||||
|
// Import the Canvas renderer
|
||||||
|
// Note that introducing the CanvasRenderer or SVGRenderer is a required step
|
||||||
|
import { CanvasRenderer } from "echarts/renderers";
|
||||||
|
|
||||||
|
// Register the required components
|
||||||
|
echarts.use([
|
||||||
|
LineChart,
|
||||||
|
TitleComponent,
|
||||||
|
TooltipComponent,
|
||||||
|
GridComponent,
|
||||||
|
DatasetComponent,
|
||||||
|
TransformComponent,
|
||||||
|
LegendComponent,
|
||||||
|
ToolboxComponent,
|
||||||
|
DataZoomComponent,
|
||||||
|
LabelLayout,
|
||||||
|
UniversalTransition,
|
||||||
|
CanvasRenderer,
|
||||||
|
]);
|
||||||
|
|
||||||
|
export function embed(target, option) {
|
||||||
|
let chart = echarts.init(target);
|
||||||
|
chart.setOption(option);
|
||||||
|
|
||||||
|
window.addEventListener("resize", () => {
|
||||||
|
if (chart) {
|
||||||
|
chart.resize();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
import { colorHash } from "@ctfdio/ctfd-js/ui";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
|
export function cumulativeSum(arr) {
|
||||||
|
let result = arr.concat();
|
||||||
|
for (let i = 0; i < arr.length; i++) {
|
||||||
|
result[i] = arr.slice(0, i + 1).reduce(function (p, i) {
|
||||||
|
return p + i;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getOption(mode, places) {
|
||||||
|
let option = {
|
||||||
|
title: {
|
||||||
|
left: "center",
|
||||||
|
text: "Top 10 " + (mode === "teams" ? "Teams" : "Users"),
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: "axis",
|
||||||
|
axisPointer: {
|
||||||
|
type: "cross",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
type: "scroll",
|
||||||
|
orient: "horizontal",
|
||||||
|
align: "left",
|
||||||
|
bottom: 35,
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
toolbox: {
|
||||||
|
feature: {
|
||||||
|
dataZoom: {
|
||||||
|
yAxisIndex: "none",
|
||||||
|
},
|
||||||
|
saveAsImage: {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
containLabel: true,
|
||||||
|
},
|
||||||
|
xAxis: [
|
||||||
|
{
|
||||||
|
type: "time",
|
||||||
|
boundaryGap: false,
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
yAxis: [
|
||||||
|
{
|
||||||
|
type: "value",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
dataZoom: [
|
||||||
|
{
|
||||||
|
id: "dataZoomX",
|
||||||
|
type: "slider",
|
||||||
|
xAxisIndex: [0],
|
||||||
|
filterMode: "filter",
|
||||||
|
height: 20,
|
||||||
|
top: 35,
|
||||||
|
fillerColor: "rgba(233, 236, 241, 0.4)",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
series: [],
|
||||||
|
};
|
||||||
|
|
||||||
|
const teams = Object.keys(places);
|
||||||
|
for (let i = 0; i < teams.length; i++) {
|
||||||
|
const team_score = [];
|
||||||
|
const times = [];
|
||||||
|
for (let j = 0; j < places[teams[i]]["solves"].length; j++) {
|
||||||
|
team_score.push(places[teams[i]]["solves"][j].value);
|
||||||
|
const date = dayjs(places[teams[i]]["solves"][j].date);
|
||||||
|
times.push(date.toDate());
|
||||||
|
}
|
||||||
|
|
||||||
|
const total_scores = cumulativeSum(team_score);
|
||||||
|
let scores = times.map(function (e, i) {
|
||||||
|
return [e, total_scores[i]];
|
||||||
|
});
|
||||||
|
|
||||||
|
option.legend.data.push(places[teams[i]]["name"]);
|
||||||
|
|
||||||
|
const data = {
|
||||||
|
name: places[teams[i]]["name"],
|
||||||
|
type: "line",
|
||||||
|
label: {
|
||||||
|
normal: {
|
||||||
|
position: "top",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: colorHash(places[teams[i]]["name"] + places[teams[i]]["id"]),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data: scores,
|
||||||
|
};
|
||||||
|
option.series.push(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
return option;
|
||||||
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
export function getOption(solves, fails) {
|
||||||
|
let option = {
|
||||||
|
title: {
|
||||||
|
left: "center",
|
||||||
|
text: "Solve Percentages",
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: "item",
|
||||||
|
},
|
||||||
|
toolbox: {
|
||||||
|
show: true,
|
||||||
|
feature: {
|
||||||
|
saveAsImage: {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
orient: "vertical",
|
||||||
|
top: "middle",
|
||||||
|
right: 0,
|
||||||
|
data: ["Fails", "Solves"],
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: "Solve Percentages",
|
||||||
|
type: "pie",
|
||||||
|
radius: ["30%", "50%"],
|
||||||
|
avoidLabelOverlap: false,
|
||||||
|
label: {
|
||||||
|
show: false,
|
||||||
|
position: "center",
|
||||||
|
},
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
formatter: function (data) {
|
||||||
|
return `${data.name} - ${data.value} (${data.percent}%)`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
labelLine: {
|
||||||
|
show: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
emphasis: {
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: "center",
|
||||||
|
textStyle: {
|
||||||
|
fontSize: "14",
|
||||||
|
fontWeight: "normal",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
emphasis: {
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
fontSize: "30",
|
||||||
|
fontWeight: "bold",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
labelLine: {
|
||||||
|
show: false,
|
||||||
|
},
|
||||||
|
data: [
|
||||||
|
{
|
||||||
|
value: fails,
|
||||||
|
name: "Fails",
|
||||||
|
itemStyle: { color: "rgb(207, 38, 0)" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: solves,
|
||||||
|
name: "Solves",
|
||||||
|
itemStyle: { color: "rgb(0, 209, 64)" },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
return option;
|
||||||
|
}
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
import { colorHash } from "@ctfdio/ctfd-js/ui";
|
||||||
|
import { cumulativeSum } from "./scoreboard";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
|
export function getOption(id, name, solves, awards) {
|
||||||
|
let option = {
|
||||||
|
title: {
|
||||||
|
left: "center",
|
||||||
|
text: "Score over Time",
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: "axis",
|
||||||
|
axisPointer: {
|
||||||
|
type: "cross",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
type: "scroll",
|
||||||
|
orient: "horizontal",
|
||||||
|
align: "left",
|
||||||
|
bottom: 0,
|
||||||
|
data: [name],
|
||||||
|
},
|
||||||
|
toolbox: {
|
||||||
|
feature: {
|
||||||
|
saveAsImage: {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
containLabel: true,
|
||||||
|
},
|
||||||
|
xAxis: [
|
||||||
|
{
|
||||||
|
type: "category",
|
||||||
|
boundaryGap: false,
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
yAxis: [
|
||||||
|
{
|
||||||
|
type: "value",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
dataZoom: [
|
||||||
|
{
|
||||||
|
id: "dataZoomX",
|
||||||
|
type: "slider",
|
||||||
|
xAxisIndex: [0],
|
||||||
|
filterMode: "filter",
|
||||||
|
height: 20,
|
||||||
|
top: 35,
|
||||||
|
fillerColor: "rgba(233, 236, 241, 0.4)",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
series: [],
|
||||||
|
};
|
||||||
|
|
||||||
|
const times = [];
|
||||||
|
const scores = [];
|
||||||
|
const total = solves.concat(awards);
|
||||||
|
|
||||||
|
total.sort((a, b) => {
|
||||||
|
return new Date(a.date) - new Date(b.date);
|
||||||
|
});
|
||||||
|
|
||||||
|
for (let i = 0; i < total.length; i++) {
|
||||||
|
const date = dayjs(total[i].date);
|
||||||
|
times.push(date.toDate());
|
||||||
|
try {
|
||||||
|
scores.push(total[i].challenge.value);
|
||||||
|
} catch (e) {
|
||||||
|
scores.push(total[i].value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
times.forEach(time => {
|
||||||
|
option.xAxis[0].data.push(time);
|
||||||
|
});
|
||||||
|
|
||||||
|
option.series.push({
|
||||||
|
name: name,
|
||||||
|
type: "line",
|
||||||
|
label: {
|
||||||
|
normal: {
|
||||||
|
show: true,
|
||||||
|
position: "top",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
areaStyle: {
|
||||||
|
normal: {
|
||||||
|
color: colorHash(name + id),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: colorHash(name + id),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data: cumulativeSum(scores),
|
||||||
|
});
|
||||||
|
return option;
|
||||||
|
}
|
||||||
105
CTFd/themes/core-beta/assets/js/utils/graphs/vega/categories.js
Normal file
105
CTFd/themes/core-beta/assets/js/utils/graphs/vega/categories.js
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
export function getSpec(description, values) {
|
||||||
|
return {
|
||||||
|
$schema: "https://vega.github.io/schema/vega-lite/v5.json",
|
||||||
|
description: description,
|
||||||
|
data: {
|
||||||
|
values: values,
|
||||||
|
},
|
||||||
|
width: "container",
|
||||||
|
|
||||||
|
layer: [
|
||||||
|
{
|
||||||
|
params: [
|
||||||
|
{
|
||||||
|
name: "category",
|
||||||
|
select: {
|
||||||
|
type: "point",
|
||||||
|
fields: ["category"],
|
||||||
|
},
|
||||||
|
bind: "legend",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
mark: {
|
||||||
|
type: "arc",
|
||||||
|
innerRadius: 50,
|
||||||
|
outerRadius: 95,
|
||||||
|
stroke: "#fff",
|
||||||
|
},
|
||||||
|
encoding: {
|
||||||
|
opacity: {
|
||||||
|
condition: {
|
||||||
|
param: "category",
|
||||||
|
value: 1,
|
||||||
|
},
|
||||||
|
value: 0.2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
mark: {
|
||||||
|
type: "text",
|
||||||
|
radius: 105,
|
||||||
|
},
|
||||||
|
encoding: {
|
||||||
|
text: {
|
||||||
|
field: "value",
|
||||||
|
type: "quantitative",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
encoding: {
|
||||||
|
theta: {
|
||||||
|
field: "value",
|
||||||
|
type: "quantitative",
|
||||||
|
stack: true,
|
||||||
|
},
|
||||||
|
color: {
|
||||||
|
field: "category",
|
||||||
|
type: "nominal",
|
||||||
|
// scale: {
|
||||||
|
// domain: ["Solves", "Fails"],
|
||||||
|
// range: ["#00d13f", "#cf2600"],
|
||||||
|
// },
|
||||||
|
legend: {
|
||||||
|
orient: "bottom",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getValues(solves) {
|
||||||
|
const solvesData = solves.data;
|
||||||
|
const categories = [];
|
||||||
|
|
||||||
|
for (let i = 0; i < solvesData.length; i++) {
|
||||||
|
categories.push(solvesData[i].challenge.category);
|
||||||
|
}
|
||||||
|
|
||||||
|
const keys = categories.filter((elem, pos) => {
|
||||||
|
return categories.indexOf(elem) == pos;
|
||||||
|
});
|
||||||
|
|
||||||
|
const counts = [];
|
||||||
|
for (let i = 0; i < keys.length; i++) {
|
||||||
|
let count = 0;
|
||||||
|
for (let x = 0; x < categories.length; x++) {
|
||||||
|
if (categories[x] == keys[i]) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
counts.push(count);
|
||||||
|
}
|
||||||
|
|
||||||
|
let values = [];
|
||||||
|
|
||||||
|
keys.forEach((category, index) => {
|
||||||
|
values.push({
|
||||||
|
category: category,
|
||||||
|
value: counts[index],
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return values;
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
import { cumulativeSum } from "../math";
|
||||||
|
|
||||||
|
export function getSpec(description, values) {
|
||||||
|
let spec = {
|
||||||
|
$schema: "https://vega.github.io/schema/vega-lite/v5.json",
|
||||||
|
description: description,
|
||||||
|
data: { values: values },
|
||||||
|
mark: "line",
|
||||||
|
width: "container",
|
||||||
|
encoding: {
|
||||||
|
x: { field: "date", type: "temporal" },
|
||||||
|
y: { field: "score", type: "quantitative" },
|
||||||
|
color: {
|
||||||
|
field: "name",
|
||||||
|
type: "nominal",
|
||||||
|
legend: {
|
||||||
|
orient: "bottom",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
return spec;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getValues(scoreboardDetail) {
|
||||||
|
const teams = Object.keys(scoreboardDetail);
|
||||||
|
let values = [];
|
||||||
|
|
||||||
|
for (let i = 0; i < teams.length; i++) {
|
||||||
|
const team = scoreboardDetail[teams[i]];
|
||||||
|
const team_score = [];
|
||||||
|
const times = [];
|
||||||
|
for (let j = 0; j < team["solves"].length; j++) {
|
||||||
|
team_score.push(team["solves"][j].value);
|
||||||
|
times.push(team["solves"][j].date);
|
||||||
|
// const date = dayjs(team["solves"][j].date);
|
||||||
|
// times.push(date.toDate());
|
||||||
|
}
|
||||||
|
|
||||||
|
const total_scores = cumulativeSum(team_score);
|
||||||
|
const team_name = team["name"];
|
||||||
|
let scores = times.map(function (e, i) {
|
||||||
|
return {
|
||||||
|
name: team_name,
|
||||||
|
score: total_scores[i],
|
||||||
|
date: e,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
values = values.concat(scores);
|
||||||
|
}
|
||||||
|
|
||||||
|
return values;
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
export function getSpec(description, values) {
|
||||||
|
return {
|
||||||
|
$schema: "https://vega.github.io/schema/vega-lite/v5.json",
|
||||||
|
description: description,
|
||||||
|
data: {
|
||||||
|
values: values,
|
||||||
|
},
|
||||||
|
width: "container",
|
||||||
|
|
||||||
|
layer: [
|
||||||
|
{
|
||||||
|
params: [
|
||||||
|
{
|
||||||
|
name: "category",
|
||||||
|
select: {
|
||||||
|
type: "point",
|
||||||
|
fields: ["category"],
|
||||||
|
},
|
||||||
|
bind: "legend",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
mark: {
|
||||||
|
type: "arc",
|
||||||
|
innerRadius: 50,
|
||||||
|
outerRadius: 95,
|
||||||
|
stroke: "#fff",
|
||||||
|
},
|
||||||
|
encoding: {
|
||||||
|
opacity: {
|
||||||
|
condition: {
|
||||||
|
param: "category",
|
||||||
|
value: 1,
|
||||||
|
},
|
||||||
|
value: 0.2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
mark: {
|
||||||
|
type: "text",
|
||||||
|
radius: 105,
|
||||||
|
},
|
||||||
|
encoding: {
|
||||||
|
text: {
|
||||||
|
field: "value",
|
||||||
|
type: "quantitative",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
encoding: {
|
||||||
|
theta: {
|
||||||
|
field: "value",
|
||||||
|
type: "quantitative",
|
||||||
|
stack: true,
|
||||||
|
},
|
||||||
|
color: {
|
||||||
|
field: "category",
|
||||||
|
type: "nominal",
|
||||||
|
scale: {
|
||||||
|
domain: ["Solves", "Fails"],
|
||||||
|
range: ["#00d13f", "#cf2600"],
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
orient: "bottom",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getValues(solves, fails) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
category: "Solves",
|
||||||
|
value: solves.meta.count,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
category: "Fails",
|
||||||
|
value: fails.meta.count,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
import { cumulativeSum } from "../math";
|
||||||
|
|
||||||
|
export function getSpec(description, values) {
|
||||||
|
return {
|
||||||
|
$schema: "https://vega.github.io/schema/vega-lite/v5.json",
|
||||||
|
description: description,
|
||||||
|
data: {
|
||||||
|
values: values,
|
||||||
|
},
|
||||||
|
width: "container",
|
||||||
|
mark: {
|
||||||
|
type: "area",
|
||||||
|
line: true,
|
||||||
|
point: true,
|
||||||
|
// interpolate: "step-after",
|
||||||
|
tooltip: { content: "data", nearest: true },
|
||||||
|
},
|
||||||
|
encoding: {
|
||||||
|
x: { field: "time", type: "temporal" },
|
||||||
|
y: { field: "score", type: "quantitative" },
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getValues(solves, awards) {
|
||||||
|
const times = [];
|
||||||
|
let scores = [];
|
||||||
|
const solvesData2 = solves.data;
|
||||||
|
const awardsData = awards.data;
|
||||||
|
const total = solvesData2.concat(awardsData);
|
||||||
|
|
||||||
|
total.sort((a, b) => {
|
||||||
|
return new Date(a.date) - new Date(b.date);
|
||||||
|
});
|
||||||
|
|
||||||
|
for (let i = 0; i < total.length; i++) {
|
||||||
|
// const date = dayjs(total[i].date);
|
||||||
|
// times.push(date.toDate());
|
||||||
|
const date = total[i].date;
|
||||||
|
times.push(date);
|
||||||
|
try {
|
||||||
|
scores.push(total[i].challenge.value);
|
||||||
|
} catch (e) {
|
||||||
|
scores.push(total[i].value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
scores = cumulativeSum(scores);
|
||||||
|
|
||||||
|
let values = [];
|
||||||
|
times.forEach((time, index) => {
|
||||||
|
// option.xAxis[0].data.push(time);
|
||||||
|
values.push({
|
||||||
|
time: time,
|
||||||
|
score: scores[index],
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return values;
|
||||||
|
}
|
||||||
9
CTFd/themes/core-beta/assets/js/utils/math.js
Normal file
9
CTFd/themes/core-beta/assets/js/utils/math.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
export function cumulativeSum(arr) {
|
||||||
|
let result = arr.concat();
|
||||||
|
for (let i = 0; i < arr.length; i++) {
|
||||||
|
result[i] = arr.slice(0, i + 1).reduce(function (p, i) {
|
||||||
|
return p + i;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import Alpine from "alpinejs";
|
||||||
|
import { Modal } from "bootstrap";
|
||||||
|
|
||||||
|
import CTFd from "../../index";
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
Alpine.store("modal", { title: "", html: "" });
|
||||||
|
|
||||||
|
CTFd._functions.events.eventAlert = data => {
|
||||||
|
Alpine.store("modal", data);
|
||||||
|
let modal = new Modal(document.querySelector("[x-ref='modal']"));
|
||||||
|
// TODO: Get rid of this private attribute access
|
||||||
|
// See https://github.com/twbs/bootstrap/issues/31266
|
||||||
|
modal._element.addEventListener(
|
||||||
|
"hidden.bs.modal",
|
||||||
|
event => {
|
||||||
|
CTFd._functions.events.eventRead(data.id);
|
||||||
|
},
|
||||||
|
{ once: true }
|
||||||
|
);
|
||||||
|
modal.show();
|
||||||
|
};
|
||||||
|
};
|
||||||
19
CTFd/themes/core-beta/assets/js/utils/notifications/read.js
Normal file
19
CTFd/themes/core-beta/assets/js/utils/notifications/read.js
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import Alpine from "alpinejs";
|
||||||
|
import CTFd from "../../index";
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
CTFd._functions.events.eventCount = count => {
|
||||||
|
Alpine.store("unread_count", count);
|
||||||
|
};
|
||||||
|
|
||||||
|
CTFd._functions.events.eventRead = eventId => {
|
||||||
|
CTFd.events.counter.read.add(eventId);
|
||||||
|
let count = CTFd.events.counter.unread.getAll().length;
|
||||||
|
CTFd.events.controller.broadcast("counter", { count: count });
|
||||||
|
Alpine.store("unread_count", count);
|
||||||
|
};
|
||||||
|
|
||||||
|
document.addEventListener("alpine:init", () => {
|
||||||
|
CTFd._functions.events.eventCount(CTFd.events.counter.unread.getAll().length);
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import Alpine from "alpinejs";
|
||||||
|
import { Toast } from "bootstrap";
|
||||||
|
import CTFd from "../../index";
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
Alpine.store("toast", { title: "", html: "" });
|
||||||
|
|
||||||
|
CTFd._functions.events.eventToast = data => {
|
||||||
|
Alpine.store("toast", data);
|
||||||
|
let toast = new Toast(document.querySelector("[x-ref='toast']"));
|
||||||
|
// TODO: Get rid of this private attribute access
|
||||||
|
// See https://github.com/twbs/bootstrap/issues/31266
|
||||||
|
let close = toast._element.querySelector("[data-bs-dismiss='toast']");
|
||||||
|
let handler = event => {
|
||||||
|
CTFd._functions.events.eventRead(data.id);
|
||||||
|
};
|
||||||
|
close.addEventListener("click", handler, { once: true });
|
||||||
|
toast._element.addEventListener(
|
||||||
|
"hidden.bs.toast",
|
||||||
|
event => {
|
||||||
|
close.removeEventListener("click", handler);
|
||||||
|
},
|
||||||
|
{ once: true }
|
||||||
|
);
|
||||||
|
|
||||||
|
toast.show();
|
||||||
|
};
|
||||||
|
};
|
||||||
10
CTFd/themes/core-beta/assets/js/utils/tooltips.js
Normal file
10
CTFd/themes/core-beta/assets/js/utils/tooltips.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import { Tooltip } from "bootstrap";
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
const tooltipList = [].slice.call(
|
||||||
|
document.querySelectorAll('[data-bs-toggle="tooltip"]')
|
||||||
|
);
|
||||||
|
tooltipList.map(element => {
|
||||||
|
return new Tooltip(element);
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
/* Challenge styles
|
||||||
|
-------------------------------------------------- */
|
||||||
|
|
||||||
|
.challenge-desc {
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
|
||||||
|
img {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.challenge-button {
|
||||||
|
box-shadow: 3px 3px 3px var(--bs-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.challenge-solved {
|
||||||
|
background-color: #37d63e !important;
|
||||||
|
opacity: 0.6;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
/* Graph styles
|
||||||
|
-------------------------------------------------- */
|
||||||
|
|
||||||
|
#score-graph {
|
||||||
|
min-height: 400px;
|
||||||
|
display: block;
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
#solves-graph {
|
||||||
|
display: block;
|
||||||
|
height: 350px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#keys-pie-graph {
|
||||||
|
min-height: 400px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
#categories-pie-graph {
|
||||||
|
min-height: 400px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
/* Jumbotron styles
|
||||||
|
-------------------------------------------------- */
|
||||||
|
|
||||||
|
// Move down content because we have a fixed navbar that is 3.5rem tall
|
||||||
|
main {
|
||||||
|
padding-top: 3.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jumbotron {
|
||||||
|
padding: 2rem 1rem;
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
background-color: var(--bs-dark);
|
||||||
|
color: var(--bs-white);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 576px) {
|
||||||
|
.jumbotron {
|
||||||
|
padding: 4rem 2rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// @media (min-width: 768px) {
|
||||||
|
// .jumbotron {
|
||||||
|
// // I kind of like this, but it could be discussed
|
||||||
|
// clip-path: polygon(0 0, 100% 0, 100% 90%, 0% 100%);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
/* Sticky footer styles
|
||||||
|
-------------------------------------------------- */
|
||||||
|
html {
|
||||||
|
position: relative;
|
||||||
|
min-height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
main {
|
||||||
|
/* Margin bottom by footer height */
|
||||||
|
margin-bottom: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
position: absolute;
|
||||||
|
|
||||||
|
/* prevent scrollbars from showing on pages that don't use the full page height */
|
||||||
|
bottom: 1px;
|
||||||
|
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
/* Set the fixed height of the footer here */
|
||||||
|
height: 60px;
|
||||||
|
|
||||||
|
/* Vertically center the text there */
|
||||||
|
line-height: 60px;
|
||||||
|
|
||||||
|
/* Avoid covering things */
|
||||||
|
z-index: -20;
|
||||||
|
|
||||||
|
/*background-color: #f5f5f5;*/
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
/* Table styles
|
||||||
|
-------------------------------------------------- */
|
||||||
|
|
||||||
|
// Center text in tables, after the first cell
|
||||||
|
// Override with text-center on cells
|
||||||
|
.table tr > td:not(:first-of-type) {
|
||||||
|
text-align: center !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Vertically center text in cells
|
||||||
|
.table td,
|
||||||
|
th {
|
||||||
|
vertical-align: middle !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add some default spacing
|
||||||
|
.table > tbody > tr > td {
|
||||||
|
padding: 0.8rem 1rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove border line from thead of all tables
|
||||||
|
.table > tbody {
|
||||||
|
border-top: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add some padding from the edge of table
|
||||||
|
.table > thead > tr > td:first-of-type {
|
||||||
|
padding-left: 1rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table > thead > th {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
.award-icon {
|
||||||
|
font-family: "Font Awesome 6 Free";
|
||||||
|
font-weight: 900;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
display: inline-block;
|
||||||
|
font-style: normal;
|
||||||
|
font-variant: normal;
|
||||||
|
text-rendering: auto;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.award-shield:before {
|
||||||
|
content: "\f3ed";
|
||||||
|
}
|
||||||
|
.award-bug:before {
|
||||||
|
content: "\f188";
|
||||||
|
}
|
||||||
|
.award-crown:before {
|
||||||
|
content: "\f521";
|
||||||
|
}
|
||||||
|
.award-crosshairs:before {
|
||||||
|
content: "\f05b";
|
||||||
|
}
|
||||||
|
.award-ban:before {
|
||||||
|
content: "\f05e";
|
||||||
|
}
|
||||||
|
.award-brain:before {
|
||||||
|
content: "\f5dc";
|
||||||
|
}
|
||||||
|
.award-lightning:before {
|
||||||
|
content: "\f0e7";
|
||||||
|
}
|
||||||
|
.award-code:before {
|
||||||
|
content: "\f121";
|
||||||
|
}
|
||||||
|
.award-cowboy:before {
|
||||||
|
content: "\f8c0";
|
||||||
|
}
|
||||||
|
.award-angry:before {
|
||||||
|
content: "\f556";
|
||||||
|
}
|
||||||
@@ -0,0 +1,511 @@
|
|||||||
|
$flags: (
|
||||||
|
ad: "🇦🇩",
|
||||||
|
// Andorra
|
||||||
|
ae: "🇦🇪",
|
||||||
|
// United Arab Emirates
|
||||||
|
af: "🇦🇫",
|
||||||
|
// Afghanistan
|
||||||
|
ag: "🇦🇬",
|
||||||
|
// Antigua and Barbuda
|
||||||
|
ai: "🇦🇮",
|
||||||
|
// Anguilla
|
||||||
|
al: "🇦🇱",
|
||||||
|
// Albania
|
||||||
|
am: "🇦🇲",
|
||||||
|
// Armenia
|
||||||
|
ao: "🇦🇴",
|
||||||
|
// Angola
|
||||||
|
aq: "🇦🇶",
|
||||||
|
// Antarctica
|
||||||
|
ar: "🇦🇷",
|
||||||
|
// Argentina
|
||||||
|
as: "🇦🇸",
|
||||||
|
// American Samoa
|
||||||
|
at: "🇦🇹",
|
||||||
|
// Austria
|
||||||
|
au: "🇦🇺",
|
||||||
|
// Australia
|
||||||
|
aw: "🇦🇼",
|
||||||
|
// Aruba
|
||||||
|
ax: "🇦🇽",
|
||||||
|
// Åland Islands
|
||||||
|
az: "🇦🇿",
|
||||||
|
// Azerbaijan
|
||||||
|
ba: "🇧🇦",
|
||||||
|
// Bosnia and Herzegovina
|
||||||
|
bb: "🇧🇧",
|
||||||
|
// Barbados
|
||||||
|
bd: "🇧🇩",
|
||||||
|
// Bangladesh
|
||||||
|
be: "🇧🇪",
|
||||||
|
// Belgium
|
||||||
|
bf: "🇧🇫",
|
||||||
|
// Burkina Faso
|
||||||
|
bg: "🇧🇬",
|
||||||
|
// Bulgaria
|
||||||
|
bh: "🇧🇭",
|
||||||
|
// Bahrain
|
||||||
|
bi: "🇧🇮",
|
||||||
|
// Burundi
|
||||||
|
bj: "🇧🇯",
|
||||||
|
// Benin
|
||||||
|
bl: "🇧🇱",
|
||||||
|
// Saint Barthélemy
|
||||||
|
bm: "🇧🇲",
|
||||||
|
// Bermuda
|
||||||
|
bn: "🇧🇳",
|
||||||
|
// Brunei Darussalam
|
||||||
|
bo: "🇧🇴",
|
||||||
|
// Bolivia
|
||||||
|
bq: "🇧🇶",
|
||||||
|
// Bonaire, Sint Eustatius and Saba
|
||||||
|
br: "🇧🇷",
|
||||||
|
// Brazil
|
||||||
|
bs: "🇧🇸",
|
||||||
|
// Bahamas
|
||||||
|
bt: "🇧🇹",
|
||||||
|
// Bhutan
|
||||||
|
bv: "🇧🇻",
|
||||||
|
// Bouvet Island
|
||||||
|
bw: "🇧🇼",
|
||||||
|
// Botswana
|
||||||
|
by: "🇧🇾",
|
||||||
|
// Belarus
|
||||||
|
bz: "🇧🇿",
|
||||||
|
// Belize
|
||||||
|
ca: "🇨🇦",
|
||||||
|
// Canada
|
||||||
|
cc: "🇨🇨",
|
||||||
|
// Cocos (Keeling) Islands
|
||||||
|
cd: "🇨🇩",
|
||||||
|
// Congo
|
||||||
|
cf: "🇨🇫",
|
||||||
|
// Central African Republic
|
||||||
|
cg: "🇨🇬",
|
||||||
|
// Congo
|
||||||
|
ch: "🇨🇭",
|
||||||
|
// Switzerland
|
||||||
|
ci: "🇨🇮",
|
||||||
|
// Côte D'Ivoire
|
||||||
|
ck: "🇨🇰",
|
||||||
|
// Cook Islands
|
||||||
|
cl: "🇨🇱",
|
||||||
|
// Chile
|
||||||
|
cm: "🇨🇲",
|
||||||
|
// Cameroon
|
||||||
|
cn: "🇨🇳",
|
||||||
|
// China
|
||||||
|
co: "🇨🇴",
|
||||||
|
// Colombia
|
||||||
|
cr: "🇨🇷",
|
||||||
|
// Costa Rica
|
||||||
|
cu: "🇨🇺",
|
||||||
|
// Cuba
|
||||||
|
cv: "🇨🇻",
|
||||||
|
// Cape Verde
|
||||||
|
cw: "🇨🇼",
|
||||||
|
// Curaçao
|
||||||
|
cx: "🇨🇽",
|
||||||
|
// Christmas Island
|
||||||
|
cy: "🇨🇾",
|
||||||
|
// Cyprus
|
||||||
|
cz: "🇨🇿",
|
||||||
|
// Czech Republic
|
||||||
|
de: "🇩🇪",
|
||||||
|
// Germany
|
||||||
|
dj: "🇩🇯",
|
||||||
|
// Djibouti
|
||||||
|
dk: "🇩🇰",
|
||||||
|
// Denmark
|
||||||
|
dm: "🇩🇲",
|
||||||
|
// Dominica
|
||||||
|
do: "🇩🇴",
|
||||||
|
// Dominican Republic
|
||||||
|
dz: "🇩🇿",
|
||||||
|
// Algeria
|
||||||
|
ec: "🇪🇨",
|
||||||
|
// Ecuador
|
||||||
|
ee: "🇪🇪",
|
||||||
|
// Estonia
|
||||||
|
eg: "🇪🇬",
|
||||||
|
// Egypt
|
||||||
|
eh: "🇪🇭",
|
||||||
|
// Western Sahara
|
||||||
|
er: "🇪🇷",
|
||||||
|
// Eritrea
|
||||||
|
es: "🇪🇸",
|
||||||
|
// Spain
|
||||||
|
et: "🇪🇹",
|
||||||
|
// Ethiopia
|
||||||
|
fi: "🇫🇮",
|
||||||
|
// Finland
|
||||||
|
fj: "🇫🇯",
|
||||||
|
// Fiji
|
||||||
|
fk: "🇫🇰",
|
||||||
|
// Falkland Islands (Malvinas)
|
||||||
|
fm: "🇫🇲",
|
||||||
|
// Micronesia
|
||||||
|
fo: "🇫🇴",
|
||||||
|
// Faroe Islands
|
||||||
|
fr: "🇫🇷",
|
||||||
|
// France
|
||||||
|
ga: "🇬🇦",
|
||||||
|
// Gabon
|
||||||
|
gb: "🇬🇧",
|
||||||
|
// United Kingdom
|
||||||
|
gd: "🇬🇩",
|
||||||
|
// Grenada
|
||||||
|
ge: "🇬🇪",
|
||||||
|
// Georgia
|
||||||
|
gf: "🇬🇫",
|
||||||
|
// French Guiana
|
||||||
|
gg: "🇬🇬",
|
||||||
|
// Guernsey
|
||||||
|
gh: "🇬🇭",
|
||||||
|
// Ghana
|
||||||
|
gi: "🇬🇮",
|
||||||
|
// Gibraltar
|
||||||
|
gl: "🇬🇱",
|
||||||
|
// Greenland
|
||||||
|
gm: "🇬🇲",
|
||||||
|
// Gambia
|
||||||
|
gn: "🇬🇳",
|
||||||
|
// Guinea
|
||||||
|
gp: "🇬🇵",
|
||||||
|
// Guadeloupe
|
||||||
|
gq: "🇬🇶",
|
||||||
|
// Equatorial Guinea
|
||||||
|
gr: "🇬🇷",
|
||||||
|
// Greece
|
||||||
|
gs: "🇬🇸",
|
||||||
|
// South Georgia
|
||||||
|
gt: "🇬🇹",
|
||||||
|
// Guatemala
|
||||||
|
gu: "🇬🇺",
|
||||||
|
// Guam
|
||||||
|
gw: "🇬🇼",
|
||||||
|
// Guinea-Bissau
|
||||||
|
gy: "🇬🇾",
|
||||||
|
// Guyana
|
||||||
|
hk: "🇭🇰",
|
||||||
|
// Hong Kong
|
||||||
|
hm: "🇭🇲",
|
||||||
|
// Heard Island and Mcdonald Islands
|
||||||
|
hn: "🇭🇳",
|
||||||
|
// Honduras
|
||||||
|
hr: "🇭🇷",
|
||||||
|
// Croatia
|
||||||
|
ht: "🇭🇹",
|
||||||
|
// Haiti
|
||||||
|
hu: "🇭🇺",
|
||||||
|
// Hungary
|
||||||
|
id: "🇮🇩",
|
||||||
|
// Indonesia
|
||||||
|
ie: "🇮🇪",
|
||||||
|
// Ireland
|
||||||
|
il: "🇮🇱",
|
||||||
|
// Israel
|
||||||
|
im: "🇮🇲",
|
||||||
|
// Isle of Man
|
||||||
|
in: "🇮🇳",
|
||||||
|
// India
|
||||||
|
io: "🇮🇴",
|
||||||
|
// British Indian Ocean Territory
|
||||||
|
iq: "🇮🇶",
|
||||||
|
// Iraq
|
||||||
|
ir: "🇮🇷",
|
||||||
|
// Iran
|
||||||
|
is: "🇮🇸",
|
||||||
|
// Iceland
|
||||||
|
it: "🇮🇹",
|
||||||
|
// Italy
|
||||||
|
je: "🇯🇪",
|
||||||
|
// Jersey
|
||||||
|
jm: "🇯🇲",
|
||||||
|
// Jamaica
|
||||||
|
jo: "🇯🇴",
|
||||||
|
// Jordan
|
||||||
|
jp: "🇯🇵",
|
||||||
|
// Japan
|
||||||
|
ke: "🇰🇪",
|
||||||
|
// Kenya
|
||||||
|
kg: "🇰🇬",
|
||||||
|
// Kyrgyzstan
|
||||||
|
kh: "🇰🇭",
|
||||||
|
// Cambodia
|
||||||
|
ki: "🇰🇮",
|
||||||
|
// Kiribati
|
||||||
|
km: "🇰🇲",
|
||||||
|
// Comoros
|
||||||
|
kn: "🇰🇳",
|
||||||
|
// Saint Kitts and Nevis
|
||||||
|
kp: "🇰🇵",
|
||||||
|
// North Korea
|
||||||
|
kr: "🇰🇷",
|
||||||
|
// South Korea
|
||||||
|
kw: "🇰🇼",
|
||||||
|
// Kuwait
|
||||||
|
ky: "🇰🇾",
|
||||||
|
// Cayman Islands
|
||||||
|
kz: "🇰🇿",
|
||||||
|
// Kazakhstan
|
||||||
|
la: "🇱🇦",
|
||||||
|
// Lao People's Democratic Republic
|
||||||
|
lb: "🇱🇧",
|
||||||
|
// Lebanon
|
||||||
|
lc: "🇱🇨",
|
||||||
|
// Saint Lucia
|
||||||
|
li: "🇱🇮",
|
||||||
|
// Liechtenstein
|
||||||
|
lk: "🇱🇰",
|
||||||
|
// Sri Lanka
|
||||||
|
lr: "🇱🇷",
|
||||||
|
// Liberia
|
||||||
|
ls: "🇱🇸",
|
||||||
|
// Lesotho
|
||||||
|
lt: "🇱🇹",
|
||||||
|
// Lithuania
|
||||||
|
lu: "🇱🇺",
|
||||||
|
// Luxembourg
|
||||||
|
lv: "🇱🇻",
|
||||||
|
// Latvia
|
||||||
|
ly: "🇱🇾",
|
||||||
|
// Libya
|
||||||
|
ma: "🇲🇦",
|
||||||
|
// Morocco
|
||||||
|
mc: "🇲🇨",
|
||||||
|
// Monaco
|
||||||
|
md: "🇲🇩",
|
||||||
|
// Moldova
|
||||||
|
me: "🇲🇪",
|
||||||
|
// Montenegro
|
||||||
|
mf: "🇲🇫",
|
||||||
|
// Saint Martin (French Part)
|
||||||
|
mg: "🇲🇬",
|
||||||
|
// Madagascar
|
||||||
|
mh: "🇲🇭",
|
||||||
|
// Marshall Islands
|
||||||
|
mk: "🇲🇰",
|
||||||
|
// Macedonia
|
||||||
|
ml: "🇲🇱",
|
||||||
|
// Mali
|
||||||
|
mm: "🇲🇲",
|
||||||
|
// Myanmar
|
||||||
|
mn: "🇲🇳",
|
||||||
|
// Mongolia
|
||||||
|
mo: "🇲🇴",
|
||||||
|
// Macao
|
||||||
|
mp: "🇲🇵",
|
||||||
|
// Northern Mariana Islands
|
||||||
|
mq: "🇲🇶",
|
||||||
|
// Martinique
|
||||||
|
mr: "🇲🇷",
|
||||||
|
// Mauritania
|
||||||
|
ms: "🇲🇸",
|
||||||
|
// Montserrat
|
||||||
|
mt: "🇲🇹",
|
||||||
|
// Malta
|
||||||
|
mu: "🇲🇺",
|
||||||
|
// Mauritius
|
||||||
|
mv: "🇲🇻",
|
||||||
|
// Maldives
|
||||||
|
mw: "🇲🇼",
|
||||||
|
// Malawi
|
||||||
|
mx: "🇲🇽",
|
||||||
|
// Mexico
|
||||||
|
my: "🇲🇾",
|
||||||
|
// Malaysia
|
||||||
|
mz: "🇲🇿",
|
||||||
|
// Mozambique
|
||||||
|
na: "🇳🇦",
|
||||||
|
// Namibia
|
||||||
|
nc: "🇳🇨",
|
||||||
|
// New Caledonia
|
||||||
|
ne: "🇳🇪",
|
||||||
|
// Niger
|
||||||
|
nf: "🇳🇫",
|
||||||
|
// Norfolk Island
|
||||||
|
ng: "🇳🇬",
|
||||||
|
// Nigeria
|
||||||
|
ni: "🇳🇮",
|
||||||
|
// Nicaragua
|
||||||
|
nl: "🇳🇱",
|
||||||
|
// Netherlands
|
||||||
|
no: "🇳🇴",
|
||||||
|
// Norway
|
||||||
|
np: "🇳🇵",
|
||||||
|
// Nepal
|
||||||
|
nr: "🇳🇷",
|
||||||
|
// Nauru
|
||||||
|
nu: "🇳🇺",
|
||||||
|
// Niue
|
||||||
|
nz: "🇳🇿",
|
||||||
|
// New Zealand
|
||||||
|
om: "🇴🇲",
|
||||||
|
// Oman
|
||||||
|
pa: "🇵🇦",
|
||||||
|
// Panama
|
||||||
|
pe: "🇵🇪",
|
||||||
|
// Peru
|
||||||
|
pf: "🇵🇫",
|
||||||
|
// French Polynesia
|
||||||
|
pg: "🇵🇬",
|
||||||
|
// Papua New Guinea
|
||||||
|
ph: "🇵🇭",
|
||||||
|
// Philippines
|
||||||
|
pk: "🇵🇰",
|
||||||
|
// Pakistan
|
||||||
|
pl: "🇵🇱",
|
||||||
|
// Poland
|
||||||
|
pm: "🇵🇲",
|
||||||
|
// Saint Pierre and Miquelon
|
||||||
|
pn: "🇵🇳",
|
||||||
|
// Pitcairn
|
||||||
|
pr: "🇵🇷",
|
||||||
|
// Puerto Rico
|
||||||
|
ps: "🇵🇸",
|
||||||
|
// Palestinian Territory
|
||||||
|
pt: "🇵🇹",
|
||||||
|
// Portugal
|
||||||
|
pw: "🇵🇼",
|
||||||
|
// Palau
|
||||||
|
py: "🇵🇾",
|
||||||
|
// Paraguay
|
||||||
|
qa: "🇶🇦",
|
||||||
|
// Qatar
|
||||||
|
re: "🇷🇪",
|
||||||
|
// Réunion
|
||||||
|
ro: "🇷🇴",
|
||||||
|
// Romania
|
||||||
|
rs: "🇷🇸",
|
||||||
|
// Serbia
|
||||||
|
ru: "🇷🇺",
|
||||||
|
// Russia
|
||||||
|
rw: "🇷🇼",
|
||||||
|
// Rwanda
|
||||||
|
sa: "🇸🇦",
|
||||||
|
// Saudi Arabia
|
||||||
|
sb: "🇸🇧",
|
||||||
|
// Solomon Islands
|
||||||
|
sc: "🇸🇨",
|
||||||
|
// Seychelles
|
||||||
|
sd: "🇸🇩",
|
||||||
|
// Sudan
|
||||||
|
se: "🇸🇪",
|
||||||
|
// Sweden
|
||||||
|
sg: "🇸🇬",
|
||||||
|
// Singapore
|
||||||
|
sh: "🇸🇭",
|
||||||
|
// Saint Helena, Ascension and Tristan Da Cunha
|
||||||
|
si: "🇸🇮",
|
||||||
|
// Slovenia
|
||||||
|
sj: "🇸🇯",
|
||||||
|
// Svalbard and Jan Mayen
|
||||||
|
sk: "🇸🇰",
|
||||||
|
// Slovakia
|
||||||
|
sl: "🇸🇱",
|
||||||
|
// Sierra Leone
|
||||||
|
sm: "🇸🇲",
|
||||||
|
// San Marino
|
||||||
|
sn: "🇸🇳",
|
||||||
|
// Senegal
|
||||||
|
so: "🇸🇴",
|
||||||
|
// Somalia
|
||||||
|
sr: "🇸🇷",
|
||||||
|
// Suriname
|
||||||
|
ss: "🇸🇸",
|
||||||
|
// South Sudan
|
||||||
|
st: "🇸🇹",
|
||||||
|
// Sao Tome and Principe
|
||||||
|
sv: "🇸🇻",
|
||||||
|
// El Salvador
|
||||||
|
sx: "🇸🇽",
|
||||||
|
// Sint Maarten (Dutch Part)
|
||||||
|
sy: "🇸🇾",
|
||||||
|
// Syrian Arab Republic
|
||||||
|
sz: "🇸🇿",
|
||||||
|
// Swaziland
|
||||||
|
tc: "🇹🇨",
|
||||||
|
// Turks and Caicos Islands
|
||||||
|
td: "🇹🇩",
|
||||||
|
// Chad
|
||||||
|
tf: "🇹🇫",
|
||||||
|
// French Southern Territories
|
||||||
|
tg: "🇹🇬",
|
||||||
|
// Togo
|
||||||
|
th: "🇹🇭",
|
||||||
|
// Thailand
|
||||||
|
tj: "🇹🇯",
|
||||||
|
// Tajikistan
|
||||||
|
tk: "🇹🇰",
|
||||||
|
// Tokelau
|
||||||
|
tl: "🇹🇱",
|
||||||
|
// Timor-Leste
|
||||||
|
tm: "🇹🇲",
|
||||||
|
// Turkmenistan
|
||||||
|
tn: "🇹🇳",
|
||||||
|
// Tunisia
|
||||||
|
to: "🇹🇴",
|
||||||
|
// Tonga
|
||||||
|
tr: "🇹🇷",
|
||||||
|
// Turkey
|
||||||
|
tt: "🇹🇹",
|
||||||
|
// Trinidad and Tobago
|
||||||
|
tv: "🇹🇻",
|
||||||
|
// Tuvalu
|
||||||
|
tw: "🇹🇼",
|
||||||
|
// Taiwan
|
||||||
|
tz: "🇹🇿",
|
||||||
|
// Tanzania
|
||||||
|
ua: "🇺🇦",
|
||||||
|
// Ukraine
|
||||||
|
ug: "🇺🇬",
|
||||||
|
// Uganda
|
||||||
|
um: "🇺🇲",
|
||||||
|
// United States Minor Outlying Islands
|
||||||
|
us: "🇺🇸",
|
||||||
|
// United States
|
||||||
|
uy: "🇺🇾",
|
||||||
|
// Uruguay
|
||||||
|
uz: "🇺🇿",
|
||||||
|
// Uzbekistan
|
||||||
|
va: "🇻🇦",
|
||||||
|
// Vatican City
|
||||||
|
vc: "🇻🇨",
|
||||||
|
// Saint Vincent and The Grenadines
|
||||||
|
ve: "🇻🇪",
|
||||||
|
// Venezuela
|
||||||
|
vg: "🇻🇬",
|
||||||
|
// Virgin Islands, British
|
||||||
|
vi: "🇻🇮",
|
||||||
|
// Virgin Islands, U.S.
|
||||||
|
vn: "🇻🇳",
|
||||||
|
// Viet Nam
|
||||||
|
vu: "🇻🇺",
|
||||||
|
// Vanuatu
|
||||||
|
wf: "🇼🇫",
|
||||||
|
// Wallis and Futuna
|
||||||
|
ws: "🇼🇸",
|
||||||
|
// Samoa
|
||||||
|
ye: "🇾🇪",
|
||||||
|
// Yemen
|
||||||
|
yt: "🇾🇹",
|
||||||
|
// Mayotte
|
||||||
|
za: "🇿🇦",
|
||||||
|
// South Africa
|
||||||
|
zm: "🇿🇲",
|
||||||
|
// Zambia
|
||||||
|
zw: "🇿🇼",
|
||||||
|
// Zimbabwe
|
||||||
|
);
|
||||||
|
|
||||||
|
[class^="flag-"] {
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
// generate classes
|
||||||
|
@each $name, $icon in $flags {
|
||||||
|
.flag-#{$name}:before {
|
||||||
|
content: $icon;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
.cursor-pointer {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cursor-help {
|
||||||
|
cursor: help;
|
||||||
|
}
|
||||||
34
CTFd/themes/core-beta/assets/scss/includes/utils/_fonts.scss
Normal file
34
CTFd/themes/core-beta/assets/scss/includes/utils/_fonts.scss
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/* Handle offline font loading */
|
||||||
|
// $fa-font-path: "../../../node_modules/@fortawesome/fontawesome-free/webfonts" !default;
|
||||||
|
// $fa-font-display: auto !default;
|
||||||
|
// @import "../../../node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss";
|
||||||
|
// @import "../../../node_modules/@fortawesome/fontawesome-free/scss/regular.scss";
|
||||||
|
// @import "../../../node_modules/@fortawesome/fontawesome-free/scss/solid.scss";
|
||||||
|
// @import "../../../node_modules/@fortawesome/fontawesome-free/scss/brands.scss";
|
||||||
|
|
||||||
|
@use "~/@fontsource/lato/scss/mixins" as Lato;
|
||||||
|
@use "~/@fontsource/raleway/scss/mixins" as Raleway;
|
||||||
|
|
||||||
|
// Include both normal and bold weights
|
||||||
|
@include Lato.fontFace($fontDir: "../webfonts", $weight: 400);
|
||||||
|
@include Lato.fontFace($fontDir: "../webfonts", $weight: 700);
|
||||||
|
|
||||||
|
@include Raleway.fontFace($fontDir: "../webfonts");
|
||||||
|
|
||||||
|
$fa-font-path: "../webfonts";
|
||||||
|
@import "~/@fortawesome/fontawesome-free/scss/fontawesome.scss";
|
||||||
|
@import "~/@fortawesome/fontawesome-free/scss/solid.scss";
|
||||||
|
@import "~/@fortawesome/fontawesome-free/scss/brands.scss";
|
||||||
|
|
||||||
|
// @import "~/@fontsource/lato/index.css";
|
||||||
|
// @import "~/@fontsource/lato/index.css";
|
||||||
|
|
||||||
|
html,
|
||||||
|
body,
|
||||||
|
.container {
|
||||||
|
font-family: "Lato", sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jumbotron .container {
|
||||||
|
font-family: "Raleway", sans-serif;
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
.ll-nam {
|
||||||
|
/* words */
|
||||||
|
color: #24292f;
|
||||||
|
}
|
||||||
|
.ll-num {
|
||||||
|
/* numbers */
|
||||||
|
color: #005cc5;
|
||||||
|
}
|
||||||
|
.ll-str {
|
||||||
|
/* strings */
|
||||||
|
color: #0a3069;
|
||||||
|
}
|
||||||
|
.ll-rex {
|
||||||
|
/* regular expressions */
|
||||||
|
color: #032f62;
|
||||||
|
}
|
||||||
|
.ll-pct {
|
||||||
|
/* operators, punctation */
|
||||||
|
color: #0550ae;
|
||||||
|
}
|
||||||
|
.ll-key {
|
||||||
|
/* keywords */
|
||||||
|
color: #d73a49;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
.ll-com {
|
||||||
|
/* comments */
|
||||||
|
color: #6a737d;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
.min-vh-0 {
|
||||||
|
min-height: 0vh !important;
|
||||||
|
}
|
||||||
|
.min-vh-25 {
|
||||||
|
min-height: 25vh !important;
|
||||||
|
}
|
||||||
|
.min-vh-50 {
|
||||||
|
min-height: 50vh !important;
|
||||||
|
}
|
||||||
|
.min-vh-75 {
|
||||||
|
min-height: 75vh !important;
|
||||||
|
}
|
||||||
|
.min-vh-100 {
|
||||||
|
min-height: 100vh !important;
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
.opacity-0 {
|
||||||
|
opacity: 0 !important;
|
||||||
|
}
|
||||||
|
.opacity-25 {
|
||||||
|
opacity: 0.25 !important;
|
||||||
|
}
|
||||||
|
.opacity-50 {
|
||||||
|
opacity: 0.5 !important;
|
||||||
|
}
|
||||||
|
.opacity-75 {
|
||||||
|
opacity: 0.75 !important;
|
||||||
|
}
|
||||||
|
.opacity-100 {
|
||||||
|
opacity: 1 !important;
|
||||||
|
}
|
||||||
85
CTFd/themes/core-beta/assets/scss/main.scss
Normal file
85
CTFd/themes/core-beta/assets/scss/main.scss
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
@use "bootstrap/scss/bootstrap" as * with (
|
||||||
|
$info: #5c728f
|
||||||
|
);
|
||||||
|
|
||||||
|
@use "includes/components/table";
|
||||||
|
@use "includes/components/jumbotron";
|
||||||
|
@use "includes/components/challenge";
|
||||||
|
@use "includes/components/sticky-footer";
|
||||||
|
@use "includes/components/graphs";
|
||||||
|
|
||||||
|
@use "includes/utils/fonts";
|
||||||
|
@use "includes/utils/opacity";
|
||||||
|
@use "includes/utils/min-height";
|
||||||
|
@use "includes/utils/cursors";
|
||||||
|
@use "includes/utils/lolight";
|
||||||
|
|
||||||
|
@use "includes/icons/award-icons";
|
||||||
|
@use "includes/icons/flag-icons";
|
||||||
|
|
||||||
|
h1,
|
||||||
|
h2 {
|
||||||
|
font-weight: 500;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #337ab7;
|
||||||
|
text-decoration: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
blockquote {
|
||||||
|
border-left: 4px solid $secondary;
|
||||||
|
padding-left: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fa-spin.spinner {
|
||||||
|
text-align: center;
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge-notification {
|
||||||
|
vertical-align: top;
|
||||||
|
margin-left: -1.5em;
|
||||||
|
font-size: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
select.form-control {
|
||||||
|
height: auto !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-select {
|
||||||
|
background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e")
|
||||||
|
no-repeat right 0.75rem center/8px 10px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// HMM
|
||||||
|
|
||||||
|
.input-filled-valid {
|
||||||
|
background-color: transparent !important;
|
||||||
|
border-color: #a3d39c;
|
||||||
|
box-shadow: 0 0 0 0.1rem #a3d39c;
|
||||||
|
transition: background-color 0.3s, border-color 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-filled-invalid {
|
||||||
|
background-color: transparent !important;
|
||||||
|
border-color: #d46767;
|
||||||
|
box-shadow: 0 0 0 0.1rem #d46767;
|
||||||
|
transition: background-color 0.3s, border-color 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-control {
|
||||||
|
padding: 0.8em !important;
|
||||||
|
background: #f0f0f0;
|
||||||
|
color: #aaa;
|
||||||
|
/* Behavior changed in Bootstrap v4.1.3. See https://github.com/twbs/bootstrap/issues/27629 */
|
||||||
|
height: auto !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-control:focus {
|
||||||
|
background-color: transparent;
|
||||||
|
border-color: #a3d39c;
|
||||||
|
box-shadow: 0 0 0 0.1rem #a3d39c;
|
||||||
|
transition: background-color 0.3s, border-color 0.3s;
|
||||||
|
}
|
||||||
32
CTFd/themes/core-beta/package.json
Normal file
32
CTFd/themes/core-beta/package.json
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"name": "core-beta",
|
||||||
|
"private": true,
|
||||||
|
"version": "0.0.1",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "vite build --watch",
|
||||||
|
"build": "vite build",
|
||||||
|
"format": "prettier --write assets/",
|
||||||
|
"lint": "prettier --check assets/"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@ctfdio/ctfd-js": "^0.0.11",
|
||||||
|
"@fontsource/lato": "^4.5.3",
|
||||||
|
"@fontsource/raleway": "^4.5.3",
|
||||||
|
"@fortawesome/fontawesome-free": "6.0.0",
|
||||||
|
"@popperjs/core": "^2.11.4",
|
||||||
|
"alpinejs": "^3.9.1",
|
||||||
|
"bootstrap": "^5.1.3",
|
||||||
|
"bootstrap-multimodal": "~1.0.4",
|
||||||
|
"dayjs": "^1.11.0",
|
||||||
|
"echarts": "^5.3.2",
|
||||||
|
"lolight": "^1.4.0",
|
||||||
|
"vue": "^3.2.25"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@vitejs/plugin-vue": "^3.0.1",
|
||||||
|
"prettier": "2.6.1",
|
||||||
|
"rollup-plugin-copy": "^3.4.0",
|
||||||
|
"sass": "^1.49.7",
|
||||||
|
"vite": "^3.0.5"
|
||||||
|
}
|
||||||
|
}
|
||||||
0
CTFd/themes/core-beta/postcss.config.js
Normal file
0
CTFd/themes/core-beta/postcss.config.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
import{m as s,C as a,h as r,T as h,d as g,M as c}from"./index.1d7c7e9f.js";function o(e){let l=new DOMParser().parseFromString(e,"text/html");return l.querySelectorAll('a[href*="://"]').forEach(i=>{i.setAttribute("target","_blank")}),l.documentElement.outerHTML}window.Alpine=s;s.store("challenge",{data:{view:""}});s.data("Hint",()=>({id:null,html:null,async showHint(e){if(e.target.open){let l=(await a.pages.challenge.loadHint(this.id)).data;if(l.content)this.html=o(l.html);else if(await a.pages.challenge.displayUnlock(this.id)){let i=await a.pages.challenge.loadUnlock(this.id);if(i.success){let d=(await a.pages.challenge.loadHint(this.id)).data;this.html=o(d.html)}else e.target.open=!1,a._functions.challenge.displayUnlockError(i)}else e.target.open=!1}}}));s.data("Challenge",()=>({id:null,next_id:null,submission:"",tab:null,solves:[],response:null,async init(){r()},getStyles(){let e={"modal-dialog":!0};try{switch(a.config.themeSettings.challenge_window_size){case"sm":e["modal-sm"]=!0;break;case"lg":e["modal-lg"]=!0;break;case"xl":e["modal-xl"]=!0;break;default:break}}catch(t){console.log("Error processing challenge_window_size"),console.log(t)}return e},async init(){r()},async showChallenge(){new h(this.$el).show()},async showSolves(){this.solves=await a.pages.challenge.loadSolves(this.id),this.solves.forEach(e=>(e.date=g(e.date).format("MMMM Do, h:mm:ss A"),e)),new h(this.$el).show()},getNextId(){return s.store("challenge").data.next_id},async nextChallenge(){let e=c.getOrCreateInstance("[x-ref='challengeWindow']");e._element.addEventListener("hidden.bs.modal",t=>{s.nextTick(()=>{this.$dispatch("load-challenge",this.getNextId())})},{once:!0}),e.hide()},async submitChallenge(){this.response=await a.pages.challenge.submitChallenge(this.id,this.submission),await this.renderSubmissionResponse()},async renderSubmissionResponse(){this.response.data.status==="correct"&&(this.submission=""),this.$dispatch("load-challenges")}}));s.data("ChallengeBoard",()=>({loaded:!1,challenges:[],challenge:null,async init(){if(this.challenges=await a.pages.challenges.getChallenges(),this.loaded=!0,window.location.hash){let e=decodeURIComponent(window.location.hash.substring(1)),t=e.lastIndexOf("-");if(t>=0){let n=[e.slice(0,t),e.slice(t+1)][1];await this.loadChallenge(n)}}},getCategories(){const e=[];this.challenges.forEach(t=>{const{category:l}=t;e.includes(l)||e.push(l)});try{const t=a.config.themeSettings.challenge_category_order;if(t){const l=new Function(`return (${t})`);e.sort(l())}}catch(t){console.log("Error running challenge_category_order function"),console.log(t)}return e},getChallenges(e){let t=this.challenges;e&&(t=this.challenges.filter(l=>l.category===e));try{const l=a.config.themeSettings.challenge_order;if(l){const n=new Function(`return (${l})`);t.sort(n())}}catch(l){console.log("Error running challenge_order function"),console.log(l)}return t},async loadChallenges(){this.challenges=await a.pages.challenges.getChallenges()},async loadChallenge(e){await a.pages.challenge.displayChallenge(e,t=>{t.data.view=o(t.data.view),s.store("challenge").data=t.data,s.nextTick(()=>{let l=c.getOrCreateInstance("[x-ref='challengeWindow']");l._element.addEventListener("hidden.bs.modal",n=>{history.replaceState(null,null," ")},{once:!0}),l.show(),history.replaceState(null,null,`#${t.data.name}-${e}`)})})}}));s.start();
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
import{a as u}from"./index.1d7c7e9f.js";function r(a){const t=new FormData(a),c=[];for(const[l,n]of t)c.push({name:l,value:n});return c}function h(a,t,c){let l={},n=r(a);return a.querySelectorAll("input[type=checkbox]:checked").forEach(e=>{n.push({name:e.name,value:!0})}),a.querySelectorAll("input[type=checkbox]:not(:checked)").forEach(e=>{n.push({name:e.name,value:!1})}),n.map(e=>{if(c)if(e.value!==null&&e.value!=="")l[e.name]=e.value;else{let o=a.querySelector(`[name='${e.name}']`);t[o.name]!==o.value&&(l[e.name]=e.value)}else l[e.name]=e.value}),l}function m(a){const t=new u(a,{title:"Copied!",trigger:"manual"});navigator.clipboard.writeText(a.value).then(()=>{t.show(),setTimeout(()=>{t.hide()},1500)})}export{m as c,h as s};
|
||||||
56
CTFd/themes/core-beta/static/assets/echarts.128204f2.js
Normal file
56
CTFd/themes/core-beta/static/assets/echarts.128204f2.js
Normal file
File diff suppressed because one or more lines are too long
1
CTFd/themes/core-beta/static/assets/index.159418f4.js
Normal file
1
CTFd/themes/core-beta/static/assets/index.159418f4.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
import{d as c,c as f}from"./index.1d7c7e9f.js";import{u as p,i as g,a as h,b as x,c as y,d as b,e as v,f as $,g as A,h as j,j as L,k as z,l as I,m as O}from"./echarts.128204f2.js";function T(o){let t=o.concat();for(let e=0;e<o.length;e++)t[e]=o.slice(0,e+1).reduce(function(a,s){return a+s});return t}function w(o,t){let e={title:{left:"center",text:"Top 10 "+(o==="teams"?"Teams":"Users")},tooltip:{trigger:"axis",axisPointer:{type:"cross"}},legend:{type:"scroll",orient:"horizontal",align:"left",bottom:35,data:[]},toolbox:{feature:{dataZoom:{yAxisIndex:"none"},saveAsImage:{}}},grid:{containLabel:!0},xAxis:[{type:"time",boundaryGap:!1,data:[]}],yAxis:[{type:"value"}],dataZoom:[{id:"dataZoomX",type:"slider",xAxisIndex:[0],filterMode:"filter",height:20,top:35,fillerColor:"rgba(233, 236, 241, 0.4)"}],series:[]};const a=Object.keys(t);for(let s=0;s<a.length;s++){const l=[],r=[];for(let n=0;n<t[a[s]].solves.length;n++){l.push(t[a[s]].solves[n].value);const i=c(t[a[s]].solves[n].date);r.push(i.toDate())}const d=T(l);let m=r.map(function(n,i){return[n,d[i]]});e.legend.data.push(t[a[s]].name);const u={name:t[a[s]].name,type:"line",label:{normal:{position:"top"}},itemStyle:{normal:{color:f(t[a[s]].name+t[a[s]].id)}},data:m};e.series.push(u)}return e}p([g,h,x,y,b,v,$,A,j,L,z,I]);function S(o,t){let e=O(o);e.setOption(t),window.addEventListener("resize",()=>{e&&e.resize()})}export{T as c,S as e,w as g};
|
||||||
31
CTFd/themes/core-beta/static/assets/index.1d7c7e9f.js
Normal file
31
CTFd/themes/core-beta/static/assets/index.1d7c7e9f.js
Normal file
File diff suppressed because one or more lines are too long
10
CTFd/themes/core-beta/static/assets/main.0aaf0d88.css
Normal file
10
CTFd/themes/core-beta/static/assets/main.0aaf0d88.css
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
|||||||
|
import{C as e,m as n}from"./index.1d7c7e9f.js";window.CTFd=e;window.Alpine=n;let l=e.events.counter.read.getLast();e.fetch(`/api/v1/notifications?since_id=${l}`).then(t=>t.json()).then(t=>{let a=t.data,o=e.events.counter.read.getAll();a.forEach(d=>{o.push(d.id)}),e.events.counter.read.setAll(o),e.events.counter.unread.readAll();let r=e.events.counter.unread.getAll().length;e.events.controller.broadcast("counter",{count:r}),n.store("unread_count",r)});n.start();
|
||||||
1
CTFd/themes/core-beta/static/assets/page.52398723.js
Normal file
1
CTFd/themes/core-beta/static/assets/page.52398723.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
import{C as o,m as d}from"./index.1d7c7e9f.js";window.CTFd=o;window.Alpine=d;d.start();
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
import{m as t,C as a}from"./index.1d7c7e9f.js";import{g as e,e as i}from"./index.159418f4.js";import"./echarts.128204f2.js";window.Alpine=t;window.CTFd=a;t.data("ScoreboardDetail",()=>({data:null,async init(){this.data=await a.pages.scoreboard.getScoreboardDetail(10);let o=e(a.config.userMode,this.data);i(this.$refs.scoregraph,o)}}));t.start();
|
||||||
1
CTFd/themes/core-beta/static/assets/settings.9e7a9694.js
Normal file
1
CTFd/themes/core-beta/static/assets/settings.9e7a9694.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
import{m as o,C as n,M as l}from"./index.1d7c7e9f.js";import{s as r,c as d}from"./clipboard.37e7316d.js";window.Alpine=o;o.data("SettingsForm",()=>({success:null,error:null,initial:null,errors:[],init(){this.initial=r(this.$el)},async updateProfile(){this.success=null,this.error=null,this.errors=[];let e=r(this.$el,this.initial,!0);e.fields=[];for(const s in e)if(s.match(/fields\[\d+\]/)){let i={},a=parseInt(s.slice(7,-1));i.field_id=a,i.value=e[s],e.fields.push(i),delete e[s]}const t=await n.pages.settings.updateSettings(e);t.success?(this.success=!0,this.error=!1,setTimeout(()=>{this.success=null,this.error=null},3e3)):(this.success=!1,this.error=!0,Object.keys(t.errors).map(s=>{const i=t.errors[s];this.errors.push(i)}))}}));o.data("TokensForm",()=>({token:null,async generateToken(){const e=r(this.$el);e.expiration||delete e.expiration;const t=await n.pages.settings.generateToken(e);this.token=t.data.value,new l(this.$refs.tokenModal).show()},copyToken(){d(this.$refs.token)}}));o.data("Tokens",()=>({selectedTokenId:null,async deleteTokenModal(e){this.selectedTokenId=e,new l(this.$refs.confirmModal).show()},async deleteSelectedToken(){await n.pages.settings.deleteToken(this.selectedTokenId);const e=this.$refs[`token-${this.selectedTokenId}`];e&&e.remove()}}));o.start();
|
||||||
1
CTFd/themes/core-beta/static/assets/setup.b081db5d.js
Normal file
1
CTFd/themes/core-beta/static/assets/setup.b081db5d.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
import{m as i,T as l,d as u,C as c}from"./index.1d7c7e9f.js";window.Alpine=i;i.data("SetupForm",()=>({init(){this.$root.querySelectorAll("input").forEach(e=>e.addEventListener("keypress",t=>{t.key=="Enter"&&(t.preventDefault(),t.target.closest(".tab-pane").querySelector("button[data-href]").click())})),window.addEventListener("storage",function(e){e.key=="integrations"&&e.newValue&&JSON.parse(e.newValue).name=="mlc"&&($("#integration-mlc").text("Already Configured").attr("disabled",!0),window.focus(),localStorage.removeItem("integrations"))})},validateFileSize(e,t){e.target.files[0].size>t&&(confirm(`This image file is larger than ${t/1e3}KB which may result in increased load times. Are you sure you'd like to use this file?`)||(e.target.value=""))},switchTab(e){let t=!0;if(e.target.closest('[role="tabpanel"]').querySelectorAll("input,textarea").forEach(n=>{n.checkValidity()===!1&&(t=!1)}),t==!1)return;let o=e.target.dataset.href,r=this.$root.querySelector(`[data-bs-target="${o}"]`);l.getOrCreateInstance(r).show()},setThemeColor(e){document.querySelector("#config-color-input").value=e.target.value},resetThemeColor(e){document.querySelector("#config-color-input").value="",document.querySelector("#config-color-picker").value=""},processDateTime(e){return function(t){let a=document.querySelector(`#${e}-date`),o=document.querySelector(`#${e}-time`),r=u(`${a.value} ${o.value}`,"YYYY-MM-DD HH:mm").unix();isNaN(r)?document.querySelector(`#${e}-preview`).value="":document.querySelector(`#${e}-preview`).value=r}},mlcSetup(){let e=document.querySelector,t=c.config.urlRoot,a={name:e("#ctf_name").value,type:"jeopardy",description:e("#ctf_description").value,user_mode:e("#user_mode").value,event_url:window.location.origin+t,redirect_url:window.location.origin+t+"/redirect",integration_setup_url:window.location.origin+t+"/setup/integrations",start:e("#start-preview").value,end:e("#end-preview").value,platform:"CTFd",state:window.STATE};const o=[];for(let r in a)o.push(encodeURIComponent(r)+"="+encodeURIComponent(a[r]));window.open("https://www.majorleaguecyber.org/events/new?"+o.join("&"),"_blank")},submitSetup(e){if(document.querySelector("#newsletter-checkbox").checked){let o={email:e.target.querySelector("input[name=email]").value,b_38e27f7d496889133d2214208_d7c3ed71f9:"",c:"jsonp_callback_"+Math.round(1e4*Math.random())};const r=[];for(let n in o)r.push(encodeURIComponent(n)+"="+encodeURIComponent(o[n]));var t=document.createElement("script");t.src="https://newsletters.ctfd.io/lists/ot889gr1sa0e1/subscribe/post-json?"+r.join("&"),document.head.appendChild(t)}}}));i.start();
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
import{C as o,m as d}from"./index.1d7c7e9f.js";window.CTFd=o;window.Alpine=d;d.start();
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
import{m as o,C as i,M as n,c as d}from"./index.1d7c7e9f.js";import{s as r,c as m}from"./clipboard.37e7316d.js";import{g as c}from"./userscore.6e7f2954.js";import{e as u}from"./index.159418f4.js";import"./echarts.128204f2.js";window.Alpine=o;window.CTFd=i;o.store("inviteToken","");o.data("TeamEditModal",()=>({success:null,error:null,initial:null,errors:[],init(){this.initial=r(this.$el.querySelector("form"))},async updateProfile(){let e=r(this.$el,this.initial,!0);e.fields=[];for(const a in e)if(a.match(/fields\[\d+\]/)){let t={},l=parseInt(a.slice(7,-1));t.field_id=l,t.value=e[a],e.fields.push(t),delete e[a]}let s=await i.pages.teams.updateTeamSettings(e);s.success?(this.success=!0,this.error=!1,setTimeout(()=>{this.success=null,this.error=null},3e3)):(this.success=!1,this.error=!0,Object.keys(s.errors).map(a=>{const t=s.errors[a];this.errors.push(t)}))}}));o.data("TeamCaptainModal",()=>({success:null,error:null,errors:[],async updateCaptain(){let e=r(this.$el,null,!0),s=await i.pages.teams.updateTeamSettings(e);s.success?window.location.reload():(this.success=!1,this.error=!0,Object.keys(s.errors).map(a=>{const t=s.errors[a];this.errors.push(t)}))}}));o.data("TeamInviteModal",()=>({copy(){m(this.$refs.link)}}));o.data("TeamDisbandModal",()=>({errors:[],async disbandTeam(){let e=await i.pages.teams.disbandTeam();e.success?window.location.reload():this.errors=e.errors[""]}}));o.data("CaptainMenu",()=>({captain:!1,editTeam(){this.teamEditModal=new n(document.getElementById("team-edit-modal")),this.teamEditModal.show()},chooseCaptain(){this.teamCaptainModal=new n(document.getElementById("team-captain-modal")),this.teamCaptainModal.show()},async inviteMembers(){const e=await i.pages.teams.getInviteToken();if(e.success){const s=e.data.code,a=`${window.location.origin}${i.config.urlRoot}/teams/invite?code=${s}`;document.querySelector("#team-invite-modal input[name=link]").value=a,this.$store.inviteToken=a,this.teamInviteModal=new n(document.getElementById("team-invite-modal")),this.teamInviteModal.show()}},disbandTeam(){this.teamDisbandModal=new n(document.getElementById("team-disband-modal")),this.teamDisbandModal.show()}}));o.data("TeamGraphs",()=>({solves:null,fails:null,awards:null,solveCount:0,failCount:0,awardCount:0,getSolvePercentage(){return(this.solveCount/(this.solveCount+this.failCount)*100).toFixed(2)},getFailPercentage(){return(this.failCount/(this.solveCount+this.failCount)*100).toFixed(2)},getCategoryBreakdown(){const e=[],s={};this.solves.data.map(t=>{e.push(t.challenge.category)}),e.forEach(t=>{t in s?s[t]+=1:s[t]=1});const a=[];for(const t in s)a.push({name:t,count:s[t],percent:s[t]/e.length*100,color:d(t)});return a},async init(){this.solves=await i.pages.teams.teamSolves("me"),this.fails=await i.pages.teams.teamFails("me"),this.awards=await i.pages.teams.teamAwards("me"),this.solveCount=this.solves.meta.count,this.failCount=this.fails.meta.count,this.awardCount=this.awards.meta.count,u(this.$refs.scoregraph,c(i.team.id,i.team.name,this.solves.data,this.awards.data))}}));o.start();
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
import{m as o,c as n,C as e}from"./index.1d7c7e9f.js";import{g as l}from"./userscore.6e7f2954.js";import{e as r}from"./index.159418f4.js";import"./echarts.128204f2.js";window.Alpine=o;o.data("TeamGraphs",()=>({solves:null,fails:null,awards:null,solveCount:0,failCount:0,awardCount:0,getSolvePercentage(){return(this.solveCount/(this.solveCount+this.failCount)*100).toFixed(2)},getFailPercentage(){return(this.failCount/(this.solveCount+this.failCount)*100).toFixed(2)},getCategoryBreakdown(){const s=[],a={};this.solves.data.map(t=>{s.push(t.challenge.category)}),s.forEach(t=>{t in a?a[t]+=1:a[t]=1});const i=[];for(const t in a)i.push({name:t,count:a[t],percent:(a[t]/s.length*100).toFixed(2),color:n(t)});return i},async init(){this.solves=await e.pages.teams.teamSolves(window.TEAM.id),this.fails=await e.pages.teams.teamFails(window.TEAM.id),this.awards=await e.pages.teams.teamAwards(window.TEAM.id),this.solveCount=this.solves.meta.count,this.failCount=this.fails.meta.count,this.awardCount=this.awards.meta.count,r(this.$refs.scoregraph,l(window.TEAM.id,window.TEAM.name,this.solves.data,this.awards.data))}}));o.start();
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
import{C as o,m as d}from"./index.1d7c7e9f.js";window.CTFd=o;window.Alpine=d;d.start();
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
import{m as o,c as n,C as e}from"./index.1d7c7e9f.js";import{g as l}from"./userscore.6e7f2954.js";import{e as u}from"./index.159418f4.js";import"./echarts.128204f2.js";window.Alpine=o;o.data("UserGraphs",()=>({solves:null,fails:null,awards:null,solveCount:0,failCount:0,awardCount:0,getSolvePercentage(){return(this.solveCount/(this.solveCount+this.failCount)*100).toFixed(2)},getFailPercentage(){return(this.failCount/(this.solveCount+this.failCount)*100).toFixed(2)},getCategoryBreakdown(){const a=[],t={};this.solves.data.map(s=>{a.push(s.challenge.category)}),a.forEach(s=>{s in t?t[s]+=1:t[s]=1});const i=[];for(const s in t){const r=Number(t[s]/a.length*100).toFixed(2);i.push({name:s,count:t[s],color:n(s),percent:r})}return i},async init(){this.solves=await e.pages.users.userSolves("me"),this.fails=await e.pages.users.userFails("me"),this.awards=await e.pages.users.userAwards("me"),this.solveCount=this.solves.meta.count,this.failCount=this.fails.meta.count,this.awardCount=this.awards.meta.count,u(this.$refs.scoregraph,l(e.user.id,e.user.name,this.solves.data,this.awards.data))}}));o.start();
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
import{m as o,c as r,C as e}from"./index.1d7c7e9f.js";import{g as l}from"./userscore.6e7f2954.js";import{e as u}from"./index.159418f4.js";import"./echarts.128204f2.js";window.Alpine=o;o.data("UserGraphs",()=>({solves:null,fails:null,awards:null,solveCount:0,failCount:0,awardCount:0,getSolvePercentage(){return(this.solveCount/(this.solveCount+this.failCount)*100).toFixed(2)},getFailPercentage(){return(this.failCount/(this.solveCount+this.failCount)*100).toFixed(2)},getCategoryBreakdown(){const a=[],t={};this.solves.data.map(s=>{a.push(s.challenge.category)}),a.forEach(s=>{s in t?t[s]+=1:t[s]=1});const i=[];for(const s in t){const n=Number(t[s]/a.length*100).toFixed(2);i.push({name:s,count:t[s],color:r(s),percent:n})}return i},async init(){this.solves=await e.pages.users.userSolves(window.USER.id),this.fails=await e.pages.users.userFails(window.USER.id),this.awards=await e.pages.users.userAwards(window.USER.id),this.solveCount=this.solves.meta.count,this.failCount=this.fails.meta.count,this.awardCount=this.awards.meta.count,u(this.$refs.scoregraph,l(window.USER.id,window.USER.name,this.solves.data,this.awards.data))}}));o.start();
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
import{d,c as n}from"./index.1d7c7e9f.js";import{c as u}from"./index.159418f4.js";function x(s,o,c,p){let a={title:{left:"center",text:"Score over Time"},tooltip:{trigger:"axis",axisPointer:{type:"cross"}},legend:{type:"scroll",orient:"horizontal",align:"left",bottom:0,data:[o]},toolbox:{feature:{saveAsImage:{}}},grid:{containLabel:!0},xAxis:[{type:"category",boundaryGap:!1,data:[]}],yAxis:[{type:"value"}],dataZoom:[{id:"dataZoomX",type:"slider",xAxisIndex:[0],filterMode:"filter",height:20,top:35,fillerColor:"rgba(233, 236, 241, 0.4)"}],series:[]};const i=[],r=[],e=c.concat(p);e.sort((t,l)=>new Date(t.date)-new Date(l.date));for(let t=0;t<e.length;t++){const l=d(e[t].date);i.push(l.toDate());try{r.push(e[t].challenge.value)}catch{r.push(e[t].value)}}return i.forEach(t=>{a.xAxis[0].data.push(t)}),a.series.push({name:o,type:"line",label:{normal:{show:!0,position:"top"}},areaStyle:{normal:{color:n(o+s)}},itemStyle:{normal:{color:n(o+s)}},data:u(r)}),a}export{x as g};
|
||||||
BIN
CTFd/themes/core-beta/static/img/favicon.ico
Normal file
BIN
CTFd/themes/core-beta/static/img/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
147
CTFd/themes/core-beta/static/manifest.json
Normal file
147
CTFd/themes/core-beta/static/manifest.json
Normal file
@@ -0,0 +1,147 @@
|
|||||||
|
{
|
||||||
|
"assets/js/index.js": {
|
||||||
|
"file": "assets/index.1d7c7e9f.js",
|
||||||
|
"src": "assets/js/index.js",
|
||||||
|
"isEntry": true
|
||||||
|
},
|
||||||
|
"assets/js/page.js": {
|
||||||
|
"file": "assets/page.52398723.js",
|
||||||
|
"src": "assets/js/page.js",
|
||||||
|
"isEntry": true,
|
||||||
|
"imports": [
|
||||||
|
"assets/js/index.js"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"assets/js/setup.js": {
|
||||||
|
"file": "assets/setup.b081db5d.js",
|
||||||
|
"src": "assets/js/setup.js",
|
||||||
|
"isEntry": true,
|
||||||
|
"imports": [
|
||||||
|
"assets/js/index.js"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"assets/js/settings.js": {
|
||||||
|
"file": "assets/settings.9e7a9694.js",
|
||||||
|
"src": "assets/js/settings.js",
|
||||||
|
"isEntry": true,
|
||||||
|
"imports": [
|
||||||
|
"assets/js/index.js",
|
||||||
|
"_clipboard.37e7316d.js"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"assets/js/challenges.js": {
|
||||||
|
"file": "assets/challenges.fcb4326f.js",
|
||||||
|
"src": "assets/js/challenges.js",
|
||||||
|
"isEntry": true,
|
||||||
|
"imports": [
|
||||||
|
"assets/js/index.js"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"assets/js/scoreboard.js": {
|
||||||
|
"file": "assets/scoreboard.a8a2da7f.js",
|
||||||
|
"src": "assets/js/scoreboard.js",
|
||||||
|
"isEntry": true,
|
||||||
|
"imports": [
|
||||||
|
"assets/js/index.js",
|
||||||
|
"_index.159418f4.js",
|
||||||
|
"_echarts.128204f2.js"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"assets/js/notifications.js": {
|
||||||
|
"file": "assets/notifications.e17c29d8.js",
|
||||||
|
"src": "assets/js/notifications.js",
|
||||||
|
"isEntry": true,
|
||||||
|
"imports": [
|
||||||
|
"assets/js/index.js"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"assets/js/teams/public.js": {
|
||||||
|
"file": "assets/teams_public.caf8cc98.js",
|
||||||
|
"src": "assets/js/teams/public.js",
|
||||||
|
"isEntry": true,
|
||||||
|
"imports": [
|
||||||
|
"assets/js/index.js",
|
||||||
|
"_userscore.6e7f2954.js",
|
||||||
|
"_index.159418f4.js",
|
||||||
|
"_echarts.128204f2.js"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"assets/js/teams/private.js": {
|
||||||
|
"file": "assets/teams_private.88c32ddc.js",
|
||||||
|
"src": "assets/js/teams/private.js",
|
||||||
|
"isEntry": true,
|
||||||
|
"imports": [
|
||||||
|
"assets/js/index.js",
|
||||||
|
"_clipboard.37e7316d.js",
|
||||||
|
"_userscore.6e7f2954.js",
|
||||||
|
"_index.159418f4.js",
|
||||||
|
"_echarts.128204f2.js"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"assets/js/teams/list.js": {
|
||||||
|
"file": "assets/teams_list.60231f18.js",
|
||||||
|
"src": "assets/js/teams/list.js",
|
||||||
|
"isEntry": true,
|
||||||
|
"imports": [
|
||||||
|
"assets/js/index.js"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"assets/js/users/public.js": {
|
||||||
|
"file": "assets/users_public.2a27f04d.js",
|
||||||
|
"src": "assets/js/users/public.js",
|
||||||
|
"isEntry": true,
|
||||||
|
"imports": [
|
||||||
|
"assets/js/index.js",
|
||||||
|
"_userscore.6e7f2954.js",
|
||||||
|
"_index.159418f4.js",
|
||||||
|
"_echarts.128204f2.js"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"assets/js/users/private.js": {
|
||||||
|
"file": "assets/users_private.5ba3fc6b.js",
|
||||||
|
"src": "assets/js/users/private.js",
|
||||||
|
"isEntry": true,
|
||||||
|
"imports": [
|
||||||
|
"assets/js/index.js",
|
||||||
|
"_userscore.6e7f2954.js",
|
||||||
|
"_index.159418f4.js",
|
||||||
|
"_echarts.128204f2.js"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"assets/js/users/list.js": {
|
||||||
|
"file": "assets/users_list.af9909e0.js",
|
||||||
|
"src": "assets/js/users/list.js",
|
||||||
|
"isEntry": true,
|
||||||
|
"imports": [
|
||||||
|
"assets/js/index.js"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"_echarts.128204f2.js": {
|
||||||
|
"file": "assets/echarts.128204f2.js"
|
||||||
|
},
|
||||||
|
"_clipboard.37e7316d.js": {
|
||||||
|
"file": "assets/clipboard.37e7316d.js",
|
||||||
|
"imports": [
|
||||||
|
"assets/js/index.js"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"_index.159418f4.js": {
|
||||||
|
"file": "assets/index.159418f4.js",
|
||||||
|
"imports": [
|
||||||
|
"assets/js/index.js",
|
||||||
|
"_echarts.128204f2.js"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"_userscore.6e7f2954.js": {
|
||||||
|
"file": "assets/userscore.6e7f2954.js",
|
||||||
|
"imports": [
|
||||||
|
"assets/js/index.js",
|
||||||
|
"_index.159418f4.js"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"assets/scss/main.scss": {
|
||||||
|
"file": "assets/main.0aaf0d88.css",
|
||||||
|
"src": "assets/scss/main.scss",
|
||||||
|
"isEntry": true
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
CTFd/themes/core-beta/static/webfonts/fa-brands-400.ttf
Normal file
BIN
CTFd/themes/core-beta/static/webfonts/fa-brands-400.ttf
Normal file
Binary file not shown.
BIN
CTFd/themes/core-beta/static/webfonts/fa-brands-400.woff2
Normal file
BIN
CTFd/themes/core-beta/static/webfonts/fa-brands-400.woff2
Normal file
Binary file not shown.
BIN
CTFd/themes/core-beta/static/webfonts/fa-regular-400.ttf
Normal file
BIN
CTFd/themes/core-beta/static/webfonts/fa-regular-400.ttf
Normal file
Binary file not shown.
BIN
CTFd/themes/core-beta/static/webfonts/fa-regular-400.woff2
Normal file
BIN
CTFd/themes/core-beta/static/webfonts/fa-regular-400.woff2
Normal file
Binary file not shown.
BIN
CTFd/themes/core-beta/static/webfonts/fa-solid-900.ttf
Normal file
BIN
CTFd/themes/core-beta/static/webfonts/fa-solid-900.ttf
Normal file
Binary file not shown.
BIN
CTFd/themes/core-beta/static/webfonts/fa-solid-900.woff2
Normal file
BIN
CTFd/themes/core-beta/static/webfonts/fa-solid-900.woff2
Normal file
Binary file not shown.
BIN
CTFd/themes/core-beta/static/webfonts/fa-v4compatibility.ttf
Normal file
BIN
CTFd/themes/core-beta/static/webfonts/fa-v4compatibility.ttf
Normal file
Binary file not shown.
BIN
CTFd/themes/core-beta/static/webfonts/fa-v4compatibility.woff2
Normal file
BIN
CTFd/themes/core-beta/static/webfonts/fa-v4compatibility.woff2
Normal file
Binary file not shown.
BIN
CTFd/themes/core-beta/static/webfonts/lato-all-400-normal.woff
Normal file
BIN
CTFd/themes/core-beta/static/webfonts/lato-all-400-normal.woff
Normal file
Binary file not shown.
BIN
CTFd/themes/core-beta/static/webfonts/lato-all-700-normal.woff
Normal file
BIN
CTFd/themes/core-beta/static/webfonts/lato-all-700-normal.woff
Normal file
Binary file not shown.
BIN
CTFd/themes/core-beta/static/webfonts/lato-latin-400-normal.woff
Normal file
BIN
CTFd/themes/core-beta/static/webfonts/lato-latin-400-normal.woff
Normal file
Binary file not shown.
Binary file not shown.
BIN
CTFd/themes/core-beta/static/webfonts/lato-latin-700-normal.woff
Normal file
BIN
CTFd/themes/core-beta/static/webfonts/lato-latin-700-normal.woff
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user