Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Will you add day support ? #52

Open
wants to merge 92 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
44e5ee7
Copy current timesheet to new timesheet-advanced. Switch logic betwee…
Jul 16, 2015
a4e571c
make default one work like on original plugin. (type is parallel)
Jul 17, 2015
97f261e
sass refactored
Jul 17, 2015
cc752f2
classes changed, added default bubble color
Jul 17, 2015
6f5fdb7
serial render js
Jul 17, 2015
7819f78
Merge branch 'develop' of https://github.com/ntucakovic/timesheet.js …
Jul 17, 2015
b1f3e33
default serial view
Jul 17, 2015
4fd1052
Bubble constructor changed - 5 parameters required, some of them can …
Jul 17, 2015
b9f80b6
Merge branch 'develop' of https://github.com/ntucakovic/timesheet.js …
Jul 17, 2015
e4139cf
link styled differently
Jul 17, 2015
64ddc26
bug fixes serial view
Jul 17, 2015
0ea3674
Merge branch 'develop' into feature/serial_view
Jul 17, 2015
7e880ec
make serial view usable
Jul 17, 2015
8838a8e
position bubbles
Jul 17, 2015
ecd77d8
Merge branch 'feature/serial_view' into develop
Jul 17, 2015
db784ba
More samples
Jul 17, 2015
1271455
content changes
Jul 17, 2015
33d494d
Merge branch 'develop' of https://github.com/ntucakovic/timesheet.js …
Jul 17, 2015
f4ab40c
only test page changed - displays parallel and serial examples
Jul 19, 2015
4e4ebdb
Display current month line if applicable (only if last month on X axi…
Jul 21, 2015
653289b
Add timesheet type to wrapper
Jul 21, 2015
bb8f1a4
Fix specificity, no need to go so deep
Jul 21, 2015
2421c44
add ts-bubble-wrapper class to ul element on serial view
Jul 21, 2015
a0078eb
Improve sass specificity, use new class for ul wrapper
Jul 21, 2015
7ada695
change border radius on serial view
Jul 21, 2015
050a5d6
Merge branch 'feature/improve_sass_add_timesheet_type_to_container' i…
Jul 21, 2015
e6ce25c
removed try-catch
Jul 21, 2015
263862b
Merge branch 'develop' of https://github.com/ntucakovic/timesheet.js …
Jul 21, 2015
fdce755
Constructor options refactor
Jul 21, 2015
8933880
use extra class parameter
Jul 21, 2015
fad7783
Merge branch 'feature/constructor_fix' into develop
Jul 21, 2015
b08532a
Fix merge problems
Jul 21, 2015
2026022
removed unused styles
Jul 21, 2015
37bedf9
added event listener on bubbles
Jul 21, 2015
8048166
override min/max logic
Jul 21, 2015
785689b
style
Jul 21, 2015
428e9ae
get attributes - initial
Jul 21, 2015
1be0247
Alter offsets depending on min and max width of timesheet
Jul 21, 2015
f1c6fbe
Merge branch 'feature/min_max_date_fix' into develop
Jul 21, 2015
dc67414
tooltips
Jul 21, 2015
7193071
Merge branch 'feature/tooltips' into develop
Jul 21, 2015
8384d5f
don't draw bubble if it doesn't fit within timesheet
Jul 21, 2015
6cc9e4f
fix timesheet max
Jul 21, 2015
9ac908b
x position improved
Jul 21, 2015
8767bdf
y position
Jul 21, 2015
d57964e
cut off bubbles and increase height on parallel
Jul 21, 2015
1281703
Merge branch 'feature/mix_max_fix' into develop
Jul 21, 2015
8e5876c
fix width (scrollbar appears) because of right border on section
Jul 21, 2015
e98bcfa
styles improved
Jul 21, 2015
69fca86
changed examples
Jul 21, 2015
f4d9468
white mode
Jul 21, 2015
9b0a698
X axis scroll mousewheel
Jul 22, 2015
ed5a774
Param to prevent binding scroll on X axis
Jul 22, 2015
cf2d1fd
dark tooltips
Jul 22, 2015
8e294b7
Merge branch 'feature/tooltip_position' into develop
Jul 22, 2015
a2a589e
Introduce light parameter to constructor and change classes' names
Jul 22, 2015
32c03ab
bower.json update
Jul 22, 2015
291c81a
api docs
Jul 22, 2015
7d29995
Merge branch 'develop' of https://github.com/ntucakovic/timesheet.js …
Jul 22, 2015
f5e226a
examples
Jul 22, 2015
018fe3a
Remove timesheet.js and disable test for the time being
Jul 22, 2015
2df0a22
rename scale and data
Jul 22, 2015
ef2027b
prefix variables
Jul 22, 2015
ac66be0
prefix variables
Jul 22, 2015
ff3d31c
Merge branch 'feature/rename_classes' into develop
Jul 22, 2015
683dcff
hide tooltips
Jul 22, 2015
5274d6b
Merge branch 'develop' of https://github.com/ntucakovic/timesheet.js …
Jul 22, 2015
408eeb0
removed old tests because they don't make sense anymore
Jul 22, 2015
f043e26
click on tooltip does not close it
Jul 22, 2015
e8787f9
Check if bubble fits on serial view. Typo ts-vertical-line to tsa-ver…
Jul 23, 2015
307dbad
Fix margin on bubble-wrap ul element
Jul 23, 2015
742873c
Serial hover bug fix
Jul 23, 2015
e5e837e
quick fix event binding
Jul 24, 2015
9b723cc
Add and remove active bubble classes on tooltips
Jul 24, 2015
20a79c0
Merge branch 'feature/tooltip_active' into develop
Jul 24, 2015
943e32f
Margin month feature
Jul 24, 2015
229d9bc
Added triangles to the tooltips; added tsa-tooltip--top and tsa-toolt…
Jul 24, 2015
5377634
merge
Jul 24, 2015
2184c6f
Switch data to json for bubbles
Jul 24, 2015
15703e6
Merge branch 'develop' of https://github.com/ntucakovic/timesheet.js …
Jul 24, 2015
181420e
data attributes in bubble
Jul 24, 2015
d60eaba
fix empty link render
Jul 27, 2015
d123215
Fix firefox's close tooltip
Jul 28, 2015
fb3bf7e
changes in readme.md
Mar 22, 2016
b7822b2
package json
Mar 22, 2016
28ee616
theme added in readme
Mar 22, 2016
a44f90e
Fix landing page
Mar 22, 2016
3457e02
Add images to readme
Mar 22, 2016
5d26ec7
Add rows for readme
Mar 22, 2016
5800303
Fix code in haml file
Mar 22, 2016
534c3eb
Add version to bower component
Mar 22, 2016
ea3ee1a
Clean up repo
Mar 22, 2016
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
44 changes: 19 additions & 25 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = function(grunt) {
},
my_target: {
files: {
'dist/timesheet.min.js': ['source/javascripts/timesheet.js']
'dist/timesheet-advanced.min.js': ['source/javascripts/timesheet-advanced.js']
}
}
},
Expand All @@ -29,7 +29,6 @@ module.exports = function(grunt) {
},
files: {
'dist/timesheet.min.css': 'source/stylesheets/timesheet.sass',
'dist/timesheet-white.min.css': 'source/stylesheets/timesheet-white.sass'
}
}
},
Expand All @@ -43,17 +42,17 @@ module.exports = function(grunt) {
}
}
},
simplemocha: {
options: {
globals: ['should'],
timeout: 3000,
ignoreLeaks: false,
grep: '',
ui: 'tdd',
reporter: 'spec'
},
all: { src: ['test/**/*.js'] }
},
//simplemocha: {
// options: {
// globals: ['should'],
// timeout: 3000,
// ignoreLeaks: false,
// grep: '',
// ui: 'tdd',
// reporter: 'spec'
// },
// all: { src: ['test/**/*.js'] }
//},
express: {
options: {
port: 8080
Expand Down Expand Up @@ -95,13 +94,11 @@ module.exports = function(grunt) {
copy: {
gh: {
files: [
{expand: false, src: __dirname + '/source/javascripts/lib.js', dest: __dirname + '/gh-pages/script/lib.js'},
{expand: false, src: __dirname + '/source/javascripts/lib.js', dest: __dirname + '/gh-pages/script/lib.js'},
{expand: false, src: __dirname + '/source/javascripts/main.js', dest: __dirname + '/gh-pages/script/main.js'},
{expand: false, src: __dirname + '/dist/timesheet.min.js', dest: __dirname + '/gh-pages/script/timesheet.min.js'},
{expand: false, src: __dirname + '/dist/timesheet.min.css', dest: __dirname + '/gh-pages/styles/timesheet.css'},
{expand: false, src: __dirname + '/dist/timesheet-white.min.css', dest: __dirname + '/gh-pages/styles/timesheet-white.css'},
{expand: false, src: __dirname + '/dist/timesheet.min.css.map', dest: __dirname + '/gh-pages/styles/timesheet.css.map'},
{expand: false, src: __dirname + '/dist/timesheet-white.min.css.map', dest: __dirname + '/gh-pages/styles/timesheet-white.css.map'}
{expand: false, src: __dirname + '/dist/timesheet-advanced.min.js', dest: __dirname + '/gh-pages/script/timesheet-advanced.min.js'},
{expand: false, src: __dirname + '/dist/timesheet.min.css', dest: __dirname + '/gh-pages/styles/timesheet.css'},
{expand: false, src: __dirname + '/dist/timesheet.min.css.map', dest: __dirname + '/gh-pages/styles/timesheet.css.map'},
]
}
}
Expand All @@ -110,20 +107,17 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-simple-mocha');

grunt.loadNpmTasks('grunt-contrib-copy');

grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-sass');

grunt.loadNpmTasks('grunt-express-server');

grunt.loadNpmTasks('grunt-haml');

// Default task
grunt.registerTask('default', ['build']);
grunt.registerTask('build', ['simplemocha', 'jshint', 'uglify', 'sass']);
grunt.registerTask('server', ['express:dev', 'watch' ])
//grunt.registerTask('build', ['simplemocha', 'jshint', 'uglify', 'sass']);
grunt.registerTask('build', ['jshint', 'uglify', 'sass']);
grunt.registerTask('server', ['express:dev', 'watch' ]);
grunt.registerTask('gh', ['build', 'haml:gh', 'sass:gh', 'copy:gh']);

};
82 changes: 60 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,81 @@
# Timesheet.js
# Timesheet-advanced.js

Simple JavaScript library to create HTML time sheets. Wrapped in an example project using Middleman …
JavaScript library to create HTML time sheets.

![https://sbstjn.github.io/timesheet.js](https://raw.githubusercontent.com/sbstjn/timesheet.js/master/screen.png)
https://ntucakovic.github.io/timesheet-advanced.js

You only have to include `dist/timesheet.js` and `dist/timesheet.css` in your HTML and initialize Timesheet.js with:
You only have to include `dist/timesheet-advanced.js` and `dist/timesheet.min.css` in your HTML and initialize time sheet with:

```HTML
<div id="timesheet"></div>
<div id="my-timesheet"></div>
```

```javascript
new Timesheet('timesheet', 2002, 2013, [
['2002', '09/2002', 'A freaking awesome time', 'lorem'],
['06/2002', '09/2003', 'Some great memories', 'ipsum'],
['2003', 'Had very bad luck'],
['10/2003', '2006', 'At least had fun', 'dolor'],
['02/2005', '05/2006', 'Enjoyed those times as well', 'ipsum'],
['07/2005', '09/2005', 'Bad luck again', 'default'],
['10/2005', '2008', 'For a long time nothing happened', 'dolor'],
['01/2008', '05/2009', 'LOST Season #4', 'lorem'],
['01/2009', '05/2009', 'LOST Season #4', 'lorem'],
['02/2010', '05/2010', 'LOST Season #5', 'lorem'],
['09/2008', '06/2010', 'FRINGE #1 & #2', 'ipsum']
]);
var bubbles = [
{start: '2002', end: '09/2002', label: 'First project', type: 'red', data: { technologies: 'php,drupal,mysql,symfony' }},
{start: '06/2002', end: '09/2003', label: 'Second project', type: 'blue'},
{start: '2003', label: 'Still working on'},
{start: '10/2003', end: '2006', label: 'Yellow project', type: 'yellow', link: 'http://www.example.com'},
{start: '02/2005', end: '05/2006', label: 'Green project', type: 'green', link: '#'},
{start: '07/2005', end: '09/2005', label: 'The shortest project', type: 'purple', link: '#'}
];

new Timesheet(bubbles, {
container: 'my-timesheet',
type: 'parallel',
timesheetYearMin: 2002,
timesheetYearMax: 2008,
theme: 'light'
});
```

### Explanation

'Bubbles' array contains information about all the bubbles that will appear in the time sheet. Each bubble can have:
- start: required; starting date in one of the following formats: mm/yyyy or yyyy
- end : optional; end date (if no end date is given, bubble is stretched until the end of the timesheet)
- label: required; name of the bubble (what does it refer to)
- type : optional; color of the bubble (if nothing is given, default value is used)
- link : optional; URL (if bubble name should act as a link)
- data : optional; HTML data attributes of a bubble. Foreach key in data object a data attribute is created in HTML. Values must be STRINGS.

Timesheet object contains information about the time sheet itself. It consists of:
- bubbles array,
- timesheetYearMax,
- timesheetYearMin,
- container : ID of the HTML element,
- theme: light or dark,
- type: serial or parallel.

In parallel mode, every bubble is in its own row.

In serial mode, bubbles are 'packed' in one row without overlapping.

Parallel Dark

![https://ntucakovic.github.io/timesheet-advanced.js](https://raw.githubusercontent.com/ntucakovic/timesheet-advanced.js/master/images/parallel-dark.png)

Serial Dark

![https://ntucakovic.github.io/timesheet-advanced.js](https://raw.githubusercontent.com/ntucakovic/timesheet-advanced.js/master/images/serial-dark.png)

Serial Light

![https://ntucakovic.github.io/timesheet-advanced.js](https://raw.githubusercontent.com/ntucakovic/timesheet-advanced.js/master/images/serial-light.png)


### Bower

`$ > bower install https://github.com/sbstjn/timesheet.js.git`
`$ > bower install timesheet-advanced.js`

## Grunt commands

Use `grunt` to build all JavaScript and StyleSheet files located inside `dist/`.

Use `grunt server` to start a local web server on [localhost:8080](http://localhost:8080) to customize Timesheet.js, afterwards run `grunt` to compile all needed files.
Use `grunt server` to start a local web server on [localhost:8080](http://localhost:8080) to customize Timesheet-advanced.js, afterwards run `grunt` to compile all needed files.

Use `grunt gh` to generate the site and files available at [sbstjn.github.io/timesheet.js](http://sbstjn.github.io/timesheet.js) into the `gh-pages` folder.
Use `grunt gh` to generate the site and files available at [ntucakovic.github.io/timesheet-advanced.js](http://ntucakovic.github.io/timesheet-advanced.js) into the `gh-pages` folder.

## License

Timesheet.js is licensed under MIT License.
Timesheet-advanced.js is licensed under MIT License.
14 changes: 8 additions & 6 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"name": "timesheet.js",
"homepage": "https://sbstjn.github.io/timesheet.js/",
"name": "timesheet-advanced.js",
"version": "1.0.1",
"homepage": "https://github.com/ntucakovic/timesheet-advanced.js",
"authors": [
"sbstjn <[email protected]>"
"Jelena <[email protected]>",
"Nikola <[email protected]>"
],
"description": "With Timesheet.js you can easily create simple time and data sheets or timelines using HTML5, JavaScript and CSS3. Yep, it's a Vanilla JS library!",
"main": ["dist/timesheet.min.js", "dist/timesheet.min.css"],
"description": "Timesheet-advanced.js is improved version of timesheet.js plugin with more functionality and more customization options.",
"main": ["dist/timesheet-advanced.min.js", "dist/timesheet.min.css"],
"moduleType": [
"amd"
],
"keywords": [
"timeline",
"timesheet",
"timesheet-advanced",
"timebar",
"line",
"bar",
Expand All @@ -26,7 +29,6 @@
"bower_components",
"test",
"tests",
"screen.png",
"source",
"Gruntfile.js",
"package.json"
Expand Down
Loading