Skip to content
This repository has been archived by the owner on Nov 17, 2019. It is now read-only.

Commit

Permalink
hideBlankYears option added
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylvain Simao authored and Sylvain Simao committed Jan 28, 2017
1 parent 0d6338d commit a48c636
Show file tree
Hide file tree
Showing 11 changed files with 204 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.DS_Store

# NODE
node_modules/*
node_modules

# SASS
.sass-cache
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sandbox
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 Sylvain Simao
Copyright (c) 2017 Sylvain Simao

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ IE 10+, Opera, Safari, Firefox & Chrome.

```html
<!-- Before closing your <head> tag -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/jquery.timeliny/1.0.0/jquery.timeliny.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/jquery.timeliny/1.0.1/jquery.timeliny.min.css" />

<!-- Before closing your <body> tag -->
<script src="https://cdn.jsdelivr.net/jquery.timeliny/1.0.0/jquery.timeliny.min.js"></script>
<script src="https://cdn.jsdelivr.net/jquery.timeliny/1.0.1/jquery.timeliny.min.js"></script>
```

**Using NPM:**
Expand Down Expand Up @@ -78,6 +78,7 @@ $(function() {
wrapper: '<div class="timeliny-wrapper"></div>',
boundaries: 2,
animationSpeed: 250,
hideBlankYears: false,
onInit: function() {},
onDestroy: function() {},
afterLoad: function(currYear) {},
Expand All @@ -101,6 +102,7 @@ $(function() {
| wrapper | `<div class="timeliny-wrapper"></div>` | Specifies the structure of the main wrapper element. Useful if you use a grid system. Example with Foundation grid: `<div class="row"><div class="small-12 columns"></div></div>`. |
| boundaries | `2` | Specifies the amount of 'ghost' dots/years to add on both sides of your timeline. For example, if your timeline contain years from 2002 to 2005 and boundaries is set to `2`, timeliny will transform your timeline from 2000 to 2007. |
| animationSpeed | `250` | Specifies the animation speed for transition from one date to another one. |
| hideBlankYears | `false` | If set to `true`, it will only show years that have a data-year attribute. |

### Callbacks

Expand Down Expand Up @@ -225,4 +227,4 @@ Edit files in the `/src/` folder, run `gulp` to copy/minify into the `/dist/` f

Code released under the [MIT license](https://github.com/maoosi/jquery.timeliny/blob/master/LICENSE.md).

Copyright (c) 2016 Sylvain Simao
Copyright (c) 2017 Sylvain Simao
12 changes: 9 additions & 3 deletions dist/jquery.timeliny.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
* Author: Sylvain Simao - https://github.com/maoosi
*/

;(function($) {
;(function ( $, window, document, undefined ) {

"use strict";

/**
* Plugin object constructor.
Expand All @@ -26,7 +28,9 @@
hook('onInit');

_reorderElems();
_addGhostElems();
if (options.hideBlankYears === false) {
_addGhostElems();
}
_createWrapper();
_createDots();
_fixBlockSizes();
Expand Down Expand Up @@ -350,6 +354,7 @@
* Plugin definition.
*/
$.fn['timeliny'] = function(options) {
console.log(options);
// If the first parameter is a string, treat this as a call to
// a public method.
if (typeof arguments[0] === 'string') {
Expand Down Expand Up @@ -398,6 +403,7 @@
wrapper: '<div class="timeliny-wrapper"></div>',
boundaries: 2,
animationSpeed: 250,
hideBlankYears: false,
onInit: function() {},
onDestroy: function() {},
afterLoad: function(currYear) {},
Expand All @@ -406,4 +412,4 @@
afterResize: function() {}
};

})(jQuery);
})( jQuery, window, document );
2 changes: 1 addition & 1 deletion dist/jquery.timeliny.min.css

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

2 changes: 1 addition & 1 deletion dist/jquery.timeliny.min.js

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jquery.timeliny",
"version": "1.0.0",
"version": "1.0.1",
"description": "Responsive jQuery plugin for creating year-based interactive timelines.",
"homepage": "https://github.com/maoosi/jquery.timeliny",
"main": "dist/jquery.timeliny.min.js",
Expand Down
Binary file added sandbox/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a48c636

Please sign in to comment.