Compare commits
222 commits
Author | SHA1 | Date | |
---|---|---|---|
39be84fcc0 | |||
242e70eabf | |||
174ceaa4e7 | |||
058b409adf | |||
8e006c7003 | |||
23d47fa6d2 | |||
bdad34e065 | |||
fc6a899f16 | |||
1f16de2239 | |||
1550a5da57 | |||
7ef1974c88 | |||
0f45a5f60f | |||
324fe21d73 | |||
153abde3a2 | |||
f8aaa71260 | |||
37a3bc1ee6 | |||
f547812d5a | |||
8a06836985 | |||
34528ae413 | |||
0bf7ca0d52 | |||
cc9fccdf18 | |||
ca77b501e7 | |||
2439f87df9 | |||
400253e04b | |||
01c60e3027 | |||
37d8413118 | |||
8cfa07bc8c | |||
a65579bf9d | |||
44a4bb6e6f | |||
ec00cfa176 | |||
1d295df8da | |||
6a88ed8b11 | |||
36bcf1ab1d | |||
5d3e1d4960 | |||
9bb943bacf | |||
107d16cf46 | |||
0afc5186a7 | |||
0300bae994 | |||
cb0c64f8ed | |||
89ef9d9ad1 | |||
c02d922dc6 | |||
80cd6222c4 | |||
344a3c9160 | |||
df5dbdf3ad | |||
c0caceed7b | |||
be54ce2c22 | |||
070dc5e782 | |||
b89621cb1a | |||
760cca0e5d | |||
fe77f1616c | |||
eb81ed7a82 | |||
8ef11afe02 | |||
cca016ba10 | |||
b80151583e | |||
d8cc208a85 | |||
4b2f9a2fec | |||
ddb255bf32 | |||
5a70e3f3f1 | |||
bd3e055323 | |||
dba5754ccc | |||
ec6ba3f781 | |||
70ec285f99 | |||
77eadd5bde | |||
f0fc735975 | |||
adb80bad9e | |||
f30cf41f86 | |||
b4f5dd0660 | |||
133e2f420c | |||
bf65c95490 | |||
7ef5994da4 | |||
2b34bde413 | |||
432615508d | |||
a4cc14e4c1 | |||
65e695e9d9 | |||
2e6a84b46d | |||
8f56174637 | |||
19fbe59ddd | |||
f7a571e551 | |||
5f57e3fdf4 | |||
c2836719c7 | |||
14c9a1d9f6 | |||
4f1e35b566 | |||
9aa2a1431e | |||
4322f2561c | |||
67d9620037 | |||
904d220582 | |||
d9b152fb78 | |||
a945cc518a | |||
edc64b45ff | |||
17e0d1f591 | |||
5554c5c28d | |||
55e23c7b5d | |||
e376671136 | |||
3e49f6e503 | |||
7db43a2acd | |||
099bd899ed | |||
1248c0d2f6 | |||
c3bed1c0e3 | |||
163da8b213 | |||
c68279add9 | |||
737c99280e | |||
8b0f960c86 | |||
c5a284f360 | |||
506d32d210 | |||
498ec0cf9a | |||
15e96684c2 | |||
73e4597e16 | |||
9b2c409a24 | |||
7190a5f4df | |||
5c67d49225 | |||
69e4d05be6 | |||
2d0f083e1a | |||
1da6470928 | |||
9682fa595a | |||
c14195c4c3 | |||
45500ce698 | |||
0c9bac473b | |||
061d4c8a8f | |||
6fc10984e1 | |||
e222009dd0 | |||
85b629bc08 | |||
16ea495c7a | |||
ad3fe74275 | |||
29426fafc1 | |||
4d6fb64f3a | |||
40558ceb39 | |||
f03c8ebfa5 | |||
07a2868159 | |||
ca23822e40 | |||
34bd71600a | |||
5bab957a7c | |||
57b9e82c10 | |||
460a0ca57d | |||
39c6269cf3 | |||
fb41c71ee9 | |||
2214dffc5b | |||
bab8b29c5b | |||
0a11c5525a | |||
d4f6990e8a | |||
87915b6a25 | |||
cf71129153 | |||
6bfa3d7238 | |||
b7de5acfd8 | |||
9dd7156c79 | |||
00d1d2922d | |||
383e2ed0e0 | |||
57081d858d | |||
e813f2a90e | |||
0158333c90 | |||
a89d8d26f4 | |||
e3c0ae662e | |||
61daa21d3a | |||
934b016541 | |||
8ef113f3a9 | |||
a22433f7dd | |||
c5ec94289d | |||
8c52fc81e2 | |||
d2f0eebfb2 | |||
3148da4403 | |||
5c8ffa09fc | |||
20b309563e | |||
461ffbf73b | |||
26a0e11253 | |||
70623d3a7c | |||
b4d4e8578c | |||
8480d5f043 | |||
a30df1b17c | |||
351043e283 | |||
2231cd8124 | |||
86432616c6 | |||
1d552e907b | |||
057551edb3 | |||
710049794f | |||
ca1edb4270 | |||
f4f465d8d8 | |||
81f4dfce19 | |||
bd683d8404 | |||
3299d73df2 | |||
ee304af133 | |||
3d67b59238 | |||
dd21fce6e3 | |||
f6058823f1 | |||
392881c0d8 | |||
6e3023a772 | |||
d0e3f6ce65 | |||
42d893fc18 | |||
baefea88df | |||
e369038609 | |||
9962bbc5df | |||
761bc94b8e | |||
ffbe25d0b5 | |||
e4b647f2c6 | |||
683462ef71 | |||
14c5635b4f | |||
ebac064c59 | |||
f32624c61d | |||
2e49940260 | |||
24d61cc60e | |||
029c1ff20e | |||
c9993bf08b | |||
e678efedf4 | |||
239b0bae61 | |||
30e77bd698 | |||
65549e3fa4 | |||
319f37a313 | |||
bec58f589f | |||
473d5f22b5 | |||
e6c826a7d7 | |||
2f7cddde19 | |||
cecfaf4852 | |||
e5d9128cd0 | |||
1a11a8f8ba | |||
96be282a93 | |||
074e078692 | |||
f24f811acc | |||
6274f7f8d3 | |||
472fc0decc | |||
bff42c26ab | |||
69c6b6f2ac | |||
c56617e051 | |||
76c9cc50f4 | |||
6d0d49171e |
539 changed files with 30476 additions and 18232 deletions
1
.browserslistrc
Normal file
1
.browserslistrc
Normal file
|
@ -0,0 +1 @@
|
|||
last 5 versions, not dead
|
2
.gitattributes
vendored
2
.gitattributes
vendored
|
@ -1,3 +1 @@
|
|||
* text=auto
|
||||
/msz text eol=lf
|
||||
*.sh text eol=lf
|
||||
|
|
11
.gitignore
vendored
11
.gitignore
vendored
|
@ -1,11 +1,18 @@
|
|||
# Assets
|
||||
/public/assets
|
||||
/assets/current.json
|
||||
|
||||
# Libraries
|
||||
/vendor
|
||||
/node_modules
|
||||
/npm-debug.log
|
||||
/yarn-error.log
|
||||
/lib/index-dev
|
||||
/composer.local.json
|
||||
|
||||
# Configuration
|
||||
/config/config.cfg
|
||||
/config/github.cfg
|
||||
/config/config.ini
|
||||
/config/github.ini
|
||||
/.debug
|
||||
|
@ -38,3 +45,7 @@
|
|||
|
||||
# Google
|
||||
/public/robots.txt
|
||||
|
||||
# moguu?
|
||||
/public/moguu.swf
|
||||
/public/moguu.html
|
||||
|
|
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -1,3 +0,0 @@
|
|||
[submodule "lib/index"]
|
||||
path = lib/index
|
||||
url = https://git.flash.moe/flash/index.git
|
221
LICENSE
221
LICENSE
|
@ -1,201 +1,30 @@
|
|||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
Copyright (c) 2017-2024, flashwave <me@flash.moe>
|
||||
All rights reserved.
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted (subject to the limitations in the disclaimer
|
||||
below) provided that the following conditions are met:
|
||||
|
||||
1. Definitions.
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
"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 2017-2023 flashwave <me@flash.moe>
|
||||
|
||||
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.
|
||||
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY
|
||||
THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
||||
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
> Misuzu can and will steal your lunch money.
|
||||
|
||||
## Requirements
|
||||
- PHP 8.1
|
||||
- PHP 8.2 (64-bit)
|
||||
- MariaDB 10.6
|
||||
- [Composer](https://getcomposer.org/)
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
# Misuzu Assets
|
||||
|
||||
Subdirectories of the `css` and `js` folder are accessible through the web as `example.com/assets/<subdirectory>.<directory>`.
|
||||
Meaning `/assets/js/misuzu` is accessible as `/assets/misuzu.js`.
|
||||
Files are concatenated recursively, files first then directories in alphabetical order.
|
||||
Use `_` prefixes to raise things up.
|
108
assets/assproc.js
Normal file
108
assets/assproc.js
Normal file
|
@ -0,0 +1,108 @@
|
|||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const readline = require('readline');
|
||||
const utils = require('./utils.js');
|
||||
|
||||
exports.process = async function(root, options) {
|
||||
const macroPrefix = options.prefix || '#';
|
||||
const entryPoint = options.entry || '';
|
||||
|
||||
root = fs.realpathSync(root);
|
||||
|
||||
const included = [];
|
||||
|
||||
const processFile = async function(fileName) {
|
||||
const fullPath = path.join(root, fileName);
|
||||
if(included.includes(fullPath))
|
||||
return '';
|
||||
included.push(fullPath);
|
||||
|
||||
if(!fullPath.startsWith(root))
|
||||
return '/* *** INVALID PATH: ' + fullPath + ' */';
|
||||
if(!fs.existsSync(fullPath))
|
||||
return '/* *** FILE NOT FOUND: ' + fullPath + ' */';
|
||||
|
||||
const lines = readline.createInterface({
|
||||
input: fs.createReadStream(fullPath),
|
||||
crlfDelay: Infinity,
|
||||
});
|
||||
|
||||
let output = '';
|
||||
let lastWasEmpty = false;
|
||||
|
||||
if(options.showPath)
|
||||
output += "/* *** PATH: " + fullPath + " */\n";
|
||||
|
||||
for await(const line of lines) {
|
||||
const lineTrimmed = utils.trim(line);
|
||||
if(lineTrimmed === '')
|
||||
continue;
|
||||
|
||||
if(line.startsWith(macroPrefix)) {
|
||||
const args = lineTrimmed.split(' ');
|
||||
const macro = utils.trim(utils.trimStart(args.shift(), macroPrefix));
|
||||
|
||||
switch(macro) {
|
||||
case 'comment':
|
||||
break;
|
||||
|
||||
case 'include': {
|
||||
const includePath = utils.trimEnd(args.join(' '), ';');
|
||||
output += utils.trim(await processFile(includePath));
|
||||
output += "\n";
|
||||
break;
|
||||
}
|
||||
|
||||
case 'buildvars':
|
||||
if(typeof options.buildVars === 'object') {
|
||||
const bvTarget = options.buildVarsTarget || 'window';
|
||||
const bvProps = [];
|
||||
|
||||
for(const bvName in options.buildVars)
|
||||
bvProps.push(`${bvName}: { value: ${JSON.stringify(options.buildVars[bvName])}, writable: false }`);
|
||||
|
||||
if(Object.keys(bvProps).length > 0)
|
||||
output += `Object.defineProperties(${bvTarget}, { ${bvProps.join(', ')} });\n`;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
output += line;
|
||||
output += "\n";
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
output += line;
|
||||
output += "\n";
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
};
|
||||
|
||||
return await processFile(entryPoint);
|
||||
};
|
||||
|
||||
exports.housekeep = function(assetsPath) {
|
||||
const files = fs.readdirSync(assetsPath).map(fileName => {
|
||||
const stats = fs.statSync(path.join(assetsPath, fileName));
|
||||
return {
|
||||
name: fileName,
|
||||
lastMod: stats.mtimeMs,
|
||||
};
|
||||
}).sort((a, b) => b.lastMod - a.lastMod).map(info => info.name);
|
||||
|
||||
const regex = /^(.+)[\-\.]([a-f0-9]+)\.(.+)$/i;
|
||||
const counts = {};
|
||||
|
||||
for(const fileName of files) {
|
||||
const match = fileName.match(regex);
|
||||
if(match) {
|
||||
const name = match[1] + '-' + match[3];
|
||||
counts[name] = (counts[name] || 0) + 1;
|
||||
|
||||
if(counts[name] > 5)
|
||||
fs.unlinkSync(path.join(assetsPath, fileName));
|
||||
} else console.log(`Encountered file name in assets folder with unexpected format: ${fileName}`);
|
||||
}
|
||||
};
|
|
@ -1,96 +0,0 @@
|
|||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
outline-style: none;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
[hidden],
|
||||
.hidden {
|
||||
display: none !important;
|
||||
visibility: hidden !important;
|
||||
}
|
||||
|
||||
:root {
|
||||
--font-size: 12px;
|
||||
--line-height: 20px;
|
||||
--font-regular: Verdana, Geneva, 'Dejavu Sans', Arial, Helvetica, sans-serif;
|
||||
--font-monospace: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
|
||||
|
||||
--site-max-width: 1200px;
|
||||
--site-mobile-width: 800px;
|
||||
--site-logo: url('/images/logos/imouto-default.png');
|
||||
|
||||
--header-height-desktop: 70px;
|
||||
--header-height-mobile: 50px;
|
||||
|
||||
--background-image: initial;
|
||||
--background-colour: #111;
|
||||
--background-colour-translucent-1: rgba(17, 17, 17, 0.1);
|
||||
--background-colour-translucent-2: rgba(17, 17, 17, 0.2);
|
||||
--background-colour-translucent-3: rgba(17, 17, 17, 0.3);
|
||||
--background-colour-translucent-4: rgba(17, 17, 17, 0.4);
|
||||
--background-colour-translucent-5: rgba(17, 17, 17, 0.5);
|
||||
--background-colour-translucent-6: rgba(17, 17, 17, 0.6);
|
||||
--background-colour-translucent-7: rgba(17, 17, 17, 0.7);
|
||||
--background-colour-translucent-8: rgba(17, 17, 17, 0.8);
|
||||
--background-colour-translucent-9: rgba(17, 17, 17, 0.9);
|
||||
--background-pattern: url('/images/clouds.png') fixed;
|
||||
|
||||
--container-colour: #161616;
|
||||
|
||||
--text-colour: #fff;
|
||||
--text-colour-inverted: #000;
|
||||
|
||||
--user-colour: inherit;
|
||||
--user-header: url('/images/pixel.png');
|
||||
--accent-colour: #8559a5;
|
||||
--header-accent-colour: var(--accent-colour);
|
||||
}
|
||||
|
||||
html {
|
||||
scrollbar-color: var(--accent-colour) var(--background-colour);
|
||||
}
|
||||
|
||||
.main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-image: var(--background-image);
|
||||
background-color: var(--background-colour);
|
||||
font-size: var(--font-size);
|
||||
line-height: var(--line-height);
|
||||
font-family: var(--font-regular);
|
||||
color: var(--text-colour);
|
||||
background-attachment: fixed;
|
||||
background-position: center center;
|
||||
}
|
||||
.main__wrapper {
|
||||
max-width: var(--site-max-width);
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
flex: 1 0 auto;
|
||||
}
|
||||
|
||||
.main--bg-blend {
|
||||
background-color: var(--accent-colour);
|
||||
background-blend-mode: multiply;
|
||||
}
|
||||
.main--bg-slide { animation: background-slide infinite linear 2s; }
|
||||
.main--bg-cover { background-size: cover; }
|
||||
.main--bg-contain { background-size: contain; }
|
||||
.main--bg-stretch { background-size: 100% 100%; }
|
||||
.main--bg-tile { background-size: auto; }
|
||||
|
||||
.link {
|
||||
color: var(--accent-colour);
|
||||
text-decoration: none;
|
||||
}
|
||||
.link:hover, .link:focus { text-decoration: underline; }
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
.manage {
|
||||
display: flex;
|
||||
}
|
||||
.manage__sidebar {
|
||||
flex: 0 0 auto;
|
||||
width: 280px;
|
||||
}
|
||||
.manage__content {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
.manage__description {
|
||||
font-size: .9em;
|
||||
margin: 1px 2px;
|
||||
border-bottom: 1px solid var(--accent-colour);
|
||||
padding: 2px 5px;
|
||||
}
|
||||
|
||||
@media (max-width: 800px) {
|
||||
.manage {
|
||||
flex-direction: column;
|
||||
}
|
||||
.manage__sidebar {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
|
@ -1,129 +0,0 @@
|
|||
.news__preview {
|
||||
display: flex;
|
||||
margin: 2px 0;
|
||||
flex-direction: row-reverse;
|
||||
|
||||
--user-colour: var(--accent-colour);
|
||||
}
|
||||
.news__preview__info__content {
|
||||
width: 200px;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 15px;
|
||||
flex: 0 0 auto;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.news__preview__info__background {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
mask-image: linear-gradient(90deg, transparent 10%, var(--background-colour) 100%);
|
||||
-webkit-mask-image: linear-gradient(90deg, transparent 10%, var(--background-colour) 100%);
|
||||
background: var(--background-pattern);
|
||||
background-color: var(--user-colour);
|
||||
background-blend-mode: multiply;
|
||||
}
|
||||
|
||||
.news__preview__listing {
|
||||
flex-grow: 1;
|
||||
flex-shrink: 1;
|
||||
}
|
||||
|
||||
.news__preview__container {
|
||||
display: flex;
|
||||
margin: 1px;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.news__preview__user {
|
||||
display: flex;
|
||||
text-align: left;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.news__preview__user__details {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.news__preview__avatar {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.news__preview__username {
|
||||
color: inherit;
|
||||
font-size: 1.4em;
|
||||
line-height: 1.5em;
|
||||
text-decoration: none;
|
||||
}
|
||||
.news__preview__username[href]:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.news__preview__date {
|
||||
font-size: 1.1em;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
|
||||
.news__preview__category {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
font-size: 1.1em;
|
||||
line-height: 1.5em;
|
||||
margin: 6px 0;
|
||||
}
|
||||
.news__preview__category:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.news__preview__content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
line-height: 1.2em;
|
||||
flex: 1 1 auto;
|
||||
word-wrap: break-word;
|
||||
overflow: hidden;
|
||||
margin: 2px;
|
||||
padding: 0 10px 10px 10px;
|
||||
}
|
||||
|
||||
.news__preview__text {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
.news__preview__links {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.news__preview__link {
|
||||
font-size: .9em;
|
||||
}
|
||||
|
||||
@media (max-width: 800px) {
|
||||
.news__preview { flex-direction: column-reverse; }
|
||||
.news__preview__info { display: none; }
|
||||
.news__preview__info__content {
|
||||
width: 100%;
|
||||
flex-wrap: wrap;
|
||||
text-align: left;
|
||||
}
|
||||
.news__preview__info__background {
|
||||
mask-image: linear-gradient(180deg, transparent 10%, var(--background-colour) 100%);
|
||||
-webkit-mask-image: linear-gradient(180deg, transparent 10%, var(--background-colour) 100%);
|
||||
}
|
||||
.news__preview__user {
|
||||
margin-bottom: 0;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.news__preview__avatar {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
.profile__relations {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
}
|
||||
.profile__relations__user {
|
||||
margin: 2px;
|
||||
width: 300px;
|
||||
display: flex;
|
||||
}
|
|
@ -1,139 +0,0 @@
|
|||
.profile__warning {
|
||||
margin: 2px;
|
||||
border-radius: 2px;
|
||||
border: 1px solid var(--accent-colour);
|
||||
}
|
||||
.profile__warning__container {
|
||||
margin: 2px 0;
|
||||
}
|
||||
|
||||
.profile__warning--warning {
|
||||
--accent-colour: #666;
|
||||
}
|
||||
|
||||
.profile__warning--silence {
|
||||
--accent-colour: #f70;
|
||||
}
|
||||
|
||||
.profile__warning--ban {
|
||||
--accent-colour: #c33;
|
||||
}
|
||||
|
||||
.profile__warning--extendo {
|
||||
margin: 4px;
|
||||
}
|
||||
|
||||
.profile__warning__background {
|
||||
background-color: var(--accent-colour);
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.profile__warning__content {
|
||||
background-color: var(--background-colour-translucent-9);
|
||||
display: flex;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.profile__warning__type,
|
||||
.profile__warning__created,
|
||||
.profile__warning__duration {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.profile__warning__type {
|
||||
min-width: 80px;
|
||||
background-color: var(--accent-colour);
|
||||
border-radius: 1px;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
.profile__warning__created,
|
||||
.profile__warning__duration {
|
||||
min-width: 100px;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
.profile__warning__note {
|
||||
padding: 1px 4px;
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
.profile__warning__private {
|
||||
border-top: 1px solid var(--accent-colour);
|
||||
margin-top: 1px;
|
||||
width: 100%;
|
||||
opacity: .5;
|
||||
transition: opacity .2s;
|
||||
}
|
||||
.profile__warning__private:hover,
|
||||
.profile__warning__private:active,
|
||||
.profile__warning__private:focus {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.profile__warning__tools {
|
||||
display: flex;
|
||||
padding-bottom: 1px;
|
||||
}
|
||||
|
||||
.profile__warning__options {
|
||||
flex: 1 1 auto;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.profile__warning__option {
|
||||
padding: 2px 5px;
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.profile__warning__user {
|
||||
display: flex;
|
||||
padding: 2px;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.profile__warning__user__avatar {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.profile__warning__user__username {
|
||||
padding: 0 5px;
|
||||
min-width: 60px;
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
.profile__warning__user__username:hover,
|
||||
.profile__warning__user__username:focus,
|
||||
.profile__warning__user__username:active {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.profile__warning__user__ip {
|
||||
display: inline-flex;
|
||||
padding: 0 5px;
|
||||
}
|
||||
.profile__warning__user__ip:before { content: "("; }
|
||||
.profile__warning__user__ip:after { content: ")"; }
|
||||
|
||||
|
||||
@media (max-width: 800px) {
|
||||
.profile__warning__content {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.profile__warning__tools {
|
||||
flex-direction: column;
|
||||
}
|
||||
.profile__warning__options {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
}
|
|
@ -1,170 +0,0 @@
|
|||
.usercard {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
transition: box-shadow .5s;
|
||||
z-index: 1;
|
||||
color: #fff;
|
||||
background-color: var(--background-colour);
|
||||
box-shadow: 0 1px 2px #000A;
|
||||
text-shadow: 0 1px 4px #000;
|
||||
overflow: hidden;
|
||||
flex: 1 1 auto;
|
||||
|
||||
--usercard-header-overlay-start: transparent;
|
||||
--usercard-header-overlay-stop: var(--background-colour-translucent-9);
|
||||
}
|
||||
.usercard:hover {
|
||||
box-shadow: 0 1px 4px #000;
|
||||
z-index: 2;
|
||||
}
|
||||
.usercard__background {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: var(--accent-colour) var(--background-pattern);
|
||||
background-blend-mode: multiply;
|
||||
}
|
||||
|
||||
.usercard__header {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
.usercard__header__link {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.usercard__header__avatar {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
z-index: 20;
|
||||
}
|
||||
|
||||
.usercard__header__container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 10px;
|
||||
background-image: linear-gradient(0deg, var(--usercard-header-overlay-stop), var(--usercard-header-overlay-start));
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.usercard__header__details {
|
||||
margin: 0 10px;
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
.usercard__header__relation {
|
||||
font-variant: all-small-caps;
|
||||
background: var(--usercard-header-overlay-stop);
|
||||
border-radius: 2px;
|
||||
line-height: 1.2em;
|
||||
padding: 1px 5px 4px;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.usercard__header__username {
|
||||
font-size: 1.5em;
|
||||
line-height: 1.3em;
|
||||
}
|
||||
|
||||
.usercard__header__title {
|
||||
font-size: .9em;
|
||||
line-height: 1.2em;
|
||||
}
|
||||
|
||||
.usercard__header__country {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
}
|
||||
.usercard__header__country__name {
|
||||
font-size: .9em;
|
||||
margin-left: 4px;
|
||||
line-height: 1.2em;
|
||||
}
|
||||
|
||||
.usercard__container {
|
||||
flex: 1 1 auto;
|
||||
background-color: var(--usercard-header-overlay-stop);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.usercard__dates {
|
||||
font-size: .9em;
|
||||
line-height: 1em;
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
align-items: center;
|
||||
flex: 0 0 auto;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.usercard__date {
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.usercard__stats {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-end;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
.usercard__stat {
|
||||
display: flex;
|
||||
flex-direction: column-reverse;
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
padding: 5px 10px;
|
||||
cursor: default;
|
||||
flex: 0 0 auto;
|
||||
text-align: right;
|
||||
}
|
||||
.usercard__stat[href] {
|
||||
cursor: pointer;
|
||||
}
|
||||
.usercard__stat[href]:hover,
|
||||
.usercard__stat[href]:focus {
|
||||
border-bottom: 2px solid var(--accent-colour);
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
.usercard__stat__name {
|
||||
font-size: .9em;
|
||||
font-variant: small-caps;
|
||||
cursor: inherit;
|
||||
}
|
||||
.usercard__stat__value {
|
||||
font-size: 1.3em;
|
||||
cursor: inherit;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.usercard__actions {
|
||||
flex: 0 0 auto;
|
||||
display: flex;
|
||||
height: 38px;
|
||||
}
|
||||
.usercard__action {
|
||||
flex: 1 1 auto;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
font-size: 1.5em;
|
||||
transition: background-color .2s;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
.usercard__action:hover,
|
||||
.usercard__action:focus { background-color: rgba(255, 255, 255, .2); }
|
||||
.usercard__action:active { background-color: rgba(255, 255, 255, .1); }
|
||||
|
||||
@media (max-width: 800px) {
|
||||
.usercard__header__details {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
|
@ -1,127 +0,0 @@
|
|||
var Misuzu = function() {
|
||||
timeago.render($qa('time'));
|
||||
hljs.initHighlighting();
|
||||
|
||||
MszEmbed.init(location.protocol + '//uiharu.' + location.host);
|
||||
|
||||
Misuzu.initQuickSubmit(); // only used by the forum posting form
|
||||
Misuzu.Forum.Editor.init();
|
||||
Misuzu.Events.dispatch();
|
||||
Misuzu.initLoginPage();
|
||||
|
||||
MszEmbed.handle($qa('.js-msz-embed-media'));
|
||||
};
|
||||
Misuzu.showMessageBox = function(text, title, buttons) {
|
||||
if($q('.messagebox'))
|
||||
return false;
|
||||
|
||||
text = text || '';
|
||||
title = title || '';
|
||||
buttons = buttons || [];
|
||||
|
||||
var element = document.createElement('div');
|
||||
element.className = 'messagebox';
|
||||
|
||||
var container = element.appendChild(document.createElement('div'));
|
||||
container.className = 'container messagebox__container';
|
||||
|
||||
var titleElement = container.appendChild(document.createElement('div')),
|
||||
titleBackground = titleElement.appendChild(document.createElement('div')),
|
||||
titleText = titleElement.appendChild(document.createElement('div'));
|
||||
|
||||
titleElement.className = 'container__title';
|
||||
titleBackground.className = 'container__title__background';
|
||||
titleText.className = 'container__title__text';
|
||||
titleText.textContent = title || 'Information';
|
||||
|
||||
var textElement = container.appendChild(document.createElement('div'));
|
||||
textElement.className = 'container__content';
|
||||
textElement.textContent = text;
|
||||
|
||||
var buttonsContainer = container.appendChild(document.createElement('div'));
|
||||
buttonsContainer.className = 'messagebox__buttons';
|
||||
|
||||
var firstButton = null;
|
||||
|
||||
if(buttons.length < 1) {
|
||||
firstButton = buttonsContainer.appendChild(document.createElement('button'));
|
||||
firstButton.className = 'input__button';
|
||||
firstButton.textContent = 'OK';
|
||||
firstButton.addEventListener('click', function() { element.remove(); });
|
||||
} else {
|
||||
for(var i = 0; i < buttons.length; i++) {
|
||||
var button = buttonsContainer.appendChild(document.createElement('button'));
|
||||
button.className = 'input__button';
|
||||
button.textContent = buttons[i].text;
|
||||
button.addEventListener('click', function() {
|
||||
element.remove();
|
||||
buttons[i].callback();
|
||||
});
|
||||
|
||||
if(firstButton === null)
|
||||
firstButton = button;
|
||||
}
|
||||
}
|
||||
|
||||
document.body.appendChild(element);
|
||||
firstButton.focus();
|
||||
return true;
|
||||
};
|
||||
Misuzu.initLoginPage = function() {
|
||||
var updateForm = function(avatarElem, usernameElem) {
|
||||
var xhr = new XMLHttpRequest;
|
||||
xhr.addEventListener('readystatechange', function() {
|
||||
if(xhr.readyState !== 4)
|
||||
return;
|
||||
|
||||
var json = JSON.parse(xhr.responseText);
|
||||
if(!json)
|
||||
return;
|
||||
|
||||
if(json.name)
|
||||
usernameElem.value = json.name;
|
||||
avatarElem.src = json.avatar;
|
||||
});
|
||||
// need to figure out a url registry system again, current one is too much overhead so lets just do this for now
|
||||
xhr.open('GET', '/auth/login.php?resolve=1&name=' + encodeURIComponent(usernameElem.value));
|
||||
xhr.send();
|
||||
};
|
||||
|
||||
var loginForms = $c('js-login-form');
|
||||
|
||||
for(var i = 0; i < loginForms.length; ++i)
|
||||
(function(form) {
|
||||
var loginTimeOut = 0,
|
||||
loginAvatar = form.querySelector('.js-login-avatar'),
|
||||
loginUsername = form.querySelector('.js-login-username');
|
||||
|
||||
updateForm(loginAvatar, loginUsername);
|
||||
loginUsername.addEventListener('keyup', function() {
|
||||
if(loginTimeOut)
|
||||
return;
|
||||
loginTimeOut = setTimeout(function() {
|
||||
updateForm(loginAvatar, loginUsername);
|
||||
clearTimeout(loginTimeOut);
|
||||
loginTimeOut = 0;
|
||||
}, 750);
|
||||
});
|
||||
})(loginForms[i]);
|
||||
};
|
||||
Misuzu.initQuickSubmit = function() {
|
||||
var ctrlSubmit = Array.from($qa('.js-quick-submit, .js-ctrl-enter-submit'));
|
||||
if(!ctrlSubmit)
|
||||
return;
|
||||
|
||||
for(var i = 0; i < ctrlSubmit.length; ++i)
|
||||
ctrlSubmit[i].addEventListener('keydown', function(ev) {
|
||||
if((ev.code === 'Enter' || ev.code === 'NumpadEnter') // i hate this fucking language so much
|
||||
&& ev.ctrlKey && !ev.altKey && !ev.shiftKey && !ev.metaKey) {
|
||||
// hack: prevent forum editor from screaming when using this keycombo
|
||||
// can probably be done in a less stupid manner
|
||||
Misuzu.Forum.Editor.allowWindowClose = true;
|
||||
|
||||
this.form.submit();
|
||||
ev.preventDefault();
|
||||
}
|
||||
});
|
||||
};
|
|
@ -1,122 +0,0 @@
|
|||
var MszEmbed = (function() {
|
||||
let uiharu = undefined;
|
||||
|
||||
return {
|
||||
init: function(endPoint) {
|
||||
uiharu = new Uiharu(endPoint);
|
||||
},
|
||||
handle: function(targets) {
|
||||
if(!Array.isArray(targets))
|
||||
targets = Array.from(targets);
|
||||
|
||||
const filtered = new Map;
|
||||
for(const target of targets) {
|
||||
if(!(target instanceof HTMLElement)
|
||||
|| !('dataset' in target)
|
||||
|| !('mszEmbedUrl' in target.dataset))
|
||||
continue;
|
||||
|
||||
const cleanUrl = target.dataset.mszEmbedUrl.replace(/ /, '%20');
|
||||
if(cleanUrl.indexOf('https://') !== 0
|
||||
&& cleanUrl.indexOf('http://') !== 0
|
||||
&& cleanUrl.indexOf('//') !== 0) {
|
||||
target.textContent = target.dataset.mszEmbedUrl;
|
||||
continue;
|
||||
}
|
||||
|
||||
$rc(target);
|
||||
target.appendChild($e({
|
||||
tag: 'i',
|
||||
attrs: {
|
||||
className: 'fas fa-2x fa-spinner fa-pulse',
|
||||
style: {
|
||||
width: '32px',
|
||||
height: '32px',
|
||||
lineHeight: '32px',
|
||||
textAlign: 'center',
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
||||
if(filtered.has(cleanUrl))
|
||||
filtered.get(cleanUrl).push(target);
|
||||
else
|
||||
filtered.set(cleanUrl, [target]);
|
||||
}
|
||||
|
||||
const replaceWithUrl = function(targets, url) {
|
||||
for(const target of targets) {
|
||||
let body = $e({
|
||||
tag: 'a',
|
||||
attrs: {
|
||||
className: 'link',
|
||||
href: url,
|
||||
target: '_blank',
|
||||
rel: 'noopener noreferrer',
|
||||
},
|
||||
child: url
|
||||
});
|
||||
$ib(target, body);
|
||||
$r(target);
|
||||
}
|
||||
};
|
||||
|
||||
filtered.forEach(function(targets, url) {
|
||||
uiharu.lookupOne(url, function(metadata) {
|
||||
if(metadata.error) {
|
||||
replaceWithUrl(targets, url);
|
||||
console.error(metadata.error);
|
||||
return;
|
||||
}
|
||||
|
||||
if(metadata.title === undefined) {
|
||||
replaceWithUrl(targets, url);
|
||||
console.warn('Media is no longer available.');
|
||||
return;
|
||||
}
|
||||
|
||||
let phc = undefined,
|
||||
options = {
|
||||
onembed: console.log,
|
||||
};
|
||||
|
||||
if(metadata.type === 'youtube:video') {
|
||||
phc = MszVideoEmbedPlaceholder;
|
||||
options.type = 'youtube';
|
||||
options.player = MszVideoEmbedYouTube;
|
||||
} else if(metadata.type === 'niconico:video') {
|
||||
phc = MszVideoEmbedPlaceholder;
|
||||
options.type = 'nicovideo';
|
||||
options.player = MszVideoEmbedNicoNico;
|
||||
} else if(metadata.is_video) {
|
||||
phc = MszVideoEmbedPlaceholder;
|
||||
options.type = 'external';
|
||||
options.player = MszVideoEmbedPlayer;
|
||||
//options.frame = MszVideoEmbedFrame;
|
||||
options.nativeControls = true;
|
||||
options.autosize = false;
|
||||
options.maxWidth = 640;
|
||||
options.maxHeight = 360;
|
||||
} else if(metadata.is_audio) {
|
||||
phc = MszAudioEmbedPlaceholder;
|
||||
options.type = 'external';
|
||||
options.player = MszAudioEmbedPlayer;
|
||||
options.nativeControls = true;
|
||||
} else if(metadata.is_image) {
|
||||
phc = MszImageEmbed;
|
||||
options.type = 'external';
|
||||
}
|
||||
|
||||
if(phc === undefined)
|
||||
return;
|
||||
|
||||
for(const target of targets) {
|
||||
const placeholder = new phc(metadata, options, target);
|
||||
if(placeholder !== undefined)
|
||||
placeholder.replaceElement(target);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
};
|
||||
})();
|
|
@ -1,12 +0,0 @@
|
|||
Misuzu.Events = {};
|
||||
Misuzu.Events.getList = function() {
|
||||
return [
|
||||
new Misuzu.Events.Christmas2019,
|
||||
];
|
||||
};
|
||||
Misuzu.Events.dispatch = function() {
|
||||
var list = Misuzu.Events.getList();
|
||||
for(var i = 0; i < list.length; ++i)
|
||||
if(list[i].isActive())
|
||||
list[i].dispatch();
|
||||
};
|
|
@ -1,33 +0,0 @@
|
|||
Misuzu.Events.Christmas2019 = function() {
|
||||
this.propName = propName = 'msz-christmas-' + (new Date).getFullYear().toString();
|
||||
};
|
||||
Misuzu.Events.Christmas2019.prototype.changeColour = function() {
|
||||
var count = parseInt(localStorage.getItem(this.propName));
|
||||
document.body.style.setProperty('--header-accent-colour', (count++ % 2) ? 'green' : 'red');
|
||||
localStorage.setItem(this.propName, count.toString());
|
||||
};
|
||||
Misuzu.Events.Christmas2019.prototype.isActive = function() {
|
||||
var d = new Date;
|
||||
return d.getMonth() === 11 && d.getDate() > 5 && d.getDate() < 27;
|
||||
};
|
||||
Misuzu.Events.Christmas2019.prototype.dispatch = function() {
|
||||
var headerBg = $q('.header__background'),
|
||||
menuBgs = $qa('.header__desktop__submenu__background');
|
||||
|
||||
if(!localStorage.getItem(this.propName))
|
||||
localStorage.setItem(this.propName, '0');
|
||||
|
||||
if(headerBg)
|
||||
headerBg.style.transition = 'background-color .4s';
|
||||
|
||||
setTimeout(function() {
|
||||
if(headerBg)
|
||||
headerBg.style.transition = 'background-color 1s';
|
||||
|
||||
for(var i = 0; i < menuBgs.length; i++)
|
||||
menuBgs[i].style.transition = 'background-color 1s';
|
||||
}, 1000);
|
||||
|
||||
this.changeColour();
|
||||
setInterval(this.changeColour, 10000);
|
||||
};
|
|
@ -1 +0,0 @@
|
|||
Misuzu.Forum = {};
|
|
@ -1,435 +0,0 @@
|
|||
Misuzu.Forum.Editor = {};
|
||||
Misuzu.Forum.Editor.allowWindowClose = false;
|
||||
Misuzu.Forum.Editor.init = function() {
|
||||
const postingForm = $q('.js-forum-posting');
|
||||
if(!postingForm)
|
||||
return;
|
||||
|
||||
const postingButtons = postingForm.querySelector('.js-forum-posting-buttons'),
|
||||
postingText = postingForm.querySelector('.js-forum-posting-text'),
|
||||
postingParser = postingForm.querySelector('.js-forum-posting-parser'),
|
||||
postingPreview = postingForm.querySelector('.js-forum-posting-preview'),
|
||||
postingMode = postingForm.querySelector('.js-forum-posting-mode'),
|
||||
previewButton = document.createElement('button'),
|
||||
bbcodeButtons = $q('.forum__post__actions--bbcode'),
|
||||
markdownButtons = $q('.forum__post__actions--markdown'),
|
||||
markupButtons = $qa('.forum__post__action--tag');
|
||||
|
||||
// Initialise EEPROM, code sucks ass but it's getting nuked soon again anyway
|
||||
if(typeof peepPath === 'string')
|
||||
document.body.appendChild($e({
|
||||
tag: 'script',
|
||||
attrs: {
|
||||
src: peepPath + '/eeprom.js',
|
||||
charset: 'utf-8',
|
||||
type: 'text/javascript',
|
||||
onload: function() {
|
||||
const eepromClient = new EEPROM(peepApp, peepPath + '/uploads', '');
|
||||
|
||||
const eepromHistory = $e({
|
||||
attrs: {
|
||||
className: 'eeprom-widget-history-items',
|
||||
},
|
||||
});
|
||||
|
||||
const eepromHandleFileUpload = function(file) {
|
||||
const uploadElemNameValue = $e({
|
||||
attrs: {
|
||||
className: 'eeprom-widget-file-name-value',
|
||||
title: file.name,
|
||||
},
|
||||
child: file.name,
|
||||
});
|
||||
|
||||
const uploadElemName = $e({
|
||||
tag: 'a',
|
||||
attrs: {
|
||||
className: 'eeprom-widget-file-name',
|
||||
target: '_blank',
|
||||
},
|
||||
child: uploadElemNameValue,
|
||||
});
|
||||
|
||||
const uploadElemProgressText = $e({
|
||||
attrs: {
|
||||
className: 'eeprom-widget-file-progress',
|
||||
},
|
||||
child: 'Please wait...',
|
||||
});
|
||||
|
||||
const uploadElemProgressBarValue = $e({
|
||||
attrs: {
|
||||
className: 'eeprom-widget-file-bar-fill',
|
||||
style: {
|
||||
width: '0%',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const uploadElem = $e({
|
||||
attrs: {
|
||||
className: 'eeprom-widget-file',
|
||||
},
|
||||
child: [
|
||||
{
|
||||
attrs: {
|
||||
className: 'eeprom-widget-file-info',
|
||||
},
|
||||
child: [
|
||||
uploadElemName,
|
||||
uploadElemProgressText,
|
||||
],
|
||||
},
|
||||
{
|
||||
attrs: {
|
||||
className: 'eeprom-widget-file-bar',
|
||||
},
|
||||
child: uploadElemProgressBarValue,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
if(eepromHistory.children.length > 0)
|
||||
$ib(eepromHistory.firstChild, uploadElem);
|
||||
else
|
||||
eepromHistory.appendChild(uploadElem);
|
||||
|
||||
const explodeUploadElem = function() {
|
||||
$r(uploadElem);
|
||||
};
|
||||
|
||||
const uploadTask = eepromClient.createUpload(file);
|
||||
|
||||
uploadTask.onProgress = function(progressInfo) {
|
||||
const progressValue = progressInfo.progress.toString() + '%';
|
||||
uploadElemProgressBarValue.style.width = progressValue;
|
||||
uploadElemProgressText.textContent = progressValue + ' (' + (progressInfo.total - progressInfo.loaded).toString() + ' bytes remaining)';
|
||||
};
|
||||
|
||||
uploadTask.onFailure = function(errorInfo) {
|
||||
if(!errorInfo.userAborted) {
|
||||
let errorText = 'Was unable to upload file.';
|
||||
|
||||
switch(errorInfo.error) {
|
||||
case EEPROM.ERR_INVALID:
|
||||
errorText = 'Upload request was invalid.';
|
||||
break;
|
||||
case EEPROM.ERR_AUTH:
|
||||
errorText = 'Upload authentication failed, refresh and try again.';
|
||||
break;
|
||||
case EEPROM.ERR_ACCESS:
|
||||
errorText = 'You\'re not allowed to upload files.';
|
||||
break;
|
||||
case EEPROM.ERR_GONE:
|
||||
errorText = 'Upload client has a configuration error or the server is gone.';
|
||||
break;
|
||||
case EEPROM.ERR_DMCA:
|
||||
errorText = 'This file has been uploaded before and was removed for copyright reasons, you cannot upload this file.';
|
||||
break;
|
||||
case EEPROM.ERR_SERVER:
|
||||
errorText = 'Upload server returned a critical error, try again later.';
|
||||
break;
|
||||
case EEPROM.ERR_SIZE:
|
||||
if(errorInfo.maxSize < 1)
|
||||
errorText = 'Selected file is too large.';
|
||||
else {
|
||||
const _t = ['bytes', 'KB', 'MB', 'GB', 'TB'],
|
||||
_i = parseInt(Math.floor(Math.log(errorInfo.maxSize) / Math.log(1024))),
|
||||
_s = Math.round(errorInfo.maxSize / Math.pow(1024, _i), 2);
|
||||
|
||||
errorText = 'Upload may not be larger than %1 %2.'.replace('%1', _s).replace('%2', _t[_i]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
uploadElem.classList.add('eeprom-widget-file-fail');
|
||||
uploadElemProgressText.textContent = errorText;
|
||||
Misuzu.showMessageBox(errorText, 'Upload Error');
|
||||
}
|
||||
};
|
||||
|
||||
uploadTask.onComplete = function(fileInfo) {
|
||||
uploadElem.classList.add('eeprom-widget-file-done');
|
||||
uploadElemName.href = fileInfo.url;
|
||||
uploadElemProgressText.textContent = '';
|
||||
|
||||
const insertTheLinkIntoTheBoxEx2 = function() {
|
||||
const parserMode = parseInt(postingParser.value);
|
||||
let insertText = location.protocol + fileInfo.url;
|
||||
|
||||
if(parserMode == 1) { // bbcode
|
||||
if(fileInfo.isImage())
|
||||
insertText = '[img]' + fileInfo.url + '[/img]';
|
||||
else if(fileInfo.isAudio())
|
||||
insertText = '[audio]' + fileInfo.url + '[/audio]';
|
||||
else if(fileInfo.isVideo())
|
||||
insertText = '[video]' + fileInfo.url + '[/video]';
|
||||
} else if(parserMode == 2) { // markdown
|
||||
if(fileInfo.isMedia())
|
||||
insertText = '![](' + fileInfo.url + ')';
|
||||
}
|
||||
|
||||
$insertTags(postingText, insertText, '');
|
||||
postingText.value = postingText.value.trim();
|
||||
};
|
||||
|
||||
uploadElemProgressText.appendChild($e({
|
||||
tag: 'a',
|
||||
attrs: {
|
||||
href: 'javascript:void(0);',
|
||||
onclick: function() { insertTheLinkIntoTheBoxEx2(); },
|
||||
},
|
||||
child: 'Insert',
|
||||
}));
|
||||
uploadElemProgressText.appendChild($t(' '));
|
||||
uploadElemProgressText.appendChild($e({
|
||||
tag: 'a',
|
||||
attrs: {
|
||||
href: 'javascript:void(0);',
|
||||
onclick: function() {
|
||||
eepromClient.deleteUpload(fileInfo).start();
|
||||
explodeUploadElem();
|
||||
},
|
||||
},
|
||||
child: 'Delete',
|
||||
}));
|
||||
|
||||
insertTheLinkIntoTheBoxEx2();
|
||||
};
|
||||
|
||||
uploadTask.start();
|
||||
};
|
||||
|
||||
const eepromFormInput = $e({
|
||||
tag: 'input',
|
||||
attrs: {
|
||||
type: 'file',
|
||||
multiple: 'multiple',
|
||||
className: 'eeprom-widget-form-input',
|
||||
onchange: function(ev) {
|
||||
const files = this.files;
|
||||
for(const file of files)
|
||||
eepromHandleFileUpload(file);
|
||||
this.value = '';
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const eepromForm = $e({
|
||||
tag: 'label',
|
||||
attrs: {
|
||||
className: 'eeprom-widget-form',
|
||||
},
|
||||
child: [
|
||||
eepromFormInput,
|
||||
{
|
||||
attrs: {
|
||||
className: 'eeprom-widget-form-text',
|
||||
},
|
||||
child: 'Select Files...',
|
||||
}
|
||||
],
|
||||
});
|
||||
|
||||
const eepromWidget = $e({
|
||||
attrs: {
|
||||
className: 'eeprom-widget',
|
||||
},
|
||||
child: [
|
||||
eepromForm,
|
||||
{
|
||||
attrs: {
|
||||
className: 'eeprom-widget-history',
|
||||
},
|
||||
child: eepromHistory,
|
||||
},
|
||||
],
|
||||
});
|
||||
postingForm.appendChild(eepromWidget);
|
||||
|
||||
postingText.addEventListener('paste', function(ev) {
|
||||
if(ev.clipboardData && ev.clipboardData.files.length > 0) {
|
||||
ev.preventDefault();
|
||||
|
||||
const files = ev.clipboardData.files;
|
||||
for(const file of files)
|
||||
eepromHandleFileUpload(file);
|
||||
}
|
||||
});
|
||||
|
||||
document.body.addEventListener('dragenter', function(ev) {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
});
|
||||
document.body.addEventListener('dragover', function(ev) {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
});
|
||||
document.body.addEventListener('dragleave', function(ev) {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
});
|
||||
document.body.addEventListener('drop', function(ev) {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
if(ev.dataTransfer && ev.dataTransfer.files.length > 0) {
|
||||
const files = ev.dataTransfer.files;
|
||||
for(const file of files)
|
||||
eepromHandleFileUpload(file);
|
||||
}
|
||||
});
|
||||
},
|
||||
onerror: function(ev) {
|
||||
console.error('Failed to initialise EEPROM: ', ev);
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
||||
// hack: don't prompt user when hitting submit, really need to make this not stupid.
|
||||
postingButtons.firstElementChild.addEventListener('click', function() {
|
||||
Misuzu.Forum.Editor.allowWindowClose = true;
|
||||
});
|
||||
|
||||
window.addEventListener('beforeunload', function(ev) {
|
||||
if(!Misuzu.Forum.Editor.allowWindowClose && postingText.value.length > 0) {
|
||||
ev.preventDefault();
|
||||
ev.returnValue = '';
|
||||
}
|
||||
});
|
||||
|
||||
for(var i = 0; i < markupButtons.length; ++i)
|
||||
(function(currentBtn) {
|
||||
currentBtn.addEventListener('click', function(ev) {
|
||||
$insertTags(postingText, currentBtn.dataset.tagOpen, currentBtn.dataset.tagClose);
|
||||
});
|
||||
})(markupButtons[i]);
|
||||
|
||||
Misuzu.Forum.Editor.switchButtons(parseInt(postingParser.value));
|
||||
|
||||
var lastPostText = '',
|
||||
lastPostParser = null;
|
||||
|
||||
postingParser.addEventListener('change', function() {
|
||||
var postParser = parseInt(postingParser.value);
|
||||
Misuzu.Forum.Editor.switchButtons(postParser);
|
||||
|
||||
if(postingPreview.hasAttribute('hidden'))
|
||||
return;
|
||||
|
||||
// dunno if this would even be possible, but ech
|
||||
if(postParser === lastPostParser)
|
||||
return;
|
||||
|
||||
postingParser.setAttribute('disabled', 'disabled');
|
||||
previewButton.setAttribute('disabled', 'disabled');
|
||||
previewButton.classList.add('input__button--busy');
|
||||
|
||||
Misuzu.Forum.Editor.renderPreview(postParser, lastPostText, function(success, text) {
|
||||
if(!success) {
|
||||
Misuzu.showMessageBox(text);
|
||||
return;
|
||||
}
|
||||
|
||||
postingPreview.classList[postParser == 2 ? 'add' : 'remove']('markdown');
|
||||
|
||||
lastPostParser = postParser;
|
||||
postingPreview.innerHTML = text;
|
||||
MszEmbed.handle($qa('.js-msz-embed-media'));
|
||||
|
||||
previewButton.removeAttribute('disabled');
|
||||
postingParser.removeAttribute('disabled');
|
||||
previewButton.classList.remove('input__button--busy');
|
||||
});
|
||||
});
|
||||
|
||||
previewButton.className = 'input__button';
|
||||
previewButton.textContent = 'Preview';
|
||||
previewButton.type = 'button';
|
||||
previewButton.value = 'preview';
|
||||
previewButton.addEventListener('click', function() {
|
||||
if(previewButton.value === 'back') {
|
||||
postingPreview.setAttribute('hidden', 'hidden');
|
||||
postingText.removeAttribute('hidden');
|
||||
previewButton.value = 'preview';
|
||||
previewButton.textContent = 'Preview';
|
||||
postingMode.textContent = postingMode.dataset.original;
|
||||
postingMode.dataset.original = null;
|
||||
} else {
|
||||
var postText = postingText.value,
|
||||
postParser = parseInt(postingParser.value);
|
||||
|
||||
if(lastPostText === postText && lastPostParser === postParser) {
|
||||
postingPreview.removeAttribute('hidden');
|
||||
postingText.setAttribute('hidden', 'hidden');
|
||||
previewButton.value = 'back';
|
||||
previewButton.textContent = 'Edit';
|
||||
postingMode.dataset.original = postingMode.textContent;
|
||||
postingMode.textContent = 'Previewing';
|
||||
return;
|
||||
}
|
||||
|
||||
postingParser.setAttribute('disabled', 'disabled');
|
||||
previewButton.setAttribute('disabled', 'disabled');
|
||||
previewButton.classList.add('input__button--busy');
|
||||
|
||||
Misuzu.Forum.Editor.renderPreview(postParser, postText, function(success, text) {
|
||||
if(!success) {
|
||||
Misuzu.showMessageBox(text);
|
||||
return;
|
||||
}
|
||||
|
||||
postingPreview.classList[postParser == 2 ? 'add' : 'remove']('markdown');
|
||||
|
||||
lastPostText = postText;
|
||||
lastPostParser = postParser;
|
||||
postingPreview.innerHTML = text;
|
||||
MszEmbed.handle($qa('.js-msz-embed-media'));
|
||||
|
||||
postingPreview.removeAttribute('hidden');
|
||||
postingText.setAttribute('hidden', 'hidden');
|
||||
previewButton.value = 'back';
|
||||
previewButton.textContent = 'Back';
|
||||
previewButton.removeAttribute('disabled');
|
||||
postingParser.removeAttribute('disabled');
|
||||
previewButton.classList.remove('input__button--busy');
|
||||
postingMode.dataset.original = postingMode.textContent;
|
||||
postingMode.textContent = 'Previewing';
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
postingButtons.insertBefore(previewButton, postingButtons.firstChild);
|
||||
};
|
||||
Misuzu.Forum.Editor.switchButtons = function(parser) {
|
||||
var bbcodeButtons = $q('.forum__post__actions--bbcode'),
|
||||
markdownButtons = $q('.forum__post__actions--markdown');
|
||||
|
||||
bbcodeButtons.hidden = parser != 1;
|
||||
markdownButtons.hidden = parser != 2;
|
||||
};
|
||||
Misuzu.Forum.Editor.renderPreview = function(parser, text, callback) {
|
||||
if(!callback)
|
||||
return;
|
||||
parser = parseInt(parser);
|
||||
text = text || '';
|
||||
|
||||
var xhr = new XMLHttpRequest,
|
||||
formData = new FormData;
|
||||
|
||||
formData.append('post[mode]', 'preview');
|
||||
formData.append('post[text]', text);
|
||||
formData.append('post[parser]', parser.toString());
|
||||
|
||||
xhr.addEventListener('readystatechange', function() {
|
||||
if(xhr.readyState !== XMLHttpRequest.DONE)
|
||||
return;
|
||||
if(xhr.status === 200)
|
||||
callback(true, xhr.response);
|
||||
else
|
||||
callback(false, 'Failed to render preview.');
|
||||
});
|
||||
// need to figure out a url registry system again, current one is too much overhead so lets just do this for now
|
||||
xhr.open('POST', '/forum/posting.php');
|
||||
xhr.withCredentials = true;
|
||||
xhr.send(formData);
|
||||
};
|
|
@ -1,58 +0,0 @@
|
|||
const Uiharu = function(apiUrl) {
|
||||
const maxBatchSize = 4;
|
||||
const lookupOneUrl = apiUrl + '/metadata',
|
||||
lookupManyUrl = apiUrl + '/metadata/batch';
|
||||
|
||||
const lookupManyInternal = function(targetUrls, callback) {
|
||||
const formData = new FormData;
|
||||
|
||||
for(const url of targetUrls)
|
||||
formData.append('url[]', url);
|
||||
|
||||
const xhr = new XMLHttpRequest;
|
||||
xhr.addEventListener('load', function() {
|
||||
callback(JSON.parse(xhr.responseText));
|
||||
});
|
||||
xhr.addEventListener('error', function(ev) {
|
||||
callback({ status: xhr.status, error: 'xhr', details: ev });
|
||||
});
|
||||
xhr.open('POST', lookupManyUrl);
|
||||
xhr.send(formData);
|
||||
};
|
||||
|
||||
return {
|
||||
lookupOne: function(targetUrl, callback) {
|
||||
if(typeof callback !== 'function')
|
||||
throw 'callback is missing';
|
||||
targetUrl = (targetUrl || '').toString();
|
||||
if(targetUrl.length < 1)
|
||||
return;
|
||||
|
||||
const xhr = new XMLHttpRequest;
|
||||
xhr.addEventListener('load', function() {
|
||||
callback(JSON.parse(xhr.responseText));
|
||||
});
|
||||
xhr.addEventListener('error', function() {
|
||||
callback({ status: xhr.status, error: 'xhr', details: ex });
|
||||
});
|
||||
xhr.open('POST', lookupOneUrl);
|
||||
xhr.send(targetUrl);
|
||||
},
|
||||
lookupMany: function(targetUrls, callback) {
|
||||
if(!Array.isArray(targetUrls))
|
||||
throw 'targetUrls must be an array of urls';
|
||||
if(typeof callback !== 'function')
|
||||
throw 'callback is missing';
|
||||
if(targetUrls < 1)
|
||||
return;
|
||||
|
||||
if(targetUrls.length <= maxBatchSize) {
|
||||
lookupManyInternal(targetUrls, callback);
|
||||
return;
|
||||
}
|
||||
|
||||
for(let i = 0; i < targetUrls.length; i += maxBatchSize)
|
||||
lookupManyInternal(targetUrls.slice(i, i + maxBatchSize), callback);
|
||||
},
|
||||
};
|
||||
};
|
|
@ -1,83 +0,0 @@
|
|||
const MszWatcher = function() {
|
||||
let watchers = [];
|
||||
|
||||
return {
|
||||
watch: function(watcher, thisArg, args) {
|
||||
if(typeof watcher !== 'function')
|
||||
throw 'watcher must be a function';
|
||||
if(watchers.indexOf(watcher) >= 0)
|
||||
return;
|
||||
|
||||
watchers.push(watcher);
|
||||
|
||||
if(thisArg !== undefined) {
|
||||
if(!Array.isArray(args)) {
|
||||
if(args !== undefined)
|
||||
args = [args];
|
||||
else args = [];
|
||||
}
|
||||
|
||||
// initial call
|
||||
args.push(true);
|
||||
|
||||
watcher.apply(thisArg, args);
|
||||
}
|
||||
},
|
||||
unwatch: function(watcher) {
|
||||
$ari(watchers, watcher);
|
||||
},
|
||||
call: function(thisArg, args) {
|
||||
if(!Array.isArray(args)) {
|
||||
if(args !== undefined)
|
||||
args = [args];
|
||||
else args = [];
|
||||
}
|
||||
|
||||
args.push(false);
|
||||
|
||||
for(const watcher of watchers)
|
||||
watcher.apply(thisArg, args);
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
const MszWatcherCollection = function() {
|
||||
const collection = new Map;
|
||||
|
||||
const watch = function(name, watcher, thisArg, args) {
|
||||
const watchers = collection.get(name);
|
||||
if(watchers === undefined)
|
||||
throw 'undefined watcher name';
|
||||
watchers.watch(watcher, thisArg, args);
|
||||
};
|
||||
|
||||
const unwatch = function(name, watcher) {
|
||||
const watchers = collection.get(name);
|
||||
if(watchers === undefined)
|
||||
throw 'undefined watcher name';
|
||||
watchers.unwatch(watcher);
|
||||
};
|
||||
|
||||
return {
|
||||
define: function(names) {
|
||||
if(!Array.isArray(names))
|
||||
names = [names];
|
||||
for(const name of names)
|
||||
collection.set(name, new MszWatcher);
|
||||
},
|
||||
call: function(name, thisArg, args) {
|
||||
const watchers = collection.get(name);
|
||||
if(watchers === undefined)
|
||||
throw 'undefined watcher name';
|
||||
watchers.call(thisArg, args);
|
||||
},
|
||||
watch: watch,
|
||||
unwatch: unwatch,
|
||||
proxy: function(obj) {
|
||||
obj.watch = function(name, watcher) {
|
||||
watch(name, watcher);
|
||||
};
|
||||
obj.unwatch = unwatch;
|
||||
},
|
||||
};
|
||||
};
|
|
@ -1,7 +1,6 @@
|
|||
.container {
|
||||
background-color: var(--container-colour);
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
|
||||
text-shadow: 0 1px 4px #000;
|
||||
overflow: hidden;
|
||||
word-wrap: break-word;
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
.embed {
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
text-shadow: initial;
|
||||
}
|
||||
|
||||
.embed iframe {
|
||||
|
@ -16,7 +15,6 @@
|
|||
cursor: pointer;
|
||||
color: var(--text-colour);
|
||||
text-decoration: none;
|
||||
text-shadow: initial;
|
||||
}
|
||||
.embedph:hover .embedph-bg img,
|
||||
.embedph:active .embedph-bg img,
|
||||
|
@ -214,7 +212,6 @@
|
|||
.aembed {
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
text-shadow: initial;
|
||||
}
|
||||
|
||||
.aembedph {
|
||||
|
@ -223,7 +220,6 @@
|
|||
cursor: pointer;
|
||||
color: var(--text-colour);
|
||||
text-decoration: none;
|
||||
text-shadow: initial;
|
||||
max-width: 500px;
|
||||
min-width: 300px;
|
||||
height: 70px;
|
|
@ -139,7 +139,7 @@
|
|||
.forum__category__activity {
|
||||
text-align: right;
|
||||
min-width: 270px;
|
||||
line-height: 1.5em;
|
||||
line-height: 1.4em;
|
||||
}
|
||||
.forum__category__activity__none,
|
||||
.forum__category__activity__details {
|
||||
|
@ -171,6 +171,7 @@
|
|||
color: var(--user-colour);
|
||||
text-decoration: none;
|
||||
pointer-events: initial;
|
||||
display: block;
|
||||
}
|
||||
.forum__category__username:hover,
|
||||
.forum__category__username:focus {
|
||||
|
@ -229,4 +230,7 @@
|
|||
.forum__category__avatar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.forum__category__username {
|
||||
display: none;
|
||||
}
|
||||
}
|
|
@ -154,6 +154,9 @@
|
|||
}
|
||||
|
||||
.forum__post__action {
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
display: block;
|
||||
padding: 5px 10px;
|
||||
margin: 1px;
|
||||
color: inherit;
|
|
@ -146,9 +146,14 @@
|
|||
}
|
||||
.header__desktop__user__button__count {
|
||||
position: absolute;
|
||||
bottom: 1px;
|
||||
right: 1px;
|
||||
font-size: 10px;
|
||||
top: -5px;
|
||||
right: -3px;
|
||||
z-index: 1;
|
||||
font-size: .5em;
|
||||
line-height: 1.4em;
|
||||
text-align: right;
|
||||
padding: 2px 2px 0;
|
||||
border-radius: 4px;
|
||||
background-color: var(--header-accent-colour);
|
||||
opacity: .9;
|
||||
border-radius: 4px;
|
||||
|
@ -224,7 +229,6 @@
|
|||
background-blend-mode: multiply;
|
||||
transition: max-height .2s;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
|
||||
text-shadow: 0 1px 4px #000;
|
||||
max-height: 0;
|
||||
overflow: hidden;
|
||||
}
|
92
assets/misuzu.css/hljs.css
Normal file
92
assets/misuzu.css/hljs.css
Normal file
|
@ -0,0 +1,92 @@
|
|||
pre code.hljs {
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
padding: 1em;
|
||||
font-size: 1.2em;
|
||||
font-family: var(--font-monospace);
|
||||
}
|
||||
|
||||
code.hljs {
|
||||
padding: 2px 5px;
|
||||
}
|
||||
|
||||
.hljs {
|
||||
color: #eee;
|
||||
background: #121212;
|
||||
}
|
||||
|
||||
.hljs-strong,
|
||||
.hljs-emphasis,
|
||||
.hljs-section {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.hljs-bullet,
|
||||
.hljs-quote,
|
||||
.hljs-number,
|
||||
.hljs-regexp,
|
||||
.hljs-literal {
|
||||
color: #b2b376;
|
||||
}
|
||||
|
||||
.hljs-code {
|
||||
background-color: #242424;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-meta,
|
||||
.hljs-emphasis,
|
||||
.hljs-stronge,
|
||||
.hljs-type,
|
||||
.hljs-attribute,
|
||||
.hljs-params {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.hljs-keyword,
|
||||
.hljs-selector-tag,
|
||||
.hljs-section,
|
||||
.hljs-symbol,
|
||||
.hljs-name {
|
||||
color: #9475b2;
|
||||
}
|
||||
|
||||
.hljs-built_in,
|
||||
.hljs-subst,
|
||||
.hljs-tag,
|
||||
.hljs-title,
|
||||
.hljs-selector-attr {
|
||||
color: #c8b9d7;
|
||||
}
|
||||
|
||||
.hljs-variable,
|
||||
.hljs-class .hljs-title,
|
||||
.hljs-selector-class,
|
||||
.hljs-selector-id,
|
||||
.hljs-selector-pseudo {
|
||||
color: #b37fae;
|
||||
}
|
||||
|
||||
.hljs-string {
|
||||
color: #76b38a;
|
||||
}
|
||||
|
||||
.hljs-type,
|
||||
.hljs-template-tag,
|
||||
.hljs-template-variable,
|
||||
.hljs-link {
|
||||
color: #b39a76;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-meta {
|
||||
color: #70647b;
|
||||
}
|
||||
|
||||
.hljs-addition {
|
||||
background: #0e4d0e;
|
||||
}
|
||||
|
||||
.hljs-deletion {
|
||||
background: #4d0e0e;
|
||||
}
|
203
assets/misuzu.css/main.css
Normal file
203
assets/misuzu.css/main.css
Normal file
|
@ -0,0 +1,203 @@
|
|||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
[hidden],
|
||||
.hidden {
|
||||
display: none !important;
|
||||
visibility: hidden !important;
|
||||
}
|
||||
|
||||
:root {
|
||||
--font-size: 12px;
|
||||
--line-height: 20px;
|
||||
--font-regular: Verdana, Geneva, 'Dejavu Sans', Arial, Helvetica, sans-serif;
|
||||
--font-monospace: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
|
||||
|
||||
--site-max-width: 1200px;
|
||||
--site-mobile-width: 800px;
|
||||
--site-logo: url('/images/logos/imouto-default.png');
|
||||
|
||||
--header-height-desktop: 70px;
|
||||
--header-height-mobile: 50px;
|
||||
|
||||
--background-image: initial;
|
||||
--background-colour: #111;
|
||||
--background-colour-translucent-1: rgba(17, 17, 17, 0.1);
|
||||
--background-colour-translucent-2: rgba(17, 17, 17, 0.2);
|
||||
--background-colour-translucent-3: rgba(17, 17, 17, 0.3);
|
||||
--background-colour-translucent-4: rgba(17, 17, 17, 0.4);
|
||||
--background-colour-translucent-5: rgba(17, 17, 17, 0.5);
|
||||
--background-colour-translucent-6: rgba(17, 17, 17, 0.6);
|
||||
--background-colour-translucent-7: rgba(17, 17, 17, 0.7);
|
||||
--background-colour-translucent-8: rgba(17, 17, 17, 0.8);
|
||||
--background-colour-translucent-9: rgba(17, 17, 17, 0.9);
|
||||
--background-pattern: url('/images/clouds.png') fixed;
|
||||
|
||||
--container-colour: #161616;
|
||||
|
||||
--text-colour: #fff;
|
||||
--text-colour-inverted: #000;
|
||||
|
||||
--user-colour: inherit;
|
||||
--user-header: url('/images/pixel.png');
|
||||
--accent-colour: #8559a5;
|
||||
--header-accent-colour: var(--accent-colour);
|
||||
}
|
||||
|
||||
html {
|
||||
scrollbar-color: var(--accent-colour) var(--background-colour);
|
||||
accent-color: var(--accent-colour);
|
||||
color-scheme: dark;
|
||||
}
|
||||
|
||||
.main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-image: var(--background-image);
|
||||
background-color: var(--background-colour);
|
||||
font-size: var(--font-size);
|
||||
line-height: var(--line-height);
|
||||
font-family: var(--font-regular);
|
||||
color: var(--text-colour);
|
||||
background-attachment: fixed;
|
||||
background-position: center center;
|
||||
}
|
||||
.main__wrapper {
|
||||
max-width: var(--site-max-width);
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
flex: 1 0 auto;
|
||||
}
|
||||
|
||||
.main--bg-blend {
|
||||
background-color: var(--accent-colour);
|
||||
background-blend-mode: multiply;
|
||||
}
|
||||
.main--bg-slide { animation: background-slide infinite linear 2s; }
|
||||
.main--bg-cover { background-size: cover; }
|
||||
.main--bg-contain { background-size: contain; }
|
||||
.main--bg-stretch { background-size: 100% 100%; }
|
||||
.main--bg-tile { background-size: auto; }
|
||||
|
||||
.link {
|
||||
color: var(--accent-colour);
|
||||
text-decoration: none;
|
||||
}
|
||||
.link:hover, .link:focus { text-decoration: underline; }
|
||||
|
||||
@comment "convert all of the below into a proper inclusion structure";
|
||||
|
||||
@include animations.css;
|
||||
@include avatar.css;
|
||||
@include bb.css;
|
||||
@include confirm.css;
|
||||
@include container.css;
|
||||
@include eeprom.css;
|
||||
@include embed.css;
|
||||
@include emoticon.css;
|
||||
@include flags.css;
|
||||
@include footer.css;
|
||||
@include header.css;
|
||||
@include impersonate.css;
|
||||
@include landing.css;
|
||||
@include main.css;
|
||||
@include markdown.css;
|
||||
@include messagebox.css;
|
||||
@include navigation.css;
|
||||
@include pagination.css;
|
||||
@include permissions.css;
|
||||
@include warning.css;
|
||||
|
||||
@include hljs.css;
|
||||
|
||||
@include _input/button.css;
|
||||
@include _input/checkbox.css;
|
||||
@include _input/colour.css;
|
||||
@include _input/select.css;
|
||||
@include _input/text.css;
|
||||
@include _input/textarea.css;
|
||||
@include _input/upload.css;
|
||||
|
||||
@include auth/buttons.css;
|
||||
@include auth/container.css;
|
||||
@include auth/label.css;
|
||||
@include auth/login.css;
|
||||
@include auth/logout.css;
|
||||
@include auth/register.css;
|
||||
@include auth/warning.css;
|
||||
|
||||
@include changelog/_changelog.css;
|
||||
@include changelog/change.css;
|
||||
@include changelog/container.css;
|
||||
@include changelog/entry.css;
|
||||
@include changelog/listing.css;
|
||||
@include changelog/log.css;
|
||||
@include changelog/pagination.css;
|
||||
|
||||
@include comments/comment.css;
|
||||
@include comments/comments.css;
|
||||
|
||||
@include forum/actions.css;
|
||||
@include forum/categories.css;
|
||||
@include forum/confirm.css;
|
||||
@include forum/header.css;
|
||||
@include forum/leaderboard.css;
|
||||
@include forum/poll.css;
|
||||
@include forum/post.css;
|
||||
@include forum/priority.css;
|
||||
@include forum/status.css;
|
||||
@include forum/topics.css;
|
||||
|
||||
@include home/landingv2-footer.css;
|
||||
@include home/landingv2-header.css;
|
||||
@include home/landingv2.css;
|
||||
|
||||
@include manage/_manage.css;
|
||||
|
||||
@include messages/messages.css;
|
||||
|
||||
@include news/container.css;
|
||||
@include news/feeds.css;
|
||||
@include news/list.css;
|
||||
@include news/post.css;
|
||||
@include news/preview.css;
|
||||
@include news/sidebar.css;
|
||||
|
||||
@include profile/about.css;
|
||||
@include profile/accounts.css;
|
||||
@include profile/birthdate.css;
|
||||
@include profile/forum-activity.css;
|
||||
@include profile/guidelines.css;
|
||||
@include profile/header.css;
|
||||
@include profile/profile.css;
|
||||
@include profile/signature.css;
|
||||
@include profile/warnings.css;
|
||||
|
||||
@include search/anchor.css;
|
||||
@include search/categories.css;
|
||||
@include search/container.css;
|
||||
@include search/header.css;
|
||||
@include search/input.css;
|
||||
@include search/none.css;
|
||||
|
||||
@include settings/account-logs.css;
|
||||
@include settings/account.css;
|
||||
@include settings/data.css;
|
||||
@include settings/login-attempts.css;
|
||||
@include settings/role.css;
|
||||
@include settings/sessions.css;
|
||||
@include settings/settings.css;
|
||||
@include settings/two-factor.css;
|
||||
|
||||
@include user/usercard.css;
|
||||
@include user/userlist.css;
|
47
assets/misuzu.css/manage/_manage.css
Normal file
47
assets/misuzu.css/manage/_manage.css
Normal file
|
@ -0,0 +1,47 @@
|
|||
.manage {
|
||||
display: flex;
|
||||
}
|
||||
.manage__sidebar {
|
||||
flex: 0 0 auto;
|
||||
width: 280px;
|
||||
}
|
||||
.manage__content {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
.manage__description {
|
||||
font-size: .9em;
|
||||
margin: 1px 2px;
|
||||
border-bottom: 1px solid var(--accent-colour);
|
||||
padding: 2px 5px;
|
||||
}
|
||||
|
||||
@media (max-width: 800px) {
|
||||
.manage {
|
||||
flex-direction: column;
|
||||
}
|
||||
.manage__sidebar {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@include manage/ban.css;
|
||||
@include manage/bans.css;
|
||||
@include manage/blacklist.css;
|
||||
@include manage/changelog-actions-tags.css;
|
||||
@include manage/emote.css;
|
||||
@include manage/emotes.css;
|
||||
@include manage/navigation.css;
|
||||
@include manage/note.css;
|
||||
@include manage/notes.css;
|
||||
@include manage/role-item.css;
|
||||
@include manage/roles.css;
|
||||
@include manage/settings.css;
|
||||
@include manage/statistic.css;
|
||||
@include manage/statistics.css;
|
||||
@include manage/tag.css;
|
||||
@include manage/tags.css;
|
||||
@include manage/user-item.css;
|
||||
@include manage/user.css;
|
||||
@include manage/users.css;
|
||||
@include manage/warning.css;
|
||||
@include manage/warnings.css;
|
73
assets/misuzu.css/manage/ban.css
Normal file
73
assets/misuzu.css/manage/ban.css
Normal file
|
@ -0,0 +1,73 @@
|
|||
.manage__ban__field {
|
||||
margin: 2px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.manage__ban__title {
|
||||
font-size: 1.4em;
|
||||
line-height: 1.5em;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
.manage__ban__desc {
|
||||
font-size: .9em;
|
||||
line-height: 1.5em;
|
||||
font-style: italic;
|
||||
border-bottom: 1px solid var(--accent-colour);
|
||||
padding: 2px 4px;
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
|
||||
.manage__ban__duration {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 5px;
|
||||
gap: 5px;
|
||||
}
|
||||
.manage__ban__duration__value__custom--hidden {
|
||||
display: none;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.manage__ban__severity {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 5px;
|
||||
gap: 5px;
|
||||
}
|
||||
.manage__ban__severity__slider {
|
||||
max-width: 200px;
|
||||
width: 100%;
|
||||
}
|
||||
.manage__ban__severity__slider input {
|
||||
width: 100%;
|
||||
margin-top: 2px;
|
||||
}
|
||||
.manage__ban__severity__display {
|
||||
max-width: 80px;
|
||||
width: 100%;
|
||||
}
|
||||
.manage__ban__severity__display input {
|
||||
width: 100%;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.manage__ban__reason {
|
||||
padding: 2px;
|
||||
width: 100%;
|
||||
}
|
||||
.manage__ban__reason textarea {
|
||||
min-width: 100%;
|
||||
max-width: 100%;
|
||||
width: 100%;
|
||||
min-height: 100px;
|
||||
}
|
||||
|
||||
.manage__ban__actions {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 10px;
|
||||
padding-top: 0;
|
||||
}
|
122
assets/misuzu.css/manage/bans.css
Normal file
122
assets/misuzu.css/manage/bans.css
Normal file
|
@ -0,0 +1,122 @@
|
|||
.manage__bans__pagination {
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
.manage__bans__actions {
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
.manage__bans__item {
|
||||
padding: 0 2px;
|
||||
margin: 2px;
|
||||
border-top: 1px solid var(--accent-colour);
|
||||
}
|
||||
.manage__bans__item:not(:last-child) {
|
||||
border-bottom: 1px solid var(--accent-colour);
|
||||
}
|
||||
|
||||
.manage__bans__item__header {
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.manage__bans__item__attributes {
|
||||
flex-grow: 1;
|
||||
flex-shrink: 1;
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
margin: 0 4px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.manage__bans__item__attribute {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
align-items: center;
|
||||
}
|
||||
.manage__bans__item__created__icon,
|
||||
.manage__bans__item__expires__icon,
|
||||
.manage__bans__item__permanent__icon {
|
||||
font-size: 16px;
|
||||
}
|
||||
.manage__bans__item__expires__status span {
|
||||
padding: 2px 4px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.manage__bans__item__expires__status--active span {
|
||||
background: rgba(255, 100, 100, 0.2);
|
||||
font-weight: 700;
|
||||
}
|
||||
.manage__bans__item__expires__status--expired span {
|
||||
background: rgba(100, 255, 100, 0.2);
|
||||
}
|
||||
.manage__bans__item__permanent {
|
||||
background: rgba(255, 200, 100, 0.2);
|
||||
border-radius: 2px;
|
||||
padding: 0 4px;
|
||||
}
|
||||
.manage__bans__item__permanent__time {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.manage__bans__item__actions {
|
||||
display: flex;
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
gap: 1px;
|
||||
padding: 1px;
|
||||
margin: 1px;
|
||||
}
|
||||
.manage__bans__item__action {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
}
|
||||
|
||||
.manage__bans__item__author a,
|
||||
.manage__bans__item__user a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
.manage__bans__item__author__name a,
|
||||
.manage__bans__item__user__name a {
|
||||
font-weight: bold;
|
||||
display: inline-block;
|
||||
padding-top: 2px;
|
||||
border-bottom: 2px solid var(--user-colour, #fff);
|
||||
}
|
||||
.manage__bans__item__user__filter a {
|
||||
padding: 2px 4px;
|
||||
border-radius: 2px;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
transition: background .2s;
|
||||
}
|
||||
.manage__bans__item__user__filter a:hover,
|
||||
.manage__bans__item__user__filter a:focus {
|
||||
background: rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
.manage__bans__item__user__filter a:active {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.manage__bans__item__reason {
|
||||
margin: 1px 4px;
|
||||
padding: 2px 4px;
|
||||
border-top: 1px solid var(--accent-colour);
|
||||
}
|
||||
.manage__bans__item__reason__title {
|
||||
font-size: .9em;
|
||||
line-height: 1.5em;
|
||||
font-style: italic;
|
||||
}
|
||||
.manage__bans__item__reason__body {
|
||||
padding-left: 4px;
|
||||
border-left: 2px solid var(--accent-colour);
|
||||
}
|
||||
|
||||
.manage__bans__item__noreason {
|
||||
font-size: .9em;
|
||||
font-style: italic;
|
||||
}
|
88
assets/misuzu.css/manage/note.css
Normal file
88
assets/misuzu.css/manage/note.css
Normal file
|
@ -0,0 +1,88 @@
|
|||
.manage__note {
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
.manage__note--view .manage__note--editing,
|
||||
.manage__note--edit .manage__note--viewing {
|
||||
display: none !important;
|
||||
visibility: hidden !important;
|
||||
}
|
||||
|
||||
.manage__note__header {
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.manage__note__title {
|
||||
flex-grow: 1;
|
||||
flex-shrink: 1;
|
||||
font-size: 1.4em;
|
||||
line-height: 1.3em;
|
||||
}
|
||||
.manage__note__title__text {
|
||||
padding: 2px 5px;
|
||||
}
|
||||
.manage__note__title input {
|
||||
width: 100%;
|
||||
}
|
||||
.manage__note__actions {
|
||||
display: flex;
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
gap: 1px;
|
||||
padding: 1px;
|
||||
margin: 1px;
|
||||
}
|
||||
.manage__note__action {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
}
|
||||
|
||||
.manage__note__attributes {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
margin: 0 4px;
|
||||
}
|
||||
|
||||
.manage__note__attribute {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
align-items: center;
|
||||
}
|
||||
.manage__note__created__icon {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.manage__note__author a,
|
||||
.manage__note__user a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
.manage__note__author__name a,
|
||||
.manage__note__user__name a {
|
||||
font-weight: bold;
|
||||
display: inline-block;
|
||||
padding-top: 2px;
|
||||
border-bottom: 2px solid var(--user-colour, #fff);
|
||||
}
|
||||
|
||||
.manage__note__body {
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
.manage__note__nobody {
|
||||
text-align: center;
|
||||
font-size: .9em;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.manage__note__editor {
|
||||
width: 100%;
|
||||
}
|
||||
.manage__note__editor textarea {
|
||||
width: 100%;
|
||||
min-width: 100%;
|
||||
max-width: 100%;
|
||||
min-height: 300px;
|
||||
}
|
122
assets/misuzu.css/manage/notes.css
Normal file
122
assets/misuzu.css/manage/notes.css
Normal file
|
@ -0,0 +1,122 @@
|
|||
.manage__notes__pagination {
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
.manage__notes__actions {
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
.manage__notes__item {
|
||||
padding: 2px;
|
||||
margin: 2px;
|
||||
}
|
||||
.manage__notes__item:not(:last-child) {
|
||||
border-bottom: 1px solid var(--accent-colour);
|
||||
}
|
||||
|
||||
.manage__notes__item__header {
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
align-items: center;
|
||||
}
|
||||
.manage__notes__item__title {
|
||||
flex-grow: 1;
|
||||
flex-shrink: 1;
|
||||
font-size: 1.4em;
|
||||
line-height: 1.3em;
|
||||
padding: 2px 5px;
|
||||
}
|
||||
.manage__notes__item__title a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
.manage__notes__item__title a:hover,
|
||||
.manage__notes__item__title a:focus {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.manage__notes__item__actions {
|
||||
display: flex;
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
gap: 1px;
|
||||
padding: 1px;
|
||||
margin: 1px;
|
||||
}
|
||||
.manage__notes__item__action {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
}
|
||||
|
||||
.manage__notes__item__attributes {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
margin: 0 4px;
|
||||
}
|
||||
|
||||
.manage__notes__item__attribute {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
align-items: center;
|
||||
}
|
||||
.manage__notes__item__created__icon {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.manage__notes__item__author a,
|
||||
.manage__notes__item__user a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
.manage__notes__item__author__name a,
|
||||
.manage__notes__item__user__name a {
|
||||
font-weight: bold;
|
||||
display: inline-block;
|
||||
padding-top: 2px;
|
||||
border-bottom: 2px solid var(--user-colour, #fff);
|
||||
}
|
||||
.manage__notes__item__user__filter a {
|
||||
padding: 2px 4px;
|
||||
border-radius: 2px;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
transition: background .2s;
|
||||
}
|
||||
.manage__notes__item__user__filter a:hover,
|
||||
.manage__notes__item__user__filter a:focus {
|
||||
background: rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
.manage__notes__item__user__filter a:active {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.manage__notes__item__body {
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
.manage__notes__item__nobody {
|
||||
text-align: center;
|
||||
font-size: .9em;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.manage__notes__item__continue {
|
||||
text-align: center;
|
||||
}
|
||||
.manage__notes__item__continue a {
|
||||
display: inline-block;
|
||||
padding: 2px 5px;
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
border-radius: 5px;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
transition: background .2s;
|
||||
}
|
||||
.manage__notes__item__continue a:hover,
|
||||
.manage__notes__item__continue a:focus {
|
||||
background: rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
.manage__notes__item__continue a:active {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
.manage__role-item {
|
||||
display: flex;
|
||||
text-shadow: 0 1px 4px #000;
|
||||
box-shadow: 0 1px 4px #000A;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
@ -38,6 +37,7 @@
|
|||
width: 40px;
|
||||
height: 40px;
|
||||
box-shadow: 0 1px 4px #111;
|
||||
text-shadow: 0 1px 4px #000;
|
||||
margin: 10px;
|
||||
flex: 0 0 auto;
|
||||
overflow: hidden;
|
|
@ -36,10 +36,13 @@
|
|||
.manage-list-setting-type--string {
|
||||
--type-colour: #ef8323;
|
||||
}
|
||||
.manage-list-setting-type--integer {
|
||||
.manage-list-setting-type--int {
|
||||
--type-colour: #8c90bc;
|
||||
}
|
||||
.manage-list-setting-type--boolean {
|
||||
.manage-list-setting-type--float {
|
||||
--type-colour: #cb09c8;
|
||||
}
|
||||
.manage-list-setting-type--bool {
|
||||
--type-colour: #77b34c;
|
||||
}
|
||||
.manage-list-setting-type--array {
|
||||
|
@ -48,7 +51,6 @@
|
|||
.manage-list-setting-type-text {
|
||||
background: var(--type-colour);
|
||||
border-radius: 5px;
|
||||
text-shadow: initial;
|
||||
font-weight: 700;
|
||||
padding: 0 5px;
|
||||
font-size: .9em;
|
|
@ -9,6 +9,12 @@
|
|||
}
|
||||
.manage__statistic__value {
|
||||
text-align: right;
|
||||
font-size: 1.5em;
|
||||
line-height: 2em;
|
||||
font-size: 1.4em;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
.manage__statistic__updated {
|
||||
text-align: right;
|
||||
font-size: .9em;
|
||||
font-style: italic;
|
||||
line-height: 1.5em;
|
||||
}
|
|
@ -1,9 +1,14 @@
|
|||
.manage__statistics {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr;
|
||||
padding: 5px;
|
||||
grid-gap: 5px;
|
||||
}
|
||||
@media (max-width: 1100px) {
|
||||
.manage__statistics {
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
}
|
||||
}
|
||||
@media (max-width: 900px) {
|
||||
.manage__statistics {
|
||||
grid-template-columns: 1fr 1fr;
|
|
@ -1,6 +1,5 @@
|
|||
.manage__user-item {
|
||||
display: flex;
|
||||
text-shadow: 0 1px 4px #000;
|
||||
box-shadow: 0 1px 4px #000A;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
@ -60,6 +59,7 @@
|
|||
.manage__user-item__name {
|
||||
font-size: 1.4em;
|
||||
line-height: 1.4em;
|
||||
max-width: 600px; /* whatever */
|
||||
}
|
||||
|
||||
.manage__user-item__details {
|
37
assets/misuzu.css/manage/warning.css
Normal file
37
assets/misuzu.css/manage/warning.css
Normal file
|
@ -0,0 +1,37 @@
|
|||
.manage__warning__field {
|
||||
margin: 2px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.manage__warning__title {
|
||||
font-size: 1.4em;
|
||||
line-height: 1.5em;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
.manage__warning__desc {
|
||||
font-size: .9em;
|
||||
line-height: 1.5em;
|
||||
font-style: italic;
|
||||
border-bottom: 1px solid var(--accent-colour);
|
||||
padding: 2px 4px;
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
|
||||
.manage__warning__body {
|
||||
padding: 2px;
|
||||
width: 100%;
|
||||
}
|
||||
.manage__warning__body textarea {
|
||||
min-width: 100%;
|
||||
max-width: 100%;
|
||||
width: 100%;
|
||||
min-height: 100px;
|
||||
}
|
||||
|
||||
.manage__warning__actions {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 10px;
|
||||
padding-top: 0;
|
||||
}
|
91
assets/misuzu.css/manage/warnings.css
Normal file
91
assets/misuzu.css/manage/warnings.css
Normal file
|
@ -0,0 +1,91 @@
|
|||
.manage__warnings__pagination {
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
.manage__warnings__actions {
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
.manage__warnings__item {
|
||||
padding: 0 2px;
|
||||
margin: 2px;
|
||||
border-top: 1px solid var(--accent-colour);
|
||||
}
|
||||
.manage__warnings__item:not(:last-child) {
|
||||
border-bottom: 1px solid var(--accent-colour);
|
||||
}
|
||||
|
||||
.manage__warnings__item__header {
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.manage__warnings__item__attributes {
|
||||
flex-grow: 1;
|
||||
flex-shrink: 1;
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
margin: 0 4px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.manage__warnings__item__attribute {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
align-items: center;
|
||||
}
|
||||
.manage__warnings__item__created__icon {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.manage__warnings__item__actions {
|
||||
display: flex;
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
gap: 1px;
|
||||
padding: 1px;
|
||||
margin: 1px;
|
||||
}
|
||||
.manage__warnings__item__action {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
}
|
||||
|
||||
.manage__warnings__item__author a,
|
||||
.manage__warnings__item__user a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
.manage__warnings__item__author__name a,
|
||||
.manage__warnings__item__user__name a {
|
||||
font-weight: bold;
|
||||
display: inline-block;
|
||||
padding-top: 2px;
|
||||
border-bottom: 2px solid var(--user-colour, #fff);
|
||||
}
|
||||
.manage__warnings__item__user__filter a {
|
||||
padding: 2px 4px;
|
||||
border-radius: 2px;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
transition: background .2s;
|
||||
}
|
||||
.manage__warnings__item__user__filter a:hover,
|
||||
.manage__warnings__item__user__filter a:focus {
|
||||
background: rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
.manage__warnings__item__user__filter a:active {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.manage__warnings__item__reason {
|
||||
margin: 1px 4px;
|
||||
padding: 2px 4px;
|
||||
border-top: 1px solid var(--accent-colour);
|
||||
}
|
||||
.manage__warnings__item__reason p {
|
||||
padding-left: 4px;
|
||||
border-left: 2px solid var(--accent-colour);
|
||||
}
|
|
@ -53,7 +53,6 @@
|
|||
.markdown code {
|
||||
padding: .2em .4em;
|
||||
margin: 0;
|
||||
background-color: rgba(0, 0, 0, .7);
|
||||
border-radius: 2px;
|
||||
}
|
||||
.markdown del code { text-decoration: inherit; }
|
||||
|
@ -65,7 +64,6 @@
|
|||
overflow: hidden;
|
||||
line-height: inherit;
|
||||
word-wrap: break-word;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
}
|
||||
|
|
@ -17,4 +17,5 @@
|
|||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 5px;
|
||||
gap: 5px;
|
||||
}
|
37
assets/misuzu.css/messages/actions.css
Normal file
37
assets/misuzu.css/messages/actions.css
Normal file
|
@ -0,0 +1,37 @@
|
|||
.messages-actions-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 30px;
|
||||
margin: 1px;
|
||||
font-size: 1.3em;
|
||||
line-height: 1.4em;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
transition: background-color .1s;
|
||||
width: 100%;
|
||||
border: 0;
|
||||
background-color: inherit;
|
||||
text-align: left;
|
||||
}
|
||||
.messages-actions-item:hover,
|
||||
.messages-actions-item:focus {
|
||||
background-color: #444f;
|
||||
}
|
||||
.messages-actions-item:active,
|
||||
.messages-actions-item-current {
|
||||
background-color: var(--accent-colour) !important;
|
||||
}
|
||||
.messages-actions-item[disabled] {
|
||||
background-color: inherit !important;
|
||||
opacity: .4;
|
||||
}
|
||||
.messages-actions-item-icon {
|
||||
text-align: center;
|
||||
width: 30px;
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.messages-actions-item-label {
|
||||
flex-grow: 1;
|
||||
flex-shrink: 1;
|
||||
}
|
26
assets/misuzu.css/messages/columns.css
Normal file
26
assets/misuzu.css/messages/columns.css
Normal file
|
@ -0,0 +1,26 @@
|
|||
.messages-columns {
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.messages-columns-sidebar {
|
||||
width: 200px;
|
||||
flex-shrink: 0;
|
||||
flex-grow: 0;
|
||||
}
|
||||
|
||||
.messages-columns-content {
|
||||
flex-shrink: 1;
|
||||
flex-grow: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@media (max-width: 800px) {
|
||||
.messages-columns {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.messages-columns-sidebar {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
80
assets/misuzu.css/messages/entry.css
Normal file
80
assets/misuzu.css/messages/entry.css
Normal file
|
@ -0,0 +1,80 @@
|
|||
.messages-entry {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 2px 4px;
|
||||
gap: 4px;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
}
|
||||
.messages-entry-header {
|
||||
display: flex;
|
||||
font-size: 1.1em;
|
||||
line-height: 1.6em;
|
||||
border-bottom: 2px solid #9999;
|
||||
gap: 2px;
|
||||
}
|
||||
.messages-entry-check {
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 20px;
|
||||
}
|
||||
.messages-entry-check input {
|
||||
display: block;
|
||||
}
|
||||
.messages-entry-unread {
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 20px;
|
||||
}
|
||||
.messages-entry-unread-orb {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
background-color: var(--accent-colour);
|
||||
border-radius: 100%;
|
||||
}
|
||||
.messages-entry-author {
|
||||
font-weight: bold;
|
||||
border-bottom: 2px solid var(--user-colour, currentColor);
|
||||
margin: 0 0 -2px;
|
||||
flex-grow: 0;
|
||||
flex-shrink: 1;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.messages-entry-spacing {
|
||||
flex-grow: 1;
|
||||
flex-shrink: 1;
|
||||
}
|
||||
.messages-entry-datetime {
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
color: #aaa;
|
||||
align-self: flex-end;
|
||||
}
|
||||
.messages-entry-subject {
|
||||
line-height: 1.4em;
|
||||
color: #fff;
|
||||
overflow: hidden;
|
||||
}
|
||||
.messages-entry-preview {
|
||||
line-height: 1.4em;
|
||||
color: #888;
|
||||
overflow: hidden;
|
||||
}
|
||||
.messages-entry-preview .messages-entry-overflow {
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
.messages-entry-overflow {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue