-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
121 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
"browser": true, | ||
"devel": true, | ||
"jasmine": true, | ||
"predef": [ "Replace" ] | ||
"predef": [ "Sub" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
Replace.js | ||
substituteteacher.js | ||
========== | ||
|
||
[![Build status](https://travis-ci.org/danrschlosser/replace.js.svg)](https://travis-ci.org/danrschlosser/replace.js) | ||
[![Build status](https://travis-ci.org/danrschlosser/substituteteacher.js.svg)](https://travis-ci.org/danrschlosser/substituteteacher.js) | ||
|
||
Replace.js will rotate through a series of sentences, transitioning between each one. | ||
substituteteacher.js will rotate through a series of sentences, transitioning between each one. | ||
|
||
## Quick Start | ||
|
||
Replace.js is easy to use. Add the script to your page, provide a target container and call `run()`. | ||
substituteteacher.js is easy to use. Add the script to your page, provide a target container and call `run()`. | ||
|
||
#### Step 1: Download | ||
#### Step 0: Download | ||
|
||
[Download the latest release](https://github.com/danrschlosser/replace.js/releases/download/v0.1/replace.min.js) or clone the repo: | ||
[Download the latest release](https://github.com/danrschlosser/substituteteacher.js/releases/download/v0.1/substituteteacher.min.js) or clone the repo: | ||
|
||
```bash | ||
$ git clone [email protected]:danrschlosser/replace.js | ||
$ git clone [email protected]:danrschlosser/substituteteacher.js | ||
``` | ||
|
||
#### Step 2: Create your container element | ||
#### Step 1: Add the `substituteteacher.min.js` file | ||
|
||
```html | ||
<div id="replace"></div> | ||
<script src="substituteteacher.min.js"></script> | ||
``` | ||
|
||
#### Step 3: Add the `replace.js` file | ||
#### Step 2: Create your container element | ||
|
||
```html | ||
<script src="replace.min.js"></script> | ||
<div id="sub">Fallback Text</div> | ||
``` | ||
|
||
#### Step 4: Init Replace.js | ||
#### Step 3: Init substituteteacher.js | ||
|
||
```javascript | ||
var replace = new Replace([ | ||
var sub = new Sub([ | ||
"First sentence.", | ||
"Second sentence.", | ||
"How about a third." | ||
|
@@ -41,21 +41,21 @@ var replace = new Replace([ | |
|
||
## API | ||
|
||
### Replace(_sentences_, [_options_]) | ||
### Sub(_sentences_, [_options_]) | ||
|
||
The `Replace` constructor create a new instance of replacement. The `sentences` parameter should be a list of sentence strings. Customize the instance by passing the `options` parameter. The example below uses all options and their defaults: | ||
The `Sub` constructor create a new instance of sub. The `sentences` parameter should be a list of sentence strings. Customize the instance by passing the `options` parameter. The example below uses all options and their defaults: | ||
|
||
```javascript | ||
var opts = { | ||
containerId: "replace", | ||
namespace: "replace", | ||
containerId: "sub", | ||
namespace: "sub", | ||
interval: 5000, | ||
speed: 200, | ||
verbose: false, | ||
random: false, | ||
best: true | ||
}; | ||
var replace = new Replace([ | ||
var sub = new Sub([ | ||
"First sentence.", | ||
"Second sentence.", | ||
"How about a third." | ||
|
@@ -66,8 +66,8 @@ var replace = new Replace([ | |
|
||
| Option | Description | Defualt | | ||
|--------|-------------|---------| | ||
| `containerId` | Id of the injection point for HTML | `"replace"` | ||
| `namespace` | Namespace to prepend to classes used internally | `"replace"` | ||
| `containerId` | Id of the injection point for HTML | `"sub"` | ||
| `namespace` | Namespace to prepend to classes used internally | `"sub"` | ||
| `interval` | Number of milliseconds between each change | `5000` | ||
| `speed` | Number of milliseconds that each step of the animation should take | `200` | ||
| `verbose` | True to enable console logging | `false` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.