Skip to content

Commit

Permalink
chore: 简单修改下样式之类的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ksky521 committed Aug 1, 2019
1 parent d7945d1 commit da99afc
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/nodeppt-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
"animate.css": "^3.7.0",
"nodeppt-template-default": "^1.0.1",
"username": "^4.1.0",
"webslides": "1.4.2"
"webslides": "1.5.0"
}
}
2 changes: 1 addition & 1 deletion packages/nodeppt-js/plugins/echarts.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import DOM from 'webslides/src/js/utils/dom';
import {default as Slide, Events as SlideEvents} from 'webslides/src/js/modules/slide';

/* global echarts */
export default class Echarts {
constructor(wsInstance) {
this.ws_ = wsInstance;
Expand Down
8 changes: 2 additions & 6 deletions packages/nodeppt-js/plugins/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,14 @@ export default class Keyboard {
method = this.ws_.goToSlide;
argument = this.ws_.maxSlide_ - 1;
break;
case Keys.RIGHT:
case Keys.DOWN:
method = this.ws_.isVertical ? (this.enable_ ? this.goNext : this.ws_.goNext) : null;
break;
case Keys.LEFT:
case Keys.UP:
method = this.ws_.isVertical ? (this.enable_ ? this.goPrev : this.ws_.goPrev) : null;
break;
case Keys.LEFT:
method = !this.ws_.isVertical ? (this.enable_ ? this.goPrev : this.ws_.goPrev) : null;
break;
case Keys.RIGHT:
method = !this.ws_.isVertical ? (this.enable_ ? this.goNext : this.ws_.goNext) : null;
break;
case Keys.F:
if (!event.metaKey && !event.ctrlKey) {
method = this.ws_.fullscreen;
Expand Down
2 changes: 1 addition & 1 deletion packages/nodeppt-js/plugins/speaker-mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default class SpeakerMode {

function parseQuery(url) {
let back = {};
(url || location.search.substring(1)).split('&').forEach(function(v) {
(url || location.search.substring(1)).split('&').forEach(v => {
v = v.split('=');
back[v[0].toLowerCase()] = v[1];
});
Expand Down
11 changes: 10 additions & 1 deletion packages/nodeppt-serve/commands/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,28 @@
* @file build 主要内容
*/
const {info} = require('nodeppt-shared-utils');

const path = require('path');
module.exports = (api, options) => {
api.registerCommand('build', {}, async function serve(args) {
info('Build ...');
const context = process.cwd();
const {dest} = args;

process.env.NODE_ENV = 'production';
const webpack = require('webpack');
// resolve webpack config
const webpackConfig = api.resolveWebpackConfig();
webpackConfig.mode = 'production';

if (!args.map) {
delete webpackConfig.devtool; // = null;
}
webpackConfig.output.publicPath = './';

if (dest) {
const targetDir = path.resolve(context, dest || options.outputDir);
webpackConfig.output.path = targetDir;
}
return new Promise((resolve, reject) => {
webpack(webpackConfig, err => {
if (err) {
Expand Down
2 changes: 2 additions & 0 deletions packages/nodeppt-serve/config/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,7 @@ module.exports = (api, options) => {
additionalFormatters: [formatter]
}
]);

webpackConfig.plugin('progress').use(require('webpack/lib/ProgressPlugin'));
});
};
2 changes: 2 additions & 0 deletions packages/nodeppt/bin/nodeppt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ program
.description('start local sever show slide')
.option('-p, --port [port]', 'set server port ', 8080)
.option('--https', 'use https ', 8080)
.option('-d, --dest <dir>', 'output directory')
.option('-H, --host [host]', 'set host address', '0.0.0.0')

.action((entry, cmd) => {
require('nodeppt-serve').serve(entry, cleanArgs(cmd));
})
Expand Down

0 comments on commit da99afc

Please sign in to comment.