Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
017a3c1
add AMD support
eduardo-matos Jan 5, 2013
7e77fe4
create example of AMD usage
eduardo-matos Jan 5, 2013
af1a41c
update documentation to reflect AMD support
eduardo-matos Jan 5, 2013
49d9776
Create LICENSE
tommoor Sep 2, 2013
2f08444
Added Retina support
ggPeti Sep 7, 2013
c4909a1
Reminified script
ggPeti Sep 7, 2013
d44364c
Fallback to 16px image if no high-res present
ggPeti Sep 7, 2013
6daff2b
Reminified script
ggPeti Sep 7, 2013
8f6f301
Workaround for Chrome bug
ggPeti Sep 7, 2013
4e5d216
Reminified script
ggPeti Sep 7, 2013
353f493
Upped version to 0.6
tommoor Sep 20, 2013
fc93ec3
Fixed double-printing the favicon
mllocs Oct 11, 2013
4c42db4
Optionally set crossOrigin = 'anonymous'
PhilHarnish Oct 11, 2013
7f191dc
Merge pull request #50 from mllocs/master
tommoor Oct 11, 2013
31d49da
Merge pull request #51 from PhilHarnish/optionalCrossOrigin
tommoor Oct 11, 2013
d8dd956
Upped to 0.6.1, minified
tommoor Oct 11, 2013
9d5d8bf
Add license markup to header comment
tricknotes Dec 6, 2013
46d9ae2
Merge pull request #54 from tricknotes/add-license-markup-to-header-c…
tommoor Jan 19, 2014
9cc67d6
#19 - bugfix for handling dynamic document titles
simong Jan 21, 2014
40cf574
Repack, version upped
tommoor Feb 10, 2014
0c860ee
AMD support
tommoor Feb 10, 2014
94f32ea
Add CommonJS support
EvanHahn May 26, 2015
3b5dd1b
Ensure we have a URL to set before setting it
ChrisMBarr Jun 18, 2015
acde11a
Merge pull request #69 from chrismbarr/patch-1
tommoor Jul 19, 2015
759d45c
Merge pull request #68 from EvanHahn/add-commonjs-support
tommoor Jul 19, 2015
f667cdd
Added: package.json for NPM support
tommoor Jul 19, 2015
30361a3
Fix Syntax Error in package.json
kelhusseiny Sep 30, 2015
6537036
Merge pull request #75 from Azzurrio/patch-1
tommoor Sep 30, 2015
64f8fca
Restore the original Favicon on reset
waschmittel Oct 5, 2015
fbecd43
Update tinycon.js
waschmittel Oct 5, 2015
6830a69
Update tinycon.js
Thelonedevil Oct 21, 2015
47f390b
Update tinycon.js
Thelonedevil Oct 21, 2015
51bda66
Merge pull request #81 from Thelonedevil/Thelonedevil-patch-2
tommoor Apr 9, 2016
340c048
Merge pull request #78 from Thelonedevil/Thelonedevil-patch-1
tommoor Apr 9, 2016
dc92c1f
Merge pull request #76 from waschmittel/patch-1
tommoor Apr 9, 2016
6a4e131
Colour > color
tommoor Apr 9, 2016
ea8e815
Updated documentation
tommoor Apr 9, 2016
5fdc1dd
Bump 0.6.5
tommoor Apr 9, 2016
36179d9
Add bower.json
simison May 11, 2016
27158e7
Merge pull request #84 from simison/patch-1
tommoor May 21, 2016
06fa31a
Added license property to package.json
julianlam Jul 6, 2016
35fc54a
Merge pull request #86 from julianlam/patch-1
tommoor Aug 13, 2016
75baba2
Chrome browsers with nonstandard zoom report fractional devicePixelRa…
PhilHarnish Sep 12, 2014
38ab833
Added minified file and README note
tommoor Aug 13, 2016
cdb71d7
0.6.6
tommoor Aug 13, 2016
83e7ef5
Removed version note from comment, its in the package.json
tommoor Aug 13, 2016
729941a
Do not assume <link> tags are children of <head>
dvdplm Mar 20, 2017
3a60dfe
Merge pull request #91 from dvdplm/upstream/master
tommoor Apr 1, 2017
b904b25
Add prepublish
tommoor Apr 1, 2017
0001094
0.6.7
tommoor Apr 1, 2017
82accb1
NPM publishable
tommoor Apr 1, 2017
8d62eee
0.6.8
tommoor Apr 1, 2017
83ed386
Update install instructions
tommoor Apr 5, 2017
9c3fbfa
Update README.md
lax1089 Jul 1, 2019
463cdbc
Merge pull request #98 from lax1089/patch-1
tommoor Jul 1, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.DS_Store
.DS_Store
.log
node_modules/
16 changes: 16 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');

grunt.initConfig({
uglify: {
all: {
options: {
preserveComments: 'some'
},
files: {
'tinycon.min.js': ['tinycon.js']
}
},
},
});
};
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2015 Tom Moor

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
54 changes: 47 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
# Tinycon

A small library for manipulating the favicon, in particular adding alert bubbles and changing images. Tinycon gracefully falls back to a number in title approach for browers that don't support canvas or dynamic favicons.
A small library for manipulating the favicon, in particular adding alert bubbles and changing images. Tinycon gracefully falls back to a number in title approach for browsers that don't support canvas or dynamic favicons.

<img src="https://github.com/tommoor/tinycon/blob/master/examples/screenshot.png?raw=true" />

<a href="http://tommoor.github.com/tinycon/">See the Live Demo here.</a>

## Documentation

Tinycon adds a single object to the global namespace and does not require initialisation.
Tinycon adds a single object to the global namespace and does not require initialization.


### Installation

Install with your favorite package manager.

```
npm install tinycon --save
```
```
yarn add tinycon
```

### Basic Usage

Expand All @@ -18,13 +30,13 @@ Tinycon.setBubble(6);

### Options

Tinycon can take a range of options to customise the look
Tinycon can take a range of options to customize the look

* width: the width of the alert bubble
* height: the height of the alert bubble
* font: a css string to use for the fontface (recommended to leave this)
* colour: the foreground font colour
* background: the alert bubble background colour
* color: the foreground font color
* background: the alert bubble background color
* fallback: should we fallback to a number in brackets for browsers that don't support canvas/dynamic favicons? Boolean, or use the string 'force' to ensure a title update even in supported browsers.
* abbreviate: should tinycon shrink large numbers such as 1000 to an abbreviated version (1k). Boolean, defaults to true

Expand All @@ -33,12 +45,35 @@ Tinycon.setOptions({
width: 7,
height: 9,
font: '10px arial',
colour: '#ffffff',
color: '#ffffff',
background: '#549A2F',
fallback: true
});
```

### AMD support

Tinycon can also be used as an asynchronous module.

```javascript
require([
'tinycon.js'
], function (T) {

T.setOptions({
width: 7,
height: 9,
font: '10px arial',
color: '#ffffff',
background: '#549A2F',
fallback: true
});

T.setBubble(7);

});
```

## Browser Support

Tinycon has been tested to work completely in the following browsers. Older versions may be supported, but haven't been tested:
Expand All @@ -47,12 +82,17 @@ Tinycon has been tested to work completely in the following browsers. Older vers
* Firefox 9+
* Opera 11+

Currently the library degrades to title update:
Currently the library degrades to title update in the following browsers:

* Internet Explorer 9
* Safari 5


## Development

To produce the minified file run `grunt uglify`


## License / Credits

Tinycon is released under the MIT license. It is simple and easy to understand and places almost no restrictions on what you can do with Tinycon.
Expand Down
30 changes: 30 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "tinycon",
"description": "A small library for manipulating the favicon, in particular adding alert bubbles and changing images.",
"homepage": "http://blog.tommoor.com/tinycon/",
"repository": {
"type": "git",
"url": "https://github.com/tommoor/tinycon.git"
},
"moduleType": [
"globals",
"amd"
],
"keywords": [
"favicon",
"notification"
],
"main": [
"tinycon.js"
],
"ignore": [
"examples",
"Gruntfile.js",
".gitignore",
"*.md",
"LICENSE",
"package.json"
],
"private": false,
"license": "MIT"
}
17 changes: 17 additions & 0 deletions examples/index-amd.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<html>
<head>
<link rel="icon" href="favicon.ico">
<title>Tinycon</title>

<script src="require.js"></script>
<script>
require([
'../tinycon.min.js'
], function (T) {
T.setBubble(3);
});
</script>
</head>
<body>
</body>
</html>
35 changes: 35 additions & 0 deletions examples/require.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading