From a4282f554c3c8af9a27776a4a4477a4523acc0d5 Mon Sep 17 00:00:00 2001 From: "jerome@adatao.com" Date: Thu, 28 May 2015 17:31:48 -0700 Subject: [PATCH 01/98] uploads for the front page --- Pikaday/css/pikaday.css | 203 +++++++ Pikaday/css/site.css | 42 ++ Pikaday/pikaday.js | 1029 ++++++++++++++++++++++++++++++++++ index.html | 73 +++ params.json | 1 + stylesheets/github-light.css | 115 ++++ stylesheets/normalize.css | 424 ++++++++++++++ stylesheets/stylesheet.css | 245 ++++++++ stylesheets/table.css | 18 + tableload.js | 183 ++++++ 10 files changed, 2333 insertions(+) create mode 100755 Pikaday/css/pikaday.css create mode 100755 Pikaday/css/site.css create mode 100755 Pikaday/pikaday.js create mode 100755 index.html create mode 100755 params.json create mode 100755 stylesheets/github-light.css create mode 100755 stylesheets/normalize.css create mode 100755 stylesheets/stylesheet.css create mode 100755 stylesheets/table.css create mode 100755 tableload.js diff --git a/Pikaday/css/pikaday.css b/Pikaday/css/pikaday.css new file mode 100755 index 00000000..eccc3442 --- /dev/null +++ b/Pikaday/css/pikaday.css @@ -0,0 +1,203 @@ +@charset "UTF-8"; + +/*! + * Pikaday + * Copyright © 2014 David Bushell | BSD & MIT license | http://dbushell.com/ + */ + +.pika-single { + z-index: 9999; + display: block; + position: relative; + color: #333; + background: #fff; + border: 1px solid #ccc; + border-bottom-color: #bbb; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +} + +/* +clear child float (pika-lendar), using the famous micro clearfix hack +http://nicolasgallagher.com/micro-clearfix-hack/ +*/ +.pika-single:before, +.pika-single:after { + content: " "; + display: table; +} +.pika-single:after { clear: both } +.pika-single { *zoom: 1 } + +.pika-single.is-hidden { + display: none; +} + +.pika-single.is-bound { + position: absolute; + box-shadow: 0 5px 15px -5px rgba(0,0,0,.5); +} + +.pika-lendar { + float: left; + width: 240px; + margin: 8px; +} + +.pika-title { + position: relative; + text-align: center; +} + +.pika-label { + display: inline-block; + *display: inline; + position: relative; + z-index: 9999; + overflow: hidden; + margin: 0; + padding: 5px 3px; + font-size: 14px; + line-height: 20px; + font-weight: bold; + background-color: #fff; +} +.pika-title select { + cursor: pointer; + position: absolute; + z-index: 9998; + margin: 0; + left: 0; + top: 5px; + filter: alpha(opacity=0); + opacity: 0; +} + +.pika-prev, +.pika-next { + display: block; + cursor: pointer; + position: relative; + outline: none; + border: 0; + padding: 0; + width: 20px; + height: 30px; + /* hide text using text-indent trick, using width value (it's enough) */ + text-indent: 20px; + white-space: nowrap; + overflow: hidden; + background-color: transparent; + background-position: center center; + background-repeat: no-repeat; + background-size: 75% 75%; + opacity: .5; + *position: absolute; + *top: 0; +} + +.pika-prev:hover, +.pika-next:hover { + opacity: 1; +} + +.pika-prev, +.is-rtl .pika-next { + float: left; + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAUklEQVR42u3VMQoAIBADQf8Pgj+OD9hG2CtONJB2ymQkKe0HbwAP0xucDiQWARITIDEBEnMgMQ8S8+AqBIl6kKgHiXqQqAeJepBo/z38J/U0uAHlaBkBl9I4GwAAAABJRU5ErkJggg=='); + *left: 0; +} + +.pika-next, +.is-rtl .pika-prev { + float: right; + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAU0lEQVR42u3VOwoAMAgE0dwfAnNjU26bYkBCFGwfiL9VVWoO+BJ4Gf3gtsEKKoFBNTCoCAYVwaAiGNQGMUHMkjGbgjk2mIONuXo0nC8XnCf1JXgArVIZAQh5TKYAAAAASUVORK5CYII='); + *right: 0; +} + +.pika-prev.is-disabled, +.pika-next.is-disabled { + cursor: default; + opacity: .2; +} + +.pika-select { + display: inline-block; + *display: inline; +} + +.pika-table { + width: 100%; + border-collapse: collapse; + border-spacing: 0; + border: 0; +} + +.pika-table th, +.pika-table td { + width: 14.285714285714286%; + padding: 0; +} + +.pika-table th { + color: #999; + font-size: 12px; + line-height: 25px; + font-weight: bold; + text-align: center; +} + +.pika-button { + cursor: pointer; + display: block; + box-sizing: border-box; + -moz-box-sizing: border-box; + outline: none; + border: 0; + margin: 0; + width: 100%; + padding: 5px; + color: #666; + font-size: 12px; + line-height: 15px; + text-align: right; + background: #f5f5f5; +} + +.pika-week { + font-size: 11px; + color: #999; +} + +.is-today .pika-button { + color: #33aaff; + font-weight: bold; +} + +.is-selected .pika-button { + color: #fff; + font-weight: bold; + background: #33aaff; + box-shadow: inset 0 1px 3px #178fe5; + border-radius: 3px; +} + +.is-disabled .pika-button { + pointer-events: none; + cursor: default; + color: #999; + opacity: .3; +} + +.pika-button:hover { + color: #fff !important; + background: #ff8000 !important; + box-shadow: none !important; + border-radius: 3px !important; +} + +/* styling for abbr */ +.pika-table abbr { + border-bottom: none; + cursor: help; +} + diff --git a/Pikaday/css/site.css b/Pikaday/css/site.css new file mode 100755 index 00000000..a5111a28 --- /dev/null +++ b/Pikaday/css/site.css @@ -0,0 +1,42 @@ +html { margin: 0; padding: 0; } +body { font-size: 100%; margin: 0; padding: 1.75em; font-family: 'Helvetica Neue', Arial, sans-serif; } + +h1 { font-size: 1.75em; margin: 0 0 0.6em 0; } +h2 { font-size: 1.25em; margin: 0 0 0.6em 0; } + +a { color: #2996cc; } +a:hover { text-decoration: none; } + +p { line-height: 1.5em; } +.small { color: #666; font-size: 0.875em; } +.large { font-size: 1.25em; } + + +label { + font-weight: bold; +} + +input[type="text"] { + margin: 0.5em 0 3em 0; + padding: 0.5em; +} + +button#datepicker-button { + margin-bottom: 3em; +} + +.flow-element { + display: inline-block; + margin-right: 3em; + vertical-align: top; +} +.flow-element:last-child { + margin-right: 0; +} +.flow-element input { + margin-top: 0; +} + +#container { + min-height: 15em; +} \ No newline at end of file diff --git a/Pikaday/pikaday.js b/Pikaday/pikaday.js new file mode 100755 index 00000000..fd468ddb --- /dev/null +++ b/Pikaday/pikaday.js @@ -0,0 +1,1029 @@ +/*! + * Pikaday + * + * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday + */ + +(function (root, factory) +{ + 'use strict'; + + var moment; + if (typeof exports === 'object') { + // CommonJS module + // Load moment.js as an optional dependency + try { moment = require('moment'); } catch (e) {} + module.exports = factory(moment); + } else if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(function (req) + { + // Load moment.js as an optional dependency + var id = 'moment'; + try { moment = req(id); } catch (e) {} + return factory(moment); + }); + } else { + root.Pikaday = factory(root.moment); + } +}(this, function (moment) +{ + 'use strict'; + + /** + * feature detection and helper functions + */ + var hasMoment = typeof moment === 'function', + + hasEventListeners = !!window.addEventListener, + + document = window.document, + + sto = window.setTimeout, + + addEvent = function(el, e, callback, capture) + { + if (hasEventListeners) { + el.addEventListener(e, callback, !!capture); + } else { + el.attachEvent('on' + e, callback); + } + }, + + removeEvent = function(el, e, callback, capture) + { + if (hasEventListeners) { + el.removeEventListener(e, callback, !!capture); + } else { + el.detachEvent('on' + e, callback); + } + }, + + fireEvent = function(el, eventName, data) + { + var ev; + + if (document.createEvent) { + ev = document.createEvent('HTMLEvents'); + ev.initEvent(eventName, true, false); + ev = extend(ev, data); + el.dispatchEvent(ev); + } else if (document.createEventObject) { + ev = document.createEventObject(); + ev = extend(ev, data); + el.fireEvent('on' + eventName, ev); + } + }, + + trim = function(str) + { + return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g,''); + }, + + hasClass = function(el, cn) + { + return (' ' + el.className + ' ').indexOf(' ' + cn + ' ') !== -1; + }, + + addClass = function(el, cn) + { + if (!hasClass(el, cn)) { + el.className = (el.className === '') ? cn : el.className + ' ' + cn; + } + }, + + removeClass = function(el, cn) + { + el.className = trim((' ' + el.className + ' ').replace(' ' + cn + ' ', ' ')); + }, + + isArray = function(obj) + { + return (/Array/).test(Object.prototype.toString.call(obj)); + }, + + isDate = function(obj) + { + return (/Date/).test(Object.prototype.toString.call(obj)) && !isNaN(obj.getTime()); + }, + + isWeekend = function(date) + { + var day = date.getDay(); + return day === 0 || day === 6; + }, + + isLeapYear = function(year) + { + // solution by Matti Virkkunen: http://stackoverflow.com/a/4881951 + return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0; + }, + + getDaysInMonth = function(year, month) + { + return [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]; + }, + + setToStartOfDay = function(date) + { + if (isDate(date)) date.setHours(0,0,0,0); + }, + + compareDates = function(a,b) + { + // weak date comparison (use setToStartOfDay(date) to ensure correct result) + return a.getTime() === b.getTime(); + }, + + extend = function(to, from, overwrite) + { + var prop, hasProp; + for (prop in from) { + hasProp = to[prop] !== undefined; + if (hasProp && typeof from[prop] === 'object' && from[prop] !== null && from[prop].nodeName === undefined) { + if (isDate(from[prop])) { + if (overwrite) { + to[prop] = new Date(from[prop].getTime()); + } + } + else if (isArray(from[prop])) { + if (overwrite) { + to[prop] = from[prop].slice(0); + } + } else { + to[prop] = extend({}, from[prop], overwrite); + } + } else if (overwrite || !hasProp) { + to[prop] = from[prop]; + } + } + return to; + }, + + adjustCalendar = function(calendar) { + if (calendar.month < 0) { + calendar.year -= Math.ceil(Math.abs(calendar.month)/12); + calendar.month += 12; + } + if (calendar.month > 11) { + calendar.year += Math.floor(Math.abs(calendar.month)/12); + calendar.month -= 12; + } + return calendar; + }, + + /** + * defaults and localisation + */ + defaults = { + + // bind the picker to a form field + field: null, + + // automatically show/hide the picker on `field` focus (default `true` if `field` is set) + bound: undefined, + + // position of the datepicker, relative to the field (default to bottom & left) + // ('bottom' & 'left' keywords are not used, 'top' & 'right' are modifier on the bottom/left position) + position: 'bottom left', + + // automatically fit in the viewport even if it means repositioning from the position option + reposition: true, + + // the default output format for `.toString()` and `field` value + format: 'YYYY-MM-DD', + + // the initial date to view when first opened + defaultDate: null, + + // make the `defaultDate` the initial selected value + setDefaultDate: false, + + // first day of week (0: Sunday, 1: Monday etc) + firstDay: 0, + + // the minimum/earliest date that can be selected + minDate: null, + // the maximum/latest date that can be selected + maxDate: null, + + // number of years either side, or array of upper/lower range + yearRange: 10, + + // show week numbers at head of row + showWeekNumber: false, + + // used internally (don't config outside) + minYear: 0, + maxYear: 9999, + minMonth: undefined, + maxMonth: undefined, + + isRTL: false, + + // Additional text to append to the year in the calendar title + yearSuffix: '', + + // Render the month after year in the calendar title + showMonthAfterYear: false, + + // how many months are visible + numberOfMonths: 1, + + // when numberOfMonths is used, this will help you to choose where the main calendar will be (default `left`, can be set to `right`) + // only used for the first display or when a selected date is not visible + mainCalendar: 'left', + + // Specify a DOM element to render the calendar in + container: undefined, + + // internationalization + i18n: { + previousMonth : 'Previous Month', + nextMonth : 'Next Month', + months : ['January','February','March','April','May','June','July','August','September','October','November','December'], + weekdays : ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'], + weekdaysShort : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'] + }, + + // callback function + onSelect: null, + onOpen: null, + onClose: null, + onDraw: null + }, + + + /** + * templating functions to abstract HTML rendering + */ + renderDayName = function(opts, day, abbr) + { + day += opts.firstDay; + while (day >= 7) { + day -= 7; + } + return abbr ? opts.i18n.weekdaysShort[day] : opts.i18n.weekdays[day]; + }, + + renderDay = function(d, m, y, isSelected, isToday, isDisabled, isEmpty) + { + if (isEmpty) { + return ''; + } + var arr = []; + if (isDisabled) { + arr.push('is-disabled'); + } + if (isToday) { + arr.push('is-today'); + } + if (isSelected) { + arr.push('is-selected'); + } + return '' + + '' + + ''; + }, + + renderWeek = function (d, m, y) { + // Lifted from http://javascript.about.com/library/blweekyear.htm, lightly modified. + var onejan = new Date(y, 0, 1), + weekNum = Math.ceil((((new Date(y, m, d) - onejan) / 86400000) + onejan.getDay()+1)/7); + return '' + weekNum + ''; + }, + + renderRow = function(days, isRTL) + { + return '' + (isRTL ? days.reverse() : days).join('') + ''; + }, + + renderBody = function(rows) + { + return '' + rows.join('') + ''; + }, + + renderHead = function(opts) + { + var i, arr = []; + if (opts.showWeekNumber) { + arr.push(''); + } + for (i = 0; i < 7; i++) { + arr.push('' + renderDayName(opts, i, true) + ''); + } + return '' + (opts.isRTL ? arr.reverse() : arr).join('') + ''; + }, + + renderTitle = function(instance, c, year, month, refYear) + { + var i, j, arr, + opts = instance._o, + isMinYear = year === opts.minYear, + isMaxYear = year === opts.maxYear, + html = '
', + monthHtml, + yearHtml, + prev = true, + next = true; + + for (arr = [], i = 0; i < 12; i++) { + arr.push(''); + } + monthHtml = '
' + opts.i18n.months[month] + '
'; + + if (isArray(opts.yearRange)) { + i = opts.yearRange[0]; + j = opts.yearRange[1] + 1; + } else { + i = year - opts.yearRange; + j = 1 + year + opts.yearRange; + } + + for (arr = []; i < j && i <= opts.maxYear; i++) { + if (i >= opts.minYear) { + arr.push(''); + } + } + yearHtml = '
' + year + opts.yearSuffix + '
'; + + if (opts.showMonthAfterYear) { + html += yearHtml + monthHtml; + } else { + html += monthHtml + yearHtml; + } + + if (isMinYear && (month === 0 || opts.minMonth >= month)) { + prev = false; + } + + if (isMaxYear && (month === 11 || opts.maxMonth <= month)) { + next = false; + } + + if (c === 0) { + html += ''; + } + if (c === (instance._o.numberOfMonths - 1) ) { + html += ''; + } + + return html += '
'; + }, + + renderTable = function(opts, data) + { + return '' + renderHead(opts) + renderBody(data) + '
'; + }, + + + /** + * Pikaday constructor + */ + Pikaday = function(options) + { + var self = this, + opts = self.config(options); + + self._onMouseDown = function(e) + { + if (!self._v) { + return; + } + e = e || window.event; + var target = e.target || e.srcElement; + if (!target) { + return; + } + + if (!hasClass(target, 'is-disabled')) { + if (hasClass(target, 'pika-button') && !hasClass(target, 'is-empty')) { + self.setDate(new Date(target.getAttribute('data-pika-year'), target.getAttribute('data-pika-month'), target.getAttribute('data-pika-day'))); + if (opts.bound) { + sto(function() { + self.hide(); + if (opts.field) { + opts.field.blur(); + } + }, 100); + } + return; + } + else if (hasClass(target, 'pika-prev')) { + self.prevMonth(); + } + else if (hasClass(target, 'pika-next')) { + self.nextMonth(); + } + } + if (!hasClass(target, 'pika-select')) { + if (e.preventDefault) { + e.preventDefault(); + } else { + e.returnValue = false; + return false; + } + } else { + self._c = true; + } + }; + + self._onChange = function(e) + { + e = e || window.event; + var target = e.target || e.srcElement; + if (!target) { + return; + } + if (hasClass(target, 'pika-select-month')) { + self.gotoMonth(target.value); + } + else if (hasClass(target, 'pika-select-year')) { + self.gotoYear(target.value); + } + }; + + self._onInputChange = function(e) + { + var date; + + if (e.firedBy === self) { + return; + } + if (hasMoment) { + date = moment(opts.field.value, opts.format); + date = (date && date.isValid()) ? date.toDate() : null; + } + else { + date = new Date(Date.parse(opts.field.value)); + } + self.setDate(isDate(date) ? date : null); + if (!self._v) { + self.show(); + } + }; + + self._onInputFocus = function() + { + self.show(); + }; + + self._onInputClick = function() + { + self.show(); + }; + + self._onInputBlur = function() + { + // IE allows pika div to gain focus; catch blur the input field + var pEl = document.activeElement; + do { + if (hasClass(pEl, 'pika-single')) { + return; + } + } + while ((pEl = pEl.parentNode)); + + if (!self._c) { + self._b = sto(function() { + self.hide(); + }, 50); + } + self._c = false; + }; + + self._onClick = function(e) + { + e = e || window.event; + var target = e.target || e.srcElement, + pEl = target; + if (!target) { + return; + } + if (!hasEventListeners && hasClass(target, 'pika-select')) { + if (!target.onchange) { + target.setAttribute('onchange', 'return;'); + addEvent(target, 'change', self._onChange); + } + } + do { + if (hasClass(pEl, 'pika-single') || pEl === opts.trigger) { + return; + } + } + while ((pEl = pEl.parentNode)); + if (self._v && target !== opts.trigger && pEl !== opts.trigger) { + self.hide(); + } + }; + + self.el = document.createElement('div'); + self.el.className = 'pika-single' + (opts.isRTL ? ' is-rtl' : ''); + + addEvent(self.el, 'mousedown', self._onMouseDown, true); + addEvent(self.el, 'change', self._onChange); + + if (opts.field) { + if (opts.container) { + opts.container.appendChild(self.el); + } else if (opts.bound) { + document.body.appendChild(self.el); + } else { + opts.field.parentNode.insertBefore(self.el, opts.field.nextSibling); + } + addEvent(opts.field, 'change', self._onInputChange); + + if (!opts.defaultDate) { + if (hasMoment && opts.field.value) { + opts.defaultDate = moment(opts.field.value, opts.format).toDate(); + } else { + opts.defaultDate = new Date(Date.parse(opts.field.value)); + } + opts.setDefaultDate = true; + } + } + + var defDate = opts.defaultDate; + + if (isDate(defDate)) { + if (opts.setDefaultDate) { + self.setDate(defDate, true); + } else { + self.gotoDate(defDate); + } + } else { + self.gotoDate(new Date()); + } + + if (opts.bound) { + this.hide(); + self.el.className += ' is-bound'; + addEvent(opts.trigger, 'click', self._onInputClick); + addEvent(opts.trigger, 'focus', self._onInputFocus); + addEvent(opts.trigger, 'blur', self._onInputBlur); + } else { + this.show(); + } + }; + + + /** + * public Pikaday API + */ + Pikaday.prototype = { + + + /** + * configure functionality + */ + config: function(options) + { + if (!this._o) { + this._o = extend({}, defaults, true); + } + + var opts = extend(this._o, options, true); + + opts.isRTL = !!opts.isRTL; + + opts.field = (opts.field && opts.field.nodeName) ? opts.field : null; + + opts.bound = !!(opts.bound !== undefined ? opts.field && opts.bound : opts.field); + + opts.trigger = (opts.trigger && opts.trigger.nodeName) ? opts.trigger : opts.field; + + opts.disableWeekends = !!opts.disableWeekends; + + opts.disableDayFn = (typeof opts.disableDayFn) == "function" ? opts.disableDayFn : null; + + var nom = parseInt(opts.numberOfMonths, 10) || 1; + opts.numberOfMonths = nom > 4 ? 4 : nom; + + if (!isDate(opts.minDate)) { + opts.minDate = false; + } + if (!isDate(opts.maxDate)) { + opts.maxDate = false; + } + if ((opts.minDate && opts.maxDate) && opts.maxDate < opts.minDate) { + opts.maxDate = opts.minDate = false; + } + if (opts.minDate) { + setToStartOfDay(opts.minDate); + opts.minYear = opts.minDate.getFullYear(); + opts.minMonth = opts.minDate.getMonth(); + } + if (opts.maxDate) { + setToStartOfDay(opts.maxDate); + opts.maxYear = opts.maxDate.getFullYear(); + opts.maxMonth = opts.maxDate.getMonth(); + } + + if (isArray(opts.yearRange)) { + var fallback = new Date().getFullYear() - 10; + opts.yearRange[0] = parseInt(opts.yearRange[0], 10) || fallback; + opts.yearRange[1] = parseInt(opts.yearRange[1], 10) || fallback; + } else { + opts.yearRange = Math.abs(parseInt(opts.yearRange, 10)) || defaults.yearRange; + if (opts.yearRange > 100) { + opts.yearRange = 100; + } + } + + return opts; + }, + + /** + * return a formatted string of the current selection (using Moment.js if available) + */ + toString: function(format) + { + return !isDate(this._d) ? '' : hasMoment ? moment(this._d).format(format || this._o.format) : this._d.toDateString(); + }, + + /** + * return a Moment.js object of the current selection (if available) + */ + getMoment: function() + { + return hasMoment ? moment(this._d) : null; + }, + + /** + * set the current selection from a Moment.js object (if available) + */ + setMoment: function(date, preventOnSelect) + { + if (hasMoment && moment.isMoment(date)) { + this.setDate(date.toDate(), preventOnSelect); + } + }, + + /** + * return a Date object of the current selection + */ + getDate: function() + { + return isDate(this._d) ? new Date(this._d.getTime()) : null; + }, + + /** + * set the current selection + */ + setDate: function(date, preventOnSelect) + { + if (!date) { + this._d = null; + + if (this._o.field) { + this._o.field.value = ''; + fireEvent(this._o.field, 'change', { firedBy: this }); + } + + return this.draw(); + } + if (typeof date === 'string') { + date = new Date(Date.parse(date)); + } + if (!isDate(date)) { + return; + } + + var min = this._o.minDate, + max = this._o.maxDate; + + if (isDate(min) && date < min) { + date = min; + } else if (isDate(max) && date > max) { + date = max; + } + + this._d = new Date(date.getTime()); + setToStartOfDay(this._d); + this.gotoDate(this._d); + + if (this._o.field) { + this._o.field.value = this.toString(); + fireEvent(this._o.field, 'change', { firedBy: this }); + } + if (!preventOnSelect && typeof this._o.onSelect === 'function') { + this._o.onSelect.call(this, this.getDate()); + } + }, + + /** + * change view to a specific date + */ + gotoDate: function(date) + { + var newCalendar = true; + + if (!isDate(date)) { + return; + } + + if (this.calendars) { + var firstVisibleDate = new Date(this.calendars[0].year, this.calendars[0].month, 1), + lastVisibleDate = new Date(this.calendars[this.calendars.length-1].year, this.calendars[this.calendars.length-1].month, 1), + visibleDate = date.getTime(); + // get the end of the month + lastVisibleDate.setMonth(lastVisibleDate.getMonth()+1); + lastVisibleDate.setDate(lastVisibleDate.getDate()-1); + newCalendar = (visibleDate < firstVisibleDate.getTime() || lastVisibleDate.getTime() < visibleDate); + } + + if (newCalendar) { + this.calendars = [{ + month: date.getMonth(), + year: date.getFullYear() + }]; + if (this._o.mainCalendar === 'right') { + this.calendars[0].month += 1 - this._o.numberOfMonths; + } + } + + this.adjustCalendars(); + }, + + adjustCalendars: function() { + this.calendars[0] = adjustCalendar(this.calendars[0]); + for (var c = 1; c < this._o.numberOfMonths; c++) { + this.calendars[c] = adjustCalendar({ + month: this.calendars[0].month + c, + year: this.calendars[0].year + }); + } + this.draw(); + }, + + gotoToday: function() + { + this.gotoDate(new Date()); + }, + + /** + * change view to a specific month (zero-index, e.g. 0: January) + */ + gotoMonth: function(month) + { + if (!isNaN(month)) { + this.calendars[0].month = parseInt(month, 10); + this.adjustCalendars(); + } + }, + + nextMonth: function() + { + this.calendars[0].month++; + this.adjustCalendars(); + }, + + prevMonth: function() + { + this.calendars[0].month--; + this.adjustCalendars(); + }, + + /** + * change view to a specific full year (e.g. "2012") + */ + gotoYear: function(year) + { + if (!isNaN(year)) { + this.calendars[0].year = parseInt(year, 10); + this.adjustCalendars(); + } + }, + + /** + * change the minDate + */ + setMinDate: function(value) + { + this._o.minDate = value; + }, + + /** + * change the maxDate + */ + setMaxDate: function(value) + { + this._o.maxDate = value; + }, + + /** + * refresh the HTML + */ + draw: function(force) + { + if (!this._v && !force) { + return; + } + var opts = this._o, + minYear = opts.minYear, + maxYear = opts.maxYear, + minMonth = opts.minMonth, + maxMonth = opts.maxMonth, + html = ''; + + if (this._y <= minYear) { + this._y = minYear; + if (!isNaN(minMonth) && this._m < minMonth) { + this._m = minMonth; + } + } + if (this._y >= maxYear) { + this._y = maxYear; + if (!isNaN(maxMonth) && this._m > maxMonth) { + this._m = maxMonth; + } + } + + for (var c = 0; c < opts.numberOfMonths; c++) { + html += '
' + renderTitle(this, c, this.calendars[c].year, this.calendars[c].month, this.calendars[0].year) + this.render(this.calendars[c].year, this.calendars[c].month) + '
'; + } + + this.el.innerHTML = html; + + if (opts.bound) { + if(opts.field.type !== 'hidden') { + sto(function() { + opts.trigger.focus(); + }, 1); + } + } + + if (typeof this._o.onDraw === 'function') { + var self = this; + sto(function() { + self._o.onDraw.call(self); + }, 0); + } + }, + + adjustPosition: function() + { + if (this._o.container) return; + var field = this._o.trigger, pEl = field, + width = this.el.offsetWidth, height = this.el.offsetHeight, + viewportWidth = window.innerWidth || document.documentElement.clientWidth, + viewportHeight = window.innerHeight || document.documentElement.clientHeight, + scrollTop = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop, + left, top, clientRect; + + if (typeof field.getBoundingClientRect === 'function') { + clientRect = field.getBoundingClientRect(); + left = clientRect.left + window.pageXOffset; + top = clientRect.bottom + window.pageYOffset; + } else { + left = pEl.offsetLeft; + top = pEl.offsetTop + pEl.offsetHeight; + while((pEl = pEl.offsetParent)) { + left += pEl.offsetLeft; + top += pEl.offsetTop; + } + } + + // default position is bottom & left + if ((this._o.reposition && left + width > viewportWidth) || + ( + this._o.position.indexOf('right') > -1 && + left - width + field.offsetWidth > 0 + ) + ) { + left = left - width + field.offsetWidth; + } + if ((this._o.reposition && top + height > viewportHeight + scrollTop) || + ( + this._o.position.indexOf('top') > -1 && + top - height - field.offsetHeight > 0 + ) + ) { + top = top - height - field.offsetHeight; + } + + this.el.style.cssText = [ + 'position: absolute', + 'left: ' + left + 'px', + 'top: ' + top + 'px' + ].join(';'); + }, + + /** + * render HTML for a particular month + */ + render: function(year, month) + { + var opts = this._o, + now = new Date(), + days = getDaysInMonth(year, month), + before = new Date(year, month, 1).getDay(), + data = [], + row = []; + setToStartOfDay(now); + if (opts.firstDay > 0) { + before -= opts.firstDay; + if (before < 0) { + before += 7; + } + } + var cells = days + before, + after = cells; + while(after > 7) { + after -= 7; + } + cells += 7 - after; + for (var i = 0, r = 0; i < cells; i++) + { + var day = new Date(year, month, 1 + (i - before)), + isSelected = isDate(this._d) ? compareDates(day, this._d) : false, + isToday = compareDates(day, now), + isEmpty = i < before || i >= (days + before), + isDisabled = (opts.minDate && day < opts.minDate) || + (opts.maxDate && day > opts.maxDate) || + (opts.disableWeekends && isWeekend(day)) || + (opts.disableDayFn && opts.disableDayFn(day)); + + row.push(renderDay(1 + (i - before), month, year, isSelected, isToday, isDisabled, isEmpty)); + + if (++r === 7) { + if (opts.showWeekNumber) { + row.unshift(renderWeek(i - before, month, year)); + } + data.push(renderRow(row, opts.isRTL)); + row = []; + r = 0; + } + } + return renderTable(opts, data); + }, + + isVisible: function() + { + return this._v; + }, + + show: function() + { + if (!this._v) { + removeClass(this.el, 'is-hidden'); + this._v = true; + this.draw(); + if (this._o.bound) { + addEvent(document, 'click', this._onClick); + this.adjustPosition(); + } + if (typeof this._o.onOpen === 'function') { + this._o.onOpen.call(this); + } + } + }, + + hide: function() + { + var v = this._v; + if (v !== false) { + if (this._o.bound) { + removeEvent(document, 'click', this._onClick); + } + this.el.style.cssText = ''; + addClass(this.el, 'is-hidden'); + this._v = false; + if (v !== undefined && typeof this._o.onClose === 'function') { + this._o.onClose.call(this); + } + } + }, + + /** + * GAME OVER + */ + destroy: function() + { + this.hide(); + removeEvent(this.el, 'mousedown', this._onMouseDown, true); + removeEvent(this.el, 'change', this._onChange); + if (this._o.field) { + removeEvent(this._o.field, 'change', this._onInputChange); + if (this._o.bound) { + removeEvent(this._o.trigger, 'click', this._onInputClick); + removeEvent(this._o.trigger, 'focus', this._onInputFocus); + removeEvent(this._o.trigger, 'blur', this._onInputBlur); + } + } + if (this.el.parentNode) { + this.el.parentNode.removeChild(this.el); + } + } + + }; + + return Pikaday; + +})); diff --git a/index.html b/index.html new file mode 100755 index 00000000..123fffa0 --- /dev/null +++ b/index.html @@ -0,0 +1,73 @@ + + + + + Drunken-sansa by jckr + + + + + + + + + + + + + + + +
+ + +
+
+
+ +
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+
+ + + + + + + + + + +
idtitledaterecordscoveragesubjectlink
+
+ +
+ + +
+ + diff --git a/params.json b/params.json new file mode 100755 index 00000000..067ef1cb --- /dev/null +++ b/params.json @@ -0,0 +1 @@ +{"name":"Drunken-sansa","tagline":"this is a throwaway repo so i can get how project pages work. ","body":"### Welcome to GitHub Pages.\r\nThis automatic page generator is the easiest way to create beautiful pages for all of your projects. Author your page content here using GitHub Flavored Markdown, select a template crafted by a designer, and publish. After your page is generated, you can check out the new branch:\r\n\r\n```\r\n$ cd your_repo_root/repo_name\r\n$ git fetch origin\r\n$ git checkout gh-pages\r\n```\r\n\r\nIf you're using the GitHub for Mac, simply sync your repository and you'll see the new branch.\r\n\r\n### Designer Templates\r\nWe've crafted some handsome templates for you to use. Go ahead and continue to layouts to browse through them. You can easily go back to edit your page before publishing. After publishing your page, you can revisit the page generator and switch to another theme. Your Page content will be preserved if it remained markdown format.\r\n\r\n### Rather Drive Stick?\r\nIf you prefer to not use the automatic generator, push a branch named `gh-pages` to your repository to create a page manually. In addition to supporting regular HTML content, GitHub Pages support Jekyll, a simple, blog aware static site generator written by our own Tom Preston-Werner. Jekyll makes it easy to create site-wide headers and footers without having to copy them across every page. It also offers intelligent blog support and other advanced templating features.\r\n\r\n### Authors and Contributors\r\nYou can @mention a GitHub username to generate a link to their profile. The resulting `` element will link to the contributor's GitHub Profile. For example: In 2007, Chris Wanstrath (@defunkt), PJ Hyett (@pjhyett), and Tom Preston-Werner (@mojombo) founded GitHub.\r\n\r\n### Support or Contact\r\nHaving trouble with Pages? Check out the documentation at https://help.github.com/pages or contact support@github.com and we’ll help you sort it out.\r\n","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."} \ No newline at end of file diff --git a/stylesheets/github-light.css b/stylesheets/github-light.css new file mode 100755 index 00000000..10f40a42 --- /dev/null +++ b/stylesheets/github-light.css @@ -0,0 +1,115 @@ +/* + Copyright 2014 GitHub Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ + +.pl-c /* comment */ { + color: #969896; +} + +.pl-c1 /* constant, markup.raw, meta.diff.header, meta.module-reference, meta.property-name, support, support.constant, support.variable, variable.other.constant */, +.pl-s .pl-v /* string variable */ { + color: #0086b3; +} + +.pl-e /* entity */, +.pl-en /* entity.name */ { + color: #795da3; +} + +.pl-s .pl-s1 /* string source */, +.pl-smi /* storage.modifier.import, storage.modifier.package, storage.type.java, variable.other, variable.parameter.function */ { + color: #333; +} + +.pl-ent /* entity.name.tag */ { + color: #63a35c; +} + +.pl-k /* keyword, storage, storage.type */ { + color: #a71d5d; +} + +.pl-pds /* punctuation.definition.string, string.regexp.character-class */, +.pl-s /* string */, +.pl-s .pl-pse .pl-s1 /* string punctuation.section.embedded source */, +.pl-sr /* string.regexp */, +.pl-sr .pl-cce /* string.regexp constant.character.escape */, +.pl-sr .pl-sra /* string.regexp string.regexp.arbitrary-repitition */, +.pl-sr .pl-sre /* string.regexp source.ruby.embedded */ { + color: #183691; +} + +.pl-v /* variable */ { + color: #ed6a43; +} + +.pl-id /* invalid.deprecated */ { + color: #b52a1d; +} + +.pl-ii /* invalid.illegal */ { + background-color: #b52a1d; + color: #f8f8f8; +} + +.pl-sr .pl-cce /* string.regexp constant.character.escape */ { + color: #63a35c; + font-weight: bold; +} + +.pl-ml /* markup.list */ { + color: #693a17; +} + +.pl-mh /* markup.heading */, +.pl-mh .pl-en /* markup.heading entity.name */, +.pl-ms /* meta.separator */ { + color: #1d3e81; + font-weight: bold; +} + +.pl-mq /* markup.quote */ { + color: #008080; +} + +.pl-mi /* markup.italic */ { + color: #333; + font-style: italic; +} + +.pl-mb /* markup.bold */ { + color: #333; + font-weight: bold; +} + +.pl-md /* markup.deleted, meta.diff.header.from-file */ { + background-color: #ffecec; + color: #bd2c00; +} + +.pl-mi1 /* markup.inserted, meta.diff.header.to-file */ { + background-color: #eaffea; + color: #55a532; +} + +.pl-mdr /* meta.diff.range */ { + color: #795da3; + font-weight: bold; +} + +.pl-mo /* meta.output */ { + color: #1d3e81; +} diff --git a/stylesheets/normalize.css b/stylesheets/normalize.css new file mode 100755 index 00000000..30366a6e --- /dev/null +++ b/stylesheets/normalize.css @@ -0,0 +1,424 @@ +/*! normalize.css v3.0.2 | MIT License | git.io/normalize */ + +/** + * 1. Set default font family to sans-serif. + * 2. Prevent iOS text size adjust after orientation change, without disabling + * user zoom. + */ + +html { + font-family: sans-serif; /* 1 */ + -ms-text-size-adjust: 100%; /* 2 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/** + * Remove default margin. + */ + +body { + margin: 0; +} + +/* HTML5 display definitions + ========================================================================== */ + +/** + * Correct `block` display not defined for any HTML5 element in IE 8/9. + * Correct `block` display not defined for `details` or `summary` in IE 10/11 + * and Firefox. + * Correct `block` display not defined for `main` in IE 11. + */ + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +menu, +nav, +section, +summary { + display: block; +} + +/** + * 1. Correct `inline-block` display not defined in IE 8/9. + * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. + */ + +audio, +canvas, +progress, +video { + display: inline-block; /* 1 */ + vertical-align: baseline; /* 2 */ +} + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address `[hidden]` styling not present in IE 8/9/10. + * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. + */ + +[hidden], +template { + display: none; +} + +/* Links + ========================================================================== */ + +/** + * Remove the gray background color from active links in IE 10. + */ + +a { + background-color: transparent; +} + +/** + * Improve readability when focused and also mouse hovered in all browsers. + */ + +a:active, +a:hover { + outline: 0; +} + +/* Text-level semantics + ========================================================================== */ + +/** + * Address styling not present in IE 8/9/10/11, Safari, and Chrome. + */ + +abbr[title] { + border-bottom: 1px dotted; +} + +/** + * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. + */ + +b, +strong { + font-weight: bold; +} + +/** + * Address styling not present in Safari and Chrome. + */ + +dfn { + font-style: italic; +} + +/** + * Address variable `h1` font-size and margin within `section` and `article` + * contexts in Firefox 4+, Safari, and Chrome. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/** + * Address styling not present in IE 8/9. + */ + +mark { + background: #ff0; + color: #000; +} + +/** + * Address inconsistent and variable font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Remove border when inside `a` element in IE 8/9/10. + */ + +img { + border: 0; +} + +/** + * Correct overflow not hidden in IE 9/10/11. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* Grouping content + ========================================================================== */ + +/** + * Address margin not present in IE 8/9 and Safari. + */ + +figure { + margin: 1em 40px; +} + +/** + * Address differences between Firefox and other browsers. + */ + +hr { + box-sizing: content-box; + height: 0; +} + +/** + * Contain overflow in all browsers. + */ + +pre { + overflow: auto; +} + +/** + * Address odd `em`-unit font size rendering in all browsers. + */ + +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} + +/* Forms + ========================================================================== */ + +/** + * Known limitation: by default, Chrome and Safari on OS X allow very limited + * styling of `select`, unless a `border` property is set. + */ + +/** + * 1. Correct color not being inherited. + * Known issue: affects color of disabled elements. + * 2. Correct font properties not being inherited. + * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. + */ + +button, +input, +optgroup, +select, +textarea { + color: inherit; /* 1 */ + font: inherit; /* 2 */ + margin: 0; /* 3 */ +} + +/** + * Address `overflow` set to `hidden` in IE 8/9/10/11. + */ + +button { + overflow: visible; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. + * Correct `select` style inheritance in Firefox. + */ + +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + */ + +button, +html input[type="button"], /* 1 */ +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; /* 2 */ + cursor: pointer; /* 3 */ +} + +/** + * Re-set default cursor for disabled elements. + */ + +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * Remove inner padding and border in Firefox 4+. + */ + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ + +input { + line-height: normal; +} + +/** + * It's recommended that you don't attempt to style these elements. + * Firefox's implementation doesn't respect box-sizing, padding, or width. + * + * 1. Address box sizing set to `content-box` in IE 8/9/10. + * 2. Remove excess padding in IE 8/9/10. + */ + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Fix the cursor style for Chrome's increment/decrement buttons. For certain + * `font-size` values of the `input`, it causes the cursor style of the + * decrement button to change from `default` to `text`. + */ + +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari and Chrome + * (include `-moz` to future-proof). + */ + +input[type="search"] { + -webkit-appearance: textfield; /* 1 */ /* 2 */ + box-sizing: content-box; +} + +/** + * Remove inner padding and search cancel button in Safari and Chrome on OS X. + * Safari (but not Chrome) clips the cancel button when the search input has + * padding (and `textfield` appearance). + */ + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Define consistent border, margin, and padding. + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct `color` not being inherited in IE 8/9/10/11. + * 2. Remove padding so people aren't caught out if they zero out fieldsets. + */ + +legend { + border: 0; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Remove default vertical scrollbar in IE 8/9/10/11. + */ + +textarea { + overflow: auto; +} + +/** + * Don't inherit the `font-weight` (applied by a rule above). + * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. + */ + +optgroup { + font-weight: bold; +} + +/* Tables + ========================================================================== */ + +/** + * Remove most spacing between table cells. + */ + +table { + border-collapse: collapse; + border-spacing: 0; +} + +td, +th { + padding: 0; +} diff --git a/stylesheets/stylesheet.css b/stylesheets/stylesheet.css new file mode 100755 index 00000000..b5f20c23 --- /dev/null +++ b/stylesheets/stylesheet.css @@ -0,0 +1,245 @@ +* { + box-sizing: border-box; } + +body { + padding: 0; + margin: 0; + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 16px; + line-height: 1.5; + color: #606c71; } + +a { + color: #1e6bb8; + text-decoration: none; } + a:hover { + text-decoration: underline; } + +.btn { + display: inline-block; + margin-bottom: 1rem; + color: rgba(255, 255, 255, 0.7); + background-color: rgba(255, 255, 255, 0.08); + border-color: rgba(255, 255, 255, 0.2); + border-style: solid; + border-width: 1px; + border-radius: 0.3rem; + transition: color 0.2s, background-color 0.2s, border-color 0.2s; } + .btn + .btn { + margin-left: 1rem; } + +.btn:hover { + color: rgba(255, 255, 255, 0.8); + text-decoration: none; + background-color: rgba(255, 255, 255, 0.2); + border-color: rgba(255, 255, 255, 0.3); } + +@media screen and (min-width: 64em) { + .btn { + padding: 0.75rem 1rem; } } + +@media screen and (min-width: 42em) and (max-width: 64em) { + .btn { + padding: 0.6rem 0.9rem; + font-size: 0.9rem; } } + +@media screen and (max-width: 42em) { + .btn { + display: block; + width: 100%; + padding: 0.75rem; + font-size: 0.9rem; } + .btn + .btn { + margin-top: 1rem; + margin-left: 0; } } + +.page-header { + color: #fff; + text-align: center; + background-color: #159957; + background-image: linear-gradient(120deg, #155799, #159957); } + +@media screen and (min-width: 64em) { + .page-header { + padding: 5rem 6rem; } } + +@media screen and (min-width: 42em) and (max-width: 64em) { + .page-header { + padding: 3rem 4rem; } } + +@media screen and (max-width: 42em) { + .page-header { + padding: 2rem 1rem; } } + +.project-name { + margin-top: 0; + margin-bottom: 0.1rem; } + +@media screen and (min-width: 64em) { + .project-name { + font-size: 3.25rem; } } + +@media screen and (min-width: 42em) and (max-width: 64em) { + .project-name { + font-size: 2.25rem; } } + +@media screen and (max-width: 42em) { + .project-name { + font-size: 1.75rem; } } + +.project-tagline { + margin-bottom: 2rem; + font-weight: normal; + opacity: 0.7; } + +@media screen and (min-width: 64em) { + .project-tagline { + font-size: 1.25rem; } } + +@media screen and (min-width: 42em) and (max-width: 64em) { + .project-tagline { + font-size: 1.15rem; } } + +@media screen and (max-width: 42em) { + .project-tagline { + font-size: 1rem; } } + +.main-content :first-child { + margin-top: 0; } +.main-content img { + max-width: 100%; } +.main-content h1, .main-content h2, .main-content h3, .main-content h4, .main-content h5, .main-content h6 { + margin-top: 2rem; + margin-bottom: 1rem; + font-weight: normal; + color: #159957; } +.main-content p { + margin-bottom: 1em; } +.main-content code { + padding: 2px 4px; + font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; + font-size: 0.9rem; + color: #383e41; + background-color: #f3f6fa; + border-radius: 0.3rem; } +.main-content pre { + padding: 0.8rem; + margin-top: 0; + margin-bottom: 1rem; + font: 1rem Consolas, "Liberation Mono", Menlo, Courier, monospace; + color: #567482; + word-wrap: normal; + background-color: #f3f6fa; + border: solid 1px #dce6f0; + border-radius: 0.3rem; } + .main-content pre > code { + padding: 0; + margin: 0; + font-size: 0.9rem; + color: #567482; + word-break: normal; + white-space: pre; + background: transparent; + border: 0; } +.main-content .highlight { + margin-bottom: 1rem; } + .main-content .highlight pre { + margin-bottom: 0; + word-break: normal; } +.main-content .highlight pre, .main-content pre { + padding: 0.8rem; + overflow: auto; + font-size: 0.9rem; + line-height: 1.45; + border-radius: 0.3rem; } +.main-content pre code, .main-content pre tt { + display: inline; + max-width: initial; + padding: 0; + margin: 0; + overflow: initial; + line-height: inherit; + word-wrap: normal; + background-color: transparent; + border: 0; } + .main-content pre code:before, .main-content pre code:after, .main-content pre tt:before, .main-content pre tt:after { + content: normal; } +.main-content ul, .main-content ol { + margin-top: 0; } +.main-content blockquote { + padding: 0 1rem; + margin-left: 0; + color: #819198; + border-left: 0.3rem solid #dce6f0; } + .main-content blockquote > :first-child { + margin-top: 0; } + .main-content blockquote > :last-child { + margin-bottom: 0; } +.main-content table { + display: block; + width: 100%; + overflow: auto; + word-break: normal; + word-break: keep-all; } + .main-content table th { + font-weight: bold; } + .main-content table th, .main-content table td { + padding: 0.5rem 1rem; + border: 1px solid #e9ebec; } +.main-content dl { + padding: 0; } + .main-content dl dt { + padding: 0; + margin-top: 1rem; + font-size: 1rem; + font-weight: bold; } + .main-content dl dd { + padding: 0; + margin-bottom: 1rem; } +.main-content hr { + height: 2px; + padding: 0; + margin: 1rem 0; + background-color: #eff0f1; + border: 0; } + +@media screen and (min-width: 64em) { + .main-content { + max-width: 64rem; + padding: 2rem 6rem; + margin: 0 auto; + font-size: 1.1rem; } } + +@media screen and (min-width: 42em) and (max-width: 64em) { + .main-content { + padding: 2rem 4rem; + font-size: 1.1rem; } } + +@media screen and (max-width: 42em) { + .main-content { + padding: 2rem 1rem; + font-size: 1rem; } } + +.site-footer { + padding-top: 2rem; + margin-top: 2rem; + border-top: solid 1px #eff0f1; } + +.site-footer-owner { + display: block; + font-weight: bold; } + +.site-footer-credits { + color: #819198; } + +@media screen and (min-width: 64em) { + .site-footer { + font-size: 1rem; } } + +@media screen and (min-width: 42em) and (max-width: 64em) { + .site-footer { + font-size: 1rem; } } + +@media screen and (max-width: 42em) { + .site-footer { + font-size: 0.9rem; } } diff --git a/stylesheets/table.css b/stylesheets/table.css new file mode 100755 index 00000000..47665345 --- /dev/null +++ b/stylesheets/table.css @@ -0,0 +1,18 @@ +table { + width: 100%; + border-collapse: collapse; +} +/* Zebra striping */ +tr:nth-of-type(odd) { + background: #eee; +} +th { + background: #333; + color: white; + font-weight: bold; +} +td, th { + padding: 6px; + border: 1px solid #ccc; + text-align: left; +} \ No newline at end of file diff --git a/tableload.js b/tableload.js new file mode 100755 index 00000000..2346277c --- /dev/null +++ b/tableload.js @@ -0,0 +1,183 @@ + +function init(params) { + var key = params.key; + var account = params.account; + var repo = params.repo; + var pagination = params.pagination || 20; + + var data; + var currentData; + var filters = {}; + + var subjectFilter = document.getElementById("subject"); + var coverageFilter = document.getElementById("coverage"); + var fromFilter = document.getElementById("from"); + var toFilter = document.getElementById("to"); + var fromPicker, toPicker; + + Tabletop.init({ + key: key, + callback: loadData, + simpleSheet: true}) + + + function loadData(csv, tabletop) { + data = csv.map(function(d) {d.date = new Date(d.date); return d;}); + initFilters(); + filterData(); + } + + function initFilters() { + var subjects = {}, coverage = {}; + var minYear, maxYear; + var minDate = new Date(), maxDate = new Date(0); + var i; + var myOption; + + data.forEach(function(d) { + subjects[d.subject] = true; + coverage[d.coverage] = true; + if (minDate > d.date) {minDate = d.date;} + if (maxDate < d.date) {maxDate = d.date;} + }) + minYear = minDate.getUTCFullYear(); + maxYear = maxDate.getUTCFullYear(); + subjects = ["all"].concat(Object.keys(subjects)); + coverage = ["all"].concat(Object.keys(coverage)); + + fromPicker = new Pikaday({ + field: fromFilter, + position: 'top left', + firstDay: 1, + minDate: minDate, + maxDate: maxDate, + yearRange: [minYear, maxYear] + }); + + toPicker = new Pikaday({ + field: toFilter, + position: 'top left', + firstDay: 1, + minDate: minDate, + maxDate: maxDate, + yearRange: [minYear, maxYear] + }); + + while (subjectFilter.firstChild) { + subjectFilter.remove(subjectFilter.firstChild); + } + while (coverageFilter.firstChild) { + coverageFilter.remove(coverageFilter.firstChild); + } + subjects.forEach(function(d, i) { + myOption = document.createElement("option"); + myOption.value = d; + myOption.innerHTML = d; + subjectFilter.appendChild(myOption); + }) + + coverage.forEach(function(d, i) { + myOption = document.createElement("option"); + myOption.value = d; + myOption.innerHTML = d; + coverageFilter.appendChild(myOption); + }) + + subjectFilter.addEventListener("change", function() { + var val = subjectFilter.value; + if (val === "all") { + delete filters.subject; + } else { + filters.subject = val; + } + filterData(); + }) + + coverageFilter.addEventListener("change", function() { + var val = coverageFilter.value; + if (val === "all") { + delete filters.coverage; + } else { + filters.coverage = val; + } + filterData(); + }) + + fromFilter.addEventListener("change", function() { + var val = fromFilter.value; + if (val === "") { + delete filters.from; + } else { + filters.from = new Date(val); + } + filterData(); + }) + + toFilter.addEventListener("change", function() { + var val = toFilter.value; + if (val === "") { + delete filters.to; + } else { + filters.to = new Date(val); + } + filterData(); + }) + + } + + function filterData() { + console.log(filters); + currentData = data.filter(function(d) { + var keep = true; + Object.keys(filters).some(function(k) { + if (["coverage", "subject"].indexOf(k) >=0) { + if (d[k] !== filters[k]) {return (keep = false);} + } + if (k === "from" && d.date < filters.from) { + return (keep = false); + } + if (k === "to" && d.date > filters.to) { + return (keep = false); + } + }); + return keep; + }) + showData(); + } + + function showData() { + console.log(currentData); + var i; + var tableRecords = document.querySelectorAll("#files tr.record"); + var table = document.getElementById("files") + for (i = 0; i < tableRecords.length; i ++) { + table.removeChild(tableRecords[i]); + } + + currentData.forEach(function(d) { + var newRow = document.createElement("tr"); + newRow.classList.add("record"); + ["id", "title", "date", "records", "coverage", "subject", "link"].forEach(function(k) { + var newCell = document.createElement("td"); + if (k !== "link") { + if (k === "date") { + var date = new Date(d[k]); + newCell.innerHTML = (date.getMonth() + 1) + "/" + date.getDate() + "/" + date.getUTCFullYear(); + } else { + newCell.innerHTML = d[k]; + } + } else { + https://raw.githubusercontent.com/jckr/drunken-sansa/master/ + var a = document.createElement("a"); + a.setAttribute("href", "https://raw.githubusercontent.com/" + account + "/" + repo + "/master/" + d[k]); + a.setAttribute("download", ""); + a.setAttribute("target", "_blank"); + a.innerHTML = "Download" + newCell.appendChild(a); + } + newRow.appendChild(newCell); + }) + table.appendChild(newRow); + }) + } +} \ No newline at end of file From 543d5bed3cea6534ac2cc3f4c4c676d4f901eb97 Mon Sep 17 00:00:00 2001 From: Jennifer Lee Date: Fri, 29 May 2015 10:03:32 -0700 Subject: [PATCH 02/98] added data from Texas Storms and NBA Playoffs --- 20150526_Storms.csv | 102 ++++++++++++++++++++++++++++++++++++++ 20150528_CurryVsJames.csv | 13 +++++ 2 files changed, 115 insertions(+) create mode 100644 20150526_Storms.csv create mode 100644 20150528_CurryVsJames.csv diff --git a/20150526_Storms.csv b/20150526_Storms.csv new file mode 100644 index 00000000..da7da98f --- /dev/null +++ b/20150526_Storms.csv @@ -0,0 +1,102 @@ +Search interest in storms by city on 5/26, +City,Search Interest +Brenham (Texas United States),100.00 +Hutto (Texas United States),69.44 +Sulphur Springs (Texas United States),66.56 +Lakeport (Texas United States),52.64 +Hunters Creek Village (Texas United States),52.22 +Bryan (Texas United States),52.05 +Marshall (Texas United States),45.08 +Tyler (Texas United States),43.45 +Leander (Texas United States),42.94 +Bee Cave (Texas United States),39.53 +Nacogdoches (Texas United States),37.17 +Georgetown (Texas United States),36.79 +Round Rock (Texas United States),34.37 +Huntington (Texas United States),34.29 +Taylor (Texas United States),32.55 +Longview (Texas United States),32.10 +College Station (Texas United States),31.65 +Waco (Texas United States),31.23 +Morgan's Point Resort (Texas United States),30.10 +Shreveport (Louisiana United States),29.37 +Cedar Park (Texas United States),28.94 +The Woodlands (Texas United States),28.88 +Belton (Texas United States),28.71 +Russellville (Arkansas United States),27.38 +Mission Bend (Texas United States),25.92 +Mountain City (Texas United States),25.55 +Cinco Ranch (Texas United States),25.34 +San Marcos (Texas United States),24.58 +West Lake Hills (Texas United States),24.13 +Huntsville (Texas United States),23.50 +Conroe (Texas United States),23.30 +Austin (Texas United States),22.32 +Fort Smith (Arkansas United States),22.06 +Victoria (Texas United States),21.83 +Pecan Grove (Texas United States),21.65 +Atascocita (Texas United States),21.57 +Hot Springs (Arkansas United States),21.31 +Killeen (Texas United States),21.28 +Sugar Land (Texas United States),20.88 +Waxahachie (Texas United States),19.03 +Pearland (Texas United States),18.45 +Southlake (Texas United States),17.97 +Houston (Texas United States),17.72 +North Richland Hills (Texas United States),17.16 +Roland (Arkansas United States),17.04 +Wake Village (Texas United States),16.37 +Pasadena (Texas United States),15.84 +Little Rock (Arkansas United States),15.60 +Ball (Louisiana United States),15.34 +Baytown (Texas United States),15.18 +Dallas (Texas United States),14.23 +San Angelo (Texas United States),14.08 +Rosenberg (Texas United States),13.79 +Odessa (Texas United States),13.57 +Rockwall (Texas United States),13.52 +Denton (Texas United States),13.11 +Irondequoit (New York United States),12.93 +Allen (Texas United States),12.59 +Abilene (Texas United States),12.23 +Wylie (Texas United States),11.71 +Broken Arrow (Oklahoma United States),11.60 +Frisco (Texas United States),11.51 +Garland (Texas United States),11.31 +McKinney (Texas United States),11.26 +Flower Mound (Texas United States),11.22 +Beaumont (Texas United States),11.15 +Arlington (Texas United States),11.10 +West Memphis (Arkansas United States),11.09 +Mesquite (Texas United States),10.98 +Norman (Oklahoma United States),10.95 +League City (Texas United States),10.74 +Plano (Texas United States),10.59 +Grand Prairie (Texas United States),10.41 +Lewisville (Texas United States),10.35 +Tuttle (Oklahoma United States),10.18 +Richardson (Texas United States),9.91 +Carrollton (Texas United States),9.90 +Fort Worth (Texas United States),9.74 +Fayetteville (Arkansas United States),9.52 +San Antonio (Texas United States),9.50 +Irving (Texas United States),9.00 +Tulsa (Oklahoma United States),8.97 +Wapwallopen (Pennsylvania United States),8.71 +Canyon Lake (Texas United States),8.44 +Hays (Kansas United States),8.22 +Midland (Texas United States),8.12 +Duluth (Georgia United States),7.09 +Amarillo (Texas United States),6.82 +Topeka (Kansas United States),6.76 +Oklahoma City (Oklahoma United States),6.53 +New Orleans (Louisiana United States),6.50 +Wichita (Kansas United States),6.37 +Spokane (Washington United States),6.19 +Springfield (Illinois United States),6.11 +Eden Prairie (Minnesota United States),6.11 +Corpus Christi (Texas United States),6.03 +Livermore (California United States),5.97 +Stockbridge (Georgia United States),5.88 +McAllen (Texas United States),5.65 +Memphis (Tennessee United States),5.19 \ No newline at end of file diff --git a/20150528_CurryVsJames.csv b/20150528_CurryVsJames.csv new file mode 100644 index 00000000..457c2e9b --- /dev/null +++ b/20150528_CurryVsJames.csv @@ -0,0 +1,13 @@ +Search interest in LeBron James and Stephen Curry during the 2015 NBA Playoffs,, +Week,LeBron James,Stephen Curry +3/15/2015,28.85,11.10 +3/22/2015,25.20,9.45 +3/29/2015,25.64,16.67 +4/5/2015,25.22,11.94 +4/12/2015,25.16,15.21 +4/19/2015,32.49,22.02 +4/26/2015,25.49,12.76 +5/3/2015,29.80,29.51 +5/10/2015,48.27,22.66 +5/17/2015,36.19,55.40 +5/24/2015,56.42,100.00 \ No newline at end of file From 38abc437f6f4abc42dd597e3023fedc0e1debba1 Mon Sep 17 00:00:00 2001 From: "jerome@adatao.com" Date: Fri, 29 May 2015 11:00:08 -0700 Subject: [PATCH 03/98] small updates removing ids. records --- index.html | 6 ++---- tableload.js | 28 ++++++++++++++++++++++------ 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index 123fffa0..4df2f237 100755 --- a/index.html +++ b/index.html @@ -52,12 +52,10 @@

Google trends data

- - + - - +
idtitletitle daterecords coveragesubjectsubject link
diff --git a/tableload.js b/tableload.js index 2346277c..024fcfe5 100755 --- a/tableload.js +++ b/tableload.js @@ -22,7 +22,11 @@ function init(params) { function loadData(csv, tabletop) { - data = csv.map(function(d) {d.date = new Date(d.date); return d;}); + data = csv.map(function(d, i) { + d.id = i; + d.date = new Date(d.date); + return d; + }); initFilters(); filterData(); } @@ -35,15 +39,27 @@ function init(params) { var myOption; data.forEach(function(d) { - subjects[d.subject] = true; - coverage[d.coverage] = true; + if (d.subject.length) { + for (i = 0; i < d.subject.length; i++) { + subjects[d.subject[i]] = true; + } + } else { + subjects[d.subject] = true; + } + if (d.coverage.length) { + for (i = 0; i < d.subject.length; i++) { + coverage[d.coverage[i]] = true; + } + } else { + coverage[d.subject] = true; + } if (minDate > d.date) {minDate = d.date;} if (maxDate < d.date) {maxDate = d.date;} }) minYear = minDate.getUTCFullYear(); maxYear = maxDate.getUTCFullYear(); - subjects = ["all"].concat(Object.keys(subjects)); - coverage = ["all"].concat(Object.keys(coverage)); + subjects = ["all"].concat(Object.keys(subjects).sort()); + coverage = ["all"].concat(Object.keys(coverage).sort()); fromPicker = new Pikaday({ field: fromFilter, @@ -157,7 +173,7 @@ function init(params) { currentData.forEach(function(d) { var newRow = document.createElement("tr"); newRow.classList.add("record"); - ["id", "title", "date", "records", "coverage", "subject", "link"].forEach(function(k) { + ["title", "date", "coverage", "subject", "link"].forEach(function(k) { var newCell = document.createElement("td"); if (k !== "link") { if (k === "date") { From 8dd4a0772f276b294c61b37273486b3ce3527423 Mon Sep 17 00:00:00 2001 From: "jerome@adatao.com" Date: Fri, 29 May 2015 12:20:28 -0700 Subject: [PATCH 04/98] added pagination --- index.html | 17 +++++++---- tableload.js | 79 +++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 71 insertions(+), 25 deletions(-) diff --git a/index.html b/index.html index 4df2f237..d9ebc9b2 100755 --- a/index.html +++ b/index.html @@ -5,10 +5,11 @@ Drunken-sansa by jckr + + - @@ -22,9 +23,9 @@
@@ -60,7 +61,13 @@

Google trends data

- +
+ + Page 1 of n + + Go to page: + +
@@ -19,10 +19,10 @@ -
+
From c2299bbdbe7f08fcd5cb90275aee35d87ce6a338 Mon Sep 17 00:00:00 2001 From: Simon Rogers Date: Mon, 1 Jun 2015 14:56:26 -0700 Subject: [PATCH 10/98] Update index.html --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 53438215..ceac6025 100755 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@ - + From 1f04ecc6f81a89aa5e05d7a22cc51775e43aec39 Mon Sep 17 00:00:00 2001 From: Simon Rogers Date: Mon, 1 Jun 2015 15:09:24 -0700 Subject: [PATCH 11/98] Update index.html --- index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/index.html b/index.html index ceac6025..ecaaf115 100755 --- a/index.html +++ b/index.html @@ -74,5 +74,6 @@

Download and play with key datasets from Google Tren window.onload = function() {init({key: "1XbUaC5KDd-EMLUOolzj53Sn4sk5P9hL9ZbYxBEchZpY", account: "googletrends", repo: "data"})};

+ From baf1d8026198daefd39723a2e1a0bd92713d4e48 Mon Sep 17 00:00:00 2001 From: Simon Rogers Date: Mon, 1 Jun 2015 15:13:56 -0700 Subject: [PATCH 12/98] Update index.html --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index ecaaf115..e69a487c 100755 --- a/index.html +++ b/index.html @@ -24,8 +24,8 @@

Google Trends Datastore

Download and play with key datasets from Google Trends, curated by the News Lab @ Google team. Click on a CSV name to download it — and let us know what you do with it by emailing us

View on GitHub - Download .zip - Download .tar.gz + Google Trends + @GoogleTrends
From 81b6f24fef53a3cace09e3a2664101124f7250a7 Mon Sep 17 00:00:00 2001 From: Simon Rogers Date: Mon, 1 Jun 2015 15:14:49 -0700 Subject: [PATCH 13/98] Update index.html --- index.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.html b/index.html index e69a487c..e40dea46 100755 --- a/index.html +++ b/index.html @@ -24,7 +24,7 @@

Google Trends Datastore

Download and play with key datasets from Google Trends, curated by the News Lab @ Google team. Click on a CSV name to download it — and let us know what you do with it by emailing us

View on GitHub - Google Trends + Explore Google Trends @GoogleTrends
@@ -74,6 +74,5 @@

Download and play with key datasets from Google Tren window.onload = function() {init({key: "1XbUaC5KDd-EMLUOolzj53Sn4sk5P9hL9ZbYxBEchZpY", account: "googletrends", repo: "data"})}; - From a0ea54fcb957cdfe2e4168e1b9ad808986c5d986 Mon Sep 17 00:00:00 2001 From: Simon Rogers Date: Mon, 1 Jun 2015 15:21:27 -0700 Subject: [PATCH 14/98] Update index.html --- index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/index.html b/index.html index e40dea46..1f19a6c4 100755 --- a/index.html +++ b/index.html @@ -26,6 +26,7 @@

Download and play with key datasets from Google Tren View on GitHub Explore Google Trends @GoogleTrends + What is the News Lab?
From 22ac8559e1361862310de44ac7d5bef340b961e5 Mon Sep 17 00:00:00 2001 From: Simon Rogers Date: Mon, 1 Jun 2015 15:24:09 -0700 Subject: [PATCH 15/98] Update index.html --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 1f19a6c4..28075052 100755 --- a/index.html +++ b/index.html @@ -22,7 +22,7 @@