Skip to content

Commit 490875d

Browse files
authored
Merge pull request #8 from SpringRoll/main
Merging changes to update fork
2 parents 1fc8930 + ff4cb22 commit 490875d

34 files changed

+6402
-2139
lines changed

.github/CODEOWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Lines starting with '#' are comments.
2+
# Each line is a file pattern followed by one or more owners.
3+
4+
# These owners will be the default owners for everything in the repo.
5+
* @902seanryan @aberkie @deycorinne

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: build
22

3-
on:
3+
on:
44
pull_request:
55
paths-ignore:
66
- 'docs/**'
@@ -9,15 +9,15 @@ on:
99
push:
1010
branches:
1111
- main
12-
12+
1313
jobs:
1414
build:
1515

1616
runs-on: ubuntu-latest
1717

1818
strategy:
1919
matrix:
20-
node-version: [8.x, 10.x, 12.x]
20+
node-version: [10.x, 12.x, 14.x]
2121

2222
steps:
2323
- uses: actions/checkout@v1
@@ -32,7 +32,7 @@ jobs:
3232
npm ci
3333
env:
3434
CI: true
35-
35+
3636
- name: build
3737
run: |
3838
npm run build
@@ -44,4 +44,4 @@ jobs:
4444
npm run github-test
4545
env:
4646
CI: true
47-
47+

.github/workflows/npm-deploy.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: npm-deploy
33
on:
44
release:
55
types: [created]
6+
workflow_dispatch:
67

78
jobs:
89
publish-npm:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ node_modules
33
docs
44
.grunt
55
.env
6+
.DS_Store
67
e2e/client.js
78
local.log
89
.DS_Store

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v8.11.3
1+
v10.15.3

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [2.2.1] - 2021-03-04
8+
### Changed
9+
- socket.io dependency version bump
10+
11+
## [2.2.0] - 2021-02-19
12+
### Added
13+
- This CHANGELOG
14+
- Fullscreen Plugin. The ability to add in a fullscreen button within container
15+
- Fullscreen Plugin Automated Testing
16+
- Fullscreen Plugin Documentation
17+
- Indexeddb additions to the userdata class
18+
### Changed
19+
- update NPM modules to remove security vulnerabilities

README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,56 @@ container.openPath('game.html');
359359
any unsupported values. See [the SpringRoll Application Class docs](https://github.com/SpringRoll/SpringRoll/tree/v2/src#handling-state-change)
360360
for more information on the request format.
361361

362+
### Fullscreen Plugin
363+
The fullscreen plugin hooks up an element or elements to set the iframe to full screen then communicates this through Bellhop. The plugin will also add the class ```'--fullScreen'``` to the element(s) given
364+
365+
```javascript
366+
import { FullScreenPlugin, Container } from 'springroll-container';
367+
368+
const container = new Container('#game', {
369+
370+
plugins: [
371+
// FullScreenPlugin expects the selector for the element(s) to hook onto
372+
new FullScreenPlugin('#fullScreenButton'),
373+
]
374+
});
375+
376+
container.openPath('game.html');
377+
378+
```
379+
380+
The plugin will accept either a selector or an array of selectors as a parameter
381+
382+
```javascript
383+
new FullScreenPlugin('#fullScreenButton');
384+
new FullScreenPlugin(['#fullScreenButton', '.fullScreenButtonSideNav']);
385+
386+
// It will also accept one string with all selectors each seperated by a comma
387+
new FullScreenPlugin('#fullScreenButton, .fullScreenButtonSideNav');
388+
389+
390+
```
391+
392+
The typical html can look something like this however, the element may be positioned anywhere in the html as long as it is not inside the iframe
393+
394+
395+
```html
396+
397+
<nav>
398+
<!-- May be a button or any other element that can create an onclick event -->
399+
<button id='fullScreenButton'>Fullscreen</button>
400+
</nav>
401+
<!-- The element cannot be inside the source file -->
402+
<iframe id="game" scrolling="no"></iframe>
403+
404+
405+
```
406+
isFullScreen returns true if there is a fullscreen element
407+
`` FullScreenPlugin.isFullScreen ``
408+
409+
410+
---
411+
362412
### Multiple Plugin Controls
363413
All Plugins accept one or more HTML elements as controls in their constructor.
364414
For example the SoundPlugin can accept more than one volume slider or button if your set up requires it:
@@ -412,6 +462,7 @@ used to store user data for use across the Springroll environment. Examples are
412462
The `SavedData` class is the most direct way to access the Container storage options. It is used primarily in plugin classes, but may
413463
be used wherever necessary.
414464

465+
Following is an example of interacting with Local Storage
415466
```javascript
416467
import { SavedData } from 'springroll-container';
417468

@@ -426,6 +477,18 @@ let data = SavedData.read('user-value-key'); //data will be either the value in
426477
SavedData.remove('user-value-key'); //removes the value from both local and session storage.
427478
```
428479

480+
Following is an example of interacting with [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API) through the UserData class
481+
482+
483+
``` javascript
484+
import { SavedData } from 'springroll-container';
485+
486+
// Firstly, construct the SavedData object. This is only needed for IndexedDB work
487+
savedData = new SavedData('dbName');
488+
```
489+
All other methods will work the same as the documentation [here](https://github.com/SpringRoll/SpringRoll/tree/main/src/state#userdata);
490+
491+
429492
### SavedDataHandler
430493
The SavedDataHandler class is used primarily in the `UserDataPlugin` to interact with the `SavedData` class. But can be used directly
431494
if you require a callback when reading or writing from `SavedData`. Like `SavedData` all of the methods are static.

dist/SpringRoll-Container-umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/SpringRoll-Container-umd.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/SpringRoll-umd.js

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

dist/SpringRoll-umd.js.map

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

dist/SpringRoll.js

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

dist/SpringRoll.js.map

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

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e/client.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)