1
0
mirror of https://github.com/webslides/WebSlides.git synced 2025-09-20 09:51:31 +02:00

Compare commits

...

16 Commits
1.4.0 ... 1.5.0

Author SHA1 Message Date
Antonio Laguna
13fe06daa8 1.5.0
Fixes #96 #97
2017-09-16 22:45:19 +02:00
Antonio Laguna
eef9d75706 Fixing package.json 2017-09-16 22:32:11 +02:00
Antonio Laguna
b1e03202e3 Adding version scripts 2017-09-16 22:29:34 +02:00
Antonio Laguna
3b7203c9ab Ctrl/Cmd + F should not trigger fullscreen
Hence allowing search
#97
2017-09-16 19:45:13 +02:00
Antonio Laguna
8912d05d70 Shift + Space should go backwards
#96
2017-09-16 19:37:24 +02:00
Antonio Laguna
8b19bd28f6 Updating deps 2017-09-16 19:37:03 +02:00
Antonio Laguna
71f2fd52b9 1.4.2 2017-09-12 10:16:05 +02:00
Antonio Laguna
fe58531e74 Removing unneeded class 2017-09-12 10:14:17 +02:00
Luis Sacristán
71b08f8d3b Fixing TOC 2017-09-03 19:30:05 +02:00
Antonio Laguna
e8dc32e274 1.4.1 2017-08-18 10:43:37 +02:00
Antonio Laguna
1610da683e Merge branch 'dev' 2017-08-18 10:37:56 +02:00
José Luis Antúnez
5233851f59 fixing longform alignments 2017-08-15 19:51:59 +02:00
José Luis Antúnez
eb58c83d11 header: changing the link on the logo 2017-08-15 19:50:02 +02:00
José Luis Antúnez
253e087c15 a new unsplash photo 2017-08-15 19:48:13 +02:00
José Luis Antúnez
ce4b1603d2 updating demos
header logo and a new unsplash photo
2017-08-15 19:48:05 +02:00
José Luis Antúnez
514df1b421 fixing longform alignments 2017-08-15 12:12:25 +02:00
17 changed files with 3459 additions and 1727 deletions

1
.gitignore vendored
View File

@@ -17,3 +17,4 @@ coverage
.Trashes
ehthumbs.db
Thumbs.db
webslides.zip

View File

@@ -1,3 +1,20 @@
# 1.5.0 (2017-09-16)
- [[#96]((https://github.com/webslides/webslides/issues/96))] Using Shift Space now allows to go to previous slide.
- [[#97]((https://github.com/webslides/webslides/issues/97))] Fixing CTRL/CMD + F not allowing to search.
- Dependencies updated.
# 1.4.2 (2017-09-12)
- Fixed `.toc` class. (Regression from Sass)
- Fixed baseline being incorrectly included.
# 1.4.1 (2017-08-18)
- Fixed longform alignments. (Regression from Sass)
- Updated demos to use correct reference.
- Added new unsplash to [demo](http://webslides.tv/demos/keynote).
# 1.4.0 (2017-08-14)
## Misc

View File

@@ -89,7 +89,6 @@ You can add:
- [Animate on scroll](http://michalsnik.github.io/aos/) (Useful for longform articles)
- [pt](http://williamngan.github.io/pt/)
### Dive In!
- Do not miss [our demos](https://webslides.tv/).

View File

@@ -724,7 +724,7 @@
<!-- .end .wrap -->
</section>
<section class="bg-black aligncenter">
<span class="background light" style="background-image:url('https://source.unsplash.com/bopC0sTGu-E/')"></span>
<span class="background light" style="background-image:url('https://source.unsplash.com/UxtIESWxLh8/')"></span>
<div class="wrap">
<h2>Embedding Media</h2>
</div>

View File

@@ -81,7 +81,7 @@
<body>
<header role="banner">
<nav role="navigation">
<p class="logo"><a href="https://webslides.tv" title="WebSlides">WebSlides</a></p>
<p class="logo"><a href="../index.html" title="WebSlides">WebSlides</a></p>
<ul>
<li class="github">
<a rel="external" href="https://github.com/webslides/webslides" title="Github">

View File

@@ -66,7 +66,7 @@
<body>
<header role="banner">
<nav role="navigation">
<p class="logo"><a href="https://webslides.tv" title="WebSlides">WebSlides</a></p>
<p class="logo"><a href="../index.html" title="WebSlides">WebSlides</a></p>
<ul>
<li class="github">
<a rel="external" href="https://github.com/webslides/webslides" title="Github">

4977
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "webslides",
"version": "1.4.0",
"version": "1.5.0",
"description": "Making HTML presentations easy",
"main": "static/js/webslides.js",
"repository": {
@@ -28,32 +28,33 @@
},
"homepage": "https://github.com/webslides/webslides#readme",
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-cli": "^6.24.1",
"babel-core": "^6.25.0",
"babel-jest": "^20.0.3",
"babel-loader": "^7.1.1",
"archiver": "^2.0.3",
"autoprefixer": "^7.1.4",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-jest": "^21.0.2",
"babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.0",
"babel-preset-es2015": "^6.24.1",
"codecov": "^2.3.0",
"css-loader": "^0.28.4",
"eslint": "^4.4.1",
"css-loader": "^0.28.7",
"eslint": "^4.7.0",
"eslint-loader": "^1.9.0",
"eslint-plugin-jest": "^20.0.3",
"eslint-plugin-jest": "^21.1.0",
"extract-text-webpack-plugin": "^3.0.0",
"jest": "^20.0.4",
"jest": "^21.1.0",
"node-sass": "^4.5.3",
"npm-run-all": "^4.0.2",
"npm-run-all": "^4.1.1",
"postcss-loader": "^2.0.6",
"pre-commit": "^1.2.2",
"rimraf": "^2.6.1",
"sass-lint": "^1.10.2",
"rimraf": "^2.6.2",
"sass-lint": "^1.11.1",
"sass-loader": "^6.0.6",
"simulant": "^0.2.2",
"smart-banner-webpack-plugin": "^3.0.1",
"style-loader": "^0.18.2",
"webpack": "^3.5.4",
"webpack-dev-server": "^2.7.1"
"webpack": "^3.6.0",
"webpack-dev-server": "^2.8.2"
},
"scripts": {
"prebuild": "rimraf static/js/webslide*",
@@ -65,7 +66,18 @@
"lint:tests": "eslint ./test --cache --ignore-pattern .gitignore",
"lint:css": "sass-lint -v -f stylish",
"dev": "webpack-dev-server",
"test": "jest && codecov"
"test": "jest && codecov",
"preversion": "npm jest",
"postversion": "npm run build && git add -A static && node ./zip-release.js && git push && git push --tags"
},
"release": {
"files": [
"demos/**/**",
"static/**/**",
"*.html",
"LICENSE",
"README.md"
]
},
"jest": {
"collectCoverage": true

View File

@@ -35,9 +35,15 @@ export default class Keyboard {
switch (event.which) {
case Keys.AV_PAGE:
case Keys.SPACE:
method = this.ws_.goNext;
break;
case Keys.SPACE:
if (event.shiftKey) {
method = this.ws_.goPrev;
} else {
method = this.ws_.goNext;
}
break;
case Keys.RE_PAGE:
method = this.ws_.goPrev;
break;
@@ -62,7 +68,10 @@ export default class Keyboard {
method = !this.ws_.isVertical ? this.ws_.goNext : null;
break;
case Keys.F:
method = this.ws_.fullscreen;
if (!event.metaKey && ! event.ctrlKey) {
method = this.ws_.fullscreen;
}
break;
}

View File

@@ -36,11 +36,6 @@ webslides.js will add .ws-ready automatically. Don't worry :) -- */
}
}
/* -- Prototype faster - Vertical rhythm -- */
.baseline {
background: url('../images/baseline.png') left top .8rem/.8rem;
}
li li {
margin-left: 1.6rem;
}

View File

@@ -8,13 +8,13 @@
/* Why 72rem=720px?
90-95 characters per line = better reading speed */
&.alignleft,
&.alignright {
& .alignleft,
& .alignright {
max-width: 40%;
}
img.aligncenter,
.longform figure.aligncenter {
figure.aligncenter {
margin-bottom: 3.2rem;
margin-top: 3.2rem;
}

View File

@@ -64,3 +64,14 @@
}
}
}
.chapter {
display: inline-block;
font-size: 1.8rem;
line-height: 3.2rem;
padding-right: .8rem;
}
.toc-page {
float: right;
}

View File

@@ -1,7 +1,7 @@
/*!
* Name: WebSlides
* Version: 1.4.0
* Date: 2017-08-14
* Version: 1.5.0
* Date: 2017-09-16
* Description: Making HTML presentations easy
* URL: https://github.com/webslides/webslides#readme
* Credits: @jlantunez, @LuisSacristan, @Belelros
@@ -364,10 +364,6 @@ webslides.js will add .ws-ready automatically. Don't worry :) -- */
#webslides::-webkit-scrollbar {
display: none; }
/* -- Prototype faster - Vertical rhythm -- */
.baseline {
background: url("../images/baseline.png") left top 0.8rem/0.8rem; }
li li {
margin-left: 1.6rem; }
@@ -2400,6 +2396,15 @@ CV / News
.toc li a:hover .toc-page:before {
border-bottom-width: 2px; }
.chapter {
display: inline-block;
font-size: 1.8rem;
line-height: 3.2rem;
padding-right: .8rem; }
.toc-page {
float: right; }
/*===========================================
10. Cards
============================================= */
@@ -2823,10 +2828,11 @@ button:disabled:hover {
/* Why 72rem=720px?
90-95 characters per line = better reading speed */
/* Mobile: video full width */ }
.longform.alignleft, .longform.alignright {
.longform .alignleft,
.longform .alignright {
max-width: 40%; }
.longform img.aligncenter,
.longform .longform figure.aligncenter {
.longform figure.aligncenter {
margin-bottom: 3.2rem;
margin-top: 3.2rem; }
.longform ul,

View File

@@ -1,7 +1,7 @@
/*!
* Name: WebSlides
* Version: 1.4.0
* Date: 2017-08-14
* Version: 1.5.0
* Date: 2017-09-16
* Description: Making HTML presentations easy
* URL: https://github.com/webslides/webslides#readme
* Credits: @jlantunez, @LuisSacristan, @Belelros
@@ -1779,9 +1779,15 @@ var Keyboard = function () {
switch (event.which) {
case __WEBPACK_IMPORTED_MODULE_0__utils_keys__["a" /* default */].AV_PAGE:
case __WEBPACK_IMPORTED_MODULE_0__utils_keys__["a" /* default */].SPACE:
method = this.ws_.goNext;
break;
case __WEBPACK_IMPORTED_MODULE_0__utils_keys__["a" /* default */].SPACE:
if (event.shiftKey) {
method = this.ws_.goPrev;
} else {
method = this.ws_.goNext;
}
break;
case __WEBPACK_IMPORTED_MODULE_0__utils_keys__["a" /* default */].RE_PAGE:
method = this.ws_.goPrev;
break;
@@ -1806,7 +1812,10 @@ var Keyboard = function () {
method = !this.ws_.isVertical ? this.ws_.goNext : null;
break;
case __WEBPACK_IMPORTED_MODULE_0__utils_keys__["a" /* default */].F:
method = this.ws_.fullscreen;
if (!event.metaKey && !event.ctrlKey) {
method = this.ws_.fullscreen;
}
break;
}

File diff suppressed because one or more lines are too long

View File

@@ -2,12 +2,14 @@ import Keyboard from '../../src/js/plugins/keyboard';
import Keys from '../../src/js/utils/keys';
// @TODO: Check to do this with simulant
const simulateKeyEvent = (el, code) => {
const evt = new KeyboardEvent('keydown', {
const simulateKeyEvent = (el, code, extra) => {
const config = Object.assign({
bubbles: true,
cancelableCode: true,
which: code,
shiftKey: true});
shiftKey: false}, extra);
const evt = new KeyboardEvent('keydown', config);
el.dispatchEvent(evt);
};
@@ -37,7 +39,7 @@ test('Keyboard plugin', () => {
el: ws
};
new Keyboard(webslides);
const key = new Keyboard(webslides);
expect(goto).not.toBeCalled();
expect(next).not.toBeCalled();
@@ -51,18 +53,39 @@ test('Keyboard plugin', () => {
expect(next.mock.calls.length).toBe(1);
simulateKeyEvent(document, Keys.SPACE);
expect(next.mock.calls.length).toBe(2);
simulateKeyEvent(document, Keys.RE_PAGE);
// Shift + Space
simulateKeyEvent(document, Keys.SPACE, {shiftKey: true});
expect(next.mock.calls.length).toBe(2);
expect(prev.mock.calls.length).toBe(1);
simulateKeyEvent(document, Keys.RE_PAGE);
expect(prev.mock.calls.length).toBe(2);
// Home - End
simulateKeyEvent(document, Keys.HOME);
expect(goto.mock.calls.length).toBe(1);
simulateKeyEvent(document, Keys.END);
expect(goto.mock.calls.length).toBe(2);
// Arrow keys, only left right should increase
simulateKeyEvent(document, Keys.DOWN);
expect(next.mock.calls.length).toBe(2);
simulateKeyEvent(document, Keys.UP);
expect(prev.mock.calls.length).toBe(1);
simulateKeyEvent(document, Keys.LEFT);
expect(prev.mock.calls.length).toBe(2);
simulateKeyEvent(document, Keys.RIGHT);
expect(prev.mock.calls.length).toBe(3);
expect(next.mock.calls.length).toBe(3);
// Arrow keys, only up down should increase
key.ws_.isVertical = true;
simulateKeyEvent(document, Keys.DOWN);
simulateKeyEvent(document, Keys.UP);
simulateKeyEvent(document, Keys.LEFT);
simulateKeyEvent(document, Keys.RIGHT);
expect(prev.mock.calls.length).toBe(4);
expect(next.mock.calls.length).toBe(4);
// F, only trigger on when alone
simulateKeyEvent(document, Keys.F);
simulateKeyEvent(document, Keys.F, {ctrlKey: true});
simulateKeyEvent(document, Keys.F, {metaKey: true});
expect(fullscreen.mock.calls.length).toBe(1);
});

21
zip-release.js Normal file
View File

@@ -0,0 +1,21 @@
/* eslint-disable no-console */
const fs = require('fs');
const archiver = require('archiver');
const pck = require('./package.json');
const output = fs.createWriteStream(`${__dirname}/${pck.name}.zip`);
const archive = archiver('zip', { zlib: { level: 9 } });
output.on('close', () => {
console.log(`${archive.pointer()} total bytes`);
});
archive.on('error', err => {
throw err;
});
archive.pipe(output);
pck.release.files.forEach(f => archive.glob(f));
archive.finalize();