#309 and some cleanups

This commit is contained in:
syuilo 2017-03-22 16:19:32 +09:00
parent 4fa790bb11
commit bb17425856
49 changed files with 44 additions and 71 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

@ -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', [

BIN
resources/favicon/128.png (Stored with Git LFS)

Binary file not shown.

BIN
resources/favicon/16.png (Stored with Git LFS)

Binary file not shown.

BIN
resources/favicon/256.png (Stored with Git LFS)

Binary file not shown.

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2d6f02ab2b97e88679faf914976c64b1b547d989c22a2c15848bc5c3b1bab0ee
size 532

BIN
resources/favicon/64.png (Stored with Git LFS)

Binary file not shown.

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:440c08dea18da75849c117f4f063a47cdf559182888532ad01d7eeba461ceb28
size 262881

BIN
resources/icon.png (Stored with Git LFS)

Binary file not shown.

BIN
resources/icon.svg (Stored with Git LFS)

Binary file not shown.

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

@ -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

@ -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

@ -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' }>

BIN
src/web/resources/favicon.ico (Stored with Git LFS)

Binary file not shown.

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')
})); }));