Skip to content

Commit 2741e92

Browse files
committed
Separate code from 3rd party libs
Levareage custom calendar functionality: NUKnightLab/TimelineJS#804
1 parent 9923e82 commit 2741e92

103 files changed

Lines changed: 545 additions & 351 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
/* * Default Gregorian Calendar Formatter
2+
================================================== */
3+
if(typeof VMM != 'undefined') {
4+
5+
/*
6+
* Date Format 1.2.3
7+
* (c) 2007-2009 Steven Levithan <stevenlevithan.com>
8+
* MIT license
9+
*
10+
* Includes enhancements by Scott Trenda <scott.trenda.net>
11+
* and Kris Kowal <cixar.com/~kris.kowal/>
12+
*
13+
* Accepts a date, a mask, or a date and a mask.
14+
* Returns a formatted version of the given date.
15+
* The date defaults to the current date/time.
16+
* The mask defaults to dateFormat.masks.default.
17+
*/
18+
19+
var dateFormat = function () {
20+
var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[WLloSZ]|"[^"]*"|'[^']*'/g,
21+
timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
22+
timezoneClip = /[^-+\dA-Z]/g,
23+
pad = function (val, len) {
24+
val = String(val);
25+
len = len || 2;
26+
while (val.length < len) val = "0" + val;
27+
return val;
28+
};
29+
30+
// Regexes and supporting functions are cached through closure
31+
return function (date, mask, utc) {
32+
var dF = dateFormat;
33+
34+
// You can't provide utc if you skip other args (use the "UTC:" mask prefix)
35+
if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) {
36+
mask = date;
37+
date = undefined;
38+
}
39+
40+
// Passing date through Date applies Date.parse, if necessary
41+
// Caused problems in IE
42+
// date = date ? new Date(date) : new Date;
43+
if (isNaN(date)) {
44+
trace("invalid date " + date);
45+
//return "";
46+
}
47+
48+
mask = String(dF.masks[mask] || mask || dF.masks["default"]);
49+
50+
// Allow setting the utc argument via the mask
51+
if (mask.slice(0, 4) == "UTC:") {
52+
mask = mask.slice(4);
53+
utc = true;
54+
}
55+
56+
var _ = utc ? "getUTC" : "get",
57+
d = date[_ + "Date"](),
58+
D = date[_ + "Day"](),
59+
m = date[_ + "Month"](),
60+
y = date[_ + "FullYear"](),
61+
H = date[_ + "Hours"](),
62+
M = date[_ + "Minutes"](),
63+
s = date[_ + "Seconds"](),
64+
L = date[_ + "Milliseconds"](),
65+
W = date.getWeek(),
66+
o = utc ? 0 : date.getTimezoneOffset(),
67+
flags = {
68+
d: d,
69+
dd: pad(d),
70+
ddd: dF.i18n.dayNames[D],
71+
dddd: dF.i18n.dayNames[D + 7],
72+
m: m + 1,
73+
mm: pad(m + 1),
74+
mmm: dF.i18n.monthNames[m],
75+
mmmm: dF.i18n.monthNames[m + 12],
76+
yy: String(y).slice(2),
77+
yyyy: y,
78+
h: H % 12 || 12,
79+
hh: pad(H % 12 || 12),
80+
H: H,
81+
HH: pad(H),
82+
M: M,
83+
MM: pad(M),
84+
s: s,
85+
ss: pad(s),
86+
l: pad(L, 3),
87+
L: pad(L > 99 ? Math.round(L / 10) : L),
88+
t: H < 12 ? "a" : "p",
89+
tt: H < 12 ? "am" : "pm",
90+
T: H < 12 ? "A" : "P",
91+
TT: H < 12 ? "AM" : "PM",
92+
Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
93+
o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
94+
S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10],
95+
W: W
96+
};
97+
98+
return mask.replace(token, function ($0) {
99+
return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1);
100+
});
101+
};
102+
}();
103+
104+
// Some common format strings
105+
dateFormat.masks = {
106+
"default": "ddd mmm dd yyyy HH:MM:ss",
107+
shortDate: "m/d/yy",
108+
mediumDate: "mmm d, yyyy",
109+
longDate: "mmmm d, yyyy",
110+
fullDate: "dddd, mmmm d, yyyy",
111+
shortTime: "h:MM TT",
112+
mediumTime: "h:MM:ss TT",
113+
longTime: "h:MM:ss TT Z",
114+
isoDate: "yyyy-mm-dd",
115+
isoTime: "HH:MM:ss",
116+
isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
117+
isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
118+
};
119+
120+
// Internationalization strings
121+
dateFormat.i18n = {
122+
dayNames: [
123+
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
124+
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
125+
],
126+
monthNames: [
127+
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
128+
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
129+
]
130+
};
131+
132+
// For convenience...
133+
Date.prototype.format = function (mask, utc) {
134+
return dateFormat(this, mask, utc);
135+
};
136+
137+
// ************************************************************************************************
138+
139+
VMM.Calendar = ({
140+
141+
init: function() {
142+
return this;
143+
},
144+
145+
format: dateFormat,
146+
147+
getFullYear: function(date) {
148+
if ( date.getFullYear() < 0 ) {
149+
return Math.abs( date.getFullYear() ).toString() + " B.C.";
150+
} else {
151+
return date.getFullYear();
152+
}
153+
}
154+
155+
}).init();
156+
157+
}
File renamed without changes.

src/main/php/LoreKeeper/libs/timeline/css/fancybox_sprite.png renamed to build/LoreKeeper/libs/timeline/css/fancybox_sprite.png

File renamed without changes.

src/main/php/LoreKeeper/libs/timeline/css/fancybox_sprite@2x.png renamed to build/LoreKeeper/libs/timeline/css/fancybox_sprite@2x.png

File renamed without changes.
File renamed without changes.
File renamed without changes.

src/main/php/LoreKeeper/libs/timeline/css/themes/dark.css renamed to build/LoreKeeper/libs/timeline/css/themes/dark.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/php/LoreKeeper/libs/timeline/css/themes/font/AbrilFatface-Average.css renamed to build/LoreKeeper/libs/timeline/css/themes/font/AbrilFatface-Average.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/php/LoreKeeper/libs/timeline/css/themes/font/Arvo-PTSans.css renamed to build/LoreKeeper/libs/timeline/css/themes/font/Arvo-PTSans.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/php/LoreKeeper/libs/timeline/css/themes/font/Bevan-PotanoSans.css renamed to build/LoreKeeper/libs/timeline/css/themes/font/Bevan-PotanoSans.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)