Skip to content

Commit 9d3867d

Browse files
committed
Shortcode, fixes
1 parent ede1bf8 commit 9d3867d

16 files changed

+429
-281
lines changed

API/Content.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ public function buildContent(array $pages)
185185
public function breakContent(array $page, array $config, array $breaks)
186186
{
187187
$header = (array) $page['header'];
188-
$this->grav['debugger']->addMessage($header);
189188
if (!isset($header['horizontal'])) {
190189
echo '<section id="' . $page['slug'] . '" ';
191190
echo 'data-title="' . $page['title'] . '">';
@@ -262,7 +261,7 @@ public function buildSlide(array $page, array $config, string $break)
262261
echo 'class="' . $config['class'] . '" ';
263262
echo 'data-title="' . $page['title'] . '"';
264263
if (!empty($config['styles'])) {
265-
echo $this->parser->inlineStylesData(
264+
echo $this->parser->processStylesData(
266265
$config['styles'],
267266
$config['route'],
268267
$config['id']

API/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function processFragments(string $content)
113113
*
114114
* @return string Processed styles, in inline string
115115
*/
116-
public function inlineStylesData(array $styles, string $route, string $id)
116+
public function processStylesData(array $styles, string $route, string $id)
117117
{
118118
$inline = $data = '';
119119
foreach ($styles as $property => $value) {

API/ParserInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function processFragments(string $content);
5555
*
5656
* @return string Processed styles, in inline string
5757
*/
58-
public function inlineStylesData(array $styles, string $route, string $id);
58+
public function processStylesData(array $styles, string $route, string $id);
5959

6060
/**
6161
* Remove wrapping paragraph from img-element

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# v1.1.0-beta.6
2+
## 09-01-2019
3+
4+
1. [](#new)
5+
* Presentation-shortcode
6+
* Presentation-shortcode styles
7+
2. [](#bugfix)
8+
* Fire textsizing on Reveal ready
9+
* Links in blueprints
10+
* Asset groups
11+
112
# v1.1.0-beta.5
213
## 08-01-2019
314

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,11 @@ Use a SCSS-compiler, like [LibSass](https://github.com/sass/libsass), eg. [node-
296296

297297
As demonstrated by the `content`, `parser`, and `styles` options above, you can fairly easily extend the behavior of the plugin. For example, if you install the [Presentation Deckset Plugin](https://github.com/OleVik/grav-plugin-presentation-deckset/), you could set this to `parser: 'DecksetParser'` to use the [Deckset](https://www.deckset.com/)-syntax. Addons written this way must implement the correspond interface, and extend the base class provided by the plugin. Eg., `class DecksetParser extends Parser implements ParserInterface`.
298298

299+
## TODO
300+
301+
- Shortcode-syntax for nested properties passed to setStyle()
302+
- Presentation-shortcode (iframe)
303+
299304
## Credits
300305

301306
- Grav [presentation](https://github.com/OleVik/grav-plugin-presentation)-plugin is written by [Ole Vik](https://github.com/OleVik)

blueprints.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Presentation
2-
version: 1.1.0-beta.5
2+
version: 1.1.0-beta.6
33
testing: true
44
description: Responsive navigational slideshows with Reveal.js
55
icon: arrows-alt

css/presentation.css

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/broadcast.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
var bc = new BroadcastChannel('grav-presentation');
55
window.addEventListener("load", function (event) {
6-
if (findGetParameter('admin') == 'yes') {
6+
if (findGetParameter('admin') == 'true') {
77
Reveal.addEventListener('slidechanged', function (event) {
88
if (presentationAPIAuth == 'true') {
99
if (findGetParameter('token') !== presentationAuthToken) {

js/modularscale.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,20 @@ var delay = 200;
157157
var throttled = false;
158158
var calls = 0;
159159

160-
/* Run after slide changes or loads */
160+
/* Run after slide loads */
161+
Reveal.addEventListener('ready', function (event) {
162+
if (!throttled) {
163+
onChange();
164+
throttled = true;
165+
setTimeout(function () {
166+
throttled = false;
167+
}, delay);
168+
}
169+
clearTimeout(forLastExec);
170+
forLastExec = setTimeout(onChange, delay);
171+
});
172+
173+
/* Run after slide changes */
161174
Reveal.addEventListener('slidechanged', function (event) {
162175
if (!throttled) {
163176
onChange();

js/poll.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ var revealSlaveEventHandler = function (event) {
9090
/* If Admin, handle input, otherwise poll server */
9191
var pollingErrors = 0;
9292
window.addEventListener("load", function (event) {
93-
if (findGetParameter('admin') == 'yes') {
93+
if (findGetParameter('admin') == 'true') {
9494
Reveal.addEventListener('slidechanged', revealMasterEventHandler);
9595
Reveal.addEventListener('fragmentshown', revealMasterEventHandler);
9696
Reveal.addEventListener('fragmenthidden', revealMasterEventHandler);

0 commit comments

Comments
 (0)