Skip to content

Commit

Permalink
it's called sub now
Browse files Browse the repository at this point in the history
  • Loading branch information
schlosser committed Jul 26, 2015
1 parent b6910f3 commit 0f6c0b1
Show file tree
Hide file tree
Showing 10 changed files with 121 additions and 120 deletions.
2 changes: 1 addition & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"browser": true,
"devel": true,
"jasmine": true,
"predef": [ "Replace" ]
"predef": [ "Sub" ]
}
40 changes: 20 additions & 20 deletions README.md
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."
Expand All @@ -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."
Expand All @@ -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`
Expand Down
4 changes: 2 additions & 2 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = function (grunt) {
grunt.initConfig({
jasmine: {
pivotal: {
src: "src/replace.js",
src: "src/substituteteacher.js",
options: {
specs: "test/*Spec.js",
helpers: "test/*Helper.js"
Expand All @@ -15,7 +15,7 @@ module.exports = function (grunt) {
uglify: {
my_target: {
files: {
"src/replace.min.js": ["src/replace.js"]
"src/substituteteacher.min.js": ["src/substituteteacher.js"]
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "Replace.js",
"name": "substituteteacher.js",
"version": "0.1.0",
"description": "A clever way to replace several sentences in a loop.",
"repository": "https://github.com/danrschlosser/replace.js",
"description": "A clever way to substitute several sentences in a loop.",
"repository": "https://github.com/danrschlosser/substituteteacher.js",
"scripts": {
"test": "grunt jasmine"
},
Expand Down
1 change: 0 additions & 1 deletion src/replace.min.js

This file was deleted.

Loading

0 comments on commit 0f6c0b1

Please sign in to comment.