Skip to content

Commit 7fedcc1

Browse files
committed
merging pull 93
1 parent 8840f2a commit 7fedcc1

File tree

6 files changed

+231
-136
lines changed

6 files changed

+231
-136
lines changed

CONTRIBUTORS.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Welcome Contributor
22
=
33

4-
Thank your very much for your time examining and potentially modifying the source code. I truly believe it is what makes this community so great. This plugin wouldn't have gained the notoriety it has, had I not opened up the original source and been quiet unhappy with it.
4+
Thank you very much for your time examining and potentially modifying the source code. I truly believe it is what makes this community so great. This plugin wouldn't have gained the notoriety it has had I not opened up the original source and been quite unhappy with it.
55

66

77
Requirements & Best Practices
@@ -12,5 +12,6 @@ Just a few guidelines before submitting issues and pull requests:
1212
- Ensure the code passes [JSHint](http://jshint.com) completely
1313
- Always strive to write code that meets [best practices](http://taitems.github.com/Front-End-Development-Guidelines/)
1414
- If you're attempting to solve a very unique bug, a test case is preferred
15+
- Please target all pull requests to the [develop](/../../tree/develop) branch
1516

16-
And thanks once again!
17+
And thanks once again!

css/style.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
background-image: url(../img/grid.png);
106106
background-repeat: repeat;
107107
background-position: 24px 24px;
108+
position: relative;
108109
}
109110
.fn-gantt .day, .fn-gantt .date {
110111
overflow: visible;
@@ -181,7 +182,7 @@
181182
.fn-gantt .bar {
182183
background-color: #D0E4FD;
183184
height: 18px;
184-
margin: 4px 3px 3px 3px;
185+
margin: 0px 3px 3px 0px;
185186
position: absolute;
186187
z-index: 10;
187188
text-align: center;
@@ -402,6 +403,7 @@
402403
top: 0;
403404
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#bf000000', endColorstr='#bf000000',GradientType=0 );
404405
background: rgba(0,0,0,0.75);
406+
cursor: wait;
405407
z-index: 30;
406408
}
407409
.fn-gantt-loader-spinner span {

index.html

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
<!doctype html>
2-
<html lang="en-au">
1+
<!DOCTYPE html>
2+
<html lang="en">
33
<head>
44
<title>jQuery.Gantt</title>
55
<meta charset="utf-8">
6-
<meta http-equiv="X-UA-Compatible" content="IE=Edge;chrome=1" >
7-
<link rel="stylesheet" href="css/style.css" />
8-
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
9-
<link rel="stylesheet" href="http://taitems.github.com/UX-Lab/core/css/prettify.css" />
6+
<meta http-equiv="X-UA-Compatible" content="IE=Edge;chrome=1">
7+
<link href="css/style.css" type="text/css" rel="stylesheet">
8+
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" type="text/css">
9+
<link href="http://taitems.github.com/UX-Lab/core/css/prettify.css" rel="stylesheet" type="text/css">
1010
<style type="text/css">
1111
body {
1212
font-family: Helvetica, Arial, sans-serif;
@@ -30,6 +30,14 @@
3030
table th:first-child {
3131
width: 150px;
3232
}
33+
/* Bootstrap 3.0 re-reset */
34+
.fn-gantt *,
35+
.fn-gantt *:after,
36+
.fn-gantt *:before {
37+
-webkit-box-sizing: content-box;
38+
-moz-box-sizing: content-box;
39+
box-sizing: content-box;
40+
}
3341
</style>
3442
</head>
3543
<body>
@@ -108,7 +116,7 @@ <h2>
108116
<code>source</code>
109117
</td>
110118
<td>
111-
null
119+
[]
112120
</td>
113121
<td>
114122
Array, String (url)
@@ -204,7 +212,7 @@ <h2>
204212
</tr>
205213
<tr>
206214
<td>
207-
<code>onItemClick: </code>
215+
<code>onItemClick</code>
208216
</td>
209217
<td>
210218
<code>function (data) { return; }</code></td>
@@ -427,13 +435,11 @@ <h2>
427435

428436
</div>
429437

430-
</body>
431438
<script src="js/jquery.min.js"></script>
432439
<script src="js/jquery.fn.gantt.js"></script>
433-
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
440+
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
434441
<script src="http://taitems.github.com/UX-Lab/core/js/prettify.js"></script>
435-
<script>
436-
442+
<script>
437443
$(function() {
438444

439445
"use strict";
@@ -445,7 +451,7 @@ <h2>
445451
values: [{
446452
from: "/Date(1320192000000)/",
447453
to: "/Date(1322401600000)/",
448-
label: "Requirement Gathering",
454+
label: "Requirement Gathering",
449455
customClass: "ganttRed"
450456
}]
451457
},{
@@ -454,7 +460,7 @@ <h2>
454460
values: [{
455461
from: "/Date(1322611200000)/",
456462
to: "/Date(1323302400000)/",
457-
label: "Scoping",
463+
label: "Scoping",
458464
customClass: "ganttRed"
459465
}]
460466
},{
@@ -463,7 +469,7 @@ <h2>
463469
values: [{
464470
from: "/Date(1323802400000)/",
465471
to: "/Date(1325685200000)/",
466-
label: "Development",
472+
label: "Development",
467473
customClass: "ganttGreen"
468474
}]
469475
},{
@@ -472,7 +478,7 @@ <h2>
472478
values: [{
473479
from: "/Date(1325685200000)/",
474480
to: "/Date(1325695200000)/",
475-
label: "Showcasing",
481+
label: "Showcasing",
476482
customClass: "ganttBlue"
477483
}]
478484
},{
@@ -481,7 +487,7 @@ <h2>
481487
values: [{
482488
from: "/Date(1326785200000)/",
483489
to: "/Date(1325785200000)/",
484-
label: "Development",
490+
label: "Development",
485491
customClass: "ganttGreen"
486492
}]
487493
},{
@@ -490,7 +496,7 @@ <h2>
490496
values: [{
491497
from: "/Date(1328785200000)/",
492498
to: "/Date(1328905200000)/",
493-
label: "Showcasing",
499+
label: "Showcasing",
494500
customClass: "ganttBlue"
495501
}]
496502
},{
@@ -499,7 +505,7 @@ <h2>
499505
values: [{
500506
from: "/Date(1330011200000)/",
501507
to: "/Date(1336611200000)/",
502-
label: "Training",
508+
label: "Training",
503509
customClass: "ganttOrange"
504510
}]
505511
},{
@@ -508,7 +514,7 @@ <h2>
508514
values: [{
509515
from: "/Date(1336611200000)/",
510516
to: "/Date(1338711200000)/",
511-
label: "Deployment",
517+
label: "Deployment",
512518
customClass: "ganttOrange"
513519
}]
514520
},{
@@ -517,7 +523,7 @@ <h2>
517523
values: [{
518524
from: "/Date(1336611200000)/",
519525
to: "/Date(1349711200000)/",
520-
label: "Warranty Period",
526+
label: "Warranty Period",
521527
customClass: "ganttOrange"
522528
}]
523529
}],
@@ -547,6 +553,7 @@ <h2>
547553
prettyPrint();
548554

549555
});
556+
</script>
550557

551-
</script>
552-
</html>
558+
</body>
559+
</html>

js/jquery.cookie.js

Lines changed: 96 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,96 @@
1-
/*!
2-
* jQuery Cookie Plugin
3-
* https://github.com/carhartl/jquery-cookie
4-
*
5-
* Copyright 2011, Klaus Hartl
6-
* Dual licensed under the MIT or GPL Version 2 licenses.
7-
* http://www.opensource.org/licenses/mit-license.php
8-
* http://www.opensource.org/licenses/GPL-2.0
9-
*/
10-
(function ($) {
11-
$.cookie = function (key, value, options) {
12-
13-
// key and at least value given, set cookie...
14-
if (arguments.length > 1 && (!/Object/.test(Object.prototype.toString.call(value)) || value === null || value === undefined)) {
15-
options = $.extend({}, options);
16-
17-
if (value === null || value === undefined) {
18-
options.expires = -1;
19-
}
20-
21-
if (typeof options.expires === 'number') {
22-
var days = options.expires, t = options.expires = new Date();
23-
t.setDate(t.getDate() + days);
24-
}
25-
26-
value = String(value);
27-
28-
return (document.cookie = [
29-
encodeURIComponent(key), '=', options.raw ? value : encodeURIComponent(value),
30-
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
31-
options.path ? '; path=' + options.path : '',
32-
options.domain ? '; domain=' + options.domain : '',
33-
options.secure ? '; secure' : ''
34-
].join(''));
35-
}
36-
37-
// key and possibly options given, get cookie...
38-
options = value || {};
39-
var decode = options.raw ? function (s) { return s; } : decodeURIComponent;
40-
41-
var pairs = document.cookie.split('; ');
42-
for (var i = 0, pair; pair = pairs[i] && pairs[i].split('='); i++) {
43-
if (decode(pair[0]) === key) return decode(pair[1] || ''); // IE saves cookies with empty string as "c; ", e.g. without "=" as opposed to EOMB, thus pair[1] may be undefined
44-
}
45-
return null;
46-
};
47-
})(jQuery);
1+
/*!
2+
* jQuery Cookie Plugin v1.3.1
3+
* https://github.com/carhartl/jquery-cookie
4+
*
5+
* Copyright 2013 Klaus Hartl
6+
* Released under the MIT license
7+
*/
8+
(function (factory) {
9+
if (typeof define === 'function' && define.amd) {
10+
// AMD. Register as anonymous module.
11+
define(['jquery'], factory);
12+
} else {
13+
// Browser globals.
14+
factory(jQuery);
15+
}
16+
}(function ($) {
17+
18+
var pluses = /\+/g;
19+
20+
function decode(s) {
21+
if (config.raw) {
22+
return s;
23+
}
24+
return decodeURIComponent(s.replace(pluses, ' '));
25+
}
26+
27+
function decodeAndParse(s) {
28+
if (s.indexOf('"') === 0) {
29+
// This is a quoted cookie as according to RFC2068, unescape...
30+
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
31+
}
32+
33+
s = decode(s);
34+
35+
try {
36+
return config.json ? JSON.parse(s) : s;
37+
} catch(e) {}
38+
}
39+
40+
var config = $.cookie = function (key, value, options) {
41+
42+
// Write
43+
if (value !== undefined) {
44+
options = $.extend({}, config.defaults, options);
45+
46+
if (typeof options.expires === 'number') {
47+
var days = options.expires, t = options.expires = new Date();
48+
t.setDate(t.getDate() + days);
49+
}
50+
51+
value = config.json ? JSON.stringify(value) : String(value);
52+
53+
return (document.cookie = [
54+
config.raw ? key : encodeURIComponent(key),
55+
'=',
56+
config.raw ? value : encodeURIComponent(value),
57+
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
58+
options.path ? '; path=' + options.path : '',
59+
options.domain ? '; domain=' + options.domain : '',
60+
options.secure ? '; secure' : ''
61+
].join(''));
62+
}
63+
64+
// Read
65+
var cookies = document.cookie.split('; ');
66+
var result = key ? undefined : {};
67+
for (var i = 0, l = cookies.length; i < l; i++) {
68+
var parts = cookies[i].split('=');
69+
var name = decode(parts.shift());
70+
var cookie = parts.join('=');
71+
72+
if (key && key === name) {
73+
result = decodeAndParse(cookie);
74+
break;
75+
}
76+
77+
if (!key) {
78+
result[name] = decodeAndParse(cookie);
79+
}
80+
}
81+
82+
return result;
83+
};
84+
85+
config.defaults = {};
86+
87+
$.removeCookie = function (key, options) {
88+
if ($.cookie(key) !== undefined) {
89+
// Must not alter options, thus extending a fresh object...
90+
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
91+
return true;
92+
}
93+
return false;
94+
};
95+
96+
}));

0 commit comments

Comments
 (0)