#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,
ultimately sophisticated new type of mini-blog based SNS.
![ss](./resources/ss.jpg)
![ss](./assets/ss.jpg)
Key features
--------------------------------

View file

@ -8,7 +8,7 @@ html(lang='ja', dir='ltr')
meta(name='theme-color', content=themeColor)
meta(name='referrer', content='origin')
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
block title
| | About Misskey

View file

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

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.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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
*/
app.use('/resources', express.static(__dirname + '/resources', {
app.use('/assets', express.static(__dirname + '/assets', {
maxAge: 1000 * 60 * 60 * 24 * 365 // 一年
}));
@ -33,12 +33,12 @@ app.get('/', (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);
});
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);
});
@ -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> {
if (!/^image\/.*$/.test(type)) {
data = fs.readFileSync(__dirname + '/resources/dummy.png');
data = fs.readFileSync(__dirname + '/assets/dummy.png');
}
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)});
if (file == null) {
res.status(404).sendFile(__dirname + '/resources/dummy.png');
res.status(404).sendFile(__dirname + '/assets/dummy.png');
return;
} else if (file.data == null) {
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)});
if (file == null) {
res.status(404).sendFile(__dirname + '/resources/dummy.png');
res.status(404).sendFile(__dirname + '/assets/dummy.png');
return;
} else if (file.data == null) {
res.sendStatus(400);

View file

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

View file

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

View file

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

View file

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

View file

@ -15,7 +15,7 @@
*/
function mountDesktop() {
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('defer', 'true');
head.appendChild(script);
@ -31,7 +31,7 @@
head.appendChild(meta);
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('defer', 'true');
head.appendChild(script);

View file

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

View file

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

View file

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

View file

@ -2,7 +2,7 @@
<div class="content-container">
<div class="balloon">
<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 ref="text"></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 }>
<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>
</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>
</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>
</div>
<div class="thumbnail"><img src={ file.url + '?thumbnail&size=128' } alt=""/></div>

View file

@ -1,6 +1,6 @@
<mk-entrance>
<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-signup if={ mode == 'signup' }></mk-entrance-signup>
<div class="introduction" if={ mode == 'introduction' }>

View file

@ -5,7 +5,7 @@
<ul>
<li each={ files }>
<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 class="add" if={ files.length < 4 } title="PCからファイルを添付" onclick={ selectFile }><i class="fa fa-plus"></i></li>
</ul>

View file

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

View file

@ -1,4 +1,4 @@
extends ../base
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>
<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-signup if={ mode == 'signup' }></mk-entrance-signup>
<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.get('/manifest.json', (req, res) => res.sendFile(__dirname + '/resources/manifest.json'));
app.get('/apple-touch-icon.png', (req, res) => res.sendFile(__dirname + '/resources/apple-touch-icon.png'));
app.use('/resources', express.static(`${__dirname}/resources`, {
app.use(favicon(`${__dirname}/assets/favicon.ico`));
app.get('/manifest.json', (req, res) => res.sendFile(__dirname + '/assets/manifest.json'));
app.get('/apple-touch-icon.png', (req, res) => res.sendFile(__dirname + '/assets/apple-touch-icon.png'));
app.use('/assets', express.static(`${__dirname}/assets`, {
maxAge: ms('7 days')
}));