Skip to content

Commit

Permalink
merging pull 93
Browse files Browse the repository at this point in the history
  • Loading branch information
taitems committed Nov 2, 2013
1 parent 8840f2a commit 7fedcc1
Show file tree
Hide file tree
Showing 6 changed files with 231 additions and 136 deletions.
5 changes: 3 additions & 2 deletions CONTRIBUTORS.md
@@ -1,7 +1,7 @@
Welcome Contributor
=

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.
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.


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

And thanks once again!
And thanks once again!
4 changes: 3 additions & 1 deletion css/style.css
Expand Up @@ -105,6 +105,7 @@
background-image: url(../img/grid.png);
background-repeat: repeat;
background-position: 24px 24px;
position: relative;
}
.fn-gantt .day, .fn-gantt .date {
overflow: visible;
Expand Down Expand Up @@ -181,7 +182,7 @@
.fn-gantt .bar {
background-color: #D0E4FD;
height: 18px;
margin: 4px 3px 3px 3px;
margin: 0px 3px 3px 0px;
position: absolute;
z-index: 10;
text-align: center;
Expand Down Expand Up @@ -402,6 +403,7 @@
top: 0;
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#bf000000', endColorstr='#bf000000',GradientType=0 );
background: rgba(0,0,0,0.75);
cursor: wait;
z-index: 30;
}
.fn-gantt-loader-spinner span {
Expand Down
53 changes: 30 additions & 23 deletions index.html
@@ -1,12 +1,12 @@
<!doctype html>
<html lang="en-au">
<!DOCTYPE html>
<html lang="en">
<head>
<title>jQuery.Gantt</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge;chrome=1" >
<link rel="stylesheet" href="css/style.css" />
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
<link rel="stylesheet" href="http://taitems.github.com/UX-Lab/core/css/prettify.css" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge;chrome=1">
<link href="css/style.css" type="text/css" rel="stylesheet">
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="http://taitems.github.com/UX-Lab/core/css/prettify.css" rel="stylesheet" type="text/css">
<style type="text/css">
body {
font-family: Helvetica, Arial, sans-serif;
Expand All @@ -30,6 +30,14 @@
table th:first-child {
width: 150px;
}
/* Bootstrap 3.0 re-reset */
.fn-gantt *,
.fn-gantt *:after,
.fn-gantt *:before {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
</style>
</head>
<body>
Expand Down Expand Up @@ -108,7 +116,7 @@ <h2>
<code>source</code>
</td>
<td>
null
[]
</td>
<td>
Array, String (url)
Expand Down Expand Up @@ -204,7 +212,7 @@ <h2>
</tr>
<tr>
<td>
<code>onItemClick: </code>
<code>onItemClick</code>
</td>
<td>
<code>function (data) { return; }</code></td>
Expand Down Expand Up @@ -427,13 +435,11 @@ <h2>

</div>

</body>
<script src="js/jquery.min.js"></script>
<script src="js/jquery.fn.gantt.js"></script>
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="http://taitems.github.com/UX-Lab/core/js/prettify.js"></script>
<script>

<script>
$(function() {

"use strict";
Expand All @@ -445,7 +451,7 @@ <h2>
values: [{
from: "/Date(1320192000000)/",
to: "/Date(1322401600000)/",
label: "Requirement Gathering",
label: "Requirement Gathering",
customClass: "ganttRed"
}]
},{
Expand All @@ -454,7 +460,7 @@ <h2>
values: [{
from: "/Date(1322611200000)/",
to: "/Date(1323302400000)/",
label: "Scoping",
label: "Scoping",
customClass: "ganttRed"
}]
},{
Expand All @@ -463,7 +469,7 @@ <h2>
values: [{
from: "/Date(1323802400000)/",
to: "/Date(1325685200000)/",
label: "Development",
label: "Development",
customClass: "ganttGreen"
}]
},{
Expand All @@ -472,7 +478,7 @@ <h2>
values: [{
from: "/Date(1325685200000)/",
to: "/Date(1325695200000)/",
label: "Showcasing",
label: "Showcasing",
customClass: "ganttBlue"
}]
},{
Expand All @@ -481,7 +487,7 @@ <h2>
values: [{
from: "/Date(1326785200000)/",
to: "/Date(1325785200000)/",
label: "Development",
label: "Development",
customClass: "ganttGreen"
}]
},{
Expand All @@ -490,7 +496,7 @@ <h2>
values: [{
from: "/Date(1328785200000)/",
to: "/Date(1328905200000)/",
label: "Showcasing",
label: "Showcasing",
customClass: "ganttBlue"
}]
},{
Expand All @@ -499,7 +505,7 @@ <h2>
values: [{
from: "/Date(1330011200000)/",
to: "/Date(1336611200000)/",
label: "Training",
label: "Training",
customClass: "ganttOrange"
}]
},{
Expand All @@ -508,7 +514,7 @@ <h2>
values: [{
from: "/Date(1336611200000)/",
to: "/Date(1338711200000)/",
label: "Deployment",
label: "Deployment",
customClass: "ganttOrange"
}]
},{
Expand All @@ -517,7 +523,7 @@ <h2>
values: [{
from: "/Date(1336611200000)/",
to: "/Date(1349711200000)/",
label: "Warranty Period",
label: "Warranty Period",
customClass: "ganttOrange"
}]
}],
Expand Down Expand Up @@ -547,6 +553,7 @@ <h2>
prettyPrint();

});
</script>

</script>
</html>
</body>
</html>
143 changes: 96 additions & 47 deletions js/jquery.cookie.js
@@ -1,47 +1,96 @@
/*!
* jQuery Cookie Plugin
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2011, Klaus Hartl
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://www.opensource.org/licenses/mit-license.php
* http://www.opensource.org/licenses/GPL-2.0
*/
(function ($) {
$.cookie = function (key, value, options) {

// key and at least value given, set cookie...
if (arguments.length > 1 && (!/Object/.test(Object.prototype.toString.call(value)) || value === null || value === undefined)) {
options = $.extend({}, options);

if (value === null || value === undefined) {
options.expires = -1;
}

if (typeof options.expires === 'number') {
var days = options.expires, t = options.expires = new Date();
t.setDate(t.getDate() + days);
}

value = String(value);

return (document.cookie = [
encodeURIComponent(key), '=', options.raw ? value : encodeURIComponent(value),
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
options.path ? '; path=' + options.path : '',
options.domain ? '; domain=' + options.domain : '',
options.secure ? '; secure' : ''
].join(''));
}

// key and possibly options given, get cookie...
options = value || {};
var decode = options.raw ? function (s) { return s; } : decodeURIComponent;

var pairs = document.cookie.split('; ');
for (var i = 0, pair; pair = pairs[i] && pairs[i].split('='); i++) {
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
}
return null;
};
})(jQuery);
/*!
* jQuery Cookie Plugin v1.3.1
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2013 Klaus Hartl
* Released under the MIT license
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as anonymous module.
define(['jquery'], factory);
} else {
// Browser globals.
factory(jQuery);
}
}(function ($) {

var pluses = /\+/g;

function decode(s) {
if (config.raw) {
return s;
}
return decodeURIComponent(s.replace(pluses, ' '));
}

function decodeAndParse(s) {
if (s.indexOf('"') === 0) {
// This is a quoted cookie as according to RFC2068, unescape...
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
}

s = decode(s);

try {
return config.json ? JSON.parse(s) : s;
} catch(e) {}
}

var config = $.cookie = function (key, value, options) {

// Write
if (value !== undefined) {
options = $.extend({}, config.defaults, options);

if (typeof options.expires === 'number') {
var days = options.expires, t = options.expires = new Date();
t.setDate(t.getDate() + days);
}

value = config.json ? JSON.stringify(value) : String(value);

return (document.cookie = [
config.raw ? key : encodeURIComponent(key),
'=',
config.raw ? value : encodeURIComponent(value),
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
options.path ? '; path=' + options.path : '',
options.domain ? '; domain=' + options.domain : '',
options.secure ? '; secure' : ''
].join(''));
}

// Read
var cookies = document.cookie.split('; ');
var result = key ? undefined : {};
for (var i = 0, l = cookies.length; i < l; i++) {
var parts = cookies[i].split('=');
var name = decode(parts.shift());
var cookie = parts.join('=');

if (key && key === name) {
result = decodeAndParse(cookie);
break;
}

if (!key) {
result[name] = decodeAndParse(cookie);
}
}

return result;
};

config.defaults = {};

$.removeCookie = function (key, options) {
if ($.cookie(key) !== undefined) {
// Must not alter options, thus extending a fresh object...
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
return true;
}
return false;
};

}));

0 comments on commit 7fedcc1

Please sign in to comment.