#309 and some cleanups

This commit is contained in:
syuilo 2017-03-22 16:19:32 +09:00
parent 5306bb518d
commit b646877e8b
49 changed files with 44 additions and 44 deletions

View file

@ -12,7 +12,7 @@ Welcome!
[Misskey](https://misskey.xyz) is a completely open source, [Misskey](https://misskey.xyz) is a completely open source,
ultimately sophisticated new type of mini-blog based SNS. ultimately sophisticated new type of mini-blog based SNS.
![ss](./resources/ss.jpg) ![ss](./assets/ss.jpg)
Key features Key features
-------------------------------- --------------------------------

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

Before

Width:  |  Height:  |  Size: 628 B

After

Width:  |  Height:  |  Size: 628 B

View file

Before

Width:  |  Height:  |  Size: 300 KiB

After

Width:  |  Height:  |  Size: 300 KiB

View file

@ -8,7 +8,7 @@ html(lang='ja', dir='ltr')
meta(name='theme-color', content=themeColor) meta(name='theme-color', content=themeColor)
meta(name='referrer', content='origin') meta(name='referrer', content='origin')
meta(name='viewport', content='width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no') meta(name='viewport', content='width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no')
link(rel='stylesheet', href='/resources/style.css') link(rel='stylesheet', href='/assets/style.css')
title title
block title block title
| | About Misskey | | About Misskey

View file

@ -85,8 +85,8 @@ gulp.task('build:about:docs', () => {
gulp.task('build:copy', () => gulp.task('build:copy', () =>
es.merge( es.merge(
gulp.src([ gulp.src([
'./src/**/resources/**/*', './src/**/assets/**/*',
'!./src/web/app/**/resources/**/*' '!./src/web/app/**/assets/**/*'
]).pipe(gulp.dest('./built/')) as any, ]).pipe(gulp.dest('./built/')) as any,
gulp.src([ gulp.src([
'./src/web/about/**/*', './src/web/about/**/*',
@ -134,11 +134,11 @@ gulp.task('build:client:scripts', done => {
require('./webpack.config').then(webpackOptions => { require('./webpack.config').then(webpackOptions => {
es.merge( es.merge(
webpack(webpackOptions, require('webpack')) webpack(webpackOptions, require('webpack'))
.pipe(gulp.dest('./built/web/resources/')) as any, .pipe(gulp.dest('./built/web/assets/')) as any,
gulp.src('./src/web/app/client/script.js') gulp.src('./src/web/app/client/script.js')
.pipe(replace('VERSION', JSON.stringify(version))) .pipe(replace('VERSION', JSON.stringify(version)))
//.pipe(isProduction ? uglify() : gutil.noop()) //.pipe(isProduction ? uglify() : gutil.noop())
.pipe(gulp.dest('./built/web/resources/client/')) as any .pipe(gulp.dest('./built/web/assets/client/')) as any
); );
done(); done();
}); });
@ -150,22 +150,22 @@ gulp.task('build:client:styles', () =>
.pipe(isProduction .pipe(isProduction
? (cssnano as any)() ? (cssnano as any)()
: gutil.noop()) : gutil.noop())
.pipe(gulp.dest('./built/web/resources/')) .pipe(gulp.dest('./built/web/assets/'))
); );
gulp.task('copy:client', [ gulp.task('copy:client', [
'build:client:scripts' 'build:client:scripts'
], () => ], () =>
gulp.src([ gulp.src([
'./resources/**/*', './assets/**/*',
'./src/web/resources/**/*', './src/web/assets/**/*',
'./src/web/app/*/resources/**/*' './src/web/app/*/assets/**/*'
]) ])
.pipe(isProduction ? (imagemin as any)() : gutil.noop()) .pipe(isProduction ? (imagemin as any)() : gutil.noop())
.pipe(rename(path => { .pipe(rename(path => {
path.dirname = path.dirname.replace('resources', '.'); path.dirname = path.dirname.replace('assets', '.');
})) }))
.pipe(gulp.dest('./built/web/resources/')) .pipe(gulp.dest('./built/web/assets/'))
); );
gulp.task('build:client:pug', [ gulp.task('build:client:pug', [

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 930 B

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 843 B

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View file

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View file

@ -24,7 +24,7 @@ app.use(cors());
/** /**
* Statics * Statics
*/ */
app.use('/resources', express.static(__dirname + '/resources', { app.use('/assets', express.static(__dirname + '/assets', {
maxAge: 1000 * 60 * 60 * 24 * 365 // 一年 maxAge: 1000 * 60 * 60 * 24 * 365 // 一年
})); }));
@ -33,12 +33,12 @@ app.get('/', (req, res) => {
}); });
app.get('/default-avatar.jpg', (req, res) => { app.get('/default-avatar.jpg', (req, res) => {
const file = fs.readFileSync(__dirname + '/resources/avatar.jpg'); const file = fs.readFileSync(__dirname + '/assets/avatar.jpg');
send(file, 'image/jpeg', req, res); send(file, 'image/jpeg', req, res);
}); });
app.get('/app-default.jpg', (req, res) => { app.get('/app-default.jpg', (req, res) => {
const file = fs.readFileSync(__dirname + '/resources/dummy.png'); const file = fs.readFileSync(__dirname + '/assets/dummy.png');
send(file, 'image/png', req, res); send(file, 'image/png', req, res);
}); });
@ -54,7 +54,7 @@ async function raw(data: Buffer, type: string, download: boolean, res: express.R
async function thumbnail(data: Buffer, type: string, resize: number, res: express.Response): Promise<any> { async function thumbnail(data: Buffer, type: string, resize: number, res: express.Response): Promise<any> {
if (!/^image\/.*$/.test(type)) { if (!/^image\/.*$/.test(type)) {
data = fs.readFileSync(__dirname + '/resources/dummy.png'); data = fs.readFileSync(__dirname + '/assets/dummy.png');
} }
let g = gm(data); let g = gm(data);
@ -100,7 +100,7 @@ app.get('/:id', async (req, res) => {
const file = await File.findOne({_id: new mongodb.ObjectID(req.params.id)}); const file = await File.findOne({_id: new mongodb.ObjectID(req.params.id)});
if (file == null) { if (file == null) {
res.status(404).sendFile(__dirname + '/resources/dummy.png'); res.status(404).sendFile(__dirname + '/assets/dummy.png');
return; return;
} else if (file.data == null) { } else if (file.data == null) {
res.sendStatus(400); res.sendStatus(400);
@ -120,7 +120,7 @@ app.get('/:id/:name', async (req, res) => {
const file = await File.findOne({_id: new mongodb.ObjectID(req.params.id)}); const file = await File.findOne({_id: new mongodb.ObjectID(req.params.id)});
if (file == null) { if (file == null) {
res.status(404).sendFile(__dirname + '/resources/dummy.png'); res.status(404).sendFile(__dirname + '/assets/dummy.png');
return; return;
} else if (file.data == null) { } else if (file.data == null) {
res.sendStatus(400); res.sendStatus(400);

View file

Before

Width:  |  Height:  |  Size: 141 KiB

After

Width:  |  Height:  |  Size: 141 KiB

View file

@ -13,11 +13,11 @@ app.disable('x-powered-by');
app.locals.cache = true; app.locals.cache = true;
app.get('/himasaku.png', (req, res) => { app.get('/himasaku.png', (req, res) => {
res.sendFile(__dirname + '/resources/himasaku.png'); res.sendFile(__dirname + '/assets/himasaku.png');
}); });
app.get('*', (req, res) => { app.get('*', (req, res) => {
res.sendFile(__dirname + '/resources/index.html'); res.sendFile(__dirname + '/assets/index.html');
}); });
module.exports = app; module.exports = app;

View file

@ -3,7 +3,7 @@ import ms = require('ms');
const router = express.Router(); const router = express.Router();
router.use('/@/about/resources', express.static(`${__dirname}/resources`, { router.use('/@/about/assets', express.static(`${__dirname}/assets`, {
maxAge: ms('7 days') maxAge: ms('7 days')
})); }));

View file

Before

Width:  |  Height:  |  Size: 646 B

After

Width:  |  Height:  |  Size: 646 B

View file

@ -23,7 +23,7 @@
<h1>サインインしてください</h1> <h1>サインインしてください</h1>
<mk-signin></mk-signin> <mk-signin></mk-signin>
</main> </main>
<footer><img src="/resources/auth/logo.svg" alt="Misskey"/></footer> <footer><img src="/assets/auth/logo.svg" alt="Misskey"/></footer>
<style> <style>
:scope :scope
display block display block

View file

@ -2,4 +2,4 @@ extends ../base
block head block head
meta(name='viewport' content='width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no') meta(name='viewport' content='width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no')
script(src=`/resources/auth/script.${version}.js` async defer) script(src=`/assets/auth/script.${version}.js` async defer)

View file

@ -1,6 +1,6 @@
doctype html doctype html
!= '\r\n<!-- Thank you for using Misskey! @syuilo -->\r\n' != '\n<!-- Thank you for using Misskey! @syuilo -->\n'
html(lang='ja' dir='ltr') html(lang='ja' dir='ltr')
@ -11,7 +11,7 @@ html(lang='ja' dir='ltr')
meta(name='referrer' content='origin') meta(name='referrer' content='origin')
title Misskey title Misskey
style style
include ./../../../built/web/resources/init.css include ./../../../built/web/assets/init.css
script(src='https://use.fontawesome.com/22aba0df4f.js' async) script(src='https://use.fontawesome.com/22aba0df4f.js' async)
block head block head

View file

@ -15,7 +15,7 @@
*/ */
function mountDesktop() { function mountDesktop() {
const script = document.createElement('script'); const script = document.createElement('script');
script.setAttribute('src', `/resources/desktop/script.${VERSION}.js`); script.setAttribute('src', `/assets/desktop/script.${VERSION}.js`);
script.setAttribute('async', 'true'); script.setAttribute('async', 'true');
script.setAttribute('defer', 'true'); script.setAttribute('defer', 'true');
head.appendChild(script); head.appendChild(script);
@ -31,7 +31,7 @@
head.appendChild(meta); head.appendChild(meta);
const script = document.createElement('script'); const script = document.createElement('script');
script.setAttribute('src', `/resources/mobile/script.${VERSION}.js`); script.setAttribute('src', `/assets/mobile/script.${VERSION}.js`);
script.setAttribute('async', 'true'); script.setAttribute('async', 'true');
script.setAttribute('defer', 'true'); script.setAttribute('defer', 'true');
head.appendChild(script); head.appendChild(script);

View file

@ -2,4 +2,4 @@ extends ../base
block head block head
script script
include ./../../../../built/web/resources/client/script.js include ./../../../../built/web/assets/client/script.js

View file

@ -1,6 +1,6 @@
<mk-core-error> <mk-core-error>
<!--i: i.fa.fa-times-circle--> <!--i: i.fa.fa-times-circle-->
<img src="/resources/error.jpg" alt=""/> <img src="/assets/error.jpg" alt=""/>
<h1>サーバーに接続できません</h1> <h1>サーバーに接続できません</h1>
<p class="text">インターネット回線に問題があるか、サーバーがダウンまたはメンテナンスしている可能性があります。しばらくしてから<a onclick={ retry }>再度お試し</a>ください。</p> <p class="text">インターネット回線に問題があるか、サーバーがダウンまたはメンテナンスしている可能性があります。しばらくしてから<a onclick={ retry }>再度お試し</a>ください。</p>
<p class="thanks">いつもMisskeyをご利用いただきありがとうございます。</p> <p class="thanks">いつもMisskeyをご利用いただきありがとうございます。</p>

View file

@ -191,7 +191,7 @@
&:not([data-is-me]):not([data-is-read]) &:not([data-is-me]):not([data-is-read])
> div > div
background-image url("/resources/unread.svg") background-image url("/assets/unread.svg")
background-repeat no-repeat background-repeat no-repeat
background-position 0 center background-position 0 center

View file

@ -2,7 +2,7 @@
<div class="content-container"> <div class="content-container">
<div class="balloon"> <div class="balloon">
<p class="read" if={ message.is_me && message.is_read }>既読</p> <p class="read" if={ message.is_me && message.is_read }>既読</p>
<button class="delete-button" if={ message.is_me } title="メッセージを削除"><img src="/resources/desktop/messaging/delete.png" alt="Delete"/></button> <button class="delete-button" if={ message.is_me } title="メッセージを削除"><img src="/assets/desktop/messaging/delete.png" alt="Delete"/></button>
<div class="content" if={ !message.is_deleted }> <div class="content" if={ !message.is_deleted }>
<div ref="text"></div> <div ref="text"></div>
<div class="image" if={ message.file }><img src={ message.file.url } alt="image" title={ message.file.name }/></div> <div class="image" if={ message.file }><img src={ message.file.url } alt="image" title={ message.file.name }/></div>

View file

Before

Width:  |  Height:  |  Size: 643 B

After

Width:  |  Height:  |  Size: 643 B

View file

Before

Width:  |  Height:  |  Size: 646 B

After

Width:  |  Height:  |  Size: 646 B

View file

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 3 KiB

View file

@ -1,11 +1,11 @@
<mk-drive-browser-file data-is-selected={ isSelected } data-is-contextmenu-showing={ isContextmenuShowing.toString() } onclick={ onclick } oncontextmenu={ oncontextmenu } draggable="true" ondragstart={ ondragstart } ondragend={ ondragend } title={ title }> <mk-drive-browser-file data-is-selected={ isSelected } data-is-contextmenu-showing={ isContextmenuShowing.toString() } onclick={ onclick } oncontextmenu={ oncontextmenu } draggable="true" ondragstart={ ondragstart } ondragend={ ondragend } title={ title }>
<div class="label" if={ I.avatar_id == file.id }><img src="/resources/label.svg"/> <div class="label" if={ I.avatar_id == file.id }><img src="/assets/label.svg"/>
<p>アバター</p> <p>アバター</p>
</div> </div>
<div class="label" if={ I.banner_id == file.id }><img src="/resources/label.svg"/> <div class="label" if={ I.banner_id == file.id }><img src="/assets/label.svg"/>
<p>バナー</p> <p>バナー</p>
</div> </div>
<div class="label" if={ I.data.wallpaper == file.id }><img src="/resources/label.svg"/> <div class="label" if={ I.data.wallpaper == file.id }><img src="/assets/label.svg"/>
<p>壁紙</p> <p>壁紙</p>
</div> </div>
<div class="thumbnail"><img src={ file.url + '?thumbnail&size=128' } alt=""/></div> <div class="thumbnail"><img src={ file.url + '?thumbnail&size=128' } alt=""/></div>

View file

@ -1,6 +1,6 @@
<mk-entrance> <mk-entrance>
<main> <main>
<img src="/resources/title.svg" alt="Misskey"/> <img src="/assets/title.svg" alt="Misskey"/>
<mk-entrance-signin if={ mode == 'signin' }></mk-entrance-signin> <mk-entrance-signin if={ mode == 'signin' }></mk-entrance-signin>
<mk-entrance-signup if={ mode == 'signup' }></mk-entrance-signup> <mk-entrance-signup if={ mode == 'signup' }></mk-entrance-signup>
<div class="introduction" if={ mode == 'introduction' }> <div class="introduction" if={ mode == 'introduction' }>

View file

@ -5,7 +5,7 @@
<ul> <ul>
<li each={ files }> <li each={ files }>
<div class="img" style="background-image: url({ url + '?thumbnail&size=64' })" title={ name }></div> <div class="img" style="background-image: url({ url + '?thumbnail&size=64' })" title={ name }></div>
<img class="remove" onclick={ removeFile } src="/resources/desktop/remove.png" title="添付取り消し" alt=""/> <img class="remove" onclick={ removeFile } src="/assets/desktop/remove.png" title="添付取り消し" alt=""/>
</li> </li>
<li class="add" if={ files.length < 4 } title="PCからファイルを添付" onclick={ selectFile }><i class="fa fa-plus"></i></li> <li class="add" if={ files.length < 4 } title="PCからファイルを添付" onclick={ selectFile }><i class="fa fa-plus"></i></li>
</ul> </ul>

View file

@ -45,7 +45,7 @@
display block display block
width 100% width 100%
height 48px height 48px
background-image url(/resources/desktop/header-logo-white.svg) background-image url(/assets/desktop/header-logo-white.svg)
background-size 64px background-size 64px
background-position center background-position center
background-repeat no-repeat background-repeat no-repeat

View file

@ -1,4 +1,4 @@
extends ../base extends ../base
block head block head
script(src=`/resources/dev/script.${version}.js` async defer) script(src=`/assets/dev/script.${version}.js` async defer)

View file

@ -1,5 +1,5 @@
<mk-entrance> <mk-entrance>
<main><img src="/resources/title.svg" alt="Misskey"/> <main><img src="/assets/title.svg" alt="Misskey"/>
<mk-entrance-signin if={ mode == 'signin' }></mk-entrance-signin> <mk-entrance-signin if={ mode == 'signin' }></mk-entrance-signin>
<mk-entrance-signup if={ mode == 'signup' }></mk-entrance-signup> <mk-entrance-signup if={ mode == 'signup' }></mk-entrance-signup>
<div class="introduction" if={ mode == 'introduction' }> <div class="introduction" if={ mode == 'introduction' }>

View file

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

View file

Before

Width:  |  Height:  |  Size: 352 KiB

After

Width:  |  Height:  |  Size: 352 KiB

View file

Before

Width:  |  Height:  |  Size: 441 B

After

Width:  |  Height:  |  Size: 441 B

View file

Before

Width:  |  Height:  |  Size: 646 B

After

Width:  |  Height:  |  Size: 646 B

View file

Before

Width:  |  Height:  |  Size: 536 B

After

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 352 KiB

View file

@ -35,12 +35,12 @@ app.use((req, res, next) => {
}); });
/** /**
* Static resources * Static assets
*/ */
app.use(favicon(`${__dirname}/resources/favicon.ico`)); app.use(favicon(`${__dirname}/assets/favicon.ico`));
app.get('/manifest.json', (req, res) => res.sendFile(__dirname + '/resources/manifest.json')); app.get('/manifest.json', (req, res) => res.sendFile(__dirname + '/assets/manifest.json'));
app.get('/apple-touch-icon.png', (req, res) => res.sendFile(__dirname + '/resources/apple-touch-icon.png')); app.get('/apple-touch-icon.png', (req, res) => res.sendFile(__dirname + '/assets/apple-touch-icon.png'));
app.use('/resources', express.static(`${__dirname}/resources`, { app.use('/assets', express.static(`${__dirname}/assets`, {
maxAge: ms('7 days') maxAge: ms('7 days')
})); }));