Skip to content

Commit f1af903

Browse files
committed
repo cosmetics
1 parent 3697594 commit f1af903

File tree

9 files changed

+24
-44
lines changed

9 files changed

+24
-44
lines changed

LICENSE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Copyright (c) 2016, SimulatedGREG <[email protected]>
2+
3+
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
4+
5+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

LINCENSE.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[Kappa]: http://static-cdn.jtvnw.net/emoticons/v1/25/1.0
22

3-
# ![Kappa Emote][Kappa] Kappa.js v1.0.8
3+
# ![Kappa Emote][Kappa] Kappa.js v2.0.0
44
Kappa.js is a simple jQuery Plugin that can easily find text Twitch emotes and replace them with their respective emoticons.
55

66
## How does this work?
7-
Kappa.js is made possible with the use of [Twitch Emotes API v2](http://twitchemotes.com/apidocs). Kappa.js will pull a fresh list of **global emotes** on each browser session. Please note this API is currently in *development*, so features and structure may change without warning.
7+
Kappa.js is made possible with the use of [Twitch Emotes API v2](http://twitchemotes.com/apidocs). Kappa.js will pull a fresh list of **global emotes** and save in localStorage. Please note this API is currently in *development*, so features and structure may change without warning.
88

99
## How do I get this?
1010
Kappa.js can be quickly installed from the public bower registry. Just run...
@@ -28,12 +28,12 @@ To get started include the `kappa.js` file just before the end of your closing `
2828
```
2929
Once included use jQuery to select which elements your want `kappa.js` to apply in this manner... `$([selector]).kappa([options]);`
3030

31-
In this example `kappa.js` will apply to all elements in the DOM once the page is loaded.
31+
In this example `kappa.js` will apply to elements with `class="kappa"` in the DOM once the page is loaded.
3232
```html
3333
...
3434
<script>
35-
$(function () {
36-
$('*').kappa();
35+
$(document).ready(function() {
36+
$('.kappa').kappa();
3737
});
3838
</script>
3939
</body>
@@ -42,16 +42,12 @@ In this example `kappa.js` will apply to all elements in the DOM once the page i
4242
And that's it! There's nothing else to do. All text emotes will be replaced with their respective Twitch emoticons. But wait, there's more!
4343

4444
### Options
45-
As of now, options are limited to only emoticon size. More to come!
4645

4746
| option | type | default | description |
4847
|:-----------|:--------|:-------|:------------------------------------------------------------------------------|
4948
| emoteSize | string | `'small'` | Sets emoticon image size. Can be `'small'`, `'medium'`, or `'large'`. |
5049
| customClass | string | `null` | Adds a custom class to each injected `<img>` emoticon. |
5150

52-
## What's next?
53-
In the near future I plan to add support for subscriber emotes.
54-
5551
#### Credits
5652
[Twitch Emotes API v2](http://twitchemotes.com/apidocs)
5753
*Emote and badge images are property of [Twitch Interactive](http://www.twitch.tv/) and their respective owners.*

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "Kappa.js",
3-
"version": "1.0.8",
3+
"version": "2.0.0",
44
"homepage": "http://simulatedgreg.github.io/kappa.js/",
55
"authors": [
66
"Greg Holguin <[email protected]>"
77
],
88
"description": "A simple jQuery plugin that can easily find text Twitch emotes and replace them with their respective emoticons.",
9-
"main": "dist/kappa.js",
9+
"main": "dist/kappa.min.js",
1010
"keywords": [
1111
"kappa",
1212
"twitch",

dist/kappa.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* Check for previous data in localStorage
77
*/
8-
var previousStorage = window.localStorage.getItem('kappa-js');
8+
var previousStorage = localStorage.getItem('kappa-js');
99

1010
/**
1111
* Initialize KappaJS
@@ -26,7 +26,7 @@
2626
*/
2727
function getTwitchEmotesPromise(res, rej) {
2828
$.get('https://twitchemotes.com/api_cache/v2/global.json', function (data) {
29-
if (typeof Storage !== 'undefined') window.localStorage.setItem('kappa-js', JSON.stringify(data));
29+
if (typeof Storage !== 'undefined') localStorage.setItem('kappa-js', JSON.stringify(data));
3030

3131
res(data);
3232
});
@@ -40,7 +40,7 @@
4040
init().then(function (data) {
4141
window.KappaJS = data;
4242
});
43-
} else window.KappaJS = JSON.parse(window.localStorage.getItem('kappa-js'));
43+
} else window.KappaJS = JSON.parse(localStorage.getItem('kappa-js'));
4444

4545
/**
4646
* Initialize jQuery Plugin

dist/kappa.min.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.

index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
<title>Kappa.js</title>
66
</head>
77
<body>
8-
<div class="kappa">Kappa Kappa Kappa</div>
9-
8+
<div class="kappa">Kappa FailFish WutFace</div>
109

1110
<script src="https://code.jquery.com/jquery-2.2.0.min.js"></script>
1211
<script src="dist/kappa.js"></script>

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "kappa.js",
3-
"version": "1.0.0",
3+
"version": "2.0.0",
44
"description": "Kappa.js is a simple jQuery Plugin that can easily find text Twitch emotes and replace them with their respective emoticons. ",
5-
"main": "kappa.js",
5+
"main": "dist/kappa.min.js",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1"
88
},
@@ -33,5 +33,6 @@
3333
"gulp-babel": "^6.1.2",
3434
"gulp-rename": "^1.2.2",
3535
"gulp-uglify": "^1.5.2"
36-
}
36+
},
37+
"dependencies": {}
3738
}

src/kappa.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* Check for previous data in localStorage
55
*/
6-
let previousStorage = window.localStorage.getItem('kappa-js');
6+
let previousStorage = localStorage.getItem('kappa-js');
77

88
/**
99
* Initialize KappaJS
@@ -27,7 +27,7 @@
2727
$.get('https://twitchemotes.com/api_cache/v2/global.json',
2828
(data) => {
2929
if(typeof Storage !== 'undefined')
30-
window.localStorage.setItem('kappa-js', JSON.stringify(data));
30+
localStorage.setItem('kappa-js', JSON.stringify(data));
3131

3232
res(data);
3333
});
@@ -41,7 +41,7 @@
4141
init().then((data) => {
4242
window.KappaJS = data;
4343
});
44-
} else window.KappaJS = JSON.parse(window.localStorage.getItem('kappa-js'));
44+
} else window.KappaJS = JSON.parse(localStorage.getItem('kappa-js'));
4545

4646

4747
/**

0 commit comments

Comments
 (0)