Skip to content

Commit 07f8f83

Browse files
committed
WIP
1 parent 16e5a1a commit 07f8f83

23 files changed

+25
-68020
lines changed

assets/babel-core/browser-polyfill.js

-3,207
This file was deleted.

assets/babel-core/browser-polyfill.min.js

-4
This file was deleted.

assets/babel-core/browser.js

-64,702
This file was deleted.

assets/babel-core/browser.min.js

-42
This file was deleted.

assets/robots.txt

-5
This file was deleted.

handlers/error/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ function renderError(ctx, err) {
3838
ctx.status = 400;
3939
}
4040

41+
// mongoose validation error
4142
if (err.name == 'ValidationError') {
4243
ctx.status = 400;
4344

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

handlers/tutorial/locales/task/en.yml

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ open_solution:
1111
Importance: Importance
1212
importance: importance
1313
solution: solution
14+
back: back to the lesson
1415
importance_help: How important is the task, from 1 to 5
1516

1617
task_not_found: "Task \"#{path}\" not found"

handlers/tutorial/locales/task/ru.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ Importance: Важность
1313
importance: важность
1414
importance_help: Насколько эта задача важна для освоения материала, от 1 до 5
1515
solution: решение
16-
16+
back: вернуться к уроку
1717
task_not_found: "Не найдена задача \"#{path}\""

handlers/tutorial/templates/task.pug

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ block main
2020
meta(itemprop="name" content="Ilya Kantor")
2121

2222
+e('a').back(href=articleUrl)
23-
span вернуться к уроку
23+
span= t('tutorial.task.back')
2424

2525
+b.task.__task(itemprop="articleBody")
2626
+e.header

locales/en.yml

-25
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,10 @@
1-
toolbar:
2-
logo:
3-
svg: sitetoolbar__logo.en.svg
4-
width: 185 # 171
5-
6-
sorry_old_browser: Sorry, IE<10 is not supported, please use a newer browser.
7-
contact_us: contact us
8-
about_the_project: about the project
9-
ilya_kantor: Ilya Kantor
101
comments: Comments
11-
loading: Loading...
12-
search: Search
13-
share: Share
14-
donate: Donate
15-
read_before_commenting: read before commenting…
162

173
tutorial: Tutorial
184
tutorial_map: Tutorial map
195
additional_articles: Additional articles
20-
comment:
21-
help:
22-
- You're welcome to post additions, questions to the articles and answers to them.
23-
- To insert a few words of code, use the <code>&lt;code&gt;</code> tag, for several lines – use <code>&lt;pre&gt;</code>, for more than 10 lines – use a sandbox (<a href='http://plnkr.co/edit/?p=preview'>plnkr</a>, <a href='http://jsbin.com'>JSBin</a>, <a href='http://codepen.io'>codepen</a>…)
24-
- If you can't understand something in the article – please elaborate.
256

267
edit_on_github: Edit on Github
27-
Error: Error
28-
close: close
29-
Close: Close
30-
31-
hide_forever: hide permanently
32-
hidden_forever: This information will not show up any more.
338

349
meta:
3510
description: 'Modern JavaScript Tutorial: simple, but detailed explanations with examples and tasks, including: closures, document and events, object oriented programming and more.'

locales/ru.yml

-27
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,10 @@
1-
toolbar:
2-
logo:
3-
svg: sitetoolbar__logo.svg
4-
width: 171
5-
6-
7-
sorry_old_browser: Извините, IE<10 не поддерживается, пожалуйста используйте более новый браузер.
8-
contact_us: связаться с нами
9-
about_the_project: о проекте
10-
ilya_kantor: Илья Кантор
111
comments: Комментарии
12-
loading: Загружается...
13-
search: Искать
14-
share: Поделиться
15-
donate: Поддержать
16-
read_before_commenting: перед тем как писать…
172

183
tutorial: Учебник
194
tutorial_map: Карта учебника
205
additional_articles: Дополнительно
21-
comment:
22-
help:
23-
- Приветствуются комментарии, содержащие дополнения и вопросы по статье, и ответы на них.
24-
- Для одной строки кода используйте тег <code>&lt;code&gt;</code>, для нескольких строк кода&nbsp;&mdash; тег <code>&lt;pre&gt;</code>, если больше 10 строк&nbsp;&mdash; ссылку на песочницу (<a href='http://plnkr.co/edit/?p=preview'>plnkr</a>, <a href='http://jsbin.com'>JSBin</a>, <a href='http://codepen.io'>codepen</a>…)
25-
- Если что-то непонятно в статье&nbsp;&mdash; пишите, что именно и с какого места.
266

277
edit_on_github: Редактировать на Github
28-
Error: Ошибка
29-
close: закрыть
30-
Close: Закрыть
31-
32-
hide_forever: не показывать
33-
hidden_forever: Эта информация больше не будет выводиться.
34-
358

369
meta:
3710
description: 'Modern JavaScript Tutorial: simple, but detailed explanations with examples and tasks, including: closures, document and events, object oriented programming and more.'

modules/config/webpack.js

+14
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ let config = require('config');
99
let webpack = require('webpack');
1010
let WriteVersionsPlugin = require('lib/webpack/writeVersionsPlugin');
1111
let CssWatchRebuildPlugin = require('lib/webpack/cssWatchRebuildPlugin');
12+
const CopyWebpackPlugin = require('copy-webpack-plugin')
1213
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
1314
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
1415
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
@@ -228,6 +229,19 @@ module.exports = function (config) {
228229
styles: '{templates,styles}'
229230
}),
230231

232+
new CopyWebpackPlugin(
233+
config.handlers.map(handler => {
234+
let from = `handlers/${handler}/client/assets`;
235+
if (!fse.existsSync(from)) return;
236+
237+
return {
238+
from,
239+
to: config.publicRoot
240+
}
241+
}).filter(Boolean),
242+
{ debug: 'warning'}
243+
),
244+
231245
{
232246
apply: function (compiler) {
233247
compiler.plugin("done", function (stats) {

modules/lib/webpack/cssWatchRebuildPlugin.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ class CssWatchFS {
5151

5252
let styles = glob.sync(`${this.roots[name]}/**/*.styl`, {cwd: config.projectRoot});
5353

54-
// config.handlers.forEach(handler => {
55-
// let handlerStyles = glob.sync(`handlers/${handler}/client/styles/**/*.styl`, {cwd: config.projectRoot});
56-
// styles.push(...handlerStyles);
57-
// });
54+
config.handlers.forEach(handler => {
55+
let handlerStyles = glob.sync(`handlers/${handler}/client/styles/**/*.styl`, {cwd: config.projectRoot});
56+
styles.push(...handlerStyles);
57+
});
5858

5959
let content = styles.map(s => `@require '../${s}'`).join("\n");
6060

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"bunyan": "*",
2525
"chokidar": "^2.0.4",
2626
"clarify": "^2.1.0",
27+
"copy-webpack-plugin": "^4.5.2",
2728
"css-loader": "^0",
2829
"file-loader": "^1.1",
2930
"fs-extra": "*",
@@ -79,11 +80,11 @@
7980
"engineStrict": true,
8081
"repository": {
8182
"type": "git",
82-
"url": "https://github.com/iliakan/javascript.git"
83+
"url": "https://github.com/iliakan/javascript-tutorial-server.git"
8384
},
8485
"author": "Ilya Kantor",
8586
"license": "CC BY-NC-SA 3.0",
8687
"bugs": {
87-
"url": "https://github.com/iliakan/javascript/issues"
88+
"url": "https://github.com/iliakan/javascript-tutorial-server/issues"
8889
}
8990
}

0 commit comments

Comments
 (0)