code
stringlengths
2
1.05M
repo_name
stringlengths
5
114
path
stringlengths
4
991
language
stringclasses
1 value
license
stringclasses
15 values
size
int32
2
1.05M
import Helper from '@ember/component/helper'; import { inject as service } from '@ember/service'; import { get } from '@ember/object'; export default Helper.extend({ assetMap: service(), compute(params) { const file = params[0] || ""; if (!file) { return; } return get(this, 'assetMap').resolve(file); } });
RuslanZavacky/ember-cli-ifa
addon/helpers/asset-map.js
JavaScript
mit
340
'use babel'; // eslint-disable-next-line import/no-extraneous-dependencies, import/extensions import { Point } from 'atom'; import { Emitter } from 'event-kit'; class TreeNode { constructor(item) { const { label, icon, children, access, signature, position } = item; this.emitter = new Emitter(); this.item = item; this.item.view = this; let syntaxCategory = ''; let scopeName; let language; if ( atom.workspace.getActiveTextEditor() != null && atom.workspace.getActiveTextEditor().getGrammar() != null ) { scopeName = atom.workspace.getActiveTextEditor().getGrammar().scopeName; } if (scopeName != null) { const scopeNameSplit = scopeName.split('.'); language = scopeNameSplit[scopeNameSplit.length - 1]; } if (icon != null) { const iconSplit = icon.split('-'); syntaxCategory = iconSplit[iconSplit.length - 1]; } if (['python', 'django'].indexOf(language) !== -1 && syntaxCategory === 'member') { syntaxCategory = 'function'; } const symbolColored = atom.config.get('symbols-navigator.colorsForSyntax') ? '-colored' : ''; const syntaxCategoryClass = icon ? [`${icon}${symbolColored}`] : []; const iconClass = ['icon']; if (atom.config.get('symbols-navigator.showSyntaxIcons')) { iconClass.push(...syntaxCategoryClass); } const iconAccess = atom.config.get('symbols-navigator.showAccessIcons') ? [`icon-${access}`] : []; const signatureClass = ['signature', 'status-ignored']; const collapsed = atom.config.get('symbols-navigator.collapsedByDefault') ? ['collapsed'] : []; const accessElement = document.createElement('span'); accessElement.classList.add(...iconAccess); const nameElement = document.createElement('span'); nameElement.classList.add(...iconClass); nameElement.innerHTML = label; const signatureElement = document.createElement('span'); signatureElement.classList.add(...signatureClass); signatureElement.innerHTML = signature; accessElement.appendChild(nameElement); accessElement.appendChild(signatureElement); this.element = document.createElement('li'); if (children) { this.element.classList.add('list-nested-item', 'list-selectable-item', ...collapsed); this.element.dataset.title = label; const symbolRoot = document.createElement('div'); symbolRoot.classList.add('list-item', 'symbol-root'); const childElement = document.createElement('ul'); childElement.classList.add('list-tree'); for (const child of children) { const childTreeNode = new TreeNode(child); childElement.appendChild(childTreeNode.element); } symbolRoot.appendChild(accessElement); this.element.appendChild(symbolRoot); this.element.appendChild(childElement); } else { this.element.classList.add('list-item', 'symbol-item', 'list-selectable-item'); this.element.dataset.title = label; this.element.appendChild(accessElement); } if (position) { this.element.dataset.row = position.row; this.element.dataset.column = position.column; } } setSelected() { this.element.classList.add('selected'); } hide() { this.element.style.display = 'none'; } } export default class TreeView { constructor(statusBarManager) { this.statusBarManager = statusBarManager; this.element = document.createElement('div'); this.element.classList.add('symbols-navigator-tree-view'); this.list = document.createElement('ul'); this.list.classList.add('list-tree', 'has-collapsable-children'); this.element.appendChild(this.list); this.element.addEventListener('click', (event) => { this.onClick(event); }); this.element.addEventListener('dblclick', (event) => { this.onDblClick(event); }); this.order = { class: 1, function: 2, method: 3, }; this.emitter = new Emitter(); } destroy() { this.remove(); } setRoot(rootData, sortByName = true, ignoreRoot = true) { if (sortByName) { this.sortByName(rootData); } else { this.sortByRow(rootData); } this.rootNode = new TreeNode(rootData); while (this.list.firstChild) { this.list.removeChild(this.list.firstChild); } if (ignoreRoot) { for (const child of rootData.children) { this.list.appendChild(child.view.element); } } else { this.list.appendChild(rootData.view.element); } } setEmptyRoot() { this.rootNode = new TreeNode({}); while (this.list.firstChild) { this.list.removeChild(this.list.firstChild); } } traversal = (node, doing) => { doing(node); if (node.children) { for (const child of node.children) { this.traversal(child, doing); } } } toggleTypeVisible = (type) => { this.traversal(this.rootNode.item, (item) => { if (item.type === type) { item.view.hide(); } }); } sortByName = (rootData) => { this.traversal(rootData, (node) => { if (node.children != null) { node.children.sort((a, b) => { const aOrder = (this.order[a.type] != null) ? this.order[a.type] : 99; const bOrder = (this.order[b.type] != null) ? this.order[b.type] : 99; if ((aOrder - bOrder) !== 0) { return aOrder - bOrder; } return a.name.localeCompare(b.name); }); } }); } sortByRow = (rootData) => { this.traversal(rootData, (node) => { if (node.children != null) { node.children.sort((a, b) => { return a.position.row - b.position.row; }); } }); } onClick(event) { const target = event.target; let currentNode; let collapsed = false; event.stopPropagation(); if (target.classList.contains('list-nested-item')) { currentNode = target; } else if (target.classList.contains('list-tree')) { currentNode = target.closest('.list-nested-item'); } else if (target.classList.contains('symbol-root')) { currentNode = target.closest('.list-nested-item'); if (atom.config.get('symbols-navigator.collapseClick') === 'Go to symbol') { const left = currentNode.getBoundingClientRect().left; const right = currentNode.querySelector('span').getBoundingClientRect().left; const width = right - left; collapsed = event.offsetX <= width; } else if (atom.config.get('symbols-navigator.clickType') === 'Single Click') { collapsed = true; } } else if (target.closest('.list-item') && target.closest('.list-item').classList.contains('symbol-root')) { currentNode = target.closest('.list-nested-item'); if (atom.config.get('symbols-navigator.collapseClick') === 'Collapse item' && atom.config.get('symbols-navigator.clickType') === 'Single Click') { collapsed = true; } } else { currentNode = target.closest('.list-item'); } if (currentNode === null) { return; } if (collapsed) { currentNode.classList.toggle('collapsed'); return; } this.clearSelect(); currentNode.classList.add('selected'); if (atom.config.get('symbols-navigator.clickType') === 'Single Click') { this.moveToSelectedSymbol(); } } onDblClick(event) { const target = event.target; let currentNode = target; let collapsed = false; event.stopPropagation(); if (target.classList.contains('list-nested-item')) { collapsed = true; } else if (target.classList.contains('list-tree')) { currentNode = null; } else if (target.classList.contains('symbol-root') || (target.closest('.list-item') && target.closest('.list-item').classList.contains('symbol-root'))) { currentNode = target.closest('.list-nested-item'); if (atom.config.get('symbols-navigator.collapseClick') === 'Go to symbol') { const left = currentNode.getBoundingClientRect().left; const right = currentNode.querySelector('span').getBoundingClientRect().left; const width = right - left; collapsed = event.offsetX <= width; } else { collapsed = true; } } else { currentNode = target.closest('.list-item'); } if (currentNode === null) { return; } if (collapsed) { currentNode.classList.toggle('collapsed'); return; } this.clearSelect(); currentNode.classList.add('selected'); if (atom.config.get('symbols-navigator.clickType') === 'Double Click') { const editor = atom.workspace.getActiveTextEditor(); if (currentNode.dataset.row && currentNode.dataset.row >= 0 && editor != null) { this.moveToSelectedSymbol(); } } } clearSelect() { const allItems = document.querySelectorAll('.list-selectable-item'); for (const item of allItems) { item.classList.remove('selected'); } } select(item, currentScrollTop, currentScrollBottom) { this.clearSelect(); if (item != null) { item.view.setSelected(); const element = item.view.element; if (element.offsetTop < currentScrollTop || element.offsetTop > currentScrollBottom) { return item.view.element.offsetTop; } } return null; } moveUp() { const selectedNode = this.element.querySelector('.selected'); if (selectedNode === null) { this.element.querySelector('.list-tree').firstElementChild.classList.add('selected'); } else { let newSelectedNode = selectedNode; this.clearSelect(); const previousNode = selectedNode.previousElementSibling; if (previousNode != null && previousNode.classList.contains('list-selectable-item')) { if (previousNode.classList.contains('list-item')) { newSelectedNode = previousNode; } else if (previousNode.classList.contains('list-nested-item')) { const previousParentNode = previousNode.querySelector('.list-tree').querySelectorAll('.list-selectable-item'); if (previousNode.classList.contains('collapsed')) { newSelectedNode = previousNode; } else { newSelectedNode = previousParentNode[previousParentNode.length - 1]; } } } else if (selectedNode.parentNode.parentNode.classList.contains('list-selectable-item') && selectedNode.parentNode.parentNode.classList.contains('list-nested-item')) { newSelectedNode = selectedNode.parentNode.parentNode; } newSelectedNode = newSelectedNode != null ? newSelectedNode : selectedNode; newSelectedNode.classList.add('selected'); } event.stopImmediatePropagation(); } moveDown() { const selectedNode = this.element.querySelector('.selected'); if (selectedNode === null) { this.element.querySelector('.list-tree').firstElementChild.classList.add('selected'); } else { let newSelectedNode = selectedNode; this.clearSelect(); if (selectedNode.classList.contains('list-selectable-item') && selectedNode.classList.contains('list-nested-item')) { if (selectedNode.classList.contains('collapsed')) { newSelectedNode = selectedNode.nextElementSibling; } else { const childNodes = selectedNode.querySelector('.list-tree').querySelectorAll('.list-selectable-item'); newSelectedNode = childNodes.length > 0 ? childNodes[0] : selectedNode; } } else { const nextNode = selectedNode.nextElementSibling; if (nextNode != null && nextNode.classList.contains('list-selectable-item') && nextNode.classList.contains('list-item')) { newSelectedNode = nextNode; } else if (selectedNode.parentNode.parentNode.nextElementSibling != null && selectedNode.parentNode.parentNode.nextElementSibling.classList.contains('list-selectable-item')) { newSelectedNode = selectedNode.parentNode.parentNode.nextElementSibling; } } newSelectedNode = newSelectedNode != null ? newSelectedNode : selectedNode; newSelectedNode.classList.add('selected'); } event.stopImmediatePropagation(); } moveLeft() { const selectedNode = this.element.querySelector('.selected'); if (selectedNode != null && selectedNode.classList.contains('list-nested-item')) { selectedNode.classList.add('collapsed'); } event.stopImmediatePropagation(); } moveRight() { const selectedNode = this.element.querySelector('.selected'); if (selectedNode != null && selectedNode.classList.contains('list-nested-item')) { selectedNode.classList.remove('collapsed'); } event.stopImmediatePropagation(); } moveToSelectedSymbol() { const editor = atom.workspace.getActiveTextEditor(); const selectedNode = this.element.querySelector('.selected'); if (selectedNode.dataset.row && selectedNode.dataset.row >= 0 && editor != null) { const position = new Point(parseInt(selectedNode.dataset.row, 10)); let scrollPosition = position; // if not quickscrolling, calculate how the editor window has to be shifted to align // the selected item on top or bottom let tempPoint = null; if (atom.config.get('symbols-navigator.scrollType') === 'Top') { if (editor.getCursorBufferPosition().isLessThan(position)) { tempPoint = new Point(Math.round(position.row + (editor.getRowsPerPage() * 0.9)), 0); scrollPosition = editor.clipBufferPosition(tempPoint); } } else if (atom.config.get('symbols-navigator.scrollType') === 'Bottom') { if (editor.getCursorBufferPosition().isGreaterThan(position)) { tempPoint = new Point(Math.round(position.row - (editor.getRowsPerPage() * 0.9)), 0); scrollPosition = editor.clipBufferPosition(tempPoint); } } else if (atom.config.get('symbols-navigator.scrollType') === 'Center') { if (editor.getCursorBufferPosition().isLessThan(position)) { tempPoint = new Point(Math.round(position.row + (editor.getRowsPerPage() * 0.45)), 0); scrollPosition = editor.clipBufferPosition(tempPoint); } else { tempPoint = new Point(Math.round(position.row - (editor.getRowsPerPage() * 0.45)), 0); scrollPosition = editor.clipBufferPosition(tempPoint); } } editor.scrollToBufferPosition(scrollPosition); // setting the cursor has to be delayed for scrolling to work correctly setTimeout(() => { editor.setCursorBufferPosition(position); editor.moveToFirstCharacterOfLine(); editor.element.dispatchEvent(new CustomEvent('focus')); }, 10); } event.stopImmediatePropagation(); } }
lejsue/symbols-navigator
lib/tree-view.js
JavaScript
mit
14,779
version https://git-lfs.github.com/spec/v1 oid sha256:8ddc17d10cd707bcfb5dced5cf4a2fb481d63b9a8865683468b706bf8e090e01 size 17512
yogeshsaroya/new-cdnjs
ajax/libs/bootstrap-tokenfield/0.12.0/bootstrap-tokenfield.min.js
JavaScript
mit
130
import { CHECKBOX_UPDATE, RANGE_UPDATE, FUZZY, SEARCH_KEY_UPDATE, SETTINGS_RESET, SETTING_RESET, NUMBER_UPDATE, LAST_QUERY_UPDATE, KEYBINDING_UPDATE, KEYBINDING_DEFAULT_RESET, COLOR_UPDATE, } from './types'; import { action } from './action'; // When action is passed in from ui store the background passes the entire // action as an input export function updateCheckbox({ payload: { key, value } }) { return action(CHECKBOX_UPDATE, key, value); } export function updateFuzzyCheckbox({ payload: { key, value } }) { return action(FUZZY + CHECKBOX_UPDATE, key, value); } export function updateFuzzyRange({ payload: { key, value } }) { return action(FUZZY + RANGE_UPDATE, key, value); } export function updateFuzzySearchKeys({ payload: { value } }) { return action(FUZZY + SEARCH_KEY_UPDATE, 'keys', value); } export function updateNumber({ payload: { key, value } }) { return action(NUMBER_UPDATE, key, value); } export function resetSettings() { return action(SETTINGS_RESET); } export function resetSetting({ payload: { key } }) { return action(SETTING_RESET, key); } export function updateLastQuery(a) { return action(LAST_QUERY_UPDATE, a.payload.key); } export function updateKeybinding({ payload: { key, value } }) { return action(KEYBINDING_UPDATE, key, value); } export function resetDefaultKeybindings() { return action(KEYBINDING_DEFAULT_RESET); } export function updateColor(a) { return action(COLOR_UPDATE, a.payload.key, a.payload.value); }
reblws/tab-search
src/core/actions/index.js
JavaScript
mit
1,507
/* Widget to create an accordion control. Easy to use! var $accordion = new kbaseAccordion($('#accordion'), { elements : [ { title : 'Accordion element 1', body : 'body 1' }, { title : 'Accordion element 2', body : 'body 2' }, { title : 'Accordion element 3', body : 'body 3' }, { title : 'Accordion element 4', body : 'body 4' }, ] } ); */ define(['kbwidget', 'jquery'], (KBWidget, $) => { 'use strict'; return KBWidget({ name: 'kbaseAccordion', version: '1.0.0', options: { fontSize: '100%', }, init: function (options) { this._super(options); if (this.options.client) { this.client = this.options.client; } this.appendUI($(this.$elem)); return this; }, appendUI: function ($elem, elements) { if (elements == undefined) { elements = this.options.elements; } const fontSize = this.options.fontSize; const $block = $('<div></div>') .addClass('accordion') .css('font-size', fontSize) .attr('id', 'accordion'); $.each( elements, $.proxy(function (idx, val) { if (val.fontMultiplier == undefined) { val.fontMultiplier = this.options.fontMultiplier; } $block.append( $('<div></div>') .addClass('panel panel-default') .css('margin-bottom', '2px') .append( $('<div></div>') .addClass('panel-heading') .css('padding', '0') .append( $('<i></i>') .css('margin-right', '5px') .css('margin-left', '3px') .addClass('fa') .addClass( val.open ? 'fa-chevron-down' : 'fa-chevron-right' ) .addClass('pull-left') .css('height', 22 * val.fontMultiplier + 'px') .css('line-height', 22 * val.fontMultiplier + 'px') .css('color', 'gray') ) .append( $('<a></a>') .css('padding', '0') .attr('href', '#') .attr('title', val.title) .css('height', 22 * val.fontMultiplier + 'px') .css('line-height', 22 * val.fontMultiplier + 'px') .css('font-size', 100 * val.fontMultiplier + '%') .append(val.title) //.text(val.title) ) .bind('click', function (e) { e.preventDefault(); const $opened = $(this).closest('.panel').find('.in'); const $target = $(this).next(); if ($opened != undefined) { $opened.collapse('hide'); const $i = $opened.parent().first().find('i'); $i.removeClass('fa fa-chevron-down'); $i.addClass('fa fa-chevron-right'); } if ($target.get(0) != $opened.get(0)) { $target.collapse('show'); const $i = $(this).parent().find('i'); $i.removeClass('fa fa-chevron-right'); $i.addClass('fa fa-chevron-down'); } }) ) .append( $('<div></div>') .addClass('panel-body collapse') .addClass(val.open ? 'in' : '') .css('padding-top', '9px') .css('padding-bottom', '9px') .append(val.body) ) ); }, this) ); this._rewireIds($block, this); $elem.append($block); // $block.find('.panel-body').collapse('hide'); }, }); });
kbase/narrative
kbase-extension/static/kbase/js/widgets/kbaseAccordion.js
JavaScript
mit
5,747
/** * Auto-generated code below aims at helping you parse * the standard input according to the problem statement. **/ var L = parseInt(readline()); var H = parseInt(readline()); var T = readline(); var text = T.toUpperCase().replace(/[^A-Z]/g, '['); var answer = ''; for (var i = 0; i < H; i++) { var ROW = readline(); for (var char = 0; char < text.length; char++) { var position = text.charCodeAt(char) - 'A'.charCodeAt(0); for(var l = 0; l < L; l++) { answer += ROW[position*L + l]; } } answer += '\n'; } print(answer);
squallco/CodinGame
solutions/level-01-easy/ascii-art.js
JavaScript
mit
590
/*! * jQuery.textcomplete * * Repository: https://github.com/yuku-t/jquery-textcomplete * License: MIT (https://github.com/yuku-t/jquery-textcomplete/blob/master/LICENSE) * Author: Yuku Takahashi */ if (typeof jQuery === 'undefined') { throw new Error('jQuery.textcomplete requires jQuery'); } +function ($) { 'use strict'; var warn = function (message) { if (console.warn) { console.warn(message); } }; $.fn.textcomplete = function (strategies, option) { var args = Array.prototype.slice.call(arguments); return this.each(function () { var $this = $(this); var completer = $this.data('textComplete'); if (!completer) { completer = new $.fn.textcomplete.Completer(this, option || {}); $this.data('textComplete', completer); } if (typeof strategies === 'string') { if (!completer) return; args.shift() completer[strategies].apply(completer, args); if (strategies === 'destroy') { $this.removeData('textComplete'); } } else { // For backward compatibility. // TODO: Remove at v0.4 $.each(strategies, function (obj) { $.each(['header', 'footer', 'placement', 'maxCount'], function (name) { if (obj[name]) { completer.option[name] = obj[name]; warn(name + 'as a strategy param is deprecated. Use option.'); delete obj[name]; } }); }); completer.register($.fn.textcomplete.Strategy.parse(strategies)); } }); }; }(jQuery); +function ($) { 'use strict'; // Exclusive execution control utility. // // func - The function to be locked. It is executed with a function named // `free` as the first argument. Once it is called, additional // execution are ignored until the free is invoked. Then the last // ignored execution will be replayed immediately. // // Examples // // var lockedFunc = lock(function (free) { // setTimeout(function { free(); }, 1000); // It will be free in 1 sec. // console.log('Hello, world'); // }); // lockedFunc(); // => 'Hello, world' // lockedFunc(); // none // lockedFunc(); // none // // 1 sec past then // // => 'Hello, world' // lockedFunc(); // => 'Hello, world' // lockedFunc(); // none // // Returns a wrapped function. var lock = function (func) { var locked, queuedArgsToReplay; return function () { // Convert arguments into a real array. var args = Array.prototype.slice.call(arguments); if (locked) { // Keep a copy of this argument list to replay later. // OK to overwrite a previous value because we only replay // the last one. queuedArgsToReplay = args; return; } locked = true; var self = this; args.unshift(function replayOrFree() { if (queuedArgsToReplay) { // Other request(s) arrived while we were locked. // Now that the lock is becoming available, replay // the latest such request, then call back here to // unlock (or replay another request that arrived // while this one was in flight). var replayArgs = queuedArgsToReplay; queuedArgsToReplay = undefined; replayArgs.unshift(replayOrFree); func.apply(self, replayArgs); } else { locked = false; } }); func.apply(this, args); }; }; var isString = function (obj) { return Object.prototype.toString.call(obj) === '[object String]'; }; var uniqueId = 0; function Completer(element, option) { this.$el = $(element); this.id = 'textcomplete' + uniqueId++; this.strategies = []; this.views = []; this.option = $.extend({}, Completer._getDefaults(), option); if (!this.$el.is('input[type=text]') && !this.$el.is('textarea') && !element.isContentEditable && element.contentEditable != 'true') { throw new Error('textcomplete must be called on a Textarea or a ContentEditable.'); } if (element === document.activeElement) { // element has already been focused. Initialize view objects immediately. this.initialize() } else { // Initialize view objects lazily. var self = this; this.$el.one('focus.' + this.id, function () { self.initialize(); }); } } Completer._getDefaults = function () { if (!Completer.DEFAULTS) { Completer.DEFAULTS = { appendTo: $('body'), zIndex: '100' }; } return Completer.DEFAULTS; } $.extend(Completer.prototype, { // Public properties // ----------------- id: null, option: null, strategies: null, adapter: null, dropdown: null, $el: null, // Public methods // -------------- initialize: function () { var element = this.$el.get(0); // Initialize view objects. this.dropdown = new $.fn.textcomplete.Dropdown(element, this, this.option); var Adapter, viewName; if (this.option.adapter) { Adapter = this.option.adapter; } else { if (this.$el.is('textarea') || this.$el.is('input[type=text]')) { viewName = typeof element.selectionEnd === 'number' ? 'Textarea' : 'IETextarea'; } else { viewName = 'ContentEditable'; } Adapter = $.fn.textcomplete[viewName]; } this.adapter = new Adapter(element, this, this.option); }, destroy: function () { this.$el.off('.' + this.id); if (this.adapter) { this.adapter.destroy(); } if (this.dropdown) { this.dropdown.destroy(); } this.$el = this.adapter = this.dropdown = null; }, // Invoke textcomplete. trigger: function (text, skipUnchangedTerm) { if (!this.dropdown) { this.initialize(); } text != null || (text = this.adapter.getTextFromHeadToCaret()); var searchQuery = this._extractSearchQuery(text); if (searchQuery.length) { var term = searchQuery[1]; // Ignore shift-key, ctrl-key and so on. if (skipUnchangedTerm && this._term === term) { return; } this._term = term; this._search.apply(this, searchQuery); } else { this._term = null; this.dropdown.deactivate(); } }, fire: function (eventName) { var args = Array.prototype.slice.call(arguments, 1); this.$el.trigger(eventName, args); return this; }, register: function (strategies) { Array.prototype.push.apply(this.strategies, strategies); }, // Insert the value into adapter view. It is called when the dropdown is clicked // or selected. // // value - The selected element of the array callbacked from search func. // strategy - The Strategy object. select: function (value, strategy) { this.adapter.select(value, strategy); this.fire('change').fire('textComplete:select', value, strategy); this.adapter.focus(); }, // Private properties // ------------------ _clearAtNext: true, _term: null, // Private methods // --------------- // Parse the given text and extract the first matching strategy. // // Returns an array including the strategy, the query term and the match // object if the text matches an strategy; otherwise returns an empty array. _extractSearchQuery: function (text) { for (var i = 0; i < this.strategies.length; i++) { var strategy = this.strategies[i]; var context = strategy.context(text); if (context || context === '') { if (isString(context)) { text = context; } var cursor = editor.getCursor(); text = editor.getLine(cursor.line).slice(0, cursor.ch); var match = text.match(strategy.match); if (match) { return [strategy, match[strategy.index], match]; } } } return [] }, // Call the search method of selected strategy.. _search: lock(function (free, strategy, term, match) { var self = this; strategy.search(term, function (data, stillSearching) { if (!self.dropdown.shown) { self.dropdown.activate(); self.dropdown.setPosition(self.adapter.getCaretPosition()); } if (self._clearAtNext) { // The first callback in the current lock. self.dropdown.clear(); self._clearAtNext = false; } self.dropdown.render(self._zip(data, strategy)); if (!stillSearching) { // The last callback in the current lock. free(); self._clearAtNext = true; // Call dropdown.clear at the next time. } }, match); }), // Build a parameter for Dropdown#render. // // Examples // // this._zip(['a', 'b'], 's'); // //=> [{ value: 'a', strategy: 's' }, { value: 'b', strategy: 's' }] _zip: function (data, strategy) { return $.map(data, function (value) { return { value: value, strategy: strategy }; }); } }); $.fn.textcomplete.Completer = Completer; }(jQuery); +function ($) { 'use strict'; var include = function (zippedData, datum) { var i, elem; var idProperty = datum.strategy.idProperty for (i = 0; i < zippedData.length; i++) { elem = zippedData[i]; if (elem.strategy !== datum.strategy) continue; if (idProperty) { if (elem.value[idProperty] === datum.value[idProperty]) return true; } else { if (elem.value === datum.value) return true; } } return false; }; var dropdownViews = {}; $(document).on('click', function (e) { var id = e.originalEvent && e.originalEvent.keepTextCompleteDropdown; $.each(dropdownViews, function (key, view) { if (key !== id) { view.deactivate(); } }); }); // Dropdown view // ============= // Construct Dropdown object. // // element - Textarea or contenteditable element. function Dropdown(element, completer, option) { this.$el = Dropdown.findOrCreateElement(option); this.completer = completer; this.id = completer.id + 'dropdown'; this._data = []; // zipped data. this.$inputEl = $(element); this.option = option; // Override setPosition method. if (option.listPosition) { this.setPosition = option.listPosition; } if (option.height) { this.$el.height(option.height); } var self = this; $.each(['maxCount', 'placement', 'footer', 'header', 'className'], function (_i, name) { if (option[name] != null) { self[name] = option[name]; } }); this._bindEvents(element); dropdownViews[this.id] = this; } $.extend(Dropdown, { // Class methods // ------------- findOrCreateElement: function (option) { var $parent = option.appendTo; if (!($parent instanceof $)) { $parent = $($parent); } var $el = $parent.children('.dropdown-menu') if (!$el.length) { $el = $('<ul class="dropdown-menu"></ul>').css({ display: 'none', left: 0, position: 'absolute', zIndex: option.zIndex }).appendTo($parent); } return $el; } }); $.extend(Dropdown.prototype, { // Public properties // ----------------- $el: null, // jQuery object of ul.dropdown-menu element. $inputEl: null, // jQuery object of target textarea. completer: null, footer: null, header: null, id: null, maxCount: 10, placement: '', shown: false, data: [], // Shown zipped data. className: '', // Public methods // -------------- destroy: function () { // Don't remove $el because it may be shared by several textcompletes. this.deactivate(); this.$el.off('.' + this.id); this.$inputEl.off('.' + this.id); this.clear(); this.$el = this.$inputEl = this.completer = null; delete dropdownViews[this.id] }, render: function (zippedData) { var contentsHtml = this._buildContents(zippedData); var unzippedData = $.map(this.data, function (d) { return d.value; }); if (this.data.length) { this._renderHeader(unzippedData); this._renderFooter(unzippedData); if (contentsHtml) { this._renderContents(contentsHtml); this._activateIndexedItem(); } this._setScroll(); } else if (this.shown) { this.deactivate(); } }, setPosition: function (position) { this.$el.css(this._applyPlacement(position)); // Make the dropdown fixed if the input is also fixed // This can't be done during init, as textcomplete may be used on multiple elements on the same page // Because the same dropdown is reused behind the scenes, we need to recheck every time the dropdown is showed var position = 'absolute'; // Check if input or one of its parents has positioning we need to care about this.$inputEl.add(this.$inputEl.parents()).each(function() { if($(this).css('position') === 'absolute') // The element has absolute positioning, so it's all OK return false; if($(this).css('position') === 'fixed') { position = 'fixed'; return false; } }); this.$el.css({ position: position }); // Update positioning return this; }, clear: function () { this.$el.html(''); this.data = []; this._index = 0; this._$header = this._$footer = null; }, activate: function () { if (!this.shown) { this.clear(); this.$el.show(); if (this.className) { this.$el.addClass(this.className); } this.completer.fire('textComplete:show'); this.shown = true; } return this; }, deactivate: function () { if (this.shown) { this.$el.hide(); if (this.className) { this.$el.removeClass(this.className); } this.completer.fire('textComplete:hide'); this.shown = false; } return this; }, isUp: function (e) { return e.keyCode === 38 || (e.ctrlKey && e.keyCode === 80); // UP, Ctrl-P }, isDown: function (e) { return e.keyCode === 40 || (e.ctrlKey && e.keyCode === 78); // DOWN, Ctrl-N }, isEnter: function (e) { var modifiers = e.ctrlKey || e.altKey || e.metaKey || e.shiftKey; return !modifiers && (e.keyCode === 13 || e.keyCode === 9 || (this.option.completeOnSpace === true && e.keyCode === 32)) // ENTER, TAB }, isPageup: function (e) { return e.keyCode === 33; // PAGEUP }, isPagedown: function (e) { return e.keyCode === 34; // PAGEDOWN }, isEscape: function (e) { return e.keyCode === 27; // ESCAPE }, // Private properties // ------------------ _data: null, // Currently shown zipped data. _index: null, _$header: null, _$footer: null, // Private methods // --------------- _bindEvents: function () { this.$el.on('touchstart.' + this.id, '.textcomplete-item', $.proxy(this._onClick, this)); this.$el.on('mousedown.' + this.id, '.textcomplete-item', $.proxy(this._onClick, this)); this.$el.on('mouseover.' + this.id, '.textcomplete-item', $.proxy(this._onMouseover, this)); this.$inputEl.on('keydown.' + this.id, $.proxy(this._onKeydown, this)); }, _onClick: function (e) { var $el = $(e.target); e.stopPropagation(); e.preventDefault(); e.originalEvent.keepTextCompleteDropdown = this.id; if (!$el.hasClass('textcomplete-item')) { $el = $el.closest('.textcomplete-item'); } var datum = this.data[parseInt($el.data('index'), 10)]; this.completer.select(datum.value, datum.strategy); var self = this; // Deactive at next tick to allow other event handlers to know whether // the dropdown has been shown or not. setTimeout(function () { self.deactivate(); }, 0); }, // Activate hovered item. _onMouseover: function (e) { var $el = $(e.target); e.preventDefault(); if (!$el.hasClass('textcomplete-item')) { $el = $el.closest('.textcomplete-item'); } this._index = parseInt($el.data('index'), 10); this._activateIndexedItem(); }, _onKeydown: function (e) { if (!this.shown) { return; } if (this.isUp(e)) { e.preventDefault(); this._up(); } else if (this.isDown(e)) { e.preventDefault(); this._down(); } else if (this.isEnter(e)) { e.preventDefault(); this._enter(); } else if (this.isPageup(e)) { e.preventDefault(); this._pageup(); } else if (this.isPagedown(e)) { e.preventDefault(); this._pagedown(); } else if (this.isEscape(e)) { e.preventDefault(); this.deactivate(); } }, _up: function () { if (this._index === 0) { this._index = this.data.length - 1; } else { this._index -= 1; } this._activateIndexedItem(); this._setScroll(); }, _down: function () { if (this._index === this.data.length - 1) { this._index = 0; } else { this._index += 1; } this._activateIndexedItem(); this._setScroll(); }, _enter: function () { var datum = this.data[parseInt(this._getActiveElement().data('index'), 10)]; this.completer.select(datum.value, datum.strategy); this.deactivate(); }, _pageup: function () { var target = 0; var threshold = this._getActiveElement().position().top - this.$el.innerHeight(); this.$el.children().each(function (i) { if ($(this).position().top + $(this).outerHeight() > threshold) { target = i; return false; } }); this._index = target; this._activateIndexedItem(); this._setScroll(); }, _pagedown: function () { var target = this.data.length - 1; var threshold = this._getActiveElement().position().top + this.$el.innerHeight(); this.$el.children().each(function (i) { if ($(this).position().top > threshold) { target = i; return false } }); this._index = target; this._activateIndexedItem(); this._setScroll(); }, _activateIndexedItem: function () { this.$el.find('.textcomplete-item.active').removeClass('active'); this._getActiveElement().addClass('active'); }, _getActiveElement: function () { return this.$el.children('.textcomplete-item:nth(' + this._index + ')'); }, _setScroll: function () { var $activeEl = this._getActiveElement(); var itemTop = $activeEl.position().top; var itemHeight = $activeEl.outerHeight(); var visibleHeight = this.$el.innerHeight(); var visibleTop = this.$el.scrollTop(); if (this._index === 0 || this._index == this.data.length - 1 || itemTop < 0) { this.$el.scrollTop(itemTop + visibleTop); } else if (itemTop + itemHeight > visibleHeight) { this.$el.scrollTop(itemTop + itemHeight + visibleTop - visibleHeight); } }, _buildContents: function (zippedData) { var datum, i, index; var item = []; var html = ''; for (i = 0; i < zippedData.length; i++) { if (this.data.length === this.maxCount) break; datum = zippedData[i]; if (include(this.data, datum)) { continue; } index = this.data.length; this.data.push(datum); item.push(datum.strategy.template(datum.value)); } if(typeof upSideDown != 'undefined' && upSideDown) { for (i = item.length - 1; i >= 0; i--) { html += '<li class="textcomplete-item" data-index="' + i + '"><a>'; html += item[i]; html += '</a></li>'; } this._index = this.data.length - 1; } else { for (i = 0; i < item.length; i++) { html += '<li class="textcomplete-item" data-index="' + i + '"><a>'; html += item[i]; html += '</a></li>'; } } return html; }, _renderHeader: function (unzippedData) { if (this.header) { if (!this._$header) { this._$header = $('<li class="textcomplete-header"></li>').prependTo(this.$el); } var html = $.isFunction(this.header) ? this.header(unzippedData) : this.header; this._$header.html(html); } }, _renderFooter: function (unzippedData) { if (this.footer) { if (!this._$footer) { this._$footer = $('<li class="textcomplete-footer"></li>').appendTo(this.$el); } var html = $.isFunction(this.footer) ? this.footer(unzippedData) : this.footer; this._$footer.html(html); } }, _renderContents: function (html) { if (this._$footer) { this._$footer.before(html); } else { this.$el.append(html); } }, _applyPlacement: function (position) { // If the 'placement' option set to 'top', move the position above the element. if (this.placement.indexOf('top') !== -1) { // Overwrite the position object to set the 'bottom' property instead of the top. position = { top: 'auto', bottom: this.$el.parent().height() - position.top + position.lineHeight, left: position.left }; } else { position.bottom = 'auto'; delete position.lineHeight; } if (this.placement.indexOf('absleft') !== -1) { position.left = 0; } else if (this.placement.indexOf('absright') !== -1) { position.right = 0; position.left = 'auto'; } return position; } }); $.fn.textcomplete.Dropdown = Dropdown; }(jQuery); +function ($) { 'use strict'; // Memoize a search function. var memoize = function (func) { var memo = {}; return function (term, callback) { if (memo[term]) { callback(memo[term]); } else { func.call(this, term, function (data) { memo[term] = (memo[term] || []).concat(data); callback.apply(null, arguments); }); } }; }; function Strategy(options) { $.extend(this, options); if (this.cache) { this.search = memoize(this.search); } } Strategy.parse = function (optionsArray) { return $.map(optionsArray, function (options) { return new Strategy(options); }); }; $.extend(Strategy.prototype, { // Public properties // ----------------- // Required match: null, replace: null, search: null, // Optional cache: false, context: function () { return true; }, index: 2, template: function (obj) { return obj; }, idProperty: null }); $.fn.textcomplete.Strategy = Strategy; }(jQuery); +function ($) { 'use strict'; var now = Date.now || function () { return new Date().getTime(); }; // Returns a function, that, as long as it continues to be invoked, will not // be triggered. The function will be called after it stops being called for // `wait` msec. // // This utility function was originally implemented at Underscore.js. var debounce = function (func, wait) { var timeout, args, context, timestamp, result; var later = function () { var last = now() - timestamp; if (last < wait) { timeout = setTimeout(later, wait - last); } else { timeout = null; result = func.apply(context, args); context = args = null; } }; return function () { context = this; args = arguments; timestamp = now(); if (!timeout) { timeout = setTimeout(later, wait); } return result; }; }; function Adapter () {} $.extend(Adapter.prototype, { // Public properties // ----------------- id: null, // Identity. completer: null, // Completer object which creates it. el: null, // Textarea element. $el: null, // jQuery object of the textarea. option: null, // Public methods // -------------- initialize: function (element, completer, option) { this.el = element; this.$el = $(element); this.id = completer.id + this.constructor.name; this.completer = completer; this.option = option; if (this.option.debounce) { this._onKeyup = debounce(this._onKeyup, this.option.debounce); } this._bindEvents(); }, destroy: function () { this.$el.off('.' + this.id); // Remove all event handlers. this.$el = this.el = this.completer = null; }, // Update the element with the given value and strategy. // // value - The selected object. It is one of the item of the array // which was callbacked from the search function. // strategy - The Strategy associated with the selected value. select: function (/* value, strategy */) { throw new Error('Not implemented'); }, // Returns the caret's relative coordinates from body's left top corner. // // FIXME: Calculate the left top corner of `this.option.appendTo` element. getCaretPosition: function () { //var position = this._getCaretRelativePosition(); //var offset = this.$el.offset(); //var offset = $('.CodeMirror-cursor').offset(); var position = $('.CodeMirror-cursor').position(); var menu = $('.cursor-menu .dropdown-menu'); var offsetLeft = parseFloat(menu.attr('data-offset-left')); var offsetTop = parseFloat(menu.attr('data-offset-top')); position.left += offsetLeft; position.top += offsetTop; return position; }, // Focus on the element. focus: function () { this.$el.focus(); }, // Private methods // --------------- _bindEvents: function () { this.$el.on('keyup.' + this.id, $.proxy(this._onKeyup, this)); }, _onKeyup: function (e) { if (this._skipSearch(e)) { return; } this.completer.trigger(this.getTextFromHeadToCaret(), true); }, // Suppress searching if it returns true. _skipSearch: function (clickEvent) { switch (clickEvent.keyCode) { case 13: // ENTER case 40: // DOWN case 38: // UP return true; } if (clickEvent.ctrlKey) switch (clickEvent.keyCode) { case 78: // Ctrl-N case 80: // Ctrl-P return true; } } }); $.fn.textcomplete.Adapter = Adapter; }(jQuery); +function ($) { 'use strict'; // Textarea adapter // ================ // // Managing a textarea. It doesn't know a Dropdown. function Textarea(element, completer, option) { this.initialize(element, completer, option); } Textarea.DIV_PROPERTIES = { left: -9999, position: 'absolute', top: 0, whiteSpace: 'pre-wrap' } Textarea.COPY_PROPERTIES = [ 'border-width', 'font-family', 'font-size', 'font-style', 'font-variant', 'font-weight', 'height', 'letter-spacing', 'word-spacing', 'line-height', 'text-decoration', 'text-align', 'width', 'padding-top', 'padding-right', 'padding-bottom', 'padding-left', 'margin-top', 'margin-right', 'margin-bottom', 'margin-left', 'border-style', 'box-sizing', 'tab-size' ]; $.extend(Textarea.prototype, $.fn.textcomplete.Adapter.prototype, { // Public methods // -------------- // Update the textarea with the given value and strategy. select: function (value, strategy) { /* var pre = this.getTextFromHeadToCaret(); var post = this.el.value.substring(this.el.selectionEnd); var newSubstr = strategy.replace(value); if ($.isArray(newSubstr)) { post = newSubstr[1] + post; newSubstr = newSubstr[0]; } pre = pre.replace(strategy.match, newSubstr); this.$el.val(pre + post); this.el.selectionStart = this.el.selectionEnd = pre.length; */ var cursor = editor.getCursor(); var pre = editor.getLine(cursor.line).slice(0, cursor.ch); var match = pre.match(strategy.match); if (!match) return; pre = match[0]; var newSubstr = strategy.replace(value); newSubstr = pre.replace(strategy.match, newSubstr); editor.replaceRange(newSubstr, {line:cursor.line, ch:match.index}, {line:cursor.line, ch:match.index + match[0].length}, "+input"); if(strategy.done) strategy.done(); }, // Private methods // --------------- // Returns the caret's relative coordinates from textarea's left top corner. // // Browser native API does not provide the way to know the position of // caret in pixels, so that here we use a kind of hack to accomplish // the aim. First of all it puts a dummy div element and completely copies // the textarea's style to the element, then it inserts the text and a // span element into the textarea. // Consequently, the span element's position is the thing what we want. _getCaretRelativePosition: function () { var dummyDiv = $('<div></div>').css(this._copyCss()) .text(this.getTextFromHeadToCaret()); var span = $('<span></span>').text('.').appendTo(dummyDiv); this.$el.before(dummyDiv); var position = span.position(); position.top += span.height() - this.$el.scrollTop(); position.lineHeight = span.height(); dummyDiv.remove(); return position; }, _copyCss: function () { return $.extend({ // Set 'scroll' if a scrollbar is being shown; otherwise 'auto'. overflow: this.el.scrollHeight > this.el.offsetHeight ? 'scroll' : 'auto' }, Textarea.DIV_PROPERTIES, this._getStyles()); }, _getStyles: (function ($) { var color = $('<div></div>').css(['color']).color; if (typeof color !== 'undefined') { return function () { return this.$el.css(Textarea.COPY_PROPERTIES); }; } else { // jQuery < 1.8 return function () { var $el = this.$el; var styles = {}; $.each(Textarea.COPY_PROPERTIES, function (i, property) { styles[property] = $el.css(property); }); return styles; }; } })($), getTextFromHeadToCaret: function () { return this.el.value.substring(0, this.el.selectionEnd); } }); $.fn.textcomplete.Textarea = Textarea; }(jQuery); +function ($) { 'use strict'; var sentinelChar = '吶'; function IETextarea(element, completer, option) { this.initialize(element, completer, option); $('<span>' + sentinelChar + '</span>').css({ position: 'absolute', top: -9999, left: -9999 }).insertBefore(element); } $.extend(IETextarea.prototype, $.fn.textcomplete.Textarea.prototype, { // Public methods // -------------- select: function (value, strategy) { var pre = this.getTextFromHeadToCaret(); var post = this.el.value.substring(pre.length); var newSubstr = strategy.replace(value); if ($.isArray(newSubstr)) { post = newSubstr[1] + post; newSubstr = newSubstr[0]; } pre = pre.replace(strategy.match, newSubstr); this.$el.val(pre + post); this.el.focus(); var range = this.el.createTextRange(); range.collapse(true); range.moveEnd('character', pre.length); range.moveStart('character', pre.length); range.select(); }, getTextFromHeadToCaret: function () { this.el.focus(); var range = document.selection.createRange(); range.moveStart('character', -this.el.value.length); var arr = range.text.split(sentinelChar) return arr.length === 1 ? arr[0] : arr[1]; } }); $.fn.textcomplete.IETextarea = IETextarea; }(jQuery); // NOTE: TextComplete plugin has contenteditable support but it does not work // fine especially on old IEs. // Any pull requests are REALLY welcome. +function ($) { 'use strict'; // ContentEditable adapter // ======================= // // Adapter for contenteditable elements. function ContentEditable (element, completer, option) { this.initialize(element, completer, option); } $.extend(ContentEditable.prototype, $.fn.textcomplete.Adapter.prototype, { // Public methods // -------------- // Update the content with the given value and strategy. // When an dropdown item is selected, it is executed. select: function (value, strategy) { var pre = this.getTextFromHeadToCaret(); var sel = window.getSelection() var range = sel.getRangeAt(0); var selection = range.cloneRange(); selection.selectNodeContents(range.startContainer); var content = selection.toString(); var post = content.substring(range.startOffset); var newSubstr = strategy.replace(value); if ($.isArray(newSubstr)) { post = newSubstr[1] + post; newSubstr = newSubstr[0]; } pre = pre.replace(strategy.match, newSubstr); range.selectNodeContents(range.startContainer); range.deleteContents(); var node = document.createTextNode(pre + post); range.insertNode(node); range.setStart(node, pre.length); range.collapse(true); sel.removeAllRanges(); sel.addRange(range); }, // Private methods // --------------- // Returns the caret's relative position from the contenteditable's // left top corner. // // Examples // // this._getCaretRelativePosition() // //=> { top: 18, left: 200, lineHeight: 16 } // // Dropdown's position will be decided using the result. _getCaretRelativePosition: function () { var range = window.getSelection().getRangeAt(0).cloneRange(); var node = document.createElement('span'); range.insertNode(node); range.selectNodeContents(node); range.deleteContents(); var $node = $(node); var position = $node.offset(); position.left -= this.$el.offset().left; position.top += $node.height() - this.$el.offset().top; position.lineHeight = $node.height(); $node.remove(); var dir = this.$el.attr('dir') || this.$el.css('direction'); if (dir === 'rtl') { position.left -= this.listView.$el.width(); } return position; }, // Returns the string between the first character and the caret. // Completer will be triggered with the result for start autocompleting. // // Example // // // Suppose the html is '<b>hello</b> wor|ld' and | is the caret. // this.getTextFromHeadToCaret() // // => ' wor' // not '<b>hello</b> wor' getTextFromHeadToCaret: function () { var range = window.getSelection().getRangeAt(0); var selection = range.cloneRange(); selection.selectNodeContents(range.startContainer); return selection.toString().substring(0, range.startOffset); } }); $.fn.textcomplete.ContentEditable = ContentEditable; }(jQuery);
zackexplosion/HackMD
public/vendor/jquery-textcomplete/jquery.textcomplete.js
JavaScript
mit
35,475
// Future versions of Hyper may add additional config options, // which will not automatically be merged into this file. // See https://hyper.is#cfg for all currently supported options. module.exports = { config: { // choose either `'stable'` for receiving highly polished, // or `'canary'` for less polished but more frequent updates updateChannel: 'stable', // default font size in pixels for all tabs fontSize: 12, // font family with optional fallbacks fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace', // default font weight: 'normal' or 'bold' fontWeight: 'normal', // font weight for bold characters: 'normal' or 'bold' fontWeightBold: 'bold', // terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk) cursorColor: 'rgba(248,28,229,0.8)', // terminal text color under BLOCK cursor cursorAccentColor: '#000', // `'BEAM'` for |, `'UNDERLINE'` for _, `'BLOCK'` for █ cursorShape: 'BLOCK', // set to `true` (without backticks and without quotes) for blinking cursor cursorBlink: false, // color of the text foregroundColor: '#fff', // terminal background color // opacity is only supported on macOS backgroundColor: '#000', // terminal selection color selectionColor: 'rgba(248,28,229,0.3)', // border color (window, tabs) borderColor: '#333', // custom CSS to embed in the main window css: '', // custom CSS to embed in the terminal window termCSS: '', // if you're using a Linux setup which show native menus, set to false // default: `true` on Linux, `true` on Windows, ignored on macOS showHamburgerMenu: '', // set to `false` (without backticks and without quotes) if you want to hide the minimize, maximize and close buttons // additionally, set to `'left'` if you want them on the left, like in Ubuntu // default: `true` (without backticks and without quotes) on Windows and Linux, ignored on macOS showWindowControls: '', // custom padding (CSS format, i.e.: `top right bottom left`) padding: '12px 14px', // the full list. if you're going to provide the full color palette, // including the 6 x 6 color cubes and the grayscale map, just provide // an array here instead of a color map object colors: { black: '#000000', red: '#C51E14', green: '#1DC121', yellow: '#C7C329', blue: '#0A2FC4', magenta: '#C839C5', cyan: '#20C5C6', white: '#C7C7C7', lightBlack: '#686868', lightRed: '#FD6F6B', lightGreen: '#67F86F', lightYellow: '#FFFA72', lightBlue: '#6A76FB', lightMagenta: '#FD7CFC', lightCyan: '#68FDFE', lightWhite: '#FFFFFF', }, // the shell to run when spawning a new session (i.e. /usr/local/bin/fish) // if left empty, your system's login shell will be used by default // // Windows // - Make sure to use a full path if the binary name doesn't work // - Remove `--login` in shellArgs // // Bash on Windows // - Example: `C:\\Windows\\System32\\bash.exe` // // PowerShell on Windows // - Example: `C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe` shell: '/usr/local/bin/zsh', // for setting shell arguments (i.e. for using interactive shellArgs: `['-i']`) // by default `['--login']` will be used shellArgs: ['--login'], // for environment variables env: {}, // set to `false` for no bell bell: 'SOUND', // if `true` (without backticks and without quotes), selected text will automatically be copied to the clipboard copyOnSelect: false, // if `true` (without backticks and without quotes), hyper will be set as the default protocol client for SSH defaultSSHApp: true, // if `true` (without backticks and without quotes), on right click selected text will be copied or pasted if no // selection is present (`true` by default on Windows and disables the context menu feature) // quickEdit: true, // URL to custom bell // bellSoundURL: 'http://example.com/bell.mp3', // for advanced config flags please refer to https://hyper.is/#cfg opacity: 0.88, }, // a list of plugins to fetch and install from npm // format: [@org/]project[#version] // examples: // `hyperpower` // `@company/project` // `project#1.0.1` plugins: ["hyper-search", "hyper-opacity"], // in development, you can create a directory under // `~/.hyper_plugins/local/` and include it here // to load it and avoid it being `npm install`ed localPlugins: [], keymaps: { // Example // 'window:devtools': 'cmd+alt+o', }, };
shinoyu/dotfiles
configs/hyper/hyper.js
JavaScript
mit
4,748
import '@babel/polyfill'; import 'app-module-path/register'; import 'dotenv/config'; import bodyParser from 'body-parser'; import cookieParser from 'cookie-parser'; import cors from 'cors'; import express from 'express'; import favicon from 'serve-favicon'; import logger from 'morgan'; import path from 'path'; import { addPath } from 'app-module-path'; import api from './routes'; const app = express(); // view engine setup app.set('views', path.join(__dirname, '../views')); app.set('view engine', 'pug'); app.use(favicon(path.join(__dirname, '../public', 'favicon.ico'))); app.use(logger(process.env.MORGAN_FMT)); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: false })); app.use(cookieParser()); app.use(cors()); app.use(express.static(path.join(__dirname, '../public'))); addPath(__dirname); /* use RESTful APIs listing. */ app.use('/api', api); /* use for admin app. */ app.get(['/admin', '/admin/*'], (req, res) => { res.render('index', { title: 'MERNjs - Admin', name: 'description', content: 'content', stylesheet: app.get('env') === 'production' ? '/dist/admin.bundle.min.css' : '/dist/admin.bundle.css', javascript: app.get('env') === 'production' ? '/dist/admin.bundle.min.js' : '/dist/admin.bundle.js', }); }); /* use for default app. */ app.get('*', (req, res) => { res.render('index', { title: 'MERNjs', name: 'description', content: 'content', stylesheet: app.get('env') === 'production' ? '/dist/client.bundle.min.css' : '/dist/client.bundle.css', javascript: app.get('env') === 'production' ? '/dist/client.bundle.min.js' : '/dist/client.bundle.js', }); }); // error handler // eslint-disable-next-line no-unused-vars app.use((err, req, res, next) => { res.status(err.status || 500); if (req.app.get('env') === 'production') { res.json({ message: err.message, error: {}, }); } else { res.json({ message: err.message, error: err, }); } }); export default app;
IamMohaiminul/MERN
server/app.js
JavaScript
mit
2,007
"use strict"; exports.login = (conn, req) => { let sql = `select * from admin where username='${req.body.username}' and password='${req.body.password}'`; return new promise((resolve, reject) => { conn.query(sql, (err, rows) => { conn.release(); if (err) { reject(); } else { resolve(rows); } }); }); }
yuankuomg/movie
module/loginModule.js
JavaScript
mit
410
$(document).ready(function() { var token = $( 'meta[name="csrf-token"]' ).attr( 'content' ); $.ajaxSetup( { beforeSend: function ( xhr ) { xhr.setRequestHeader( 'X-CSRF-Token', token ); } }); $('#create_attended_concert').submit(function(event) { event.preventDefault(); var form = $(this).closest("form"); var concertId = form.find('#concert').val(); var userId = form.find('#user').val(); var authenticity = form.find('input[name=authenticity_token]').val(); $.post('/attended_concerts', { user_id: userId, concert_id: concertId, authenticity_token: authenticity}) .done(function(data) { console.log(data); $('#flash').append('<div class="alert alert-success">' + data + '</div>'); $('#add_attendee_btn').replaceWith("<div id='buttons' style='margin-right: 2.12766%'><button class='added'><h4>I attended this concert</h4></button></div>"); }); }); $('.report-video').on('click', function(e) { e.preventDefault(); var $this = $(this); var videoId = $this.data('video-id'); if ($this.text() == "Report Video") { $.post('/flag_video', { video_id: videoId }) .done(function(resp) { $this.closest('.video-container').addClass('flagged'); $this.closest('span').empty(); $this.text("Unflag"); }) } else { $.post('/unflag_video', { video_id: videoId}) .done(function(resp) { $this.closest('.video-container').removeClass('flagged'); $this.text("Report Video"); }) } }) });
fiddler-crabs-2014/encore
app/assets/javascripts/concerts.js
JavaScript
mit
1,650
import _extends from "@babel/runtime/helpers/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties"; import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import withStyles from '../styles/withStyles'; import Fade from '../Fade'; export var styles = { /* Styles applied to the root element. */ root: { zIndex: -1, position: 'fixed', right: 0, bottom: 0, top: 0, left: 0, backgroundColor: 'rgba(0, 0, 0, 0.5)', // Remove grey highlight WebkitTapHighlightColor: 'transparent', // Disable scroll capabilities. touchAction: 'none' }, /* Styles applied to the root element if `invisible={true}`. */ invisible: { backgroundColor: 'transparent' } }; var Backdrop = React.forwardRef(function Backdrop(props, ref) { var classes = props.classes, className = props.className, _props$invisible = props.invisible, invisible = _props$invisible === void 0 ? false : _props$invisible, open = props.open, transitionDuration = props.transitionDuration, other = _objectWithoutProperties(props, ["classes", "className", "invisible", "open", "transitionDuration"]); return React.createElement(Fade, _extends({ in: open, timeout: transitionDuration }, other), React.createElement("div", { className: clsx(classes.root, invisible && classes.invisible, className), "aria-hidden": true, ref: ref })); }); process.env.NODE_ENV !== "production" ? Backdrop.propTypes = { /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * @ignore */ className: PropTypes.string, /** * If `true`, the backdrop is invisible. * It can be used when rendering a popover or a custom select component. */ invisible: PropTypes.bool, /** * If `true`, the backdrop is open. */ open: PropTypes.bool.isRequired, /** * The duration for the transition, in milliseconds. * You may specify a single timeout for all transitions, or individually with an object. */ transitionDuration: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({ enter: PropTypes.number, exit: PropTypes.number })]) } : void 0; export default withStyles(styles, { name: 'MuiBackdrop' })(Backdrop);
pcclarke/civ-techs
node_modules/@material-ui/core/esm/Backdrop/Backdrop.js
JavaScript
mit
2,393
var node = {}; var modules = ['child_process', 'fs', 'http', 'https', 'cluster', 'crypto', 'dns', 'domain', 'net', 'url', 'util', 'vm', 'path', 'events' ]; var loadedModules = {}; modules.forEach(function(moduleName) { Object.defineProperty(node, moduleName, { get: function() { if (!loadedModules[moduleName]) { loadedModules[moduleName] = require(moduleName); } return loadedModules[moduleName]; } }); }); module.exports = node; global.node = node;
Paxa/postbird
lib/node_lib.js
JavaScript
mit
496
import { createApi } from '@ajax' import { mockURL, /* baseURL, */ path } from '@config' const prefix = 'usercenter' const option = { baseURL: mockURL } // 模块管理 export const fetchModuleList = createApi(`${path}/${prefix}/resource/list`, option) // 获取模块列表 export const fetchModuleDelete = createApi(`${path}/${prefix}/resource/delete`, option) // 删除模块 export const fetchModuleDetail = createApi(`${path}/${prefix}/resource/detail`, option) // 获取模块详情 export const fetchChangeModuleStatus = createApi(`${path}/${prefix}/resource/updateStatus`, option) // 修改模块显隐状态 export const fetchModuleUpdateDetail = createApi(`${path}/${prefix}/resource/update`, option) // 修改模块详情 export const fetchModuleAdd = createApi(`${path}/${prefix}/resource/save`, option) // 新增模块 export const fetchButtonList = createApi(`${path}/${prefix}/resource/button/list`, option) // 按钮权限列表 // 角色管理 export const fetchRoleList = createApi(`${path}/${prefix}/role/list`, option) // 角色列表 export const fetchRoleAdd = createApi(`${path}/${prefix}/role/save`, option) // 保存角色 export const fetchRoleUpdate = createApi(`${path}/${prefix}/role/update`, option) // 角色编辑 export const fetchRoleDetail = createApi(`${path}/${prefix}/role/detail`, option) // 已选择的菜单以及按钮 export const fetchRoleDelete = createApi(`${path}/${prefix}/role/delete`, option) // 删除角色 export const fetchModuleListInRole = createApi(`${path}/${prefix}/role/resList`, option) // 已选择的模块 export const fetchUpdateRoleRes = createApi(`${path}/${prefix}/role/updateRes`, option) // 更新已选择的模块 export const fetchRoleDeletePeople = createApi(`${path}/${prefix}/user/removeRole`, option) export const fetchUpdateButton = createApi(`${path}/${prefix}/role/updateButton`, option) export const fetchTreeList = createApi(`${path}/${prefix}/role/resTree`, option) // 用户管理 export const fetchUserDepttList = createApi(`${path}/${prefix}/dept/list`, option) // 获取用户管理左侧分类列表 export const fetchUserList = createApi(`${path}/${prefix}/user/list`, option) // 获取用户列表 export const fetchUserDetail = createApi(`${path}/${prefix}/user/detail`, option) // 获取用户详情 export const fetchUserDetailUpdate = createApi(`${path}/${prefix}/user/update`, option) // 修改用户详情 export const fetchUserAdd = createApi(`${path}/${prefix}/user/save`, option) // 新增用户 export const synUser = createApi(`${path}/${prefix}/user/synUser`, option) // 同步用户 export const fetchUserSetRole = createApi(`${path}/${prefix}/user/updateRole`, option) // 修改用户角色 export const fetchUserDelete = createApi(`${path}/${prefix}/user/delete`, option) // 删除用户 export const fetchChangeUserStatus = createApi(`${path}/${prefix}/user/updateStatus`, option) // 设置用户是否冻结状态
duxianwei520/react
app/apis/manage.js
JavaScript
mit
2,927
import firebase from 'firebase/app'; import { createUser, ensureAuth } from './helpers'; import { FirebaseProviderAuthenticationError } from './errors'; export default function signInWithGoogle(options) { return ensureAuth().then(() => { const scopes = options.scopes || []; const redirect = options.redirect || false; const provider = new firebase.auth.GoogleAuthProvider(); scopes.forEach(scope => { provider.addScope(scope); }); return new Promise((resolve, reject) => { if (redirect) { firebase.auth().signInWithRedirect(provider); resolve(); } else { firebase .auth() .signInWithPopup(provider) .then( result => { const user = createUser(result.user); user.accessToken = result.credential.accessToken; resolve(createUser(user)); }, error => { reject(new FirebaseProviderAuthenticationError(error)); } ); } }); }); }
JohannesAnd/SKWebsite
client/providers/Firebase/src/signInWithGoogle.js
JavaScript
mit
1,049
"use strict"; const EventEmitter = require('events'); const evts = new EventEmitter(); const env = require('../../env'); const outsideConditions = require('./outsideConditions'); const insideConditions = require('./insideConditions'); let currentValues = { inside: { temperature: '-', humidity: '-' }, outside: { temperature: '-', humidity: '-' } }; let outData = outsideConditions.get(); currentValues.outside.temperature = outData.temperature; currentValues.outside.humidity = outData.humidity; outsideConditions.evts.on('change', (data) => { currentValues.outside.temperature = data.temperature; currentValues.outside.humidity = data.humidity; evts.emit('change', currentValues); }); let inData = insideConditions.get(); currentValues.inside.temperature = inData.temperature; currentValues.inside.humidity = inData.humidity; insideConditions.evts.on('change', (data) => { currentValues.inside.temperature = data.temperature; currentValues.inside.humidity = data.humidity; evts.emit('change', currentValues); }); exports.get = function () { return currentValues; }; exports.evts = evts;
roland-vachter/heating-control-rpi
app/modules/ambientalConditions.js
JavaScript
mit
1,120
// Represents the Topic model class Topic { constructor(data) { for(var key in data) { this[key] = data[key]; } } }; module.exports = Topic;
tonekk/topics-challenge
assets/js/topic.js
JavaScript
mit
160
(function () { 'use strict'; angular .module('app') .controller('Projects.IndexController', Controller) .controller('Projects.AddProjectController', AddProjectController) .controller('Projects.ViewProjectModel', ViewProjectModel) .controller('Projects.AssignUsersController', AssignUsersController) .controller('Projects.AssignUserModel', AssignUserModel) .controller('Projects.ClientModel', ClientModel) .controller('Projects.ClientsController', ClientsController) .controller('Projects.ProjectUsersController', ProjectUsersController) .controller('Projects.UserProjectsController', UserProjectsController) .controller('Projects.projectHierarchyController', projectHierarchyController) .filter('searchProject', searchProject) function Controller(UserService, ProjectService, $filter, _, FlashService, NgTableParams, $uibModal, noty) { var vm = this; vm.enddateselect = 'all'; vm.isEnddateActive = ''; vm.user = {}; vm.clients = []; vm.projects = []; vm.projectTypes = [ { projectTypeId: "", projectTypeName: "All" }, { projectTypeId: "billed", projectTypeName: "Billed" }, { projectTypeId: "bizdev", projectTypeName: "Bizdev" }, { projectTypeId: "ops", projectTypeName: "ops" }, { projectTypeId: "sales", projectTypeName: "Sales" } ]; vm.projectBillTypes = [ { projectBillId: "", projectBillName: "All" }, { projectBillId: "fixed-bid", projectBillName: "Fixed bid" }, { projectBillId: "time-material", projectBillName: "Time and material" } ]; vm.projectBusinessUnits = ["All", "Launchpad", "Enterprise", "Operations", "Sales&Marketing", "SAS Products", "R&D", "iCancode-Training", "WL-Training", "Skill Up"]; function getProjects() { ProjectService.getAll().then(function (response) { vm.projects = response; console.log("vm.projects", vm.projects); }, function (error) { console.log(error); }); } vm.search = { clientId: "", projectName: "", projectBillType: "", projectType: "", businessUnit: "All", costAccount: "", isActive: true }; vm.projectColumns = { "clientName": { label: "Customer Name", selected: true }, "projectName": { label: "Project Name", selected: true }, "projectBillType": { label: "Project Bill Type", selected: false }, "projectType": { label: "Project Type", selected: false }, "businessUnit": { label: "Business Unit", selected: false }, "ownerName": { label: "Owner", selected: true }, "Status": { label: "Status", selected: false }, "costAccount": { label: "Cost Account", selected: true }, "startDate": { label: "Start Date", selected: false }, } vm.stopPropagation = function (e) { e.stopPropagation(); } function getClients() { ProjectService.getClients().then(function (response) { vm.clients = response; vm.clients.unshift({ _id: "", "clientName": "All" }); console.log("vm.clients", vm.clients); }, function (error) { console.log(error); }); } vm.viewProject = function (projectObj) { var modalInstance = $uibModal.open({ animation: true, ariaLabelledBy: 'modal-title', ariaDescribedBy: 'modal-body', templateUrl: 'projects/viewProjectModel.html', controller: 'Projects.ViewProjectModel', controllerAs: 'vm', size: 'lg', resolve: { projectObj: function () { return projectObj; } } }); modalInstance.result.then(function (projectObj) { }, function () { }); } vm.delProject = function (projectId) { ProjectService.delete(projectId).then(function (response) { getProjects(); }, function (error) { if (error) { vm.alerts.push({ msg: error, type: 'danger' }); } }); } initController(); function initController() { UserService.GetCurrent().then(function (user) { vm.user = user; if (vm.user.admin !== true) { } }); getClients(); getProjects(); } } function searchProject($filter) { return function (input, searchObj) { var output = input; if (searchObj.clientId && searchObj.clientId.length > 0) { output = $filter('filter')(output, { clientId: searchObj.clientId }); } if (searchObj.projectName && searchObj.projectName.length > 0) { output = $filter('filter')(output, { projectName: searchObj.projectName }); } if (searchObj.projectBillType && searchObj.projectBillType.length > 0) { output = $filter('filter')(output, { projectBillType: searchObj.projectBillType }); } if (searchObj.projectType && searchObj.projectType.length > 0) { output = $filter('filter')(output, { projectType: searchObj.projectType }); } if (searchObj.businessUnit && searchObj.businessUnit.length > 0 && searchObj.businessUnit != "All") { output = $filter('filter')(output, { businessUnit: searchObj.businessUnit }); } if (searchObj.ownerName && searchObj.ownerName.length > 0) { output = $filter('filter')(output, { ownerName: searchObj.ownerName }); } if (searchObj.isActive === true || searchObj.isActive === false) { output = $filter('filter')(output, { isActive: searchObj.isActive }); } if (searchObj.costAccount && searchObj.costAccount.length > 0) { output = $filter('filter')(output, { costAccount: searchObj.costAccount }); } return output; } } function AddProjectController($state, UserService, ProjectService, $stateParams, $filter, _, FlashService, noty, $uibModal) { var vm = this; vm.user = {}; vm.clients = []; var currentDay = new Date().getDay(); vm.open2 = function () { vm.popup2.opened = true; }; vm.popup2 = { opened: false }; vm.dateOptions = { formatYear: 'yy', maxDate: new Date(2030, 12, 31), startingDay: 1 }; vm.alerts = []; vm.closeAlert = function (index) { vm.alerts.splice(index, 1); }; vm.obj = { visibility: 'Private', isActive: true, billingCycle: 'M' }; vm.isNew = true; vm.projectTypes = [ { projectTypeId: "billed", projectTypeName: "Billed" }, { projectTypeId: "bizdev", projectTypeName: "Bizdev" }, { projectTypeId: "ops", projectTypeName: "ops" }, { projectTypeId: "sales", projectTypeName: "Sales" } ]; vm.projectBillTypes = [ { projectBillId: "fixed-bid", projectBillName: "Fixed bid" }, { projectBillId: "time-material", projectBillName: "Time and material" } ]; vm.projectBillTypes = [ { projectBillId: "fixed-bid", projectBillName: "Fixed bid" }, { projectBillId: "time-material", projectBillName: "Time and material" } ]; vm.projectBusinessUnits = ["Launchpad", "Enterprise", "Operations", "Sales&Marketing", "SAS Products", "R&D", "iCancode-Training", "WL-Training", "Skill Up"]; vm.getClients = function () { ProjectService.getClients().then(function (response) { vm.clients = response; }, function (error) { if (error) { vm.alerts.push({ msg: error, type: 'danger' }); } }); } function getAllUsers() { UserService.GetAll().then(function (users) { vm.users = users; vm.users = _.sortBy(vm.users, 'name'); if (!vm.isNew) { _.each(users, function (user) { if (user._id == vm.obj.ownerId) { vm.obj.user = user; }; }); } }); }; vm.getProject = function (projectId) { ProjectService.getById(projectId).then(function (response) { vm.obj = response; vm.obj.startDate = new Date(vm.obj.startDate); getAllUsers(); }, function (error) { if (error) { vm.alerts.push({ msg: error, type: 'danger' }); } }); } vm.saveProject = function (form) { if (form.$valid) { var clientObj = _.find(vm.clients, { _id: vm.obj.clientId }); if (clientObj) { vm.obj.clientName = clientObj.clientName; } vm.obj.ownerId = vm.obj.user._id; vm.obj.ownerName = vm.obj.user.name; if (vm.isNew) { ProjectService.create(vm.obj).then(function (response) { noty.showSuccess("New Project has been added successfully!"); $state.go('projects'); }, function (error) { if (error) { vm.alerts.push({ msg: error, type: 'danger' }); } }); } else { ProjectService.update(vm.obj).then(function (response) { noty.showSuccess("Project has been updated successfully!"); $state.go('projects'); }, function (error) { if (error) { vm.alerts.push({ msg: error, type: 'danger' }); } }); } } else { vm.alerts.push({ msg: "Please fill the required fields", type: 'danger' }); } } vm.viewClientModel = function (clientObj) { var client = {}; if (clientObj) { client = clientObj; client.isNew = false; } else { client.isNew = true; } var modalInstance = $uibModal.open({ animation: true, ariaLabelledBy: 'modal-title', ariaDescribedBy: 'modal-body', templateUrl: 'projects/addClientModel.html', controller: 'Projects.ClientModel', controllerAs: 'vm', size: 'md', resolve: { client: function () { return client; } } }); modalInstance.result.then(function (clientObj) { vm.getClients(); }, function () { vm.getClients(); }); } initController(); function initController() { UserService.GetCurrent().then(function (user) { vm.user = user; }); if ($stateParams.id) { vm.isNew = false; vm.getProject($stateParams.id); } else { vm.isNew = true; getAllUsers(); } vm.getClients(); } } function ViewProjectModel($uibModalInstance, ProjectService, noty, projectObj) { var vm = this; vm.alerts = []; vm.projectObj = projectObj; vm.assignedUsers = []; function getProjectAssignedUsersWithWorkedHours(projectId) { ProjectService.getAssignedUsersWithWorkedHours(projectId).then(function (response) { vm.assignedUsers = response; }, function (error) { console.log(error); }); } getProjectAssignedUsers(vm.projectObj._id); vm.closeBox = function () { $uibModalInstance.dismiss('cancel'); }; }; function AssignUsersController($state, UserService, ProjectService, $stateParams, noty, _, $uibModal) { var vm = this; vm.alerts = []; vm.project = {}; vm.users = []; vm.assignedUsers = []; vm.getProject = function (projectId) { ProjectService.getById(projectId).then(function (response) { vm.project = response; }, function (error) { if (error) { vm.alerts.push({ msg: error, type: 'danger' }); } }); } vm.getUsers = function () { UserService.getUsers().then(function (response) { vm.users = []; _.each(response, function (userObj) { console.log(userObj); vm.users.push({ userName: userObj.name, employeeId: userObj.employeeId, userId: userObj._id }); }); if ($stateParams.id) { vm.getAssignedUsers($stateParams.id); } }, function (error) { if (error) { vm.alerts.push({ msg: error, type: 'danger' }); } }); } vm.getAssignedUsers = function (projectId) { ProjectService.getAssignedUsers(projectId).then(function (response) { vm.assignedUsers = response; _.each(vm.assignedUsers, function (assignedUser) { var userIndex = _.findIndex(vm.users, { "userId": assignedUser.userId }); if (userIndex >= 0) { vm.users.splice(userIndex, 1); } }); }, function (error) { if (error) { vm.alerts.push({ msg: error, type: 'danger' }); } }); } vm.addColumn = function (user) { user.isNew = true; var modalInstance = $uibModal.open({ animation: true, ariaLabelledBy: 'modal-title', ariaDescribedBy: 'modal-body', templateUrl: 'projects/assignUserModel.html', controller: 'Projects.AssignUserModel', controllerAs: 'vm', size: 'lg', resolve: { user: function () { return user; }, project: function () { return vm.project; }, parentAlerts: function () { return vm.alerts; } } }); modalInstance.result.then(function (userObj) { vm.getAllUsers(); }, function () { //$log.info('Modal dismissed at: ' + new Date()); }); } vm.editAssignUser = function (user) { user.isNew = false; var modalInstance = $uibModal.open({ animation: true, ariaLabelledBy: 'modal-title', ariaDescribedBy: 'modal-body', templateUrl: 'projects/assignUserModel.html', controller: 'Projects.AssignUserModel', controllerAs: 'vm', size: 'lg', resolve: { user: function () { return user; }, project: function () { return vm.project; }, parentAlerts: function () { return vm.alerts; } } }); modalInstance.result.then(function (userObj) { vm.getAllUsers(); }, function () { vm.getAllUsers(); }); } vm.deleteAssignedUser = function (user) { ProjectService.unassignUser(vm.project._id, user.userId).then(function (response) { noty.showSuccess("Unassigned successfully!"); $state.go('projects'); }, function (error) { if (error) { vm.alerts.push({ msg: error, type: 'danger' }); } }); } init(); function init() { if ($stateParams.id) { vm.isNew = false; vm.getProject($stateParams.id); } else { vm.isNew = true; } vm.getUsers(); } } function AssignUserModel($uibModalInstance, ProjectService, UserService, noty, user, project, practices) { var vm = this; vm.alerts = []; vm.closeAlert = function (index) { vm.alerts.splice(index, 1); }; vm.enableSaveBtn = true; vm.resourceTypes = [ { "resourceTypeId": "shadow", "resourceTypeVal": "Shadow" }, { "resourceTypeId": "buffer", "resourceTypeVal": "Buffer" }, { "resourceTypeId": "billable", "resourceTypeVal": "Billable" }, { "resourceTypeId": "bizdev", "resourceTypeVal": "Bizdev" }, { "resourceTypeId": "projectDelivery", "resourceTypeVal": "Project Delivery" }, { "resourceTypeId": "internal", "resourceTypeVal": "Internal" }, { "resourceTypeId": "operations", "resourceTypeVal": "Operations" }, { "resourceTypeId": "trainee", "resourceTypeVal": "Trainee" }, { "resourceTypeId": "intern", "resourceTypeVal": "Intern" }, { "resourceTypeId": "bench", "resourceTypeVal": "Bench" } ]; vm.practices = practices; vm.users = []; vm.projects = []; vm.defaultSalesItemId = ""; vm.user = user; vm.user.chooseUser = false; if (!user.userId) { getUsers(); vm.user.chooseUser = true; } if (vm.user.billDates) { _.each(vm.user.billDates, function (billDate) { if (billDate.start) { billDate.start = new Date(billDate.start); } if (billDate.end) { billDate.end = new Date(billDate.end); } }); } vm.project = project; vm.project.chooseProject = false; if (!vm.project._id) { getProjects(); vm.project.chooseProject = true; } vm.selectedUser = {}; vm.selectedProject = {}; var currentDay = new Date().getDay(); vm.open2 = function () { vm.popup2.opened = true; }; vm.popup2 = { opened: false }; vm.dateOptions = { formatYear: 'yy', maxDate: new Date(2030, 12, 31), startingDay: 1 }; vm.addBillDate = function () { if (vm.user.userId && vm.user.userId) { vm.generateSalesItemId(); if (!vm.user.billDates) { vm.user.billDates = []; } vm.user.billDates.push({ "start": "", "end": "", "salesItemId": vm.defaultSalesItemId }); } else { vm.alerts.push({ msg: "Please select User or Project!", type: 'danger' }); } } vm.deleteBillDate = function (billDate, index) { vm.user.billDates.splice(index, 1); } vm.generateSalesItemId = function () { vm.defaultSalesItemId = ""; vm.defaultSalesItemId += (vm.project.client_info && vm.project.client_info.clientCode) ? vm.project.client_info.clientCode + ":" : ""; vm.defaultSalesItemId += (vm.project.projectCode) ? vm.project.projectCode + ":" : ""; vm.defaultSalesItemId += (vm.project.billingCycle) ? vm.project.billingCycle + ":" : ""; vm.defaultSalesItemId += (vm.user.employeeId) ? vm.user.employeeId : ""; } vm.selectAssignUser = function () { vm.user.userId = vm.selectedUser.userId; vm.user.employeeId = vm.selectedUser.employeeId; vm.generateSalesItemId(); } vm.selectAssignProject = function () { vm.generateSalesItemId(); } vm.generateSalesItemId(); vm.ok = function (form) { if (form.$valid) { vm.enableSaveBtn = false; var assignedUsers = []; assignedUsers.push(vm.user); ProjectService.assignUsers(vm.project._id, assignedUsers).then(function (response) { noty.showSuccess("Saved successfully!"); vm.enableSaveBtn = true; $uibModalInstance.close(vm.user); }, function (error) { if (error) { vm.alerts.push({ msg: error, type: 'danger' }); } vm.enableSaveBtn = true; $uibModalInstance.close(vm.user); }); } else { vm.enableSaveBtn = true; vm.alerts.push({ msg: "Please fill the required fields", type: 'danger' }); } }; vm.cancel = function () { $uibModalInstance.dismiss('cancel'); }; function getUsers() { UserService.getUsers().then(function (response) { vm.users = []; _.each(response, function (userObj) { vm.users.push({ userName: userObj.name, employeeId: userObj.employeeId, userId: userObj._id }); }); vm.users = _.sortBy(vm.users, 'userName'); vm.generateSalesItemId(); }, function (error) { if (error) { vm.alerts.push({ msg: error, type: 'danger' }); } }); } function getProjects() { ProjectService.getAll().then(function (response) { vm.projects = response; if (vm.user.projects && vm.user.projects.length > 0) { _.each(vm.user.projects, function (projectObj) { var prjIndex = _.findIndex(vm.projects, { _id: projectObj.projectId }); if (prjIndex >= 0) { vm.projects.splice(prjIndex, 1); } }); } vm.generateSalesItemId(); }, function (error) { console.log(error); }); } }; function ClientModel($uibModalInstance, ProjectService, noty, client) { var vm = this; vm.enableSaveBtn = true; vm.alerts = []; vm.client = client; vm.ok = function (form) { if (form.$valid) { vm.enableSaveBtn = false; if (vm.client.isNew === true) { ProjectService.createClient(vm.client).then(function (response) { noty.showSuccess("New Client has been created successfully!"); vm.enableSaveBtn = true; $uibModalInstance.close(vm.client); }, function (error) { if (error) { vm.alerts.push({ msg: error, type: 'danger' }); } vm.enableSaveBtn = true; $uibModalInstance.close(vm.client); }); } else { ProjectService.updateClient(vm.client).then(function (response) { noty.showSuccess("Client has been updated successfully!"); vm.enableSaveBtn = true; $uibModalInstance.close(vm.client); }, function (error) { if (error) { vm.alerts.push({ msg: error, type: 'danger' }); } vm.enableSaveBtn = true; $uibModalInstance.close(vm.client); }); } } else { vm.enableSaveBtn = true; vm.alerts.push({ msg: "Please fill the required fields", type: 'danger' }); } }; vm.cancel = function () { $uibModalInstance.dismiss('cancel'); }; }; function ClientsController(UserService, ProjectService, $uibModal, _) { var vm = this; vm.user = {}; vm.clients = []; function getClients() { ProjectService.getClients().then(function (response) { vm.clients = response; }, function (error) { console.log(error); }); } vm.delClient = function (clientId) { ProjectService.deleteClient(clientId).then(function (response) { getClients(); }, function (error) { if (error) { vm.alerts.push({ msg: error, type: 'danger' }); } }); } vm.viewClientModel = function (clientObj) { var client = {}; if (clientObj) { client = clientObj; client.isNew = false; } else { client.isNew = true; } var modalInstance = $uibModal.open({ animation: true, ariaLabelledBy: 'modal-title', ariaDescribedBy: 'modal-body', templateUrl: 'projects/addClientModel.html', controller: 'Projects.ClientModel', controllerAs: 'vm', size: 'md', resolve: { client: function () { return client; } } }); modalInstance.result.then(function (clientObj) { getClients(); }, function () { getClients(); }); } initController(); function initController() { UserService.GetCurrent().then(function (user) { vm.user = user; if (vm.user.admin !== true) { } }); getClients(); } }; function ProjectUsersController($scope, UserService, ProjectService, _, $filter, $uibModal) { var vm = this; vm.user = {}; vm.allProjects = []; vm.projects = []; vm.projectTypes = [ { projectTypeId: "all", projectTypeName: "All" }, { projectTypeId: "billed", projectTypeName: "Billed" }, { projectTypeId: "bizdev", projectTypeName: "Bizdev" }, { projectTypeId: "ops", projectTypeName: "ops" }, { projectTypeId: "sales", projectTypeName: "Sales" } ]; vm.projectBusinessUnits = ["All", "Launchpad", "Enterprise", "Operations", "Sales&Marketing", "SAS Products", "R&D", "iCancode-Training", "WL-Training", "Skill Up"]; vm.searchObj = { projectName: "", projectStatus: "Active", projectType: "all", businessUnit: "All", userStatus: "Active", projectAssignStatus: "Active" }; vm.userColumns = { "projectName": { label: "Project Name", selected: true }, "businessUnit": { label: "Business Unit", selected: true }, "projectType": { label: "Project Type", selected: true }, "ownerName": { label: "Owner Name", selected: true }, "userName": { label: "User Name", selected: true }, "start": { label: "Start Date", selected: true }, "end": { label: "End Date", selected: true }, "allocatedHours": { label: "Allocated Hours", selected: true }, "billableLimit": { label: "Billable Limit", selected: true }, "userResourceType": { label: "Resource Type", selected: true }, "isActive": { label: "Status", selected: true }, }; vm.practices = []; vm.sorting = function (orderBy) { if (vm.search.orderBy == orderBy) { vm.search.sortDESC = !vm.search.sortDESC; } else { vm.search.sortDESC = false; } vm.search.orderBy = orderBy; }; function getProjectUsers() { vm.Users = []; vm.BillDates = []; ProjectService.getProjectUsers().then(function (response) { vm.allProjects = response; vm.searchProjectUser(); }, function (error) { console.log(error); }); } $scope.$watch('vm.searchObj.projectName', function (newVal) { vm.searchProjectUser(); }); $scope.$watch('vm.searchObj.projectStatus', function (newVal) { vm.searchProjectUser(); }); $scope.$watch('vm.searchObj.businessUnit', function (newVal) { vm.searchProjectUser(); }); $scope.$watch('vm.searchObj.projectType', function (newVal) { vm.searchProjectUser(); }); $scope.$watch('vm.searchObj.userStatus', function (newVal) { vm.searchProjectUser(); }); $scope.$watch('vm.searchObj.projectAssignStatus', function (newVal) { vm.searchProjectUser(); }); vm.searchProjectUser = function () { var output = angular.copy(vm.allProjects); var currentDate = new Date(); if (vm.searchObj.projectName && vm.searchObj.projectName.length > 0) { output = $filter('filter')(output, { projectName: vm.searchObj.projectName }); } if (vm.searchObj.projectStatus && vm.searchObj.projectStatus != "All") { if (vm.searchObj.projectStatus == "Active") { output = $filter('filter')(output, { isActive: true }); } else if (vm.searchObj.projectStatus == "Inactive") { output = $filter('filter')(output, { isActive: false }); } } if (vm.searchObj.projectType && vm.searchObj.projectType.length > 0 && vm.searchObj.projectType != 'all') { output = $filter('filter')(output, function (item) { return (vm.searchObj.projectType == item.projectType); }); } if (vm.searchObj.businessUnit && vm.searchObj.businessUnit.length > 0 && vm.searchObj.businessUnit != "All") { output = $filter('filter')(output, { businessUnit: vm.searchObj.businessUnit }); } if (vm.searchObj.userStatus && vm.searchObj.userStatus != "All") { if (vm.searchObj.userStatus == "Active") { _.each(output, function (projectObj) { projectObj.users = $filter('filter')(projectObj.users, { isActive: true }); }); } else if (vm.searchObj.userStatus == "Inactive") { _.each(output, function (projectObj) { projectObj.users = $filter('filter')(projectObj.users, { isActive: false }); }); } _.each(output, function (projectObj) { projectObj.users = $filter('filter')(projectObj.users, function (userObj) { return (userObj.billDates && userObj.billDates.length > 0); }); }); } if (vm.searchObj.projectAssignStatus && vm.searchObj.projectAssignStatus == "Active") { _.each(output, function (projectObj) { _.each(projectObj.users, function (userObj) { userObj.billDates = $filter('filter')(userObj.billDates, function (billDateObj) { billDateObj.start = (billDateObj.start != "") ? new Date(billDateObj.start) : ""; billDateObj.end = (billDateObj.end != "") ? new Date(billDateObj.end) : ""; return ((billDateObj.start == "" && billDateObj.end == "") || (billDateObj.start == "" && billDateObj.end >= currentDate) || (billDateObj.end == "" && billDateObj.start <= currentDate) || (billDateObj.end != "" && billDateObj.start != "" && billDateObj.start <= currentDate && billDateObj.end >= currentDate)); }); }); }); _.each(output, function (projectObj) { projectObj.users = $filter('filter')(projectObj.users, function (userObj) { return (userObj.billDates && userObj.billDates.length > 0); }); }); } vm.projects = output; } vm.viewAssignUser = function (project, user) { if (!user) { var user = {}; user.isNew = true; } else { user.isNew = false; } var modalInstance = $uibModal.open({ animation: true, ariaLabelledBy: 'modal-title', ariaDescribedBy: 'modal-body', templateUrl: 'projects/assignUserModel.html', controller: 'Projects.AssignUserModel', controllerAs: 'vm', size: 'lg', resolve: { user: function () { return user; }, project: function () { return project; }, practices: function () { return vm.practices; } } }); modalInstance.result.then(function (userObj) { getProjectUsers(); }, function () { getProjectUsers(); }); } vm.getPractices = function () { UserService.getPractices().then(function (response) { vm.practices = response.practices; }, function (error) { if (error) { vm.alerts.push({ msg: error, type: 'danger' }); } }); } initController(); function initController() { UserService.GetCurrent().then(function (user) { vm.user = user; if (vm.user.admin !== true) { $state.go('home'); } }); getProjectUsers(); vm.getPractices(); } }; function UserProjectsController(UserService, ProjectService, _, $scope, $uibModal, $filter) { var vm = this; vm.user = {}; vm.users = []; vm.allUsers = []; vm.practices = []; vm.search = { userName: "", userResourceType: "", projectAssignStatus: "Active" }; function getUserProjects() { ProjectService.getUserProjects().then(function (response) { vm.allUsers = response; vm.searchUserProject(); }, function (error) { console.log(error); }); } $scope.$watch('vm.search.userName', function (newVal) { vm.searchUserProject(); }); $scope.$watch('vm.search.userResourceType', function (newVal) { vm.searchUserProject(); }); $scope.$watch('vm.search.projectAssignStatus', function (newVal) { vm.searchUserProject(); }); vm.searchUserProject = function () { var output = angular.copy(vm.allUsers); var currentDate = new Date(); if (vm.search.userName && vm.search.userName.length > 0) { output = $filter('filter')(output, { userName: vm.search.userName }); } if (vm.search.userResourceType && vm.search.userResourceType.length > 0) { output = $filter('filter')(output, function (item) { return (vm.search.userResourceType == item.userResourceType); }); } if (vm.search.projectAssignStatus && vm.search.projectAssignStatus == "Active") { _.each(output, function (userObj) { userObj.projects = $filter('filter')(userObj.projects, function (projectObj) { projectObj.billDates = $filter('filter')(projectObj.billDates, function (item) { item.start = (item.start) ? new Date(item.start) : ""; item.end = (item.end) ? new Date(item.end) : ""; if ((currentDate >= item.start && item.end == "") || (currentDate >= item.start && currentDate <= item.end) || (item.start == "" && currentDate <= item.end)) { return true; } return false; }); return (projectObj.billDates && projectObj.billDates.length > 0); }); }); } vm.users = output; } vm.viewAssignUser = function (user, project) { user.isNew = false; if (project) { user.billDates = project.billDates; project._id = project.projectId; } else { project = {}; } var modalInstance = $uibModal.open({ animation: true, ariaLabelledBy: 'modal-title', ariaDescribedBy: 'modal-body', templateUrl: 'projects/assignUserModel.html', controller: 'Projects.AssignUserModel', controllerAs: 'vm', size: 'lg', resolve: { user: function () { return user; }, project: function () { return project; }, practices: function () { return vm.practices; } } }); modalInstance.result.then(function (userObj) { getUserProjects(); }, function () { getUserProjects(); }); } vm.getPractices = function () { UserService.getPractices().then(function (response) { vm.practices = response.practices; }, function (error) { if (error) { vm.alerts.push({ msg: error, type: 'danger' }); } }); } initController(); function initController() { UserService.GetCurrent().then(function (user) { vm.user = user; if (vm.user.admin !== true) { $state.go('home'); } }); getUserProjects(); vm.getPractices(); } }; function projectHierarchyController(UserService, ProjectService, _, $uibModal) { var vm = this; vm.user = {}; vm.users = []; vm.projectOwnersArr = []; vm.projectNamesArr = []; vm.search = { userName: "", userResourceType: "" }; function getAllUsers() { UserService.GetAll().then(function (users) { vm.users = users; var projectOwnersArr = []; var projectNamesArr = []; if (vm.users) { _.each(users, function (user) { if (user && user.projects) { _.each(user.projects, function (project) { projectOwnersArr.push(project.ownerName); projectNamesArr.push(project.projectName); }) } }); } }); }; function getProjectUsers() { ProjectService.getProjectUsers().then(function (response) { vm.projects = response; var projectOwnersArr = []; var projectNamesArr = []; _.each(vm.projects, function (projectObj) { projectOwnersArr = _.find(vm.projects, { ownerName: projectObj.ownerName }); projectNamesArr = _.find(vm.projects, { projectName: projectObj.projectName }); vm.projectOwnersArr.push(projectObj.ownerName); vm.projectNamesArr.push(projectObj.projectName); }) }, function (error) { console.log(error); }); } initController(); function initController() { UserService.GetCurrent().then(function (user) { vm.user = user; if (vm.user.admin !== true) { $state.go('home'); } }); getAllUsers(); getProjectUsers(); } }; })();
anudeepjusanu/timesheet
app/projects/index.controller.js
JavaScript
mit
42,633
define([], function() { var PhpGenUserManagementApi = { _invokeApiFunction: function (functionShortName, data) { var result = new $.Deferred(); $.get( 'user_management_api.php', $.extend({}, {'hname': functionShortName}, data)) .success( function (data) { if (data.status == 'error') result.reject(data.result); else { if (data.result) result.resolve(data.result); else result.resolve(); } }) .error( function (xhr, status, errorMessage) { result.reject(status + ': ' + errorMessage); }); return result.promise(); }, addUser: function (id, name, password) { return this._invokeApiFunction('au', { 'id': id, 'username': name, 'password': password }); }, removeUser: function (id) { return this._invokeApiFunction('ru', { 'user_id': id }); }, changeUserName: function (id, username) { return this._invokeApiFunction('eu', { 'user_id': id, 'username': username }); }, changeUserPassword: function (id, password) { return this._invokeApiFunction('cup', { 'user_id': id, 'password': password }); }, getUserGrants: function (userId) { return this._invokeApiFunction('gug', { 'user_id': userId }); }, addUserGrant: function (userId, pageName, grantName) { return this._invokeApiFunction('aug', { 'user_id': userId, 'page_name': pageName, 'grant': grantName }); }, removeUserGrant: function (userId, pageName, grantName) { return this._invokeApiFunction('rug', { 'user_id': userId, 'page_name': pageName, 'grant': grantName }); }, selfChangePassword: function (currentPassword, newPassword) { return this._invokeApiFunction('self_change_password', { 'current_password': currentPassword, 'new_password': newPassword }); } }; return PhpGenUserManagementApi; });
oduudo/UJA_Finanzen
Code/components/js/pgui.user_management_api.js
JavaScript
mit
2,925
const objectAssign = require('object-assign') module.exports = proxy => { if (proxy !== false && (!proxy || !proxy.host)) { throw new Error('Proxy middleware takes an object of host, port and auth properties') } return { processOptions: options => objectAssign({proxy}, options) } }
sanity-io/get-it
src/middleware/proxy.js
JavaScript
mit
301
var packageInfo = require('./package.json'); var taskList = [{name:'default'},{name:'delete'},{name:'build'},{name:'copy'},{name:'minify'}]; var gulpTalk2me = require('gulp-talk2me'); var talk2me = new gulpTalk2me(packageInfo,taskList); var del = require('del'); var gulp = require('gulp'); var runSequence = require('run-sequence'); var sourcemaps = require('gulp-sourcemaps'); var rename = require('gulp-rename'); var ngAnnotate = require('gulp-ng-annotate'); var bytediff = require('gulp-bytediff'); var uglify = require('gulp-uglify'); var concat = require('gulp-concat'); var templateCache = require('gulp-angular-templatecache'); var series = require('stream-series'); var angularFilesort = require('gulp-angular-filesort'); console.log(talk2me.greeting); gulp.task('default',function(callback){ runSequence('build',callback); }); gulp.task('delete',function(callback){ del('dist/**/*', callback()); }); gulp.task('build',function(callback){ runSequence('delete',['copy','minify'],callback); }); gulp.task('copy',function(){ return series(genTemplateStream(),gulp.src(['src/**/*.js','!src/**/*.spec.js'])) .pipe(sourcemaps.init()) .pipe(angularFilesort()) .pipe(concat('toggle-icon-button-directive.js', {newLine: ';\n'})) .pipe(ngAnnotate({ add: true })) .pipe(sourcemaps.write('./')) .pipe(gulp.dest('dist')); }); gulp.task('minify',function(){ return series(genTemplateStream(),gulp.src(['src/**/*.js','!src/**/*.spec.js'])) .pipe(sourcemaps.init()) .pipe(angularFilesort()) .pipe(concat('toggle-icon-button-directive.js', {newLine: ';'})) .pipe(rename(function (path) { path.basename += ".min"; })) .pipe(ngAnnotate({ add: true })) .pipe(bytediff.start()) .pipe(uglify({mangle: true})) .pipe(bytediff.stop()) .pipe(sourcemaps.write('./')) .pipe(gulp.dest('dist')); }); function genTemplateStream () { return gulp.src(['src/**/*.view.html']) .pipe(templateCache({standalone:true,module:'toggleIconButton.template'})); }
belgac/toggle-icon-button-directive
Gulpfile.js
JavaScript
mit
2,035
// Copyright (c) 2012 Ecma International. All rights reserved. // Ecma International makes this code available under the terms and conditions set // forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the // "Use Terms"). Any redistribution of this code must retain the above // copyright and this notice and otherwise comply with the Use Terms. /*--- es5id: 15.2.3.11-4-9 description: > Object.isSealed returns false for all built-in objects (String.prototype) includes: [runTestCase.js] ---*/ function testcase() { var b = Object.isSealed(String.prototype); if (b === false) { return true; } } runTestCase(testcase);
PiotrDabkowski/Js2Py
tests/test_cases/built-ins/Object/isSealed/15.2.3.11-4-9.js
JavaScript
mit
661
output.text = $.selection.text()
nodule/quojs
nodes/text/node.js
JavaScript
mit
33
"use strict" const CamayakContentAPI = require('camayak-contentapi'); const CamayakMedium = require('./lib/camayak_medium'); const api_key = process.env.CAMAYAK_API_KEY; const shared_secret = process.env.CAMAYAK_SHARED_SECRET; const medium_key = process.env.MEDIUM_API_KEY; const port = process.env.PORT || 5000; // Proposed usage of a Camayak-contentapi sdk let camayak = new CamayakContentAPI({ port: port, api_key: api_key, shared_secret: shared_secret, publish: function(webhook, content) { let handler = new CamayakMedium(medium_key); handler.publish(content, function(error, response){ if (error) { return webhook.fail(error); }; return webhook.succeed({ published_id: response.published_id, published_url: response.published_url }); }); }, update: function(webhook, content) { let handler = new CamayakMedium(medium_key); handler.update(content, function(error, response){ if (error) { return webhook.fail(error); }; return webhook.succeed({ published_id: response.published_id, published_url: response.published_url }); }); }, retract: function(webhook, content) { // Retract Post using content.published_id // let handler = new CamayakMedium(medium_key); handler.retract(content, function(error, response){ if (error) { return webhook.fail(error); }; return webhook.succeed({ published_id: response.published_id, published_url: response.published_url }); }) }, error: function(error, webhook) { // Handle unexpected errors in the Camayak service webhook.fail(error); } }); // Start listening for webhooks camayak.start();
camayak/contentapi-medium-node
index.js
JavaScript
mit
1,991
import * as t from "../lib"; import { parse } from "@babel/parser"; describe("validators", function() { describe("isNodesEquivalent", function() { it("should handle simple cases", function() { const mem = t.memberExpression(t.identifier("a"), t.identifier("b")); expect(t.isNodesEquivalent(mem, mem)).toBe(true); const mem2 = t.memberExpression(t.identifier("a"), t.identifier("c")); expect(t.isNodesEquivalent(mem, mem2)).toBe(false); }); it("should handle full programs", function() { expect(t.isNodesEquivalent(parse("1 + 1"), parse("1+1"))).toBe(true); expect(t.isNodesEquivalent(parse("1 + 1"), parse("1+2"))).toBe(false); }); it("should handle complex programs", function() { const program = "'use strict'; function lol() { wow();return 1; }"; expect(t.isNodesEquivalent(parse(program), parse(program))).toBe(true); const program2 = "'use strict'; function lol() { wow();return -1; }"; expect(t.isNodesEquivalent(parse(program), parse(program2))).toBe(false); }); it("should handle nodes with object properties", function() { const original = t.templateElement({ raw: "\\'a", cooked: "'a" }, true); const identical = t.templateElement({ raw: "\\'a", cooked: "'a" }, true); const different = t.templateElement({ raw: "'a", cooked: "'a" }, true); expect(t.isNodesEquivalent(original, identical)).toBe(true); expect(t.isNodesEquivalent(original, different)).toBe(false); }); it("rejects 'await' as an identifier", function() { expect(t.isValidIdentifier("await")).toBe(false); }); }); describe("isCompatTag", function() { it("should handle lowercase tag names", function() { expect(t.react.isCompatTag("div")).toBe(true); expect(t.react.isCompatTag("a")).toBe(true); // one letter expect(t.react.isCompatTag("h3")).toBe(true); // letters and numbers }); it("should handle custom element tag names", function() { expect(t.react.isCompatTag("plastic-button")).toBe(true); // ascii letters expect(t.react.isCompatTag("math-α")).toBe(true); // non-latin chars expect(t.react.isCompatTag("img-viewer2")).toBe(true); // numbers expect(t.react.isCompatTag("emotion-😍")).toBe(true); // emoji }); it("accepts trailing dash '-' in custom element tag names", function() { expect(t.react.isCompatTag("div-")).toBe(true); expect(t.react.isCompatTag("a-")).toBe(true); expect(t.react.isCompatTag("h3-")).toBe(true); }); it("rejects empty or null tag names", function() { expect(t.react.isCompatTag(null)).toBe(false); expect(t.react.isCompatTag()).toBe(false); expect(t.react.isCompatTag(undefined)).toBe(false); expect(t.react.isCompatTag("")).toBe(false); }); it("rejects tag names starting with an uppercase letter", function() { expect(t.react.isCompatTag("Div")).toBe(false); expect(t.react.isCompatTag("A")).toBe(false); expect(t.react.isCompatTag("H3")).toBe(false); }); it("rejects all uppercase tag names", function() { expect(t.react.isCompatTag("DIV")).toBe(false); expect(t.react.isCompatTag("A")).toBe(false); expect(t.react.isCompatTag("H3")).toBe(false); }); it("rejects leading dash '-'", function() { expect(t.react.isCompatTag("-div")).toBe(false); expect(t.react.isCompatTag("-a")).toBe(false); expect(t.react.isCompatTag("-h3")).toBe(false); }); }); describe("patterns", function() { it("allows nested pattern structures", function() { const pattern = t.objectPattern([ t.objectProperty( t.identifier("a"), t.objectPattern([ t.objectProperty(t.identifier("b"), t.identifier("foo")), t.objectProperty( t.identifier("c"), t.arrayPattern([t.identifier("value")]), ), ]), ), ]); expect(t.isNodesEquivalent(pattern, pattern)).toBe(true); }); }); describe("isReferenced", function() { it("returns false if node is a key of ObjectTypeProperty", function() { const node = t.identifier("a"); const parent = t.objectTypeProperty(node, t.numberTypeAnnotation()); expect(t.isReferenced(node, parent)).toBe(false); }); it("returns true if node is a value of ObjectTypeProperty", function() { const node = t.identifier("a"); const parent = t.objectTypeProperty( t.identifier("someKey"), t.genericTypeAnnotation(node), ); expect(t.isReferenced(node, parent)).toBe(true); }); it("returns true if node is a value of ObjectProperty of an expression", function() { const node = t.identifier("a"); const parent = t.objectProperty(t.identifier("key"), node); const grandparent = t.objectExpression([parent]); expect(t.isReferenced(node, parent, grandparent)).toBe(true); }); it("returns false if node is a value of ObjectProperty of a pattern", function() { const node = t.identifier("a"); const parent = t.objectProperty(t.identifier("key"), node); const grandparent = t.objectPattern([parent]); expect(t.isReferenced(node, parent, grandparent)).toBe(false); }); describe("TSPropertySignature", function() { it("returns false if node is a key", function() { // { A: string } const node = t.identifier("A"); const parent = t.tsPropertySignature( node, t.tsTypeAnnotation(t.tsStringKeyword()), ); expect(t.isReferenced(node, parent)).toBe(false); }); it("returns true if node is a value", function() { // { someKey: A } const node = t.identifier("A"); const parent = t.tsPropertySignature( t.identifier("someKey"), t.tsTypeAnnotation(t.tsTypeReference(node)), ); expect(t.isReferenced(node, parent)).toBe(true); }); }); describe("TSEnumMember", function() { it("returns false if node is an id", function() { // enum X = { A }; const node = t.identifier("A"); const parent = t.tsEnumMember(node); expect(t.isReferenced(node, parent)).toBe(false); }); it("returns true if node is a value", function() { // enum X = { Foo = A } const node = t.identifier("A"); const parent = t.tsEnumMember(t.identifier("Foo"), node); expect(t.isReferenced(node, parent)).toBe(true); }); }); }); describe("isBinding", function() { it("returns false if node id a value of ObjectProperty of an expression", function() { const node = t.identifier("a"); const parent = t.objectProperty(t.identifier("key"), node); const grandparent = t.objectExpression([parent]); expect(t.isBinding(node, parent, grandparent)).toBe(false); }); it("returns true if node id a value of ObjectProperty of a pattern", function() { const node = t.identifier("a"); const parent = t.objectProperty(t.identifier("key"), node); const grandparent = t.objectPattern([parent]); expect(t.isBinding(node, parent, grandparent)).toBe(true); }); }); describe("isType", function() { it("returns true if nodeType equals targetType", function() { expect(t.isType("Identifier", "Identifier")).toBe(true); }); it("returns false if targetType is a primary node type", function() { expect(t.isType("Expression", "ArrayExpression")).toBe(false); }); it("returns true if targetType is an alias of nodeType", function() { expect(t.isType("ArrayExpression", "Expression")).toBe(true); }); it("returns false if nodeType and targetType are unrelated", function() { expect(t.isType("ArrayExpression", "ClassBody")).toBe(false); }); it("returns false if nodeType is undefined", function() { expect(t.isType(undefined, "Expression")).toBe(false); }); }); describe("placeholders", function() { describe("isPlaceholderType", function() { describe("when placeholderType is a specific node type", function() { const placeholder = "Identifier"; it("returns true if targetType is placeholderType", function() { expect(t.isPlaceholderType(placeholder, "Identifier")).toBe(true); }); it("returns true if targetType an alias for placeholderType", function() { expect(t.isPlaceholderType(placeholder, "Expression")).toBe(true); }); it("returns false for unrelated types", function() { expect(t.isPlaceholderType(placeholder, "String")).toBe(false); }); }); describe("when placeholderType is a generic alias type", function() { const placeholder = "Pattern"; it("returns true if targetType is placeholderType", function() { expect(t.isPlaceholderType(placeholder, "Pattern")).toBe(true); }); it("returns true if targetType an alias for placeholderType", function() { expect(t.isPlaceholderType(placeholder, "LVal")).toBe(true); }); it("returns false for unrelated types", function() { expect(t.isPlaceholderType(placeholder, "Expression")).toBe(false); }); it("returns false if targetType is aliased by placeholderType", function() { // i.e. a Pattern might not be an Identifier expect(t.isPlaceholderType(placeholder, "Identifier")).toBe(false); }); }); }); describe("is", function() { describe("when the placeholder matches a specific node", function() { const identifier = t.placeholder("Identifier", t.identifier("foo")); it("returns false if targetType is expectedNode", function() { expect(t.is("Identifier", identifier)).toBe(false); }); it("returns true if targetType is an alias", function() { expect(t.is("LVal", identifier)).toBe(true); }); }); describe("when the placeholder matches a generic alias", function() { const pattern = t.placeholder("Pattern", t.identifier("bar")); it("returns false if targetType is aliased as expectedNode", function() { // i.e. a Pattern might not be an Identifier expect(t.is("Identifier", pattern)).toBe(false); }); it("returns true if targetType is expectedNode", function() { expect(t.is("Pattern", pattern)).toBe(true); }); it("returns true if targetType is an alias for expectedNode", function() { expect(t.is("LVal", pattern)).toBe(true); }); }); }); describe("is[Type]", function() { describe("when the placeholder matches a specific node", function() { const identifier = t.placeholder("Identifier", t.identifier("foo")); it("returns false if targetType is expectedNode", function() { expect(t.isIdentifier(identifier)).toBe(false); }); it("returns true if targetType is an alias", function() { expect(t.isLVal(identifier)).toBe(true); }); }); describe("when the placeholder matches a generic alias", function() { const pattern = t.placeholder("Pattern", t.identifier("bar")); it("returns false if targetType is aliased as expectedNode", function() { expect(t.isIdentifier(pattern)).toBe(false); }); it("returns true if targetType is expectedNode", function() { expect(t.isPattern(pattern)).toBe(true); }); it("returns true if targetType is an alias for expectedNode", function() { expect(t.isLVal(pattern)).toBe(true); }); }); }); }); });
Skillupco/babel
packages/babel-types/test/validators.js
JavaScript
mit
11,769
$.scrollbar = function(scrollbarAdded) { var scrollbarTop = "0px"; var animatingOut = false; var animateOutTimer; var animateOut = function() { $(".scrollbar").stop(); if (animatingOut) { clearTimeout(animateOutTimer); } animatingOut = true; $(".scrollbar").css("opacity", "1"); animateOutTimer = setTimeout(function() { $(".scrollbar").animate({ opacity: 0 }, 2000, undefined, function() { animatingOut = false; }); }, 3000); } var winHeight = $(window).innerHeight(); var docHeight = $(document).height(); if (!scrollbarAdded) { $.scrollbar.addEvents(); $("body").prepend('<div class="scrollbar-track"><div class="scrollbar"></div></div>'); } var trackHeight = $(".scrollbar-track").height(); var scrollbarHeight = (winHeight / docHeight) * trackHeight - 10 $(".scrollbar").height(scrollbarHeight).css("top", scrollbarTop).draggable({ axis: 'y', containment: 'parent', drag: function() { var scrollbarTop = parseInt($(this).css('top')); var scrollTopNew = (scrollbarTop / (trackHeight)) * docHeight; $(window).scrollTop(scrollTopNew); animateOut(); } }); $("body").unbind("mousewheel"); $("body").bind("mousewheel", function (event, delta) { var scrollTop = $(window).scrollTop(); var scrollTopNew = scrollTop - (delta * 40); $(window).scrollTop(scrollTopNew); var scrollbarTop = ($(window).scrollTop() / docHeight) * trackHeight; $('.scrollbar').css({ top: scrollbarTop }); animateOut(); }); $(".scrollbar").css({ top: ($(window).scrollTop() / docHeight) * trackHeight }); $(document).mousemove(animateOut); animateOut(); } $.scrollbar.addEvents = function() { $(window).resize(function() { $.scrollbar(true); }); $(document).resize(function() { $.scrollbar(true); }); }
tupperkion/scrollbar-plugin
scrollbar-plugin.js
JavaScript
mit
1,780
export const GENRES = [ 'chill', 'deep', 'dubstep', 'house', 'progressive', 'tech', 'trance', 'tropical', ]; export const GENRES_MAP = GENRES.reduce((obj, genre) => Object.assign({}, obj, { [genre]: 1, }), {}); export const IMAGE_SIZES = { LARGE: 't300x300', XLARGE: 't500x500', }; export const CHANGE_TYPES = { NEXT: 'next', PLAY: 'play', PREV: 'prev', SHUFFLE: 'shuffle', };
Jesseyx/sound-vue
src/constants/SongConstants.js
JavaScript
mit
417
"use strict"; var helpers = require("../../helpers/helpers"); exports["Canada/Pacific"] = { "guess:by:offset" : helpers.makeTestGuess("Canada/Pacific", { offset: true, expect: "America/Los_Angeles" }), "guess:by:abbr" : helpers.makeTestGuess("Canada/Pacific", { abbr: true, expect: "America/Los_Angeles" }), "1918" : helpers.makeTestYear("Canada/Pacific", [ ["1918-04-14T09:59:59+00:00", "01:59:59", "PST", 480], ["1918-04-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["1918-10-27T08:59:59+00:00", "01:59:59", "PDT", 420], ["1918-10-27T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1942" : helpers.makeTestYear("Canada/Pacific", [ ["1942-02-09T09:59:59+00:00", "01:59:59", "PST", 480], ["1942-02-09T10:00:00+00:00", "03:00:00", "PWT", 420] ]), "1945" : helpers.makeTestYear("Canada/Pacific", [ ["1945-08-14T22:59:59+00:00", "15:59:59", "PWT", 420], ["1945-08-14T23:00:00+00:00", "16:00:00", "PPT", 420], ["1945-09-30T08:59:59+00:00", "01:59:59", "PPT", 420], ["1945-09-30T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1946" : helpers.makeTestYear("Canada/Pacific", [ ["1946-04-28T09:59:59+00:00", "01:59:59", "PST", 480], ["1946-04-28T10:00:00+00:00", "03:00:00", "PDT", 420], ["1946-10-13T08:59:59+00:00", "01:59:59", "PDT", 420], ["1946-10-13T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1947" : helpers.makeTestYear("Canada/Pacific", [ ["1947-04-27T09:59:59+00:00", "01:59:59", "PST", 480], ["1947-04-27T10:00:00+00:00", "03:00:00", "PDT", 420], ["1947-09-28T08:59:59+00:00", "01:59:59", "PDT", 420], ["1947-09-28T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1948" : helpers.makeTestYear("Canada/Pacific", [ ["1948-04-25T09:59:59+00:00", "01:59:59", "PST", 480], ["1948-04-25T10:00:00+00:00", "03:00:00", "PDT", 420], ["1948-09-26T08:59:59+00:00", "01:59:59", "PDT", 420], ["1948-09-26T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1949" : helpers.makeTestYear("Canada/Pacific", [ ["1949-04-24T09:59:59+00:00", "01:59:59", "PST", 480], ["1949-04-24T10:00:00+00:00", "03:00:00", "PDT", 420], ["1949-09-25T08:59:59+00:00", "01:59:59", "PDT", 420], ["1949-09-25T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1950" : helpers.makeTestYear("Canada/Pacific", [ ["1950-04-30T09:59:59+00:00", "01:59:59", "PST", 480], ["1950-04-30T10:00:00+00:00", "03:00:00", "PDT", 420], ["1950-09-24T08:59:59+00:00", "01:59:59", "PDT", 420], ["1950-09-24T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1951" : helpers.makeTestYear("Canada/Pacific", [ ["1951-04-29T09:59:59+00:00", "01:59:59", "PST", 480], ["1951-04-29T10:00:00+00:00", "03:00:00", "PDT", 420], ["1951-09-30T08:59:59+00:00", "01:59:59", "PDT", 420], ["1951-09-30T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1952" : helpers.makeTestYear("Canada/Pacific", [ ["1952-04-27T09:59:59+00:00", "01:59:59", "PST", 480], ["1952-04-27T10:00:00+00:00", "03:00:00", "PDT", 420], ["1952-09-28T08:59:59+00:00", "01:59:59", "PDT", 420], ["1952-09-28T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1953" : helpers.makeTestYear("Canada/Pacific", [ ["1953-04-26T09:59:59+00:00", "01:59:59", "PST", 480], ["1953-04-26T10:00:00+00:00", "03:00:00", "PDT", 420], ["1953-09-27T08:59:59+00:00", "01:59:59", "PDT", 420], ["1953-09-27T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1954" : helpers.makeTestYear("Canada/Pacific", [ ["1954-04-25T09:59:59+00:00", "01:59:59", "PST", 480], ["1954-04-25T10:00:00+00:00", "03:00:00", "PDT", 420], ["1954-09-26T08:59:59+00:00", "01:59:59", "PDT", 420], ["1954-09-26T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1955" : helpers.makeTestYear("Canada/Pacific", [ ["1955-04-24T09:59:59+00:00", "01:59:59", "PST", 480], ["1955-04-24T10:00:00+00:00", "03:00:00", "PDT", 420], ["1955-09-25T08:59:59+00:00", "01:59:59", "PDT", 420], ["1955-09-25T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1956" : helpers.makeTestYear("Canada/Pacific", [ ["1956-04-29T09:59:59+00:00", "01:59:59", "PST", 480], ["1956-04-29T10:00:00+00:00", "03:00:00", "PDT", 420], ["1956-09-30T08:59:59+00:00", "01:59:59", "PDT", 420], ["1956-09-30T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1957" : helpers.makeTestYear("Canada/Pacific", [ ["1957-04-28T09:59:59+00:00", "01:59:59", "PST", 480], ["1957-04-28T10:00:00+00:00", "03:00:00", "PDT", 420], ["1957-09-29T08:59:59+00:00", "01:59:59", "PDT", 420], ["1957-09-29T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1958" : helpers.makeTestYear("Canada/Pacific", [ ["1958-04-27T09:59:59+00:00", "01:59:59", "PST", 480], ["1958-04-27T10:00:00+00:00", "03:00:00", "PDT", 420], ["1958-09-28T08:59:59+00:00", "01:59:59", "PDT", 420], ["1958-09-28T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1959" : helpers.makeTestYear("Canada/Pacific", [ ["1959-04-26T09:59:59+00:00", "01:59:59", "PST", 480], ["1959-04-26T10:00:00+00:00", "03:00:00", "PDT", 420], ["1959-09-27T08:59:59+00:00", "01:59:59", "PDT", 420], ["1959-09-27T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1960" : helpers.makeTestYear("Canada/Pacific", [ ["1960-04-24T09:59:59+00:00", "01:59:59", "PST", 480], ["1960-04-24T10:00:00+00:00", "03:00:00", "PDT", 420], ["1960-09-25T08:59:59+00:00", "01:59:59", "PDT", 420], ["1960-09-25T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1961" : helpers.makeTestYear("Canada/Pacific", [ ["1961-04-30T09:59:59+00:00", "01:59:59", "PST", 480], ["1961-04-30T10:00:00+00:00", "03:00:00", "PDT", 420], ["1961-09-24T08:59:59+00:00", "01:59:59", "PDT", 420], ["1961-09-24T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1962" : helpers.makeTestYear("Canada/Pacific", [ ["1962-04-29T09:59:59+00:00", "01:59:59", "PST", 480], ["1962-04-29T10:00:00+00:00", "03:00:00", "PDT", 420], ["1962-10-28T08:59:59+00:00", "01:59:59", "PDT", 420], ["1962-10-28T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1963" : helpers.makeTestYear("Canada/Pacific", [ ["1963-04-28T09:59:59+00:00", "01:59:59", "PST", 480], ["1963-04-28T10:00:00+00:00", "03:00:00", "PDT", 420], ["1963-10-27T08:59:59+00:00", "01:59:59", "PDT", 420], ["1963-10-27T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1964" : helpers.makeTestYear("Canada/Pacific", [ ["1964-04-26T09:59:59+00:00", "01:59:59", "PST", 480], ["1964-04-26T10:00:00+00:00", "03:00:00", "PDT", 420], ["1964-10-25T08:59:59+00:00", "01:59:59", "PDT", 420], ["1964-10-25T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1965" : helpers.makeTestYear("Canada/Pacific", [ ["1965-04-25T09:59:59+00:00", "01:59:59", "PST", 480], ["1965-04-25T10:00:00+00:00", "03:00:00", "PDT", 420], ["1965-10-31T08:59:59+00:00", "01:59:59", "PDT", 420], ["1965-10-31T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1966" : helpers.makeTestYear("Canada/Pacific", [ ["1966-04-24T09:59:59+00:00", "01:59:59", "PST", 480], ["1966-04-24T10:00:00+00:00", "03:00:00", "PDT", 420], ["1966-10-30T08:59:59+00:00", "01:59:59", "PDT", 420], ["1966-10-30T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1967" : helpers.makeTestYear("Canada/Pacific", [ ["1967-04-30T09:59:59+00:00", "01:59:59", "PST", 480], ["1967-04-30T10:00:00+00:00", "03:00:00", "PDT", 420], ["1967-10-29T08:59:59+00:00", "01:59:59", "PDT", 420], ["1967-10-29T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1968" : helpers.makeTestYear("Canada/Pacific", [ ["1968-04-28T09:59:59+00:00", "01:59:59", "PST", 480], ["1968-04-28T10:00:00+00:00", "03:00:00", "PDT", 420], ["1968-10-27T08:59:59+00:00", "01:59:59", "PDT", 420], ["1968-10-27T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1969" : helpers.makeTestYear("Canada/Pacific", [ ["1969-04-27T09:59:59+00:00", "01:59:59", "PST", 480], ["1969-04-27T10:00:00+00:00", "03:00:00", "PDT", 420], ["1969-10-26T08:59:59+00:00", "01:59:59", "PDT", 420], ["1969-10-26T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1970" : helpers.makeTestYear("Canada/Pacific", [ ["1970-04-26T09:59:59+00:00", "01:59:59", "PST", 480], ["1970-04-26T10:00:00+00:00", "03:00:00", "PDT", 420], ["1970-10-25T08:59:59+00:00", "01:59:59", "PDT", 420], ["1970-10-25T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1971" : helpers.makeTestYear("Canada/Pacific", [ ["1971-04-25T09:59:59+00:00", "01:59:59", "PST", 480], ["1971-04-25T10:00:00+00:00", "03:00:00", "PDT", 420], ["1971-10-31T08:59:59+00:00", "01:59:59", "PDT", 420], ["1971-10-31T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1972" : helpers.makeTestYear("Canada/Pacific", [ ["1972-04-30T09:59:59+00:00", "01:59:59", "PST", 480], ["1972-04-30T10:00:00+00:00", "03:00:00", "PDT", 420], ["1972-10-29T08:59:59+00:00", "01:59:59", "PDT", 420], ["1972-10-29T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1973" : helpers.makeTestYear("Canada/Pacific", [ ["1973-04-29T09:59:59+00:00", "01:59:59", "PST", 480], ["1973-04-29T10:00:00+00:00", "03:00:00", "PDT", 420], ["1973-10-28T08:59:59+00:00", "01:59:59", "PDT", 420], ["1973-10-28T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1974" : helpers.makeTestYear("Canada/Pacific", [ ["1974-04-28T09:59:59+00:00", "01:59:59", "PST", 480], ["1974-04-28T10:00:00+00:00", "03:00:00", "PDT", 420], ["1974-10-27T08:59:59+00:00", "01:59:59", "PDT", 420], ["1974-10-27T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1975" : helpers.makeTestYear("Canada/Pacific", [ ["1975-04-27T09:59:59+00:00", "01:59:59", "PST", 480], ["1975-04-27T10:00:00+00:00", "03:00:00", "PDT", 420], ["1975-10-26T08:59:59+00:00", "01:59:59", "PDT", 420], ["1975-10-26T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1976" : helpers.makeTestYear("Canada/Pacific", [ ["1976-04-25T09:59:59+00:00", "01:59:59", "PST", 480], ["1976-04-25T10:00:00+00:00", "03:00:00", "PDT", 420], ["1976-10-31T08:59:59+00:00", "01:59:59", "PDT", 420], ["1976-10-31T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1977" : helpers.makeTestYear("Canada/Pacific", [ ["1977-04-24T09:59:59+00:00", "01:59:59", "PST", 480], ["1977-04-24T10:00:00+00:00", "03:00:00", "PDT", 420], ["1977-10-30T08:59:59+00:00", "01:59:59", "PDT", 420], ["1977-10-30T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1978" : helpers.makeTestYear("Canada/Pacific", [ ["1978-04-30T09:59:59+00:00", "01:59:59", "PST", 480], ["1978-04-30T10:00:00+00:00", "03:00:00", "PDT", 420], ["1978-10-29T08:59:59+00:00", "01:59:59", "PDT", 420], ["1978-10-29T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1979" : helpers.makeTestYear("Canada/Pacific", [ ["1979-04-29T09:59:59+00:00", "01:59:59", "PST", 480], ["1979-04-29T10:00:00+00:00", "03:00:00", "PDT", 420], ["1979-10-28T08:59:59+00:00", "01:59:59", "PDT", 420], ["1979-10-28T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1980" : helpers.makeTestYear("Canada/Pacific", [ ["1980-04-27T09:59:59+00:00", "01:59:59", "PST", 480], ["1980-04-27T10:00:00+00:00", "03:00:00", "PDT", 420], ["1980-10-26T08:59:59+00:00", "01:59:59", "PDT", 420], ["1980-10-26T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1981" : helpers.makeTestYear("Canada/Pacific", [ ["1981-04-26T09:59:59+00:00", "01:59:59", "PST", 480], ["1981-04-26T10:00:00+00:00", "03:00:00", "PDT", 420], ["1981-10-25T08:59:59+00:00", "01:59:59", "PDT", 420], ["1981-10-25T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1982" : helpers.makeTestYear("Canada/Pacific", [ ["1982-04-25T09:59:59+00:00", "01:59:59", "PST", 480], ["1982-04-25T10:00:00+00:00", "03:00:00", "PDT", 420], ["1982-10-31T08:59:59+00:00", "01:59:59", "PDT", 420], ["1982-10-31T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1983" : helpers.makeTestYear("Canada/Pacific", [ ["1983-04-24T09:59:59+00:00", "01:59:59", "PST", 480], ["1983-04-24T10:00:00+00:00", "03:00:00", "PDT", 420], ["1983-10-30T08:59:59+00:00", "01:59:59", "PDT", 420], ["1983-10-30T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1984" : helpers.makeTestYear("Canada/Pacific", [ ["1984-04-29T09:59:59+00:00", "01:59:59", "PST", 480], ["1984-04-29T10:00:00+00:00", "03:00:00", "PDT", 420], ["1984-10-28T08:59:59+00:00", "01:59:59", "PDT", 420], ["1984-10-28T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1985" : helpers.makeTestYear("Canada/Pacific", [ ["1985-04-28T09:59:59+00:00", "01:59:59", "PST", 480], ["1985-04-28T10:00:00+00:00", "03:00:00", "PDT", 420], ["1985-10-27T08:59:59+00:00", "01:59:59", "PDT", 420], ["1985-10-27T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1986" : helpers.makeTestYear("Canada/Pacific", [ ["1986-04-27T09:59:59+00:00", "01:59:59", "PST", 480], ["1986-04-27T10:00:00+00:00", "03:00:00", "PDT", 420], ["1986-10-26T08:59:59+00:00", "01:59:59", "PDT", 420], ["1986-10-26T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1987" : helpers.makeTestYear("Canada/Pacific", [ ["1987-04-05T09:59:59+00:00", "01:59:59", "PST", 480], ["1987-04-05T10:00:00+00:00", "03:00:00", "PDT", 420], ["1987-10-25T08:59:59+00:00", "01:59:59", "PDT", 420], ["1987-10-25T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1988" : helpers.makeTestYear("Canada/Pacific", [ ["1988-04-03T09:59:59+00:00", "01:59:59", "PST", 480], ["1988-04-03T10:00:00+00:00", "03:00:00", "PDT", 420], ["1988-10-30T08:59:59+00:00", "01:59:59", "PDT", 420], ["1988-10-30T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1989" : helpers.makeTestYear("Canada/Pacific", [ ["1989-04-02T09:59:59+00:00", "01:59:59", "PST", 480], ["1989-04-02T10:00:00+00:00", "03:00:00", "PDT", 420], ["1989-10-29T08:59:59+00:00", "01:59:59", "PDT", 420], ["1989-10-29T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1990" : helpers.makeTestYear("Canada/Pacific", [ ["1990-04-01T09:59:59+00:00", "01:59:59", "PST", 480], ["1990-04-01T10:00:00+00:00", "03:00:00", "PDT", 420], ["1990-10-28T08:59:59+00:00", "01:59:59", "PDT", 420], ["1990-10-28T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1991" : helpers.makeTestYear("Canada/Pacific", [ ["1991-04-07T09:59:59+00:00", "01:59:59", "PST", 480], ["1991-04-07T10:00:00+00:00", "03:00:00", "PDT", 420], ["1991-10-27T08:59:59+00:00", "01:59:59", "PDT", 420], ["1991-10-27T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1992" : helpers.makeTestYear("Canada/Pacific", [ ["1992-04-05T09:59:59+00:00", "01:59:59", "PST", 480], ["1992-04-05T10:00:00+00:00", "03:00:00", "PDT", 420], ["1992-10-25T08:59:59+00:00", "01:59:59", "PDT", 420], ["1992-10-25T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1993" : helpers.makeTestYear("Canada/Pacific", [ ["1993-04-04T09:59:59+00:00", "01:59:59", "PST", 480], ["1993-04-04T10:00:00+00:00", "03:00:00", "PDT", 420], ["1993-10-31T08:59:59+00:00", "01:59:59", "PDT", 420], ["1993-10-31T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1994" : helpers.makeTestYear("Canada/Pacific", [ ["1994-04-03T09:59:59+00:00", "01:59:59", "PST", 480], ["1994-04-03T10:00:00+00:00", "03:00:00", "PDT", 420], ["1994-10-30T08:59:59+00:00", "01:59:59", "PDT", 420], ["1994-10-30T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1995" : helpers.makeTestYear("Canada/Pacific", [ ["1995-04-02T09:59:59+00:00", "01:59:59", "PST", 480], ["1995-04-02T10:00:00+00:00", "03:00:00", "PDT", 420], ["1995-10-29T08:59:59+00:00", "01:59:59", "PDT", 420], ["1995-10-29T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1996" : helpers.makeTestYear("Canada/Pacific", [ ["1996-04-07T09:59:59+00:00", "01:59:59", "PST", 480], ["1996-04-07T10:00:00+00:00", "03:00:00", "PDT", 420], ["1996-10-27T08:59:59+00:00", "01:59:59", "PDT", 420], ["1996-10-27T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1997" : helpers.makeTestYear("Canada/Pacific", [ ["1997-04-06T09:59:59+00:00", "01:59:59", "PST", 480], ["1997-04-06T10:00:00+00:00", "03:00:00", "PDT", 420], ["1997-10-26T08:59:59+00:00", "01:59:59", "PDT", 420], ["1997-10-26T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1998" : helpers.makeTestYear("Canada/Pacific", [ ["1998-04-05T09:59:59+00:00", "01:59:59", "PST", 480], ["1998-04-05T10:00:00+00:00", "03:00:00", "PDT", 420], ["1998-10-25T08:59:59+00:00", "01:59:59", "PDT", 420], ["1998-10-25T09:00:00+00:00", "01:00:00", "PST", 480] ]), "1999" : helpers.makeTestYear("Canada/Pacific", [ ["1999-04-04T09:59:59+00:00", "01:59:59", "PST", 480], ["1999-04-04T10:00:00+00:00", "03:00:00", "PDT", 420], ["1999-10-31T08:59:59+00:00", "01:59:59", "PDT", 420], ["1999-10-31T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2000" : helpers.makeTestYear("Canada/Pacific", [ ["2000-04-02T09:59:59+00:00", "01:59:59", "PST", 480], ["2000-04-02T10:00:00+00:00", "03:00:00", "PDT", 420], ["2000-10-29T08:59:59+00:00", "01:59:59", "PDT", 420], ["2000-10-29T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2001" : helpers.makeTestYear("Canada/Pacific", [ ["2001-04-01T09:59:59+00:00", "01:59:59", "PST", 480], ["2001-04-01T10:00:00+00:00", "03:00:00", "PDT", 420], ["2001-10-28T08:59:59+00:00", "01:59:59", "PDT", 420], ["2001-10-28T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2002" : helpers.makeTestYear("Canada/Pacific", [ ["2002-04-07T09:59:59+00:00", "01:59:59", "PST", 480], ["2002-04-07T10:00:00+00:00", "03:00:00", "PDT", 420], ["2002-10-27T08:59:59+00:00", "01:59:59", "PDT", 420], ["2002-10-27T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2003" : helpers.makeTestYear("Canada/Pacific", [ ["2003-04-06T09:59:59+00:00", "01:59:59", "PST", 480], ["2003-04-06T10:00:00+00:00", "03:00:00", "PDT", 420], ["2003-10-26T08:59:59+00:00", "01:59:59", "PDT", 420], ["2003-10-26T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2004" : helpers.makeTestYear("Canada/Pacific", [ ["2004-04-04T09:59:59+00:00", "01:59:59", "PST", 480], ["2004-04-04T10:00:00+00:00", "03:00:00", "PDT", 420], ["2004-10-31T08:59:59+00:00", "01:59:59", "PDT", 420], ["2004-10-31T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2005" : helpers.makeTestYear("Canada/Pacific", [ ["2005-04-03T09:59:59+00:00", "01:59:59", "PST", 480], ["2005-04-03T10:00:00+00:00", "03:00:00", "PDT", 420], ["2005-10-30T08:59:59+00:00", "01:59:59", "PDT", 420], ["2005-10-30T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2006" : helpers.makeTestYear("Canada/Pacific", [ ["2006-04-02T09:59:59+00:00", "01:59:59", "PST", 480], ["2006-04-02T10:00:00+00:00", "03:00:00", "PDT", 420], ["2006-10-29T08:59:59+00:00", "01:59:59", "PDT", 420], ["2006-10-29T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2007" : helpers.makeTestYear("Canada/Pacific", [ ["2007-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2007-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2007-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2007-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2008" : helpers.makeTestYear("Canada/Pacific", [ ["2008-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2008-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2008-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2008-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2009" : helpers.makeTestYear("Canada/Pacific", [ ["2009-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2009-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2009-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2009-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2010" : helpers.makeTestYear("Canada/Pacific", [ ["2010-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2010-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2010-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2010-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2011" : helpers.makeTestYear("Canada/Pacific", [ ["2011-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2011-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2011-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2011-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2012" : helpers.makeTestYear("Canada/Pacific", [ ["2012-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2012-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2012-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2012-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2013" : helpers.makeTestYear("Canada/Pacific", [ ["2013-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2013-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2013-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2013-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2014" : helpers.makeTestYear("Canada/Pacific", [ ["2014-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2014-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2014-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2014-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2015" : helpers.makeTestYear("Canada/Pacific", [ ["2015-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2015-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2015-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2015-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2016" : helpers.makeTestYear("Canada/Pacific", [ ["2016-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2016-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2016-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2016-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2017" : helpers.makeTestYear("Canada/Pacific", [ ["2017-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2017-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2017-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2017-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2018" : helpers.makeTestYear("Canada/Pacific", [ ["2018-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2018-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2018-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2018-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2019" : helpers.makeTestYear("Canada/Pacific", [ ["2019-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2019-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2019-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2019-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2020" : helpers.makeTestYear("Canada/Pacific", [ ["2020-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2020-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2020-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2020-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2021" : helpers.makeTestYear("Canada/Pacific", [ ["2021-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2021-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2021-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2021-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2022" : helpers.makeTestYear("Canada/Pacific", [ ["2022-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2022-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2022-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2022-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2023" : helpers.makeTestYear("Canada/Pacific", [ ["2023-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2023-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2023-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2023-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2024" : helpers.makeTestYear("Canada/Pacific", [ ["2024-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2024-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2024-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2024-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2025" : helpers.makeTestYear("Canada/Pacific", [ ["2025-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2025-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2025-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2025-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2026" : helpers.makeTestYear("Canada/Pacific", [ ["2026-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2026-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2026-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2026-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2027" : helpers.makeTestYear("Canada/Pacific", [ ["2027-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2027-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2027-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2027-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2028" : helpers.makeTestYear("Canada/Pacific", [ ["2028-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2028-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2028-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2028-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2029" : helpers.makeTestYear("Canada/Pacific", [ ["2029-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2029-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2029-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2029-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2030" : helpers.makeTestYear("Canada/Pacific", [ ["2030-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2030-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2030-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2030-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2031" : helpers.makeTestYear("Canada/Pacific", [ ["2031-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2031-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2031-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2031-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2032" : helpers.makeTestYear("Canada/Pacific", [ ["2032-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2032-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2032-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2032-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2033" : helpers.makeTestYear("Canada/Pacific", [ ["2033-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2033-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2033-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2033-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2034" : helpers.makeTestYear("Canada/Pacific", [ ["2034-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2034-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2034-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2034-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2035" : helpers.makeTestYear("Canada/Pacific", [ ["2035-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2035-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2035-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2035-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2036" : helpers.makeTestYear("Canada/Pacific", [ ["2036-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2036-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2036-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2036-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2037" : helpers.makeTestYear("Canada/Pacific", [ ["2037-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2037-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2037-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2037-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2038" : helpers.makeTestYear("Canada/Pacific", [ ["2038-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2038-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2038-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2038-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2039" : helpers.makeTestYear("Canada/Pacific", [ ["2039-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2039-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2039-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2039-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2040" : helpers.makeTestYear("Canada/Pacific", [ ["2040-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2040-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2040-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2040-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2041" : helpers.makeTestYear("Canada/Pacific", [ ["2041-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2041-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2041-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2041-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2042" : helpers.makeTestYear("Canada/Pacific", [ ["2042-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2042-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2042-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2042-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2043" : helpers.makeTestYear("Canada/Pacific", [ ["2043-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2043-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2043-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2043-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2044" : helpers.makeTestYear("Canada/Pacific", [ ["2044-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2044-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2044-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2044-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2045" : helpers.makeTestYear("Canada/Pacific", [ ["2045-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2045-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2045-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2045-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2046" : helpers.makeTestYear("Canada/Pacific", [ ["2046-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2046-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2046-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2046-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2047" : helpers.makeTestYear("Canada/Pacific", [ ["2047-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2047-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2047-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2047-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2048" : helpers.makeTestYear("Canada/Pacific", [ ["2048-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2048-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2048-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2048-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2049" : helpers.makeTestYear("Canada/Pacific", [ ["2049-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2049-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2049-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2049-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2050" : helpers.makeTestYear("Canada/Pacific", [ ["2050-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2050-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2050-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2050-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2051" : helpers.makeTestYear("Canada/Pacific", [ ["2051-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2051-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2051-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2051-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2052" : helpers.makeTestYear("Canada/Pacific", [ ["2052-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2052-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2052-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2052-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2053" : helpers.makeTestYear("Canada/Pacific", [ ["2053-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2053-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2053-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2053-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2054" : helpers.makeTestYear("Canada/Pacific", [ ["2054-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2054-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2054-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2054-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2055" : helpers.makeTestYear("Canada/Pacific", [ ["2055-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2055-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2055-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2055-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2056" : helpers.makeTestYear("Canada/Pacific", [ ["2056-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2056-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2056-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2056-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2057" : helpers.makeTestYear("Canada/Pacific", [ ["2057-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2057-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2057-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2057-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2058" : helpers.makeTestYear("Canada/Pacific", [ ["2058-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2058-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2058-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2058-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2059" : helpers.makeTestYear("Canada/Pacific", [ ["2059-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2059-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2059-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2059-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2060" : helpers.makeTestYear("Canada/Pacific", [ ["2060-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2060-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2060-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2060-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2061" : helpers.makeTestYear("Canada/Pacific", [ ["2061-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2061-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2061-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2061-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2062" : helpers.makeTestYear("Canada/Pacific", [ ["2062-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2062-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2062-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2062-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2063" : helpers.makeTestYear("Canada/Pacific", [ ["2063-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2063-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2063-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2063-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2064" : helpers.makeTestYear("Canada/Pacific", [ ["2064-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2064-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2064-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2064-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2065" : helpers.makeTestYear("Canada/Pacific", [ ["2065-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2065-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2065-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2065-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2066" : helpers.makeTestYear("Canada/Pacific", [ ["2066-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2066-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2066-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2066-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2067" : helpers.makeTestYear("Canada/Pacific", [ ["2067-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2067-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2067-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2067-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2068" : helpers.makeTestYear("Canada/Pacific", [ ["2068-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2068-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2068-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2068-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2069" : helpers.makeTestYear("Canada/Pacific", [ ["2069-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2069-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2069-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2069-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2070" : helpers.makeTestYear("Canada/Pacific", [ ["2070-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2070-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2070-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2070-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2071" : helpers.makeTestYear("Canada/Pacific", [ ["2071-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2071-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2071-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2071-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2072" : helpers.makeTestYear("Canada/Pacific", [ ["2072-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2072-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2072-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2072-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2073" : helpers.makeTestYear("Canada/Pacific", [ ["2073-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2073-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2073-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2073-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2074" : helpers.makeTestYear("Canada/Pacific", [ ["2074-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2074-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2074-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2074-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2075" : helpers.makeTestYear("Canada/Pacific", [ ["2075-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2075-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2075-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2075-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2076" : helpers.makeTestYear("Canada/Pacific", [ ["2076-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2076-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2076-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2076-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2077" : helpers.makeTestYear("Canada/Pacific", [ ["2077-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2077-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2077-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2077-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2078" : helpers.makeTestYear("Canada/Pacific", [ ["2078-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2078-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2078-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2078-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2079" : helpers.makeTestYear("Canada/Pacific", [ ["2079-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2079-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2079-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2079-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2080" : helpers.makeTestYear("Canada/Pacific", [ ["2080-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2080-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2080-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2080-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2081" : helpers.makeTestYear("Canada/Pacific", [ ["2081-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2081-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2081-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2081-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2082" : helpers.makeTestYear("Canada/Pacific", [ ["2082-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2082-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2082-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2082-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2083" : helpers.makeTestYear("Canada/Pacific", [ ["2083-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2083-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2083-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2083-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2084" : helpers.makeTestYear("Canada/Pacific", [ ["2084-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2084-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2084-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2084-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2085" : helpers.makeTestYear("Canada/Pacific", [ ["2085-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2085-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2085-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2085-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2086" : helpers.makeTestYear("Canada/Pacific", [ ["2086-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2086-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2086-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2086-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2087" : helpers.makeTestYear("Canada/Pacific", [ ["2087-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2087-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2087-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2087-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2088" : helpers.makeTestYear("Canada/Pacific", [ ["2088-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2088-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2088-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2088-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2089" : helpers.makeTestYear("Canada/Pacific", [ ["2089-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2089-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2089-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2089-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2090" : helpers.makeTestYear("Canada/Pacific", [ ["2090-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2090-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2090-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2090-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2091" : helpers.makeTestYear("Canada/Pacific", [ ["2091-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2091-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2091-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2091-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2092" : helpers.makeTestYear("Canada/Pacific", [ ["2092-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2092-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2092-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2092-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2093" : helpers.makeTestYear("Canada/Pacific", [ ["2093-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2093-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2093-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2093-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2094" : helpers.makeTestYear("Canada/Pacific", [ ["2094-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2094-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2094-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2094-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2095" : helpers.makeTestYear("Canada/Pacific", [ ["2095-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2095-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2095-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2095-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2096" : helpers.makeTestYear("Canada/Pacific", [ ["2096-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2096-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2096-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2096-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2097" : helpers.makeTestYear("Canada/Pacific", [ ["2097-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2097-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2097-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2097-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2098" : helpers.makeTestYear("Canada/Pacific", [ ["2098-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2098-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2098-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2098-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2099" : helpers.makeTestYear("Canada/Pacific", [ ["2099-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2099-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2099-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2099-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2100" : helpers.makeTestYear("Canada/Pacific", [ ["2100-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2100-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2100-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2100-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2101" : helpers.makeTestYear("Canada/Pacific", [ ["2101-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2101-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2101-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2101-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2102" : helpers.makeTestYear("Canada/Pacific", [ ["2102-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2102-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2102-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2102-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2103" : helpers.makeTestYear("Canada/Pacific", [ ["2103-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2103-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2103-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2103-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2104" : helpers.makeTestYear("Canada/Pacific", [ ["2104-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2104-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2104-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2104-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2105" : helpers.makeTestYear("Canada/Pacific", [ ["2105-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2105-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2105-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2105-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2106" : helpers.makeTestYear("Canada/Pacific", [ ["2106-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2106-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2106-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2106-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2107" : helpers.makeTestYear("Canada/Pacific", [ ["2107-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2107-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2107-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2107-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2108" : helpers.makeTestYear("Canada/Pacific", [ ["2108-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2108-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2108-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2108-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2109" : helpers.makeTestYear("Canada/Pacific", [ ["2109-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2109-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2109-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2109-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2110" : helpers.makeTestYear("Canada/Pacific", [ ["2110-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2110-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2110-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2110-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2111" : helpers.makeTestYear("Canada/Pacific", [ ["2111-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2111-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2111-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2111-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2112" : helpers.makeTestYear("Canada/Pacific", [ ["2112-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2112-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2112-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2112-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2113" : helpers.makeTestYear("Canada/Pacific", [ ["2113-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2113-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2113-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2113-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2114" : helpers.makeTestYear("Canada/Pacific", [ ["2114-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2114-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2114-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2114-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2115" : helpers.makeTestYear("Canada/Pacific", [ ["2115-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2115-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2115-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2115-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2116" : helpers.makeTestYear("Canada/Pacific", [ ["2116-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2116-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2116-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2116-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2117" : helpers.makeTestYear("Canada/Pacific", [ ["2117-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2117-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2117-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2117-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2118" : helpers.makeTestYear("Canada/Pacific", [ ["2118-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2118-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2118-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2118-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2119" : helpers.makeTestYear("Canada/Pacific", [ ["2119-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2119-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2119-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2119-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2120" : helpers.makeTestYear("Canada/Pacific", [ ["2120-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2120-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2120-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2120-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2121" : helpers.makeTestYear("Canada/Pacific", [ ["2121-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2121-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2121-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2121-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2122" : helpers.makeTestYear("Canada/Pacific", [ ["2122-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2122-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2122-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2122-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2123" : helpers.makeTestYear("Canada/Pacific", [ ["2123-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2123-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2123-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2123-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2124" : helpers.makeTestYear("Canada/Pacific", [ ["2124-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2124-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2124-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2124-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2125" : helpers.makeTestYear("Canada/Pacific", [ ["2125-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2125-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2125-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2125-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2126" : helpers.makeTestYear("Canada/Pacific", [ ["2126-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2126-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2126-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2126-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2127" : helpers.makeTestYear("Canada/Pacific", [ ["2127-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2127-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2127-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2127-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2128" : helpers.makeTestYear("Canada/Pacific", [ ["2128-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2128-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2128-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2128-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2129" : helpers.makeTestYear("Canada/Pacific", [ ["2129-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2129-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2129-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2129-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2130" : helpers.makeTestYear("Canada/Pacific", [ ["2130-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2130-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2130-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2130-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2131" : helpers.makeTestYear("Canada/Pacific", [ ["2131-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2131-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2131-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2131-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2132" : helpers.makeTestYear("Canada/Pacific", [ ["2132-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2132-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2132-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2132-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2133" : helpers.makeTestYear("Canada/Pacific", [ ["2133-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2133-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2133-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2133-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2134" : helpers.makeTestYear("Canada/Pacific", [ ["2134-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2134-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2134-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2134-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2135" : helpers.makeTestYear("Canada/Pacific", [ ["2135-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2135-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2135-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2135-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2136" : helpers.makeTestYear("Canada/Pacific", [ ["2136-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2136-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2136-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2136-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2137" : helpers.makeTestYear("Canada/Pacific", [ ["2137-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2137-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2137-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2137-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2138" : helpers.makeTestYear("Canada/Pacific", [ ["2138-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2138-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2138-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2138-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2139" : helpers.makeTestYear("Canada/Pacific", [ ["2139-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2139-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2139-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2139-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2140" : helpers.makeTestYear("Canada/Pacific", [ ["2140-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2140-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2140-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2140-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2141" : helpers.makeTestYear("Canada/Pacific", [ ["2141-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2141-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2141-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2141-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2142" : helpers.makeTestYear("Canada/Pacific", [ ["2142-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2142-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2142-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2142-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2143" : helpers.makeTestYear("Canada/Pacific", [ ["2143-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2143-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2143-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2143-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2144" : helpers.makeTestYear("Canada/Pacific", [ ["2144-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2144-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2144-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2144-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2145" : helpers.makeTestYear("Canada/Pacific", [ ["2145-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2145-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2145-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2145-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2146" : helpers.makeTestYear("Canada/Pacific", [ ["2146-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2146-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2146-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2146-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2147" : helpers.makeTestYear("Canada/Pacific", [ ["2147-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2147-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2147-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2147-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2148" : helpers.makeTestYear("Canada/Pacific", [ ["2148-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2148-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2148-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2148-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2149" : helpers.makeTestYear("Canada/Pacific", [ ["2149-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2149-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2149-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2149-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2150" : helpers.makeTestYear("Canada/Pacific", [ ["2150-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2150-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2150-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2150-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2151" : helpers.makeTestYear("Canada/Pacific", [ ["2151-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2151-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2151-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2151-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2152" : helpers.makeTestYear("Canada/Pacific", [ ["2152-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2152-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2152-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2152-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2153" : helpers.makeTestYear("Canada/Pacific", [ ["2153-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2153-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2153-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2153-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2154" : helpers.makeTestYear("Canada/Pacific", [ ["2154-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2154-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2154-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2154-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2155" : helpers.makeTestYear("Canada/Pacific", [ ["2155-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2155-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2155-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2155-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2156" : helpers.makeTestYear("Canada/Pacific", [ ["2156-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2156-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2156-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2156-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2157" : helpers.makeTestYear("Canada/Pacific", [ ["2157-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2157-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2157-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2157-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2158" : helpers.makeTestYear("Canada/Pacific", [ ["2158-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2158-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2158-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2158-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2159" : helpers.makeTestYear("Canada/Pacific", [ ["2159-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2159-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2159-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2159-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2160" : helpers.makeTestYear("Canada/Pacific", [ ["2160-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2160-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2160-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2160-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2161" : helpers.makeTestYear("Canada/Pacific", [ ["2161-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2161-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2161-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2161-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2162" : helpers.makeTestYear("Canada/Pacific", [ ["2162-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2162-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2162-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2162-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2163" : helpers.makeTestYear("Canada/Pacific", [ ["2163-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2163-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2163-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2163-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2164" : helpers.makeTestYear("Canada/Pacific", [ ["2164-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2164-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2164-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2164-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2165" : helpers.makeTestYear("Canada/Pacific", [ ["2165-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2165-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2165-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2165-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2166" : helpers.makeTestYear("Canada/Pacific", [ ["2166-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2166-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2166-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2166-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2167" : helpers.makeTestYear("Canada/Pacific", [ ["2167-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2167-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2167-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2167-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2168" : helpers.makeTestYear("Canada/Pacific", [ ["2168-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2168-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2168-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2168-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2169" : helpers.makeTestYear("Canada/Pacific", [ ["2169-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2169-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2169-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2169-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2170" : helpers.makeTestYear("Canada/Pacific", [ ["2170-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2170-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2170-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2170-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2171" : helpers.makeTestYear("Canada/Pacific", [ ["2171-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2171-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2171-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2171-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2172" : helpers.makeTestYear("Canada/Pacific", [ ["2172-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2172-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2172-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2172-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2173" : helpers.makeTestYear("Canada/Pacific", [ ["2173-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2173-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2173-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2173-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2174" : helpers.makeTestYear("Canada/Pacific", [ ["2174-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2174-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2174-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2174-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2175" : helpers.makeTestYear("Canada/Pacific", [ ["2175-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2175-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2175-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2175-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2176" : helpers.makeTestYear("Canada/Pacific", [ ["2176-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2176-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2176-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2176-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2177" : helpers.makeTestYear("Canada/Pacific", [ ["2177-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2177-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2177-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2177-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2178" : helpers.makeTestYear("Canada/Pacific", [ ["2178-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2178-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2178-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2178-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2179" : helpers.makeTestYear("Canada/Pacific", [ ["2179-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2179-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2179-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2179-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2180" : helpers.makeTestYear("Canada/Pacific", [ ["2180-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2180-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2180-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2180-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2181" : helpers.makeTestYear("Canada/Pacific", [ ["2181-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2181-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2181-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2181-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2182" : helpers.makeTestYear("Canada/Pacific", [ ["2182-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2182-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2182-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2182-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2183" : helpers.makeTestYear("Canada/Pacific", [ ["2183-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2183-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2183-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2183-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2184" : helpers.makeTestYear("Canada/Pacific", [ ["2184-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2184-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2184-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2184-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2185" : helpers.makeTestYear("Canada/Pacific", [ ["2185-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2185-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2185-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2185-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2186" : helpers.makeTestYear("Canada/Pacific", [ ["2186-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2186-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2186-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2186-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2187" : helpers.makeTestYear("Canada/Pacific", [ ["2187-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2187-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2187-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2187-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2188" : helpers.makeTestYear("Canada/Pacific", [ ["2188-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2188-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2188-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2188-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2189" : helpers.makeTestYear("Canada/Pacific", [ ["2189-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2189-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2189-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2189-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2190" : helpers.makeTestYear("Canada/Pacific", [ ["2190-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2190-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2190-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2190-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2191" : helpers.makeTestYear("Canada/Pacific", [ ["2191-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2191-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2191-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2191-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2192" : helpers.makeTestYear("Canada/Pacific", [ ["2192-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2192-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2192-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2192-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2193" : helpers.makeTestYear("Canada/Pacific", [ ["2193-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2193-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2193-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2193-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2194" : helpers.makeTestYear("Canada/Pacific", [ ["2194-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2194-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2194-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2194-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2195" : helpers.makeTestYear("Canada/Pacific", [ ["2195-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2195-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2195-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2195-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2196" : helpers.makeTestYear("Canada/Pacific", [ ["2196-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2196-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2196-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2196-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2197" : helpers.makeTestYear("Canada/Pacific", [ ["2197-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2197-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2197-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2197-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2198" : helpers.makeTestYear("Canada/Pacific", [ ["2198-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2198-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2198-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2198-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2199" : helpers.makeTestYear("Canada/Pacific", [ ["2199-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2199-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2199-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2199-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2200" : helpers.makeTestYear("Canada/Pacific", [ ["2200-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2200-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2200-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2200-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2201" : helpers.makeTestYear("Canada/Pacific", [ ["2201-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2201-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2201-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2201-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2202" : helpers.makeTestYear("Canada/Pacific", [ ["2202-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2202-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2202-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2202-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2203" : helpers.makeTestYear("Canada/Pacific", [ ["2203-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2203-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2203-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2203-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2204" : helpers.makeTestYear("Canada/Pacific", [ ["2204-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2204-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2204-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2204-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2205" : helpers.makeTestYear("Canada/Pacific", [ ["2205-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2205-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2205-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2205-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2206" : helpers.makeTestYear("Canada/Pacific", [ ["2206-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2206-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2206-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2206-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2207" : helpers.makeTestYear("Canada/Pacific", [ ["2207-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2207-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2207-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2207-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2208" : helpers.makeTestYear("Canada/Pacific", [ ["2208-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2208-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2208-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2208-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2209" : helpers.makeTestYear("Canada/Pacific", [ ["2209-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2209-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2209-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2209-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2210" : helpers.makeTestYear("Canada/Pacific", [ ["2210-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2210-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2210-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2210-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2211" : helpers.makeTestYear("Canada/Pacific", [ ["2211-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2211-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2211-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2211-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2212" : helpers.makeTestYear("Canada/Pacific", [ ["2212-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2212-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2212-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2212-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2213" : helpers.makeTestYear("Canada/Pacific", [ ["2213-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2213-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2213-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2213-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2214" : helpers.makeTestYear("Canada/Pacific", [ ["2214-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2214-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2214-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2214-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2215" : helpers.makeTestYear("Canada/Pacific", [ ["2215-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2215-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2215-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2215-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2216" : helpers.makeTestYear("Canada/Pacific", [ ["2216-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2216-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2216-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2216-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2217" : helpers.makeTestYear("Canada/Pacific", [ ["2217-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2217-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2217-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2217-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2218" : helpers.makeTestYear("Canada/Pacific", [ ["2218-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2218-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2218-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2218-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2219" : helpers.makeTestYear("Canada/Pacific", [ ["2219-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2219-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2219-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2219-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2220" : helpers.makeTestYear("Canada/Pacific", [ ["2220-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2220-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2220-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2220-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2221" : helpers.makeTestYear("Canada/Pacific", [ ["2221-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2221-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2221-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2221-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2222" : helpers.makeTestYear("Canada/Pacific", [ ["2222-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2222-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2222-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2222-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2223" : helpers.makeTestYear("Canada/Pacific", [ ["2223-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2223-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2223-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2223-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2224" : helpers.makeTestYear("Canada/Pacific", [ ["2224-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2224-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2224-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2224-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2225" : helpers.makeTestYear("Canada/Pacific", [ ["2225-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2225-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2225-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2225-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2226" : helpers.makeTestYear("Canada/Pacific", [ ["2226-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2226-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2226-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2226-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2227" : helpers.makeTestYear("Canada/Pacific", [ ["2227-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2227-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2227-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2227-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2228" : helpers.makeTestYear("Canada/Pacific", [ ["2228-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2228-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2228-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2228-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2229" : helpers.makeTestYear("Canada/Pacific", [ ["2229-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2229-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2229-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2229-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2230" : helpers.makeTestYear("Canada/Pacific", [ ["2230-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2230-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2230-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2230-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2231" : helpers.makeTestYear("Canada/Pacific", [ ["2231-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2231-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2231-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2231-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2232" : helpers.makeTestYear("Canada/Pacific", [ ["2232-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2232-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2232-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2232-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2233" : helpers.makeTestYear("Canada/Pacific", [ ["2233-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2233-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2233-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2233-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2234" : helpers.makeTestYear("Canada/Pacific", [ ["2234-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2234-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2234-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2234-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2235" : helpers.makeTestYear("Canada/Pacific", [ ["2235-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2235-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2235-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2235-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2236" : helpers.makeTestYear("Canada/Pacific", [ ["2236-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2236-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2236-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2236-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2237" : helpers.makeTestYear("Canada/Pacific", [ ["2237-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2237-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2237-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2237-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2238" : helpers.makeTestYear("Canada/Pacific", [ ["2238-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2238-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2238-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2238-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2239" : helpers.makeTestYear("Canada/Pacific", [ ["2239-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2239-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2239-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2239-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2240" : helpers.makeTestYear("Canada/Pacific", [ ["2240-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2240-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2240-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2240-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2241" : helpers.makeTestYear("Canada/Pacific", [ ["2241-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2241-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2241-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2241-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2242" : helpers.makeTestYear("Canada/Pacific", [ ["2242-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2242-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2242-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2242-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2243" : helpers.makeTestYear("Canada/Pacific", [ ["2243-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2243-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2243-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2243-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2244" : helpers.makeTestYear("Canada/Pacific", [ ["2244-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2244-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2244-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2244-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2245" : helpers.makeTestYear("Canada/Pacific", [ ["2245-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2245-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2245-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2245-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2246" : helpers.makeTestYear("Canada/Pacific", [ ["2246-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2246-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2246-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2246-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2247" : helpers.makeTestYear("Canada/Pacific", [ ["2247-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2247-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2247-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2247-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2248" : helpers.makeTestYear("Canada/Pacific", [ ["2248-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2248-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2248-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2248-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2249" : helpers.makeTestYear("Canada/Pacific", [ ["2249-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2249-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2249-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2249-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2250" : helpers.makeTestYear("Canada/Pacific", [ ["2250-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2250-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2250-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2250-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2251" : helpers.makeTestYear("Canada/Pacific", [ ["2251-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2251-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2251-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2251-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2252" : helpers.makeTestYear("Canada/Pacific", [ ["2252-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2252-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2252-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2252-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2253" : helpers.makeTestYear("Canada/Pacific", [ ["2253-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2253-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2253-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2253-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2254" : helpers.makeTestYear("Canada/Pacific", [ ["2254-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2254-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2254-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2254-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2255" : helpers.makeTestYear("Canada/Pacific", [ ["2255-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2255-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2255-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2255-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2256" : helpers.makeTestYear("Canada/Pacific", [ ["2256-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2256-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2256-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2256-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2257" : helpers.makeTestYear("Canada/Pacific", [ ["2257-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2257-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2257-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2257-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2258" : helpers.makeTestYear("Canada/Pacific", [ ["2258-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2258-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2258-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2258-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2259" : helpers.makeTestYear("Canada/Pacific", [ ["2259-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2259-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2259-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2259-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2260" : helpers.makeTestYear("Canada/Pacific", [ ["2260-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2260-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2260-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2260-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2261" : helpers.makeTestYear("Canada/Pacific", [ ["2261-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2261-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2261-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2261-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2262" : helpers.makeTestYear("Canada/Pacific", [ ["2262-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2262-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2262-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2262-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2263" : helpers.makeTestYear("Canada/Pacific", [ ["2263-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2263-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2263-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2263-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2264" : helpers.makeTestYear("Canada/Pacific", [ ["2264-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2264-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2264-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2264-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2265" : helpers.makeTestYear("Canada/Pacific", [ ["2265-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2265-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2265-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2265-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2266" : helpers.makeTestYear("Canada/Pacific", [ ["2266-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2266-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2266-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2266-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2267" : helpers.makeTestYear("Canada/Pacific", [ ["2267-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2267-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2267-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2267-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2268" : helpers.makeTestYear("Canada/Pacific", [ ["2268-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2268-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2268-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2268-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2269" : helpers.makeTestYear("Canada/Pacific", [ ["2269-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2269-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2269-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2269-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2270" : helpers.makeTestYear("Canada/Pacific", [ ["2270-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2270-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2270-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2270-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2271" : helpers.makeTestYear("Canada/Pacific", [ ["2271-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2271-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2271-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2271-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2272" : helpers.makeTestYear("Canada/Pacific", [ ["2272-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2272-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2272-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2272-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2273" : helpers.makeTestYear("Canada/Pacific", [ ["2273-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2273-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2273-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2273-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2274" : helpers.makeTestYear("Canada/Pacific", [ ["2274-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2274-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2274-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2274-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2275" : helpers.makeTestYear("Canada/Pacific", [ ["2275-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2275-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2275-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2275-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2276" : helpers.makeTestYear("Canada/Pacific", [ ["2276-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2276-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2276-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2276-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2277" : helpers.makeTestYear("Canada/Pacific", [ ["2277-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2277-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2277-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2277-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2278" : helpers.makeTestYear("Canada/Pacific", [ ["2278-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2278-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2278-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2278-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2279" : helpers.makeTestYear("Canada/Pacific", [ ["2279-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2279-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2279-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2279-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2280" : helpers.makeTestYear("Canada/Pacific", [ ["2280-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2280-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2280-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2280-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2281" : helpers.makeTestYear("Canada/Pacific", [ ["2281-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2281-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2281-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2281-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2282" : helpers.makeTestYear("Canada/Pacific", [ ["2282-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2282-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2282-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2282-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2283" : helpers.makeTestYear("Canada/Pacific", [ ["2283-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2283-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2283-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2283-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2284" : helpers.makeTestYear("Canada/Pacific", [ ["2284-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2284-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2284-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2284-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2285" : helpers.makeTestYear("Canada/Pacific", [ ["2285-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2285-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2285-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2285-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2286" : helpers.makeTestYear("Canada/Pacific", [ ["2286-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2286-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2286-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2286-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2287" : helpers.makeTestYear("Canada/Pacific", [ ["2287-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2287-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2287-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2287-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2288" : helpers.makeTestYear("Canada/Pacific", [ ["2288-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2288-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2288-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2288-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2289" : helpers.makeTestYear("Canada/Pacific", [ ["2289-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2289-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2289-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2289-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2290" : helpers.makeTestYear("Canada/Pacific", [ ["2290-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2290-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2290-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2290-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2291" : helpers.makeTestYear("Canada/Pacific", [ ["2291-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2291-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2291-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2291-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2292" : helpers.makeTestYear("Canada/Pacific", [ ["2292-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2292-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2292-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2292-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2293" : helpers.makeTestYear("Canada/Pacific", [ ["2293-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2293-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2293-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2293-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2294" : helpers.makeTestYear("Canada/Pacific", [ ["2294-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2294-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2294-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2294-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2295" : helpers.makeTestYear("Canada/Pacific", [ ["2295-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2295-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2295-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2295-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2296" : helpers.makeTestYear("Canada/Pacific", [ ["2296-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2296-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2296-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2296-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2297" : helpers.makeTestYear("Canada/Pacific", [ ["2297-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2297-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2297-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2297-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2298" : helpers.makeTestYear("Canada/Pacific", [ ["2298-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2298-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2298-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2298-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2299" : helpers.makeTestYear("Canada/Pacific", [ ["2299-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2299-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2299-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2299-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2300" : helpers.makeTestYear("Canada/Pacific", [ ["2300-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2300-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2300-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2300-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2301" : helpers.makeTestYear("Canada/Pacific", [ ["2301-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2301-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2301-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2301-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2302" : helpers.makeTestYear("Canada/Pacific", [ ["2302-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2302-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2302-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2302-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2303" : helpers.makeTestYear("Canada/Pacific", [ ["2303-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2303-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2303-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2303-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2304" : helpers.makeTestYear("Canada/Pacific", [ ["2304-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2304-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2304-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2304-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2305" : helpers.makeTestYear("Canada/Pacific", [ ["2305-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2305-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2305-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2305-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2306" : helpers.makeTestYear("Canada/Pacific", [ ["2306-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2306-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2306-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2306-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2307" : helpers.makeTestYear("Canada/Pacific", [ ["2307-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2307-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2307-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2307-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2308" : helpers.makeTestYear("Canada/Pacific", [ ["2308-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2308-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2308-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2308-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2309" : helpers.makeTestYear("Canada/Pacific", [ ["2309-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2309-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2309-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2309-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2310" : helpers.makeTestYear("Canada/Pacific", [ ["2310-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2310-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2310-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2310-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2311" : helpers.makeTestYear("Canada/Pacific", [ ["2311-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2311-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2311-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2311-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2312" : helpers.makeTestYear("Canada/Pacific", [ ["2312-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2312-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2312-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2312-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2313" : helpers.makeTestYear("Canada/Pacific", [ ["2313-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2313-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2313-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2313-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2314" : helpers.makeTestYear("Canada/Pacific", [ ["2314-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2314-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2314-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2314-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2315" : helpers.makeTestYear("Canada/Pacific", [ ["2315-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2315-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2315-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2315-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2316" : helpers.makeTestYear("Canada/Pacific", [ ["2316-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2316-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2316-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2316-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2317" : helpers.makeTestYear("Canada/Pacific", [ ["2317-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2317-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2317-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2317-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2318" : helpers.makeTestYear("Canada/Pacific", [ ["2318-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2318-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2318-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2318-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2319" : helpers.makeTestYear("Canada/Pacific", [ ["2319-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2319-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2319-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2319-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2320" : helpers.makeTestYear("Canada/Pacific", [ ["2320-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2320-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2320-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2320-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2321" : helpers.makeTestYear("Canada/Pacific", [ ["2321-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2321-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2321-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2321-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2322" : helpers.makeTestYear("Canada/Pacific", [ ["2322-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2322-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2322-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2322-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2323" : helpers.makeTestYear("Canada/Pacific", [ ["2323-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2323-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2323-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2323-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2324" : helpers.makeTestYear("Canada/Pacific", [ ["2324-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2324-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2324-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2324-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2325" : helpers.makeTestYear("Canada/Pacific", [ ["2325-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2325-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2325-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2325-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2326" : helpers.makeTestYear("Canada/Pacific", [ ["2326-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2326-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2326-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2326-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2327" : helpers.makeTestYear("Canada/Pacific", [ ["2327-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2327-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2327-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2327-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2328" : helpers.makeTestYear("Canada/Pacific", [ ["2328-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2328-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2328-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2328-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2329" : helpers.makeTestYear("Canada/Pacific", [ ["2329-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2329-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2329-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2329-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2330" : helpers.makeTestYear("Canada/Pacific", [ ["2330-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2330-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2330-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2330-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2331" : helpers.makeTestYear("Canada/Pacific", [ ["2331-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2331-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2331-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2331-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2332" : helpers.makeTestYear("Canada/Pacific", [ ["2332-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2332-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2332-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2332-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2333" : helpers.makeTestYear("Canada/Pacific", [ ["2333-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2333-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2333-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2333-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2334" : helpers.makeTestYear("Canada/Pacific", [ ["2334-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2334-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2334-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2334-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2335" : helpers.makeTestYear("Canada/Pacific", [ ["2335-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2335-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2335-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2335-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2336" : helpers.makeTestYear("Canada/Pacific", [ ["2336-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2336-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2336-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2336-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2337" : helpers.makeTestYear("Canada/Pacific", [ ["2337-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2337-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2337-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2337-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2338" : helpers.makeTestYear("Canada/Pacific", [ ["2338-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2338-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2338-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2338-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2339" : helpers.makeTestYear("Canada/Pacific", [ ["2339-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2339-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2339-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2339-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2340" : helpers.makeTestYear("Canada/Pacific", [ ["2340-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2340-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2340-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2340-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2341" : helpers.makeTestYear("Canada/Pacific", [ ["2341-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2341-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2341-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2341-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2342" : helpers.makeTestYear("Canada/Pacific", [ ["2342-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2342-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2342-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2342-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2343" : helpers.makeTestYear("Canada/Pacific", [ ["2343-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2343-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2343-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2343-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2344" : helpers.makeTestYear("Canada/Pacific", [ ["2344-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2344-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2344-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2344-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2345" : helpers.makeTestYear("Canada/Pacific", [ ["2345-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2345-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2345-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2345-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2346" : helpers.makeTestYear("Canada/Pacific", [ ["2346-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2346-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2346-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2346-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2347" : helpers.makeTestYear("Canada/Pacific", [ ["2347-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2347-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2347-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2347-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2348" : helpers.makeTestYear("Canada/Pacific", [ ["2348-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2348-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2348-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2348-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2349" : helpers.makeTestYear("Canada/Pacific", [ ["2349-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2349-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2349-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2349-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2350" : helpers.makeTestYear("Canada/Pacific", [ ["2350-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2350-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2350-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2350-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2351" : helpers.makeTestYear("Canada/Pacific", [ ["2351-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2351-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2351-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2351-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2352" : helpers.makeTestYear("Canada/Pacific", [ ["2352-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2352-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2352-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2352-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2353" : helpers.makeTestYear("Canada/Pacific", [ ["2353-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2353-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2353-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2353-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2354" : helpers.makeTestYear("Canada/Pacific", [ ["2354-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2354-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2354-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2354-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2355" : helpers.makeTestYear("Canada/Pacific", [ ["2355-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2355-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2355-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2355-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2356" : helpers.makeTestYear("Canada/Pacific", [ ["2356-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2356-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2356-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2356-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2357" : helpers.makeTestYear("Canada/Pacific", [ ["2357-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2357-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2357-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2357-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2358" : helpers.makeTestYear("Canada/Pacific", [ ["2358-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2358-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2358-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2358-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2359" : helpers.makeTestYear("Canada/Pacific", [ ["2359-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2359-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2359-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2359-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2360" : helpers.makeTestYear("Canada/Pacific", [ ["2360-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2360-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2360-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2360-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2361" : helpers.makeTestYear("Canada/Pacific", [ ["2361-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2361-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2361-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2361-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2362" : helpers.makeTestYear("Canada/Pacific", [ ["2362-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2362-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2362-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2362-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2363" : helpers.makeTestYear("Canada/Pacific", [ ["2363-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2363-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2363-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2363-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2364" : helpers.makeTestYear("Canada/Pacific", [ ["2364-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2364-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2364-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2364-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2365" : helpers.makeTestYear("Canada/Pacific", [ ["2365-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2365-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2365-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2365-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2366" : helpers.makeTestYear("Canada/Pacific", [ ["2366-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2366-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2366-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2366-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2367" : helpers.makeTestYear("Canada/Pacific", [ ["2367-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2367-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2367-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2367-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2368" : helpers.makeTestYear("Canada/Pacific", [ ["2368-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2368-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2368-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2368-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2369" : helpers.makeTestYear("Canada/Pacific", [ ["2369-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2369-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2369-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2369-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2370" : helpers.makeTestYear("Canada/Pacific", [ ["2370-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2370-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2370-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2370-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2371" : helpers.makeTestYear("Canada/Pacific", [ ["2371-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2371-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2371-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2371-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2372" : helpers.makeTestYear("Canada/Pacific", [ ["2372-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2372-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2372-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2372-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2373" : helpers.makeTestYear("Canada/Pacific", [ ["2373-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2373-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2373-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2373-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2374" : helpers.makeTestYear("Canada/Pacific", [ ["2374-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2374-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2374-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2374-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2375" : helpers.makeTestYear("Canada/Pacific", [ ["2375-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2375-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2375-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2375-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2376" : helpers.makeTestYear("Canada/Pacific", [ ["2376-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2376-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2376-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2376-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2377" : helpers.makeTestYear("Canada/Pacific", [ ["2377-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2377-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2377-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2377-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2378" : helpers.makeTestYear("Canada/Pacific", [ ["2378-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2378-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2378-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2378-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2379" : helpers.makeTestYear("Canada/Pacific", [ ["2379-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2379-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2379-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2379-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2380" : helpers.makeTestYear("Canada/Pacific", [ ["2380-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2380-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2380-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2380-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2381" : helpers.makeTestYear("Canada/Pacific", [ ["2381-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2381-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2381-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2381-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2382" : helpers.makeTestYear("Canada/Pacific", [ ["2382-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2382-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2382-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2382-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2383" : helpers.makeTestYear("Canada/Pacific", [ ["2383-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2383-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2383-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2383-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2384" : helpers.makeTestYear("Canada/Pacific", [ ["2384-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2384-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2384-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2384-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2385" : helpers.makeTestYear("Canada/Pacific", [ ["2385-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2385-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2385-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2385-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2386" : helpers.makeTestYear("Canada/Pacific", [ ["2386-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2386-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2386-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2386-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2387" : helpers.makeTestYear("Canada/Pacific", [ ["2387-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2387-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2387-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2387-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2388" : helpers.makeTestYear("Canada/Pacific", [ ["2388-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2388-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2388-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2388-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2389" : helpers.makeTestYear("Canada/Pacific", [ ["2389-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2389-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2389-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2389-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2390" : helpers.makeTestYear("Canada/Pacific", [ ["2390-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2390-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2390-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2390-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2391" : helpers.makeTestYear("Canada/Pacific", [ ["2391-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2391-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2391-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2391-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2392" : helpers.makeTestYear("Canada/Pacific", [ ["2392-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2392-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2392-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2392-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2393" : helpers.makeTestYear("Canada/Pacific", [ ["2393-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2393-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2393-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2393-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2394" : helpers.makeTestYear("Canada/Pacific", [ ["2394-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2394-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2394-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2394-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2395" : helpers.makeTestYear("Canada/Pacific", [ ["2395-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2395-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2395-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2395-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2396" : helpers.makeTestYear("Canada/Pacific", [ ["2396-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2396-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2396-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2396-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2397" : helpers.makeTestYear("Canada/Pacific", [ ["2397-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2397-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2397-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2397-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2398" : helpers.makeTestYear("Canada/Pacific", [ ["2398-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2398-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2398-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2398-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2399" : helpers.makeTestYear("Canada/Pacific", [ ["2399-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2399-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2399-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2399-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2400" : helpers.makeTestYear("Canada/Pacific", [ ["2400-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2400-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2400-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2400-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2401" : helpers.makeTestYear("Canada/Pacific", [ ["2401-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2401-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2401-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2401-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2402" : helpers.makeTestYear("Canada/Pacific", [ ["2402-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2402-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2402-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2402-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2403" : helpers.makeTestYear("Canada/Pacific", [ ["2403-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2403-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2403-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2403-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2404" : helpers.makeTestYear("Canada/Pacific", [ ["2404-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2404-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2404-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2404-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2405" : helpers.makeTestYear("Canada/Pacific", [ ["2405-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2405-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2405-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2405-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2406" : helpers.makeTestYear("Canada/Pacific", [ ["2406-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2406-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2406-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2406-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2407" : helpers.makeTestYear("Canada/Pacific", [ ["2407-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2407-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2407-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2407-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2408" : helpers.makeTestYear("Canada/Pacific", [ ["2408-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2408-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2408-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2408-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2409" : helpers.makeTestYear("Canada/Pacific", [ ["2409-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2409-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2409-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2409-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2410" : helpers.makeTestYear("Canada/Pacific", [ ["2410-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2410-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2410-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2410-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2411" : helpers.makeTestYear("Canada/Pacific", [ ["2411-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2411-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2411-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2411-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2412" : helpers.makeTestYear("Canada/Pacific", [ ["2412-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2412-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2412-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2412-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2413" : helpers.makeTestYear("Canada/Pacific", [ ["2413-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2413-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2413-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2413-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2414" : helpers.makeTestYear("Canada/Pacific", [ ["2414-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2414-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2414-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2414-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2415" : helpers.makeTestYear("Canada/Pacific", [ ["2415-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2415-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2415-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2415-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2416" : helpers.makeTestYear("Canada/Pacific", [ ["2416-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2416-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2416-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2416-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2417" : helpers.makeTestYear("Canada/Pacific", [ ["2417-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2417-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2417-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2417-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2418" : helpers.makeTestYear("Canada/Pacific", [ ["2418-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2418-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2418-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2418-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2419" : helpers.makeTestYear("Canada/Pacific", [ ["2419-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2419-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2419-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2419-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2420" : helpers.makeTestYear("Canada/Pacific", [ ["2420-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2420-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2420-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2420-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2421" : helpers.makeTestYear("Canada/Pacific", [ ["2421-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2421-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2421-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2421-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2422" : helpers.makeTestYear("Canada/Pacific", [ ["2422-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2422-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2422-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2422-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2423" : helpers.makeTestYear("Canada/Pacific", [ ["2423-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2423-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2423-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2423-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2424" : helpers.makeTestYear("Canada/Pacific", [ ["2424-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2424-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2424-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2424-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2425" : helpers.makeTestYear("Canada/Pacific", [ ["2425-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2425-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2425-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2425-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2426" : helpers.makeTestYear("Canada/Pacific", [ ["2426-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2426-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2426-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2426-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2427" : helpers.makeTestYear("Canada/Pacific", [ ["2427-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2427-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2427-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2427-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2428" : helpers.makeTestYear("Canada/Pacific", [ ["2428-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2428-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2428-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2428-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2429" : helpers.makeTestYear("Canada/Pacific", [ ["2429-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2429-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2429-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2429-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2430" : helpers.makeTestYear("Canada/Pacific", [ ["2430-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2430-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2430-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2430-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2431" : helpers.makeTestYear("Canada/Pacific", [ ["2431-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2431-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2431-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2431-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2432" : helpers.makeTestYear("Canada/Pacific", [ ["2432-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2432-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2432-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2432-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2433" : helpers.makeTestYear("Canada/Pacific", [ ["2433-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2433-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2433-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2433-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2434" : helpers.makeTestYear("Canada/Pacific", [ ["2434-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2434-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2434-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2434-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2435" : helpers.makeTestYear("Canada/Pacific", [ ["2435-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2435-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2435-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2435-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2436" : helpers.makeTestYear("Canada/Pacific", [ ["2436-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2436-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2436-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2436-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2437" : helpers.makeTestYear("Canada/Pacific", [ ["2437-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2437-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2437-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2437-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2438" : helpers.makeTestYear("Canada/Pacific", [ ["2438-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2438-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2438-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2438-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2439" : helpers.makeTestYear("Canada/Pacific", [ ["2439-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2439-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2439-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2439-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2440" : helpers.makeTestYear("Canada/Pacific", [ ["2440-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2440-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2440-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2440-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2441" : helpers.makeTestYear("Canada/Pacific", [ ["2441-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2441-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2441-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2441-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2442" : helpers.makeTestYear("Canada/Pacific", [ ["2442-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2442-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2442-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2442-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2443" : helpers.makeTestYear("Canada/Pacific", [ ["2443-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2443-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2443-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2443-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2444" : helpers.makeTestYear("Canada/Pacific", [ ["2444-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2444-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2444-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2444-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2445" : helpers.makeTestYear("Canada/Pacific", [ ["2445-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2445-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2445-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2445-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2446" : helpers.makeTestYear("Canada/Pacific", [ ["2446-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2446-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2446-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2446-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2447" : helpers.makeTestYear("Canada/Pacific", [ ["2447-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2447-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2447-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2447-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2448" : helpers.makeTestYear("Canada/Pacific", [ ["2448-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2448-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2448-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2448-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2449" : helpers.makeTestYear("Canada/Pacific", [ ["2449-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2449-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2449-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2449-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2450" : helpers.makeTestYear("Canada/Pacific", [ ["2450-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2450-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2450-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2450-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2451" : helpers.makeTestYear("Canada/Pacific", [ ["2451-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2451-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2451-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2451-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2452" : helpers.makeTestYear("Canada/Pacific", [ ["2452-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2452-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2452-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2452-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2453" : helpers.makeTestYear("Canada/Pacific", [ ["2453-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2453-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2453-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2453-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2454" : helpers.makeTestYear("Canada/Pacific", [ ["2454-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2454-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2454-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2454-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2455" : helpers.makeTestYear("Canada/Pacific", [ ["2455-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2455-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2455-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2455-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2456" : helpers.makeTestYear("Canada/Pacific", [ ["2456-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2456-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2456-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2456-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2457" : helpers.makeTestYear("Canada/Pacific", [ ["2457-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2457-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2457-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2457-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2458" : helpers.makeTestYear("Canada/Pacific", [ ["2458-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2458-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2458-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2458-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2459" : helpers.makeTestYear("Canada/Pacific", [ ["2459-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2459-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2459-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2459-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2460" : helpers.makeTestYear("Canada/Pacific", [ ["2460-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2460-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2460-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2460-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2461" : helpers.makeTestYear("Canada/Pacific", [ ["2461-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2461-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2461-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2461-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2462" : helpers.makeTestYear("Canada/Pacific", [ ["2462-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2462-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2462-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2462-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2463" : helpers.makeTestYear("Canada/Pacific", [ ["2463-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2463-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2463-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2463-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2464" : helpers.makeTestYear("Canada/Pacific", [ ["2464-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2464-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2464-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2464-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2465" : helpers.makeTestYear("Canada/Pacific", [ ["2465-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2465-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2465-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2465-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2466" : helpers.makeTestYear("Canada/Pacific", [ ["2466-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2466-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2466-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2466-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2467" : helpers.makeTestYear("Canada/Pacific", [ ["2467-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2467-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2467-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2467-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2468" : helpers.makeTestYear("Canada/Pacific", [ ["2468-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2468-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2468-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2468-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2469" : helpers.makeTestYear("Canada/Pacific", [ ["2469-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2469-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2469-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2469-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2470" : helpers.makeTestYear("Canada/Pacific", [ ["2470-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2470-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2470-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2470-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2471" : helpers.makeTestYear("Canada/Pacific", [ ["2471-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2471-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2471-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2471-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2472" : helpers.makeTestYear("Canada/Pacific", [ ["2472-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2472-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2472-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2472-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2473" : helpers.makeTestYear("Canada/Pacific", [ ["2473-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2473-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2473-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2473-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2474" : helpers.makeTestYear("Canada/Pacific", [ ["2474-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2474-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2474-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2474-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2475" : helpers.makeTestYear("Canada/Pacific", [ ["2475-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2475-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2475-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2475-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2476" : helpers.makeTestYear("Canada/Pacific", [ ["2476-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2476-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2476-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2476-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2477" : helpers.makeTestYear("Canada/Pacific", [ ["2477-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2477-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2477-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2477-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2478" : helpers.makeTestYear("Canada/Pacific", [ ["2478-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2478-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2478-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2478-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2479" : helpers.makeTestYear("Canada/Pacific", [ ["2479-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2479-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2479-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2479-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2480" : helpers.makeTestYear("Canada/Pacific", [ ["2480-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2480-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2480-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2480-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2481" : helpers.makeTestYear("Canada/Pacific", [ ["2481-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2481-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2481-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2481-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2482" : helpers.makeTestYear("Canada/Pacific", [ ["2482-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2482-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2482-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2482-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2483" : helpers.makeTestYear("Canada/Pacific", [ ["2483-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2483-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2483-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2483-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2484" : helpers.makeTestYear("Canada/Pacific", [ ["2484-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2484-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2484-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2484-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2485" : helpers.makeTestYear("Canada/Pacific", [ ["2485-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2485-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2485-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2485-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2486" : helpers.makeTestYear("Canada/Pacific", [ ["2486-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2486-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2486-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2486-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2487" : helpers.makeTestYear("Canada/Pacific", [ ["2487-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2487-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2487-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2487-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2488" : helpers.makeTestYear("Canada/Pacific", [ ["2488-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2488-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2488-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2488-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2489" : helpers.makeTestYear("Canada/Pacific", [ ["2489-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2489-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2489-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2489-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2490" : helpers.makeTestYear("Canada/Pacific", [ ["2490-03-12T09:59:59+00:00", "01:59:59", "PST", 480], ["2490-03-12T10:00:00+00:00", "03:00:00", "PDT", 420], ["2490-11-05T08:59:59+00:00", "01:59:59", "PDT", 420], ["2490-11-05T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2491" : helpers.makeTestYear("Canada/Pacific", [ ["2491-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2491-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2491-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2491-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2492" : helpers.makeTestYear("Canada/Pacific", [ ["2492-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2492-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2492-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2492-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2493" : helpers.makeTestYear("Canada/Pacific", [ ["2493-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2493-03-08T10:00:00+00:00", "03:00:00", "PDT", 420], ["2493-11-01T08:59:59+00:00", "01:59:59", "PDT", 420], ["2493-11-01T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2494" : helpers.makeTestYear("Canada/Pacific", [ ["2494-03-14T09:59:59+00:00", "01:59:59", "PST", 480], ["2494-03-14T10:00:00+00:00", "03:00:00", "PDT", 420], ["2494-11-07T08:59:59+00:00", "01:59:59", "PDT", 420], ["2494-11-07T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2495" : helpers.makeTestYear("Canada/Pacific", [ ["2495-03-13T09:59:59+00:00", "01:59:59", "PST", 480], ["2495-03-13T10:00:00+00:00", "03:00:00", "PDT", 420], ["2495-11-06T08:59:59+00:00", "01:59:59", "PDT", 420], ["2495-11-06T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2496" : helpers.makeTestYear("Canada/Pacific", [ ["2496-03-11T09:59:59+00:00", "01:59:59", "PST", 480], ["2496-03-11T10:00:00+00:00", "03:00:00", "PDT", 420], ["2496-11-04T08:59:59+00:00", "01:59:59", "PDT", 420], ["2496-11-04T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2497" : helpers.makeTestYear("Canada/Pacific", [ ["2497-03-10T09:59:59+00:00", "01:59:59", "PST", 480], ["2497-03-10T10:00:00+00:00", "03:00:00", "PDT", 420], ["2497-11-03T08:59:59+00:00", "01:59:59", "PDT", 420], ["2497-11-03T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2498" : helpers.makeTestYear("Canada/Pacific", [ ["2498-03-09T09:59:59+00:00", "01:59:59", "PST", 480], ["2498-03-09T10:00:00+00:00", "03:00:00", "PDT", 420], ["2498-11-02T08:59:59+00:00", "01:59:59", "PDT", 420], ["2498-11-02T09:00:00+00:00", "01:00:00", "PST", 480] ]), "2499" : helpers.makeTestYear("Canada/Pacific", [ ["2499-03-08T09:59:59+00:00", "01:59:59", "PST", 480], ["2499-03-08T10:00:00+00:00", "03:00:00", "PDT", 420] ]) };
almamedia/moment-timezone
tests/zones/canada/pacific.js
JavaScript
mit
158,275
(function() { 'use strict'; const type = require('ee-types'); const Base = require('./Base'); const log = require('ee-log'); module.exports = class Client extends Base { constructor() { super(); this.parse(); this.initialize(); } /** * checks what to do */ initialize() { if (this.params.server) { this.mode = 'server'; } else if (this.params.report) { this.mode = 'report'; } else if (this.params.client) { this.mode = 'client'; } else this.warn(`Expected 'server', 'client' or 'report' as parameter 0!`).exit(1); } /** * configures the cli */ parse() { let args = []; process.argv.slice(2).join(' ').replace(/(\s--|\s-)/gi, '$1@').split(/\s--|\s-/gi).forEach((arg) => { if (arg[0] !== '@') args.push(...arg.split(/\s/).map(v => ({name: v, value: true}))); else { if (/\s|=/gi.test(arg)) { // kv pairs let parts = arg.split(/\s|=/gi); args.push({name: parts[0].slice(1), value: parts.slice(1).join(' ')}); } else args.push({name: arg.slice(1), value: true}); } }); this.params = {}; args.forEach(item => this.params[item.name] = item.value); } }; })();
joinbox/burp-report
lib/Cli.js
JavaScript
mit
1,621
/** * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or http://ckeditor.com/license */ ( function() { /* global confirm */ CKEDITOR.plugins.add( 'pastefromword', { requires: 'clipboard', // jscs:disable maximumLineLength lang: 'af,ar,bg,bn,bs,ca,cs,cy,da,de,de-ch,el,en,en-au,en-ca,en-gb,eo,es,et,eu,fa,fi,fo,fr,fr-ca,gl,gu,he,hi,hr,hu,id,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,oc,pl,pt,pt-br,ro,ru,si,sk,sl,sq,sr,sr-latn,sv,th,tr,tt,ug,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE% // jscs:enable maximumLineLength icons: 'pastefromword,pastefromword-rtl', // %REMOVE_LINE_CORE% hidpi: true, // %REMOVE_LINE_CORE% init: function( editor ) { var commandName = 'pastefromword', // Flag indicate this command is actually been asked instead of a generic pasting. forceFromWord = 0, path = this.path; editor.addCommand( commandName, { // Snapshots are done manually by editable.insertXXX methods. canUndo: false, async: true, exec: function( editor ) { var cmd = this; forceFromWord = 1; // Force html mode for incomming paste events sequence. editor.once( 'beforePaste', forceHtmlMode ); editor.getClipboardData( { title: editor.lang.pastefromword.title }, function( data ) { // Do not use editor#paste, because it would start from beforePaste event. data && editor.fire( 'paste', { type: 'html', dataValue: data.dataValue, method: 'paste', dataTransfer: CKEDITOR.plugins.clipboard.initPasteDataTransfer() } ); editor.fire( 'afterCommandExec', { name: commandName, command: cmd, returnValue: !!data } ); } ); } } ); // Register the toolbar button. editor.ui.addButton && editor.ui.addButton( 'PasteFromWord', { label: editor.lang.pastefromword.toolbar, command: commandName, toolbar: 'clipboard,50' } ); editor.on( 'pasteState', function( evt ) { editor.getCommand( commandName ).setState( evt.data ); } ); // Features brought by this command beside the normal process: // 1. No more bothering of user about the clean-up. // 2. Perform the clean-up even if content is not from Microsoft Word. // (e.g. from a Microsoft Word similar application.) // 3. Listen with high priority (3), so clean up is done before content // type sniffing (priority = 6). editor.on( 'paste', function( evt ) { var data = evt.data, mswordHtml = data.dataValue, wordRegexp = /(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument|<o:\w+>|<\/font>)/, pfwEvtData = { dataValue: mswordHtml }; if ( !mswordHtml || !( forceFromWord || wordRegexp.test( mswordHtml ) ) ) { return; } // PFW might still get prevented, if it's not forced. if ( editor.fire( 'pasteFromWord', pfwEvtData ) === false && !forceFromWord ) { return; } // Do not apply paste filter to data filtered by the Word filter (#13093). data.dontFilter = true; // If filter rules aren't loaded then cancel 'paste' event, // load them and when they'll get loaded fire new paste event // for which data will be filtered in second execution of // this listener. var isLazyLoad = loadFilterRules( editor, path, function() { // Event continuation with the original data. if ( isLazyLoad ) { editor.fire( 'paste', data ); } else if ( !editor.config.pasteFromWordPromptCleanup || ( forceFromWord || confirm( editor.lang.pastefromword.confirmCleanup ) ) ) { pfwEvtData.dataValue = CKEDITOR.cleanWord( pfwEvtData.dataValue, editor ); editor.fire( 'afterPasteFromWord', pfwEvtData ); data.dataValue = pfwEvtData.dataValue; } // Reset forceFromWord. forceFromWord = 0; } ); // The cleanup rules are to be loaded, we should just cancel // this event. isLazyLoad && evt.cancel(); }, null, null, 3 ); } } ); function loadFilterRules( editor, path, callback ) { var isLoaded = CKEDITOR.cleanWord; if ( isLoaded ) callback(); else { var filterFilePath = CKEDITOR.getUrl( editor.config.pasteFromWordCleanupFile || ( path + 'filter/default.js' ) ); // Load with busy indicator. CKEDITOR.scriptLoader.load( filterFilePath, callback, null, true ); } return !isLoaded; } function forceHtmlMode( evt ) { evt.data.type = 'html'; } } )(); /** * Whether to prompt the user about the clean up of content being pasted from Microsoft Word. * * config.pasteFromWordPromptCleanup = true; * * @since 3.1 * @cfg {Boolean} [pasteFromWordPromptCleanup=false] * @member CKEDITOR.config */ /** * The file that provides the Microsoft Word cleanup function for pasting operations. * * **Note:** This is a global configuration shared by all editor instances present * on the page. * * // Load from the 'pastefromword' plugin 'filter' sub folder (custom.js file) using a path relative to the CKEditor installation folder. * CKEDITOR.config.pasteFromWordCleanupFile = 'plugins/pastefromword/filter/custom.js'; * * // Load from the 'pastefromword' plugin 'filter' sub folder (custom.js file) using a full path (including the CKEditor installation folder). * CKEDITOR.config.pasteFromWordCleanupFile = '/ckeditor/plugins/pastefromword/filter/custom.js'; * * // Load custom.js file from the 'customFilters' folder (located in server's root) using the full URL. * CKEDITOR.config.pasteFromWordCleanupFile = 'http://my.example.com/customFilters/custom.js'; * * @since 3.1 * @cfg {String} [pasteFromWordCleanupFile=<plugin path> + 'filter/default.js'] * @member CKEDITOR.config */ /** * Fired when the pasted content was recognized as Microsoft Word content. * * This event is cancellable. If canceled, it will prevent Paste from Word processing. * * @since 4.6.0 * @event pasteFromWord * @param data * @param {String} data.dataValue Pasted content. Changes to this property will affect the pasted content. * @member CKEDITOR.editor */ /** * Fired after the Paste form Word filters have been applied. * * @since 4.6.0 * @event afterPasteFromWord * @param data * @param {String} data.dataValue Pasted content after processing. Changes to this property will affect the pasted content. * @member CKEDITOR.editor */
Rudhie/simlab
assets/ckeditor/plugins/pastefromword/plugin.js
JavaScript
mit
6,348
exports.doSomething = function() { console.log('YO!'); };
digitalbazaar/bedrock-dev-manager
util.js
JavaScript
mit
60
#!/usr/bin/env node // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var marked = require('marked'); var fs = require('fs'); var path = require('path'); var findMarkdownFile = require('./lib/find-markdown-file.js'); var getConfigForMarkdownFile = require('./lib/get-config-for-markdown-file.js'); var html = require('./html.js'); var json = require('./json.js'); // parse the args. // Don't use nopt or whatever for this. It's simple enough. var args = process.argv.slice(2); var format = 'json'; var template = null; var inputFile = null; args.forEach(function (arg) { if (!arg.match(/^\-\-/)) { inputFile = arg; } else if (arg.match(/^\-\-format=/)) { format = arg.replace(/^\-\-format=/, ''); } else if (arg.match(/^\-\-template=/)) { template = arg.replace(/^\-\-template=/, ''); } }) if (!inputFile) { throw new Error('No input file specified'); } console.error('Input file = %s', inputFile); fs.readFile(inputFile, 'utf8', function(er, input) { if (er) throw er; // process the input for @include lines processIncludes(input, next); }); var includeExpr = /^@include\s+([A-Za-z0-9-_]+)(?:\.)?([a-zA-Z]*)$/gmi; var includeData = {}; function processIncludes(input, cb) { var includes = input.match(includeExpr); if (includes === null) return cb(null, input); var errState = null; console.error(includes); var incCount = includes.length; if (incCount === 0) cb(null, input); includes.forEach(function(include) { var fname = include.replace(/^@include\s+/, ''); findMarkdownFile(path.resolve(path.dirname(inputFile), fname), function(err, file) { if (err) throw err; if (includeData.hasOwnProperty(file)) { input = input.split(include).join(includeData[file]); incCount--; if (incCount === 0) { return cb(null, input); } } var fullFname = path.resolve(path.dirname(inputFile), file); fs.readFile(fullFname, 'utf8', function(err, inc) { if (errState) return; if (err) return cb(errState = err); processIncludes(inc, function(err, inc) { if (errState) return; if (err) return cb(errState = err); incCount--; includeData[file] = inc; input = input.split(include + '\n').join(includeData[file] + '\n'); if (incCount === 0) { return cb(null, input); } }); }); }); }); } function next(er, input) { if (er) throw er; switch (format) { case 'json': json(input, inputFile, function(er, obj) { console.log(JSON.stringify(obj, null, 2)); if (er) throw er; }); break; case 'html': var configObj = getConfigForMarkdownFile(inputFile); html(input, inputFile, template, configObj, function(er, html) { if (er) throw er; console.log(html); }); break; default: throw new Error('Invalid format: ' + format); } }
joyent/node-documentation-generator
generate.js
JavaScript
mit
4,044
var routes = require('express').Router(); var User = require('../models/user'), School = require('../models/school'); var schools = require('./schools'), school_types = require('./school_types'), school_regions = require('./school_regions'), tasks = require('./tasks'), task_types = require('./task_types'), users = require('./users'), html = require('./html'), init = require('./init'), update = require('./update'), submit = require('./submit'); function isUniversity(school) { return school.level === 'vysoká škola'; } function isHigherSchool(school) { return school.level === 'vyšší odborná škola'; } routes.get('/', function(req, res, next) { School.where({ soft_deleted: false }).fetchAll().then(function(collection) { collection.load(['type', 'region']).then(function(loadedCollection) { var json = loadedCollection.toJSON(); var universities = json.filter(isUniversity); var higherSchools = json.filter(isHigherSchool); res.render('index', { title: 'Dotazník', page: 'questionnaire', universities: universities, higherSchools: higherSchools }); }); }).catch(function(error) { res.render('error', { page: 'error', error: error }); }); }); routes.get('/results', function(req, res, next) { if (req.query.pass !== 'supertajne') { res.status(400).render('error', { page: 'error', message: 'Not Found', error: { status: 404 } }); return; } User.forge().orderBy('updated_at', 'ASC').fetchAll().then(function(collection) { collection.load(['school', 'results']).then(function(loadedCollection) { res.render('results', { title: 'Výsledky', page: 'results', data: loadedCollection.toJSON(), correctAnswers: { 1: ['c', 'a', 'b', 'c', 'a'], 4: ['a', 'c', 'c', 'b', 'c'], 2: [ 'třešeň, kiwi, jahoda, citron', 'mrkev, meloun, rajče, paprika', 'želva, pes, panda, jablko, opice', 'žirafa, ovce, mrkev, liška, prase', 'myš, citron, rajče, had, paprika, krokodýl', 'veverka, maliny, slon, kiwi, kůň, kukuřice', 'meloun, medvěd, dýně, kočka, borůvky, banán, klokan', 'ježek, hruška, hrozno, brokolice, tučňák, panda, kráva', 'ředkev, mrkev, želva, slon, slepice, maliny, pes, kočka', 'pes, veverka, kuře, třešeň, rajče, osel, kočka, paprika' ], 5: [ 'mrkev, opice, kukuřice, krokodýl', 'liška, třešeň, žirafa, jahoda', 'kiwi, rajče, meloun, paprika, citron', 'prase, kůň, borůvky, slon, ježek', 'ovce, panda, banán, tučňák, maliny, medvěd', 'kočka, slepice, myš, hrozno, kuře, had', 'ředkev, hruška, osel, veverka, slon, klokan, želva', 'dýně, borůvky, pes, kočka, brokolice, medvěd, paprika', 'kráva, kočka, kuře, panda, pes, kiwi, jahoda, želva', 'rajče, pes, třešeň, krokodýl, meloun, kůň, banán, hrozno' ], 3: [ '3, 4, 1, 2', '2, 7, 8, 5', '9, 2, 3, 5, 4', '8, 1, 2, 3, 0', '1, 4, 5, 9, 2, 7', '2, 0, 4, 3, 8, 5', '9, 2, 3, 1, 4, 5, 6', '5, 4, 2, 7, 8, 0, 3', '0, 1, 5, 9, 3, 7, 1, 4', '5, 2, 6, 4, 7, 3, 8, 1' ], 6: [ '5, 4, 8, 9', '3, 7, 5, 1', '2, 7, 3, 9, 0', '1, 1, 6, 2, 3', '8, 5, 6, 0, 1, 8', '7, 9, 1, 3, 6, 3', '4, 3, 7, 4, 1, 6, 5', '6, 0, 5, 2, 9, 1, 3', '1, 2, 6, 0, 2, 6, 0, 5', '6, 3, 7, 5, 8, 4, 9, 2' ] } }); }); }).catch(function(error) { res.status(400).json(error); }); }); routes.post('/submit', submit); routes.use('/schools', schools); routes.use('/school-types', school_types); routes.use('/school-regions', school_regions); routes.use('/tasks', tasks); routes.use('/task-types', task_types); routes.use('/users', users); routes.use('/html/task', html); routes.use('/init', init); routes.use('/update', update); module.exports = routes;
mdrbohlav/eva-bp
routes/index.js
JavaScript
mit
4,586
"use strict"; var expect = require("expect.js"), clientLogger = require("../../lib/client/logger.client.js"), sharedLogger = require("../../lib/shared/logger.js"); describe("Logger", function() { var logger; describe("#onClient", function() { beforeEach(function () { logger = clientLogger; }); it("should return the different log-types", function() { expect(logger.get("server")).not.to.be(undefined); expect(logger.get("core")).not.to.be(undefined); expect(logger.get("build")).not.to.be(undefined); }); it("should have methods for the log-levels", function() { var log = logger.get("server"); expect(log.info).to.be.a("function"); expect(log.warn).to.be.a("function"); expect(log.error).to.be.a("function"); expect(log.debug).to.be.a("function"); expect(log.silly).to.be.a("function"); expect(log.verbose).to.be.a("function"); expect(log.bullshit).to.be(undefined); }); }); describe("#onServer", function() { beforeEach(function () { logger = sharedLogger; }); it("should return the different log-types", function() { expect(logger.get("server")).not.to.be(undefined); expect(logger.get("core")).not.to.be(undefined); expect(logger.get("build")).not.to.be(undefined); }); it("should have methods for the log-levels", function() { var log = logger.get("server"); expect(log.info).to.be.a("function"); expect(log.warn).to.be.a("function"); expect(log.error).to.be.a("function"); expect(log.debug).to.be.a("function"); expect(log.silly).to.be.a("function"); expect(log.verbose).to.be.a("function"); expect(log.bullshit).to.be(undefined); }); }); });
peerigon/alamid
test/shared/logger.test.js
JavaScript
mit
1,974
$(document).ready(function(){ if (localStorage.getItem("messageRead") === null ||localStorage.getItem("messageRead")=='0' ) { $('#msgModal').modal('toggle'); }else{ $('#msgModal').modal('hide'); } }) $('#messageOk').click(function(){ $('#msgModal').modal('hide'); localStorage.setItem("messageRead",'1') })
Tr8rStudios/pokemongo_map
js/message.js
JavaScript
mit
343
import {Router} from 'express'; import passport from 'passport'; import {isAuthenticated, fillAuthorizationHeaderFromCookie} from '../auth.service'; import * as controller from './controller'; const router = new Router(); router .get('/signin', passport.authenticate('facebook', { callbackURL: '/auth/facebook/signin/callback', session: false })) .get('/signin/callback', passport.authenticate('facebook', { successURL: '/', callbackURL: '/auth/facebook/signin/callback', session: false }), controller.signin) .get('/connect', fillAuthorizationHeaderFromCookie(), isAuthenticated(), passport.authenticate('facebook', {callbackURL: '/auth/facebook/connect/callback'})) .get('/connect/callback', fillAuthorizationHeaderFromCookie(), isAuthenticated(), controller.connect) .post('/disconnect', isAuthenticated(), controller.disconnect); export default router;
omrilitov/react-universal
api/auth/facebook/index.js
JavaScript
mit
895
var Scene = (function Scene() { function Scene(model) { this.model = model; this.name = model.name; this.sceneObjects = []; this.sceneObjectsByName = {}; this.game = null; // parent } Scene.prototype = { constructor: Scene, resetFromModel: function() { this.sceneObjects.forEach(function(sceneObject) { sceneObject.resetFromModel(); }); }, update: function(gameTime) { this.sceneObjects.forEach(function(sceneObject) { sceneObject.update(gameTime); }); }, render: function(ctx) { ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); this.sceneObjects.forEach(function(sceneObject) { sceneObject.render(ctx); }); }, addSceneObject: function(sceneObject) { if (this.sceneObjectsByName[sceneObject.name]) { throw new Error("SceneObject with name, '" + sceneObject.name + ",' already exists."); } this.sceneObjectsByName[sceneObject.name] = sceneObject; this.sceneObjects.push(sceneObject); sceneObject.scene = this; }, getModel: function() { var model = JSON.parse(JSON.stringify(this.model)); // clone this.sceneObjects.forEach(function(sceneObject) { model.sceneObjects[sceneObject.name] = sceneObject.getModel(); }); return model; } } function create(name) { // default model var model = { modelType: 'Scene', name: name, sceneObjects: {} }; return new Scene(model); } function load(json) { } return { create: create, load: load }; }());
shoerob/GameBuilder
src/engine/Scene.js
JavaScript
mit
1,477
import attr from 'ember-data/attr'; import {belongsTo} from 'ember-data/relationships'; import Model from 'ember-data/model'; export default Model.extend({ name: attr("string", { label: "Competition Name", description: "The name of the competition" }), horse: belongsTo("horse", { label: "Victorious Horse", description: "The name of the horse who was victorious at this championship", async: true }) });
autoxjs/ember-autox-support
tests/dummy/app/models/championship.js
JavaScript
mit
434
$("#locale").val(Grocy.UserSettings.locale); RefreshLocaleNumberInput();
berrnd/grocy
public/viewjs/usersettings.js
JavaScript
mit
74
/** * Sample React Native App * https://github.com/facebook/react-native * @flow */ import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View } from 'react-native'; import Onboarding from './src/components/Onboarding'; import Main from './src/components/Main'; import { Router, Scene, Actions } from 'react-native-router-flux'; class equiauction extends Component { render() { return ( <Router hideNavBar={true}> <Scene name="Onboarding" key="onboarding" component={Onboarding} title="Onboarding" initial={true} /> <Scene key="main" component={Main} title="Main" /> </Router> ); } } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', }, welcome: { fontSize: 20, textAlign: 'center', margin: 10, }, instructions: { textAlign: 'center', color: '#333333', marginBottom: 5, }, }); AppRegistry.registerComponent('equiauction', () => equiauction);
topguru/React-Equiaction
index.ios.js
JavaScript
mit
1,143
/** * Problem: https://leetcode.com/problems/valid-anagram/ Given two strings s and t, write a function to determine if t is an anagram of s. You may assume the string contains only lowercase alphabets. * Example: s = "anagram", t = "nagaram", return true. s = "rat", t = "car", return false. * @param {string} s * @param {string} t * @return {boolean} * Analysis: This is a compare question, thus we can think of solutions like hash, sort, etc. */ export const validAnagram = {}; /** * Solution 1: use hash to compare * * "N" is string length * Time complexity: O(N) * Space complexity: O(N) */ validAnagram.hash = (s, t) => { if (typeof s !== "string" || typeof t !== "string" || s.length !== t.length) { return false; } const len = s.length; const _hash = {}; let i = 0; while (i < len) { if (typeof _hash[s[i]] === "number") { _hash[s[i]] += 1; } else { _hash[s[i]] = 1; } if (typeof _hash[t[i]] === "number") { _hash[t[i]] -= 1; } else { _hash[t[i]] = -1; } i += 1; } for (const key in _hash) { if (_hash[key] !== 0) { return false; } } return true; }; /** * Solution 2: use str->array to sort * * "N" is string length * Time complexity: O(NlogN) * Space complexity: O(N) */ validAnagram.sort = (s, t) => { if (typeof s !== "string" || typeof t !== "string" || s.length !== t.length) { return false; } const sortStr = (str) => str.split("").sort(); const compareArr = (arr, arr2) => { if (arr.length !== arr2.length) { return false; } for (let i = arr.length - 1; i >= 0; i--) { if (arr[i] !== arr2[i]) { return false; } } return true; }; return compareArr(sortStr(s), sortStr(t)); }; /** * Solution 3: use alphabets array as mediator(unlike Hash, Array needs the alphabets pre-condition) * * "N" is string length * Time complexity: O(N) * Space complexity: O(N) */ validAnagram.alphaTable = (s, t) => { if (typeof s !== "string" || typeof t !== "string" || s.length !== t.length) { return false; } const alphaTable = []; const baseCode = 97; for (let i = s.length - 1; i >= 0; i--) { if (typeof alphaTable[s[i].charCodeAt(0) - baseCode] !== "number") { alphaTable[s[i].charCodeAt(0) - baseCode] = 1; } else { alphaTable[s[i].charCodeAt(0) - baseCode] += 1; } if (typeof alphaTable[t[i].charCodeAt(0) - baseCode] !== "number") { alphaTable[t[i].charCodeAt(0) - baseCode] = -1; } else { alphaTable[t[i].charCodeAt(0) - baseCode] -= 1; } } return alphaTable.every((val) => !val); }; /** * Lessons: 1. The alphaTable solution is most efficient epecially on case that has many same chars in both strings. 2. Some restrictions on Array make it unable to handle specific chars well. 3. Array#forEach doesn't hv native ability to break, it needs thrown exception to break! Use Array#some/every instead. */
Williammer/leetcode-js
src/242.validAnagram/242.validAnagram.js
JavaScript
mit
2,996
tagSchema.statics.getByObjectId = function (id, callback) { var query = this.findById(id); query.exec(function (err, results) { if (err) { callback(err, null); } if (results === null) { callback('no data', null); } else { callback(null, results); } }); };
BankOfGiving/Bog.io
server/data/repositories/bog.data.repositories.tag.js
JavaScript
mit
343
var test = require('tape') var inject = require('../index.js') test('insert undefined into string', function (t) { t.plan(1) var result = inject('123', undefined, 1) t.equal(result, '1undefined23') }) test('insert a Number into string', function (t) { t.plan(1) var result = inject('123', 4, 1) t.equal(result, '1423') }) test('insert a String into string', function (t) { t.plan(1) var result = inject('123', 'yo', 2) t.equal(result, '12yo3') }) test('insert an Array of mixed values into string', function (t) { t.plan(1) var result = inject('123', [4, true, 'yo'], 1) t.equal(result, '14,true,yo23') })
grindcode/flat-insert
test/strings.js
JavaScript
mit
634
version https://git-lfs.github.com/spec/v1 oid sha256:bc9b4fc55bf58840a89f6189a9bc0999c67938b77c5196cd102e35afcd14aeef size 15727
yogeshsaroya/new-cdnjs
ajax/libs/openlayers/2.13.1/lib/OpenLayers/Geometry/LinearRing.js
JavaScript
mit
130
version https://git-lfs.github.com/spec/v1 oid sha256:d6e3e27a76022169dad45dfd1c8f483a004bed15139853bf23ff62e66795d38d size 130077
yogeshsaroya/new-cdnjs
ajax/libs/handlebars.js/3.0.0/handlebars.amd.js
JavaScript
mit
131
var path = require('path'); var cloneStats = require('clone-stats'); var isBuffer = require('./lib/isBuffer'); var isStream = require('./lib/isStream'); var isNull = require('./lib/isNull'); var inspectStream = require('./lib/inspectStream'); var cloneBuffer = require('./lib/cloneBuffer'); function File(file) { if (!file) file = {}; // TODO: should this be moved to vinyl-fs? this.cwd = file.cwd || process.cwd(); this.base = file.base || this.cwd; this.path = file.path || null; // stat = fs stats object // TODO: should this be moved to vinyl-fs? this.stat = file.stat || null; // Meta data property for passing data to other plugins (see gulp-data) this.data = file.data || null; // contents = stream, buffer, or null if not read this.contents = file.contents || null; } File.prototype.isBuffer = function() { return isBuffer(this.contents); }; File.prototype.isStream = function() { return isStream(this.contents); }; File.prototype.isNull = function() { return isNull(this.contents); }; // TODO: should this be moved to vinyl-fs? File.prototype.isDirectory = function() { return this.isNull() && this.stat && this.stat.isDirectory(); }; File.prototype.clone = function() { var clonedContents = this.isBuffer() ? cloneBuffer(this.contents) : this.contents; var clonedStat = this.stat ? cloneStats(this.stat) : null; return new File({ cwd: this.cwd, base: this.base, path: this.path, stat: clonedStat, contents: clonedContents }); }; File.prototype.pipe = function(stream, opt) { if (!opt) opt = {}; if (typeof opt.end === 'undefined') opt.end = true; if (this.isStream()) { return this.contents.pipe(stream, opt); } if (this.isBuffer()) { if (opt.end) { stream.end(this.contents); } else { stream.write(this.contents); } return stream; } if (this.isNull()) { if (opt.end) stream.end(); return stream; } }; File.prototype.inspect = function() { var inspect = []; // use relative path if possible var filePath = (this.base && this.path) ? this.relative : this.path; if (filePath) { inspect.push('"'+filePath+'"'); } if (this.isBuffer()) { inspect.push(this.contents.inspect()); } if (this.isStream()) { inspect.push(inspectStream(this.contents)); } return '<File '+inspect.join(' ')+'>'; }; // virtual attributes // or stuff with extra logic Object.defineProperty(File.prototype, 'contents', { get: function() { return this._contents; }, set: function(val) { if (!isBuffer(val) && !isStream(val) && !isNull(val)) { throw new Error("File.contents can only be a Buffer, a Stream, or null."); } this._contents = val; } }); // TODO: should this be moved to vinyl-fs? Object.defineProperty(File.prototype, 'relative', { get: function() { if (!this.base) throw new Error('No base specified! Can not get relative.'); if (!this.path) throw new Error('No path specified! Can not get relative.'); return path.relative(this.base, this.path); }, set: function() { throw new Error('File.relative is generated from the base and path attributes. Do not modify it.'); } }); module.exports = File;
colynb/vinyl
index.js
JavaScript
mit
3,212
(function() { 'use strict'; /************************************************************************************ * @ngdoc controller * @name TopbarController * @module metricapp * @requires $scope * @requires $location * @requires AUTH_EVENTS * * @description * Manages the topbar for all users. * Realizes the control layer for {topbar.directive}. ************************************************************************************/ angular.module('metricapp') .controller('TopbarController', TopbarController); TopbarController.$inject = ['$scope', '$location', 'AuthService', 'AUTH_EVENTS']; function TopbarController($scope, $location, AuthService, AUTH_EVENTS) { var vm = this; function _render() { if ($rootScope.globals && $rootScope.globals.user) { // } else { // } } function _init() { _render(); $scope.$on(AUTH_EVENTS.LOGIN_SUCCESS, _render); $scope.$on(AUTH_EVENTS.LOGOUT_SUCCESS, _render); } } })();
metricAppTeam/metricapp-client
app/core/navigation/topbar/topbar.controller.js
JavaScript
mit
1,017
// eslint-disable-next-line import/prefer-default-export export const makeAsyncCallback = (callbackValue) => { let promiseResolve; const promise = new Promise((resolve) => { promiseResolve = resolve; }); const func = jest.fn( callbackValue ? () => promiseResolve(callbackValue) : (...args) => promiseResolve(args.length === 1 ? args[0] : args), ); return { promise, func }; }; export const loadPDF = (path) => { const fs = require('fs'); const raw = fs.readFileSync(path); const arrayBuffer = raw.buffer; const blob = new Blob([arrayBuffer], { type: 'application/pdf' }); const file = new File([arrayBuffer], { type: 'application/pdf' }); const dataURI = `data:application/pdf;base64,${raw.toString('base64')}`; return { raw, arrayBuffer, blob, file, dataURI, }; }; export const muteConsole = () => { global.consoleBackup = global.console; global.console = { log: jest.fn(), error: jest.fn(), warn: jest.fn(), }; }; export const restoreConsole = () => { global.console = global.consoleBackup; };
AngeliaGong/AngeliaGong.github.io
node_modules/react-pdf/src/__tests__/utils.js
JavaScript
mit
1,092
(function() { var React, SelectionComponent, SelectionsComponent, div, isEqualForProperties; React = require('react-atom-fork'); div = require('reactionary-atom-fork').div; isEqualForProperties = require('underscore-plus').isEqualForProperties; SelectionComponent = require('./selection-component'); module.exports = SelectionsComponent = React.createClass({ displayName: 'SelectionsComponent', render: function() { return div({ className: 'selections' }, this.renderSelections()); }, renderSelections: function() { var editor, lineHeightInPixels, screenRange, selectionComponents, selectionId, selectionScreenRanges, _ref; _ref = this.props, editor = _ref.editor, selectionScreenRanges = _ref.selectionScreenRanges, lineHeightInPixels = _ref.lineHeightInPixels; selectionComponents = []; for (selectionId in selectionScreenRanges) { screenRange = selectionScreenRanges[selectionId]; selectionComponents.push(SelectionComponent({ key: selectionId, screenRange: screenRange, editor: editor, lineHeightInPixels: lineHeightInPixels })); } return selectionComponents; }, componentWillMount: function() { return this.selectionRanges = {}; }, shouldComponentUpdate: function(newProps) { return !isEqualForProperties(newProps, this.props, 'selectionScreenRanges', 'lineHeightInPixels', 'defaultCharWidth'); } }); }).call(this);
dwings/atom-windows
resources/app/src/selections-component.js
JavaScript
mit
1,509
import { DEFAULT_OPTIONS, UPPERCASE_START, UPPERCASE_END, FOUR_CHAR_EDGECASES, FROM_ROMAJI, } from './constants'; import isCharInRange from './utils/isCharInRange'; import isCharUpperCase from './utils/isCharUpperCase'; import getChunkSize from './utils/getChunkSize'; import getChunk from './utils/getChunk'; import isCharConsonant from './utils/isCharConsonant'; import isCharVowel from './utils/isCharVowel'; import hiraganaToKatakana from './utils/hiraganaToKatakana'; import isKana from './isKana'; /** * Convert [Romaji](https://en.wikipedia.org/wiki/Romaji) to [Kana](https://en.wikipedia.org/wiki/Kana), lowercase text will result in [Hiragana](https://en.wikipedia.org/wiki/Hiragana) and uppercase text will result in [Katakana](https://en.wikipedia.org/wiki/Katakana). * @param {String} [input=''] text * @param {DefaultOptions} [options=defaultOptions] * @return {String} converted text * @example * toKana('onaji BUTTSUUJI') * // => 'おなじ ブッツウジ' * toKana('ONAJI buttsuuji') * // => 'オナジ ぶっつうじ' * toKana('座禅‘zazen’スタイル') * // => '座禅「ざぜん」スタイル' * toKana('batsuge-mu') * // => 'ばつげーむ' * toKana('!?.:/,~-‘’“”[](){}') // Punctuation conversion * // => '!?。:・、〜ー「」『』[](){}' * toKana('we', { useObsoleteKana: true }) * // => 'ゑ' */ function toKana(input = '', options = {}, ignoreCase = false) { const config = Object.assign({}, DEFAULT_OPTIONS, options); // Final output array const kana = []; // Position in the string that is being evaluated let cursor = 0; const len = input.length; const maxChunk = 3; let chunkSize = 3; let chunk = ''; let chunkLC = ''; // Steps through the string pulling out chunks of characters. Each chunk will be evaluated // against the romaji to kana table. If there is no match, the last character in the chunk // is dropped and the chunk is reevaluated. If nothing matches, the character is assumed // to be invalid or punctuation or other and gets passed through. while (cursor < len) { let kanaChar = null; chunkSize = getChunkSize(maxChunk, len - cursor); while (chunkSize > 0) { chunk = getChunk(input, cursor, cursor + chunkSize); chunkLC = chunk.toLowerCase(); // Handle super-rare edge cases with 4 char chunks (like ltsu, chya, shya) if (FOUR_CHAR_EDGECASES.includes(chunkLC) && (len - cursor) >= 4) { chunkSize += 1; chunk = getChunk(input, cursor, cursor + chunkSize); chunkLC = chunk.toLowerCase(); } else { // Handle edge case of n followed by consonant if (chunkLC.charAt(0) === 'n') { if (chunkSize === 2) { // Handle edge case of n followed by a space (only if not in IME mode) if (!config.IMEMode && chunkLC.charAt(1) === ' ') { kanaChar = 'ん '; break; } // Convert IME input of n' to "ん" if (config.IMEMode && chunkLC === "n'") { kanaChar = 'ん'; break; } } // Handle edge case of n followed by n and vowel if (isCharConsonant(chunkLC.charAt(1), false) && isCharVowel(chunkLC.charAt(2))) { chunkSize = 1; chunk = getChunk(input, cursor, cursor + chunkSize); chunkLC = chunk.toLowerCase(); } } // Handle case of double consonants if (chunkLC.charAt(0) !== 'n' && isCharConsonant(chunkLC.charAt(0)) && chunk.charAt(0) === chunk.charAt(1) ) { chunkSize = 1; // Return katakana ッ if chunk is uppercase, otherwise return hiragana っ if (isCharInRange(chunk.charAt(0), UPPERCASE_START, UPPERCASE_END)) { chunkLC = 'ッ'; chunk = 'ッ'; } else { chunkLC = 'っ'; chunk = 'っ'; } } } kanaChar = FROM_ROMAJI[chunkLC]; // console.log(`${cursor}x${chunkSize}:${chunk} => ${kanaChar}`); // DEBUG if (kanaChar != null) { break; } // Step down the chunk size. // If chunkSize was 4, step down twice. if (chunkSize === 4) { chunkSize -= 2; } else { chunkSize -= 1; } } // Passthrough undefined values if (kanaChar == null) { kanaChar = chunk; } // Handle special cases. if (config.useObsoleteKana) { if (chunkLC === 'wi') kanaChar = 'ゐ'; if (chunkLC === 'we') kanaChar = 'ゑ'; } if (!!config.IMEMode && chunkLC.charAt(0) === 'n') { if ((input.charAt(cursor + 1).toLowerCase() === 'y' && isCharVowel(input.charAt(cursor + 2)) === false) || cursor === (len - 1) || isKana(input.charAt(cursor + 1)) ) { // Don't transliterate this yet. kanaChar = chunk.charAt(0); } } // Use katakana if first letter in chunk is uppercase if (!ignoreCase) { if (isCharUpperCase(chunk.charAt(0))) { kanaChar = hiraganaToKatakana(kanaChar); } } kana.push(kanaChar); cursor += chunkSize || 1; } return kana.join(''); } export default toKana;
Kaniwani/KanaWana
src/packages/kanawana/toKana.js
JavaScript
mit
5,260
import MockRequest from './mock-request'; import { isEmptyObject, isEquivalent, paramsFromRequestBody, toParams } from "../utils/helper-functions"; export default class MockAnyRequest extends MockRequest { constructor({type = 'GET', url, responseText, status = 200}) { super(); this.responseJson = responseText; this.url = url; this.type = type; this.status = status; this.setupHandler(); } getUrl() { return this.url; } getType() { return this.type; } /** * Return some form of object * * @param json * @returns {*} */ returns(json) { this.responseJson = json; return this; } paramsMatch(request) { if (!isEmptyObject(this.queryParams)) { if (this.type === 'GET') { return isEquivalent(request.queryParams, toParams(this.queryParams)); } if (/POST|PUT|PATCH/.test(this.type)) { const requestBody = request.requestBody, requestParams = paramsFromRequestBody(requestBody); return isEquivalent(requestParams, toParams(this.queryParams)); } } return true; } }
Hstry/ember-data-factory-guy
addon/mocks/mock-any-request.js
JavaScript
mit
1,119
(function($){ $(function(){ $('.dropdown-button').dropdown(); $('.button-collapse').sideNav(); }); // end of document ready })(jQuery); // end of jQuery name space
masudrahman/ulkasoft-website
js/init.js
JavaScript
mit
177
/** * winner's podium class * * MIT License * * Version: 0.5-beta-2 * * Dominik Grzelak * Copyright 2017 */ var WinnersPodiumChart = (function () { function WinnersPodiumChart($element) { this.rootDiv = $element; this._id = "#" + $element.attr("id"); // console.log("_id", _id); this._titleContainer = $("<div></div>").addClass("wpc-chart wpc-title").appendTo(this.rootDiv); this._icon = "./icon/trophy.png"; this._icon2 = "./icon/medal.png"; this._innerStepContainer = $("<div></div>"); this._innerStepContainer.addClass("wpc-chart wpc-main-container").height(this.rootDiv.height()); this._innerStepContainer.appendTo(this.rootDiv); this._footerContainer = $("<div></div>").addClass("wpc-chart wpc-footer").appendTo(this.rootDiv); this._childs = []; this._mtArr = []; // array which holds the margin-top values for the animation of each column this._maximum = 0; this._minimum = 0; this._data = null; this._colours = ["#425BAB", "#3FAB59", "#8A48AB"]; } /** * getter / setter for data set * @param _ specify the data set which is used to draw the columns. if no argument is given than the * current data set is returned * @returns {*|null} */ WinnersPodiumChart.prototype.data = function (_) { if (arguments.length == 0) { return this._data; } this._data = $.extend(true, [], _); this.invalidateData(); }; /** * getter / setter for colour array * @param _ specify colour array or get the current colour set * @returns {Array|[string,string,string]} */ WinnersPodiumChart.prototype.colours = function (_) { if (arguments.length == 0) { return this._colours; } this._colours = _; }; WinnersPodiumChart.prototype.icon = function (_) { if (arguments.length == 0) { return this._icon; } this._icon = _; }; /** * recalculate the maximum value of the data set */ WinnersPodiumChart.prototype.invalidateData = function () { //sort and swap 1st and 2nd place this._data.sort(sortByValue); var buf = this._data[0]; this._data[0] = this._data[1]; this._data[1] = buf; //add indizes order for names in footer this._data[0].oldIx = 1; this._data[1].oldIx = 0; this._data[2].oldIx = 2; //calculate min and max values this._maximum = 0; this._minimum = this._data[0].value; var self = this; $.map(this._data, function (elem, ix) { self._maximum = self._maximum < elem.value ? elem.value : self._maximum; self._minimum = self._minimum > elem.value ? elem.value : self._minimum; }); //normalize values var h = this._innerStepContainer.height(); var b = h; var a = h * 0.35; var coeff = self._maximum - self._minimum; if(coeff === 0) { coeff = 1; a = b; } this._data = $.map(this._data, function (elem, ix) { elem.valueNorm = ((elem.value - self._minimum) / coeff) * (b - a) + a; return elem; }); console.log("this.maxmin", this._maximum, this._minimum); console.log("this._data", this._data); }; WinnersPodiumChart.prototype.draw = function () { var self = this; var h = this._innerStepContainer.height(); // number of columns to draw var n = this._data.length; var w = Math.floor(100.0 / n + 0.5); // 100 = 100% this._mtArr = []; this._data.map(function (obj, i) { var d = $("<div></div>"); $(d).attr("data-name", obj.name).attr("data-value", obj.value); $(d).addClass("wpc-podium-column"); $(d).css("background-color", self._colours[i % self._colours.length]); $(d).css("width", (w + (1 / n)) + "%"); // var erg = calcNewHeight(obj.value, h, self._maximum); // console.log("erg", erg); // var newHeight = erg[0]; // var mt = erg[1]; var newHeight = obj.valueNorm; var mt = h - obj.valueNorm; $(d).css("height", newHeight + "px"); $(d).css("margin-top", h + "px"); var numdiv = $("<div></div>"); numdiv.html(obj.value); numdiv.addClass("number"); numdiv.appendTo(d); $(d).appendTo(self._innerStepContainer); self._childs.push(d); self._mtArr.push(mt); var dn = $("<div class='names'></div>"); var objToFind = $.grep(self._data, function (e) { return e.oldIx == i; }); var name = $("<span>" + objToFind[0].name + "</span>"); // var name = $("<span>" + self._data[i*0.5 + 1].name + "</span>"); name.appendTo(dn); dn.appendTo(self._footerContainer); }); var imgTrophy = $("<img/>").attr("src", this._icon).width((w + 1 / n) / 2 + "%").addClass("trophy").css("transform", "scale(1.2)"); imgTrophy.appendTo(this._titleContainer); this.animate(); }; /** * Main function to animate the whole chart. Use this method to re-animate the chart in case of new data for instance. * The order of animation is as follows: columns, trophy, footer. */ WinnersPodiumChart.prototype.animate = function () { var self = this; anime({ targets: self._id + " div.wpc-podium-column", easing: "easeOutElastic", 'margin-top': function (el, index) { return self._mtArr[index]; }, delay: function (el, index) { return index * 145; }, complete: function () { animateTrophy(self._id); }, loop: false }); }; /** * Resets all animation properties and class the animate method again */ WinnersPodiumChart.prototype.reAnimate = function () { var self = this; //hide trophy $(this._titleContainer).find(".trophy").css("opacity", "0").css("transform", "scale(1.2)"); // hide footer $(this._id).find(".wpc-footer").css("display", "none"); $(this._id).find(".wpc-footer > .names").css("opacity", "0"); //reset columns var h = this._innerStepContainer.height(); $(this._id).find('div.wpc-podium-column').map(function (i, obj) { var newHeight = self._data[i].valueNorm; $(obj).css("height", newHeight + "px"); $(obj).css("margin-top", h + "px"); }); this.animate(); }; /** * sort function for the data set (descending) * @return {number} */ function sortByValue(a, b) { var x = a.value; var y = b.value; return ((x > y) ? -1 : ((x < y) ? 1 : 0)); } /** * helper function to animate the trophy above the chart */ function animateTrophy(id) { $(id + " .trophy").css("opacity", "1"); var fc = $(id + " > .wpc-footer"); anime({ targets: id + " .trophy", scale: 0.8, easing: "easeOutBounce", direction: "both", complete: function () { animateFooter(fc, id); } }) } /** * helper function to animate the footer * @param fc */ function animateFooter(fc, id) { fc.css("display", "block"); anime({ targets: id + ' .wpc-footer > .names', translateX: 100 + "px", opacity: [1, 0], // scale: [.75, .9], delay: function (el, index) { return index * 380; }, direction: 'reverse' }); } // /** // * helper function to calculate the column height in respect to the div container height. // * The resulting top margin is also returned because it is the css property which is animated. // * @param itemHeight // * @param h // * @param maximum // * @returns {[*,*]} // */ // function calcNewHeight(itemHeight, h, maximum) { // var frac = itemHeight / maximum; // var newHeight = h * frac; // var mt = h - newHeight; // return [newHeight, mt]; // } return WinnersPodiumChart; })();
PioBeat/WinnersPodiumChart
src/winnersPodiumChart.js
JavaScript
mit
8,598
window.React["default"] = window.React; window.ReactDOM["default"] = window.ReactDOM; window.PropTypes["default"] = window.PropTypes; (function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { factory(exports); } else { var mod = { exports: {} }; factory(mod.exports); global.filter_props_from = mod.exports; } })(this, function (exports) { "use strict"; exports.filterPropsFrom = filterPropsFrom; var internalProps = { hideTableHeader: true, column: true, columns: true, sortable: true, filterable: true, filtering: true, onFilter: true, filterPlaceholder: true, filterClassName: true, currentFilter: true, sort: true, sortBy: true, sortableColumns: true, onSort: true, defaultSort: true, defaultSortDescending: true, itemsPerPage: true, filterBy: true, hideFilterInput: true, noDataText: true, currentPage: true, onPageChange: true, previousPageLabel: true, nextPageLabel: true, pageButtonLimit: true, childNode: true, data: true, children: true }; function filterPropsFrom(baseProps) { baseProps = baseProps || {}; var props = {}; for (var key in baseProps) { if (!(key in internalProps)) { props[key] = baseProps[key]; } } return props; } }); (function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { factory(exports); } else { var mod = { exports: {} }; factory(mod.exports); global.to_array = mod.exports; } })(this, function (exports) { "use strict"; exports.toArray = toArray; function toArray(obj) { var ret = []; for (var attr in obj) { ret[attr] = obj; } return ret; } }); (function (global, factory) { if (typeof define === 'function' && define.amd) { define(['exports'], factory); } else if (typeof exports !== 'undefined') { factory(exports); } else { var mod = { exports: {} }; factory(mod.exports); global.stringable = mod.exports; } })(this, function (exports) { 'use strict'; exports.stringable = stringable; function stringable(thing) { return thing !== null && typeof thing !== 'undefined' && typeof (thing.toString === 'function'); } }); (function (global, factory) { if (typeof define === 'function' && define.amd) { define(['exports', './stringable'], factory); } else if (typeof exports !== 'undefined') { factory(exports, require('./stringable')); } else { var mod = { exports: {} }; factory(mod.exports, global.stringable); global.extract_data_from = mod.exports; } })(this, function (exports, _stringable) { 'use strict'; exports.extractDataFrom = extractDataFrom; function extractDataFrom(key, column) { var value; if (typeof key !== 'undefined' && key !== null && key.__reactableMeta === true) { value = key.data[column]; } else { value = key[column]; } if (typeof value !== 'undefined' && value !== null && value.__reactableMeta === true) { value = typeof value.props.value !== 'undefined' && value.props.value !== null ? value.props.value : value.value; } return (0, _stringable.stringable)(value) ? value : ''; } }); (function (global, factory) { if (typeof define === 'function' && define.amd) { define(['exports'], factory); } else if (typeof exports !== 'undefined') { factory(exports); } else { var mod = { exports: {} }; factory(mod.exports); global.determine_row_span = mod.exports; } })(this, function (exports) { 'use strict'; exports.determineRowSpan = determineRowSpan; function determineRowSpan(row, colName) { var rowSpan = 1; if (typeof row !== 'undefined' && row != null) { var tdData = null; if (typeof row.props !== 'undefined' && row.props !== null && row.props.data !== null) { tdData = row.props.data; } else if (typeof row[colName] !== 'undefined') { tdData = row; } if (typeof tdData !== 'undefined' && tdData !== null) { var props = tdData[colName].props; if (typeof props !== 'undefined' && typeof props.rowSpan !== 'undefined') { rowSpan = parseInt(props.rowSpan); } } } return rowSpan; } }); (function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { factory(exports); } else { var mod = { exports: {} }; factory(mod.exports); global.extend = mod.exports; } })(this, function (exports) { /** * Merge defaults with user options * @private * @param {Object} defaults Default settings * @param {Object} options User options * @returns {Object} Merged values of defaults and options */ "use strict"; exports.extend = extend; function extend(defaults, options) { var extended = {}; var prop; for (prop in defaults) { if (Object.prototype.hasOwnProperty.call(defaults, prop)) { extended[prop] = defaults[prop]; } } for (prop in options) { if (Object.prototype.hasOwnProperty.call(options, prop)) { extended[prop] = options[prop]; } } return extended; } ; }); (function (global, factory) { if (typeof define === 'function' && define.amd) { define(['exports'], factory); } else if (typeof exports !== 'undefined') { factory(exports); } else { var mod = { exports: {} }; factory(mod.exports); global.is_react_component = mod.exports; } })(this, function (exports) { // this is a bit hacky - it'd be nice if React exposed an API for this 'use strict'; exports.isReactComponent = isReactComponent; function isReactComponent(thing) { return thing !== null && typeof thing === 'object' && typeof thing.props !== 'undefined'; } }); (function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { factory(exports); } else { var mod = { exports: {} }; factory(mod.exports); global.unsafe = mod.exports; } })(this, function (exports) { "use strict"; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); exports.unsafe = unsafe; exports.isUnsafe = isUnsafe; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Unsafe = (function () { function Unsafe(content) { _classCallCheck(this, Unsafe); this.content = content; } _createClass(Unsafe, [{ key: "toString", value: function toString() { return this.content; } }]); return Unsafe; })(); function unsafe(str) { return new Unsafe(str); } ; function isUnsafe(obj) { return obj instanceof Unsafe; } ; }); (function (global, factory) { if (typeof define === 'function' && define.amd) { define(['exports', 'react', 'react-dom'], factory); } else if (typeof exports !== 'undefined') { factory(exports, require('react'), require('react-dom')); } else { var mod = { exports: {} }; factory(mod.exports, global.React, global.ReactDOM); global.filterer = mod.exports; } })(this, function (exports, _react, _reactDom) { 'use strict'; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var FiltererInput = (function (_React$Component) { _inherits(FiltererInput, _React$Component); function FiltererInput() { _classCallCheck(this, FiltererInput); _get(Object.getPrototypeOf(FiltererInput.prototype), 'constructor', this).apply(this, arguments); } _createClass(FiltererInput, [{ key: 'onChange', value: function onChange() { this.props.onFilter(_reactDom['default'].findDOMNode(this).value); } }, { key: 'render', value: function render() { return _react['default'].createElement('input', { type: 'text', className: this.props.className, placeholder: this.props.placeholder, value: this.props.value, onKeyUp: this.onChange.bind(this), onChange: this.onChange.bind(this) }); } }]); return FiltererInput; })(_react['default'].Component); exports.FiltererInput = FiltererInput; ; var Filterer = (function (_React$Component2) { _inherits(Filterer, _React$Component2); function Filterer() { _classCallCheck(this, Filterer); _get(Object.getPrototypeOf(Filterer.prototype), 'constructor', this).apply(this, arguments); } _createClass(Filterer, [{ key: 'render', value: function render() { if (typeof this.props.colSpan === 'undefined') { throw new TypeError('Must pass a colSpan argument to Filterer'); } return _react['default'].createElement( 'tr', { className: 'reactable-filterer' }, _react['default'].createElement( 'td', { colSpan: this.props.colSpan }, _react['default'].createElement(FiltererInput, { onFilter: this.props.onFilter, value: this.props.value, placeholder: this.props.placeholder, className: this.props.className ? 'reactable-filter-input ' + this.props.className : 'reactable-filter-input' }) ) ); } }]); return Filterer; })(_react['default'].Component); exports.Filterer = Filterer; ; }); (function (global, factory) { if (typeof define === 'function' && define.amd) { define(['exports'], factory); } else if (typeof exports !== 'undefined') { factory(exports); } else { var mod = { exports: {} }; factory(mod.exports); global.sort = mod.exports; } })(this, function (exports) { 'use strict'; var Sort = { Numeric: function Numeric(a, b) { var valA = parseFloat(a.toString().replace(/,/g, '')); var valB = parseFloat(b.toString().replace(/,/g, '')); // Sort non-numeric values alphabetically at the bottom of the list if (isNaN(valA) && isNaN(valB)) { valA = a; valB = b; } else { if (isNaN(valA)) { return 1; } if (isNaN(valB)) { return -1; } } if (valA < valB) { return -1; } if (valA > valB) { return 1; } return 0; }, NumericInteger: function NumericInteger(a, b) { if (isNaN(a) || isNaN(b)) { return a > b ? 1 : -1; } return a - b; }, Currency: function Currency(a, b) { // Parse out dollar signs, then do a regular numeric sort a = a.replace(/[^0-9\.\-\,]+/g, ''); b = b.replace(/[^0-9\.\-\,]+/g, ''); return exports.Sort.Numeric(a, b); }, Date: (function (_Date) { function Date(_x, _x2) { return _Date.apply(this, arguments); } Date.toString = function () { return _Date.toString(); }; return Date; })(function (a, b) { // Note: this function tries to do a standard javascript string -> date conversion // If you need more control over the date string format, consider using a different // date library and writing your own function var valA = Date.parse(a); var valB = Date.parse(b); // Handle non-date values with numeric sort // Sort non-numeric values alphabetically at the bottom of the list if (isNaN(valA) || isNaN(valB)) { return exports.Sort.Numeric(a, b); } if (valA > valB) { return 1; } if (valB > valA) { return -1; } return 0; }), CaseInsensitive: function CaseInsensitive(a, b) { return a.toLowerCase().localeCompare(b.toLowerCase()); } }; exports.Sort = Sort; }); (function (global, factory) { if (typeof define === 'function' && define.amd) { define(['exports', 'react', './lib/is_react_component', './lib/stringable', './unsafe', './lib/filter_props_from'], factory); } else if (typeof exports !== 'undefined') { factory(exports, require('react'), require('./lib/is_react_component'), require('./lib/stringable'), require('./unsafe'), require('./lib/filter_props_from')); } else { var mod = { exports: {} }; factory(mod.exports, global.React, global.is_react_component, global.stringable, global.unsafe, global.filter_props_from); global.td = mod.exports; } })(this, function (exports, _react, _libIs_react_component, _libStringable, _unsafe, _libFilter_props_from) { 'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Td = (function (_React$Component) { _inherits(Td, _React$Component); function Td() { _classCallCheck(this, Td); _get(Object.getPrototypeOf(Td.prototype), 'constructor', this).apply(this, arguments); } _createClass(Td, [{ key: 'stringifyIfNotReactComponent', value: function stringifyIfNotReactComponent(object) { if (!(0, _libIs_react_component.isReactComponent)(object) && (0, _libStringable.stringable)(object) && typeof object !== 'undefined') { return object.toString(); } return null; } }, { key: 'render', value: function render() { // Attach any properties on the column to this Td object to allow things like custom event handlers var mergedProps = (0, _libFilter_props_from.filterPropsFrom)(this.props); if (typeof this.props.column === 'object') { for (var key in this.props.column) { if (key !== 'key' && key !== 'name') { mergedProps[key] = this.props.column[key]; } } } // handleClick aliases onClick event mergedProps.onClick = this.props.handleClick; // remove property to avoid unknown prop warning delete mergedProps.handleClick; var stringifiedChildProps; if (typeof this.props.data === 'undefined') { stringifiedChildProps = this.stringifyIfNotReactComponent(this.props.children); } if ((0, _unsafe.isUnsafe)(this.props.children)) { return _react['default'].createElement('td', _extends({}, mergedProps, { dangerouslySetInnerHTML: { __html: this.props.children.toString() } })); } else { return _react['default'].createElement( 'td', mergedProps, stringifiedChildProps || this.props.children ); } } }]); return Td; })(_react['default'].Component); exports.Td = Td; ; }); (function (global, factory) { if (typeof define === 'function' && define.amd) { define(['exports', 'react', './td', './lib/to_array', './lib/filter_props_from', './lib/extend'], factory); } else if (typeof exports !== 'undefined') { factory(exports, require('react'), require('./td'), require('./lib/to_array'), require('./lib/filter_props_from'), require('./lib/extend')); } else { var mod = { exports: {} }; factory(mod.exports, global.React, global.td, global.to_array, global.filter_props_from, global.extend); global.tr = mod.exports; } })(this, function (exports, _react, _td, _libTo_array, _libFilter_props_from, _libExtend) { 'use strict'; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Tr = (function (_React$Component) { _inherits(Tr, _React$Component); function Tr() { _classCallCheck(this, Tr); _get(Object.getPrototypeOf(Tr.prototype), 'constructor', this).apply(this, arguments); } _createClass(Tr, [{ key: 'isRowSpanSkip', /** * Determines whether a row should skip the creation of a <Td> based on the rowSpan prop * @param state the state of the column * @param data the data * @param k the column key * @returns {boolean} */ value: function isRowSpanSkip(state, data, k) { var rowSpanSkip = false; // if we have already noted this <Td> has a row span, we will use the stored state to make // a determination whether we render or skip if (typeof state.rowSpanDebt !== 'undefined' && state.rowSpanDebt > 0) { //anything greater than 0, we skip render and decrement rowSpanSkip = true; state.rowSpanDebt--; } if (typeof data[k] !== 'undefined' && data[k] != null) { var props = data[k].props; // check if this column will be spanning multiple rows if (typeof props !== 'undefined' && typeof props.rowSpan !== 'undefined') { if (isNaN(props.rowSpan)) { console.warn("rowSpan for column " + k + " is not a valid integer: " + props.rowSpan); return false; } if (!rowSpanSkip) { // restart the rowSpanCount for this column: subtract 1 as all rows will have rowSpan of at least 1 state.rowSpanDebt = props.rowSpan - 1; } } } return rowSpanSkip; } /** * Build all <Td> elements to be displayed in this <Tr> * @returns {Array} */ }, { key: 'buildRows', value: function buildRows(renderState) { var columns = this.props.columns; var tds = []; var columnsToSkip = 0; // iterate through all columns and create a <Td> for each one for (var idx = 0; idx < columns.length; idx++) { var _columns$idx = columns[idx]; var _columns$idx$props = _columns$idx.props; var props = _columns$idx$props === undefined ? {} : _columns$idx$props; var column = _objectWithoutProperties(_columns$idx, ['props']); var state = renderState[column.key]; if (typeof state === 'undefined') { state = {}; renderState[column.key] = state; } var skip = this.isRowSpanSkip(state, this.props.data, column.key); if (skip) { continue; // skip render of <Td> } if (columnsToSkip > 0) { columnsToSkip--; continue; } if (this.props.data.hasOwnProperty(column.key)) { var value = this.props.data[column.key]; var componentType = _td.Td; if (typeof value !== 'undefined' && value !== null && value.__reactableMeta === true) { // merge the props props = (0, _libExtend.extend)(props, value.props); componentType = value.component || componentType; value = value.value; } var colSpan = props.colSpan || 1; // we will use 1 column (ourself), no need to skip that columnsToSkip = colSpan - 1; props.column = column; props.key = column.key; props.children = value; tds.push(_react['default'].createElement(componentType, props)); } else { tds.push(_react['default'].createElement(_td.Td, { column: column, key: column.key })); } } return tds; } }, { key: 'render', value: function render() { var children = (0, _libTo_array.toArray)(_react['default'].Children.children(this.props.children)); // Manually transfer props var _filterPropsFrom = (0, _libFilter_props_from.filterPropsFrom)(this.props); var renderState = _filterPropsFrom.renderState; var props = _objectWithoutProperties(_filterPropsFrom, ['renderState']); if (this.props.data && this.props.columns && typeof this.props.columns.map === 'function') { if (typeof children.concat === 'undefined') { console.log(children); } var trs = this.buildRows.call(this, renderState); children = children.concat(trs); } return _react['default'].createElement("tr", props, children); } }]); return Tr; })(_react['default'].Component); exports.Tr = Tr; Tr.childNode = _td.Td; Tr.dataType = 'object'; }); (function (global, factory) { if (typeof define === 'function' && define.amd) { define(['exports', 'react', './unsafe', './lib/filter_props_from'], factory); } else if (typeof exports !== 'undefined') { factory(exports, require('react'), require('./unsafe'), require('./lib/filter_props_from')); } else { var mod = { exports: {} }; factory(mod.exports, global.React, global.unsafe, global.filter_props_from); global.th = mod.exports; } })(this, function (exports, _react, _unsafe, _libFilter_props_from) { 'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Th = (function (_React$Component) { _inherits(Th, _React$Component); function Th() { _classCallCheck(this, Th); _get(Object.getPrototypeOf(Th.prototype), 'constructor', this).apply(this, arguments); } _createClass(Th, [{ key: 'render', value: function render() { var childProps = undefined; if ((0, _unsafe.isUnsafe)(this.props.children)) { return _react['default'].createElement('th', _extends({}, (0, _libFilter_props_from.filterPropsFrom)(this.props), { dangerouslySetInnerHTML: { __html: this.props.children.toString() } })); } else { return _react['default'].createElement( 'th', (0, _libFilter_props_from.filterPropsFrom)(this.props), this.props.children ); } } }]); return Th; })(_react['default'].Component); exports.Th = Th; ; }); (function (global, factory) { if (typeof define === 'function' && define.amd) { define(['exports', 'react', './th', './filterer', './lib/filter_props_from'], factory); } else if (typeof exports !== 'undefined') { factory(exports, require('react'), require('./th'), require('./filterer'), require('./lib/filter_props_from')); } else { var mod = { exports: {} }; factory(mod.exports, global.React, global.th, global.filterer, global.filter_props_from); global.thead = mod.exports; } })(this, function (exports, _react, _th, _filterer, _libFilter_props_from) { 'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Thead = (function (_React$Component) { _inherits(Thead, _React$Component); function Thead() { _classCallCheck(this, Thead); _get(Object.getPrototypeOf(Thead.prototype), 'constructor', this).apply(this, arguments); } _createClass(Thead, [{ key: 'handleClickTh', value: function handleClickTh(column) { this.props.onSort(column.key); } }, { key: 'handleKeyDownTh', value: function handleKeyDownTh(column, event) { if (event.keyCode === 13) { this.props.onSort(column.key); } } }, { key: 'render', value: function render() { // Declare the list of Ths var Ths = []; for (var index = 0; index < this.props.columns.length; index++) { var column = this.props.columns[index]; var thClass = 'reactable-th-' + column.key.replace(/\s+/g, '-').toLowerCase(); var sortClass = ''; var thRole = null; if (this.props.sortableColumns[column.key]) { sortClass += 'reactable-header-sortable '; thRole = 'button'; } if (this.props.sort.column === column.key) { sortClass += 'reactable-header-sort'; if (this.props.sort.direction === 1) { sortClass += '-asc'; } else { sortClass += '-desc'; } } if (sortClass.length > 0) { thClass += ' ' + sortClass; } if (typeof column.props === 'object' && typeof column.props.className === 'string') { thClass += ' ' + column.props.className; } Ths.push(_react['default'].createElement( _th.Th, _extends({}, column.props, { className: thClass, key: index, onClick: this.handleClickTh.bind(this, column), onKeyDown: this.handleKeyDownTh.bind(this, column), role: thRole, tabIndex: '0' }), column.content || column.label )); } // Manually transfer props var props = (0, _libFilter_props_from.filterPropsFrom)(this.props); return _react['default'].createElement( 'thead', props, this.props.filtering === true ? _react['default'].createElement(_filterer.Filterer, { colSpan: this.props.columns.length, onFilter: this.props.onFilter, placeholder: this.props.filterPlaceholder, value: this.props.currentFilter, className: this.props.filterClassName }) : null, _react['default'].createElement( 'tr', { className: 'reactable-column-header' }, Ths ) ); } }], [{ key: 'getColumns', value: function getColumns(component) { // Can't use React.Children.map since that doesn't return a proper array var columns = []; _react['default'].Children.forEach(component.props.children, function (th) { var column = {}; if (!th) return; if (typeof th.props !== 'undefined') { column.props = (0, _libFilter_props_from.filterPropsFrom)(th.props); // use the content as the label & key if (typeof th.props.children !== 'undefined') { column.label = th.props.label || th.props.children; column.content = th.props.children || th.props.label; column.key = column.label; } // the key in the column attribute supersedes the one defined previously if (typeof th.props.column === 'string') { column.key = th.props.column; // in case we don't have a label yet if (typeof column.label === 'undefined') { column.label = column.key; } } } if (typeof column.key === 'undefined') { throw new TypeError('<th> must have either a "column" property or a string ' + 'child'); } else { columns.push(column); } }); return columns; } }]); return Thead; })(_react['default'].Component); exports.Thead = Thead; ; }); (function (global, factory) { if (typeof define === 'function' && define.amd) { define(['exports', 'react'], factory); } else if (typeof exports !== 'undefined') { factory(exports, require('react')); } else { var mod = { exports: {} }; factory(mod.exports, global.React); global.tfoot = mod.exports; } })(this, function (exports, _react) { 'use strict'; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Tfoot = (function (_React$Component) { _inherits(Tfoot, _React$Component); function Tfoot() { _classCallCheck(this, Tfoot); _get(Object.getPrototypeOf(Tfoot.prototype), 'constructor', this).apply(this, arguments); } _createClass(Tfoot, [{ key: 'render', value: function render() { return _react['default'].createElement('tfoot', this.props); } }]); return Tfoot; })(_react['default'].Component); exports.Tfoot = Tfoot; }); (function (global, factory) { if (typeof define === 'function' && define.amd) { define(['exports', 'react'], factory); } else if (typeof exports !== 'undefined') { factory(exports, require('react')); } else { var mod = { exports: {} }; factory(mod.exports, global.React); global.paginator = mod.exports; } })(this, function (exports, _react) { 'use strict'; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function pageHref(num) { return '#page-' + (num + 1); } var Paginator = (function (_React$Component) { _inherits(Paginator, _React$Component); function Paginator() { _classCallCheck(this, Paginator); _get(Object.getPrototypeOf(Paginator.prototype), 'constructor', this).apply(this, arguments); } _createClass(Paginator, [{ key: 'handlePrevious', value: function handlePrevious(e) { e.preventDefault(); this.props.onPageChange(this.props.currentPage - 1); } }, { key: 'handleNext', value: function handleNext(e) { e.preventDefault(); this.props.onPageChange(this.props.currentPage + 1); } }, { key: 'handlePageButton', value: function handlePageButton(page, e) { e.preventDefault(); this.props.onPageChange(page); } }, { key: 'renderPrevious', value: function renderPrevious() { if (this.props.currentPage > 0) { return _react['default'].createElement( 'a', { className: 'reactable-previous-page', href: pageHref(this.props.currentPage - 1), onClick: this.handlePrevious.bind(this) }, this.props.previousPageLabel || 'Previous' ); } } }, { key: 'renderNext', value: function renderNext() { if (this.props.currentPage < this.props.numPages - 1) { return _react['default'].createElement( 'a', { className: 'reactable-next-page', href: pageHref(this.props.currentPage + 1), onClick: this.handleNext.bind(this) }, this.props.nextPageLabel || 'Next' ); } } }, { key: 'renderPageButton', value: function renderPageButton(className, pageNum) { return _react['default'].createElement( 'a', { className: className, key: pageNum, href: pageHref(pageNum), onClick: this.handlePageButton.bind(this, pageNum) }, pageNum + 1 ); } }, { key: 'render', value: function render() { if (typeof this.props.colSpan === 'undefined') { throw new TypeError('Must pass a colSpan argument to Paginator'); } if (typeof this.props.numPages === 'undefined') { throw new TypeError('Must pass a non-zero numPages argument to Paginator'); } if (typeof this.props.currentPage === 'undefined') { throw new TypeError('Must pass a currentPage argument to Paginator'); } var pageButtons = []; var pageButtonLimit = this.props.pageButtonLimit; var currentPage = this.props.currentPage; var numPages = this.props.numPages; var lowerHalf = Math.round(pageButtonLimit / 2); var upperHalf = pageButtonLimit - lowerHalf; for (var i = 0; i < this.props.numPages; i++) { var showPageButton = false; var pageNum = i; var className = "reactable-page-button"; if (currentPage === i) { className += " reactable-current-page"; } pageButtons.push(this.renderPageButton(className, pageNum)); } if (currentPage - pageButtonLimit + lowerHalf > 0) { if (currentPage > numPages - lowerHalf) { pageButtons.splice(0, numPages - pageButtonLimit); } else { pageButtons.splice(0, currentPage - pageButtonLimit + lowerHalf); } } if (numPages - currentPage > upperHalf) { pageButtons.splice(pageButtonLimit, pageButtons.length - pageButtonLimit); } return _react['default'].createElement( 'tbody', { className: 'reactable-pagination' }, _react['default'].createElement( 'tr', null, _react['default'].createElement( 'td', { colSpan: this.props.colSpan }, this.renderPrevious(), pageButtons, this.renderNext() ) ) ); } }]); return Paginator; })(_react['default'].Component); exports.Paginator = Paginator; ; }); (function (global, factory) { if (typeof define === 'function' && define.amd) { define(['exports', 'react', './lib/filter_props_from', './lib/extract_data_from', './lib/determine_row_span', './lib/extend', './unsafe', './thead', './th', './tr', './tfoot', './paginator', 'prop-types'], factory); } else if (typeof exports !== 'undefined') { factory(exports, require('react'), require('./lib/filter_props_from'), require('./lib/extract_data_from'), require('./lib/determine_row_span'), require('./lib/extend'), require('./unsafe'), require('./thead'), require('./th'), require('./tr'), require('./tfoot'), require('./paginator'), require('prop-types')); } else { var mod = { exports: {} }; factory(mod.exports, global.React, global.filter_props_from, global.extract_data_from, global.determine_row_span, global.extend, global.unsafe, global.thead, global.th, global.tr, global.tfoot, global.paginator, global.PropTypes); global.table = mod.exports; } })(this, function (exports, _react, _libFilter_props_from, _libExtract_data_from, _libDetermine_row_span, _libExtend, _unsafe, _thead, _th, _tr, _tfoot, _paginator, _propTypes) { 'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Table = (function (_React$Component) { _inherits(Table, _React$Component); function Table(props) { _classCallCheck(this, Table); _get(Object.getPrototypeOf(Table.prototype), 'constructor', this).call(this, props); this.state = { currentPage: this.props.currentPage ? this.props.currentPage : 0, currentSort: { column: null, direction: this.props.defaultSortDescending ? -1 : 1 }, filter: '' }; // Set the state of the current sort to the default sort if (props.sortBy !== false || props.defaultSort !== false) { var sortingColumn = props.sortBy || props.defaultSort; this.state.currentSort = this.getCurrentSort(sortingColumn); } // used for generating a key for a <Tr> that will change <Td> counts -- avoids jitters in the update this.cloneIndex = 0; this.renderNoDataComponent = this.renderNoDataComponent.bind(this); } _createClass(Table, [{ key: 'filterBy', value: function filterBy(filter) { this.setState({ filter: filter }); } // Translate a user defined column array to hold column objects if strings are specified // (e.g. ['column1'] => [{key: 'column1', label: 'column1'}]) }, { key: 'translateColumnsArray', value: function translateColumnsArray(columns) { return columns.map((function (column, i) { if (typeof column === 'string') { return { key: column, label: column }; } else { if (typeof column.sortable !== 'undefined') { var sortFunction = column.sortable === true ? 'default' : column.sortable; this._sortable[column.key] = sortFunction; } return column; } }).bind(this)); } }, { key: 'parseChildData', value: function parseChildData(props) { var data = [], tfoot = undefined; // Transform any children back to a data array if (typeof props.children !== 'undefined') { _react['default'].Children.forEach(props.children, (function (child) { if (typeof child === 'undefined' || child === null) { return; } switch (child.type) { case _thead.Thead: break; case _tfoot.Tfoot: if (typeof tfoot !== 'undefined') { console.warn('You can only have one <Tfoot>, but more than one was specified.' + 'Ignoring all but the last one'); } tfoot = child; break; case _tr.Tr: var childData = child.props.data || {}; _react['default'].Children.forEach(child.props.children, function (descendant) { // TODO /* if (descendant.type.ConvenienceConstructor === Td) { */ if (typeof descendant !== 'object' || descendant == null) { return; } else if (typeof descendant.props.column !== 'undefined') { var value = undefined; if (typeof descendant.props.data !== 'undefined') { value = descendant.props.data; } else if (typeof descendant.props.children !== 'undefined') { value = descendant.props.children; } else { var warning = 'exports.Td specified without ' + 'a `data` property or children, ignoring'; if (typeof descendant.props.column !== 'undefined') { warning += '. See definition for column \'' + descendant.props.column + '\'.'; } console.warn(warning); return; } childData[descendant.props.column] = { value: value, component: descendant.type, props: (0, _libFilter_props_from.filterPropsFrom)(descendant.props), __reactableMeta: true }; } else { console.warn('exports.Td specified without a ' + '`column` property, ignoring'); } }); data.push({ data: childData, props: (0, _libFilter_props_from.filterPropsFrom)(child.props), __reactableMeta: true }); break; default: console.warn('The only possible children of <Table> are <Thead>, <Tr>, ' + 'or one <Tfoot>.'); } }).bind(this)); } return { data: data, tfoot: tfoot }; } }, { key: 'initialize', value: function initialize(props) { this.data = props.data || []; var _parseChildData = this.parseChildData(props); var data = _parseChildData.data; var tfoot = _parseChildData.tfoot; this.data = this.data.concat(data); this.tfoot = tfoot; this.initializeSorts(props); this.initializeFilters(props); } }, { key: 'initializeFilters', value: function initializeFilters(props) { this._filterable = {}; // Transform filterable properties into a more friendly list for (var i in props.filterable) { var column = props.filterable[i]; var columnName = undefined, filterFunction = undefined; if (column instanceof Object) { if (typeof column.column !== 'undefined') { columnName = column.column; } else { console.warn('Filterable column specified without column name'); continue; } if (typeof column.filterFunction === 'function') { filterFunction = column.filterFunction; } else { filterFunction = 'default'; } } else { columnName = column; filterFunction = 'default'; } this._filterable[columnName] = filterFunction; } } }, { key: 'initializeSorts', value: function initializeSorts(props) { this._sortable = {}; // Transform sortable properties into a more friendly list for (var i in props.sortable) { var column = props.sortable[i]; var columnName = undefined, sortFunction = undefined; if (column instanceof Object) { if (typeof column.column !== 'undefined') { columnName = column.column; } else { console.warn('Sortable column specified without column name'); return; } if (typeof column.sortFunction === 'function') { sortFunction = column.sortFunction; } else { sortFunction = 'default'; } } else { columnName = column; sortFunction = 'default'; } this._sortable[columnName] = sortFunction; } } }, { key: 'getCurrentSort', value: function getCurrentSort(column) { var columnName = undefined, sortDirection = undefined; if (column instanceof Object) { if (typeof column.column !== 'undefined') { columnName = column.column; } else { console.warn('Default column specified without column name'); return; } if (typeof column.direction !== 'undefined') { if (column.direction === 1 || column.direction === 'asc') { sortDirection = 1; } else if (column.direction === -1 || column.direction === 'desc') { sortDirection = -1; } else { var defaultDirection = this.props.defaultSortDescending ? 'descending' : 'ascending'; console.warn('Invalid default sort specified. Defaulting to ' + defaultDirection); sortDirection = this.props.defaultSortDescending ? -1 : 1; } } else { sortDirection = this.props.defaultSortDescending ? -1 : 1; } } else { columnName = column; sortDirection = this.props.defaultSortDescending ? -1 : 1; } return { column: columnName, direction: sortDirection }; } }, { key: 'updateCurrentSort', value: function updateCurrentSort(sortBy) { if (sortBy !== false && sortBy.column !== this.state.currentSort.column && sortBy.direction !== this.state.currentSort.direction) { this.setState({ currentSort: this.getCurrentSort(sortBy) }); } } }, { key: 'updateCurrentPage', value: function updateCurrentPage(nextPage) { if (typeof nextPage !== 'undefined' && nextPage !== this.state.currentPage) { this.setState({ currentPage: nextPage }); } } }, { key: 'componentWillMount', value: function componentWillMount() { this.initialize(this.props); this.sortByCurrentSort(); this.filterBy(this.props.filterBy); } }, { key: 'componentWillReceiveProps', value: function componentWillReceiveProps(nextProps) { this.initialize(nextProps); this.updateCurrentPage(nextProps.currentPage); this.updateCurrentSort(nextProps.sortBy); this.sortByCurrentSort(); this.filterBy(nextProps.filterBy); } }, { key: 'applyFilter', value: function applyFilter(filter, children) { var _this = this; // Helper function to apply filter text to a list of table rows filter = filter.toLowerCase(); /** * We face two problems when trying to filter with rowSpan: * 1) what happens when the row that specifies the <Td> with the row span is filtered out? * move the rowSpan definition to the next visible row and adjust the rowSpan value to exclude * all the filtered out rows (e.g. if we have a rowSpan=5 and the 1st and 5th row are filtered * out, the rowSpan property & value shifts to row 2 and rowSpan now becomes 3) * * 2) what happens when the row/cell that specifies the rowSpan matches the text: * immediately include all the subsequent rows the that the <Td> spans in the result list. * */ var matchedChildren = {}; // row index => the matched data // houses the rowSpan definition for each row/columnName combo (e.g. [0]['Name'] provides the rowSpan definition // for the item at row 0 in the 'Name' column var rowSpanReferences = {}; // the current rowSpan definition for each column, columnName => rowSpan definition var currentRowSpanState = {}; var _loop = function (i) { var child = children[i]; var data = child.props.data; // look at each column in this row and see if there are rowSpan properties Object.keys(data).forEach(function (k) { if (typeof k !== 'undefined' && typeof data[k] !== 'undefined') { var state = currentRowSpanState[k]; // check if we've exhausted our specified number of rows for this column if (typeof state !== 'undefined') { var rowSpanEnd = state.startsAt + state.rowSpan - 1; if (i >= rowSpanEnd) { delete currentRowSpanState[k]; } } var rowSpan = (0, _libDetermine_row_span.determineRowSpan)(child, k); // we don't want to waste our time with single rows, only keep a state if we have >1 if (rowSpan > 1) { state = { rowSpan: rowSpan, startsAt: i, component: child, columnName: k }; currentRowSpanState[k] = state; // store the reference to the rowSpanDefinition for all columns it's relevant to var rowSpanEnd = i + rowSpan; for (var idx = i; idx < rowSpanEnd && idx < children.length; idx++) { if (typeof rowSpanReferences[idx] === 'undefined') { rowSpanReferences[idx] = {}; } rowSpanReferences[idx][k] = state; } } } }); // 2) look through all 'filterable' columns for this row and see if we can find the filterBy text for (var filterColumn in _this._filterable) { if (typeof data[filterColumn] !== 'undefined') { // Default filter if (typeof _this._filterable[filterColumn] === 'undefined' || _this._filterable[filterColumn] === 'default') { if ((0, _libExtract_data_from.extractDataFrom)(data, filterColumn).toString().toLowerCase().indexOf(filter) > -1) { // upon a filter text match, we include the cell that matched and all the rows that // the cell spans var rowSpan = (0, _libDetermine_row_span.determineRowSpan)(child, filterColumn); var rowSpanEnd = i + rowSpan; for (idx = i; idx < rowSpanEnd && idx < children.length; idx++) { otherChild = children[idx]; matchedChildren[idx] = otherChild; // we no longer need to handle rowSpan for the other rows if (typeof rowSpanReferences[idx] !== 'undefined') { delete rowSpanReferences[idx][filterColumn]; } } // we've rendered all the rows this cell spans, we no longer need to maintain state delete currentRowSpanState[filterColumn]; break; } } else { // Apply custom filter if (_this._filterable[filterColumn]((0, _libExtract_data_from.extractDataFrom)(data, filterColumn).toString(), filter)) { matchedChildren[i] = child; break; } } } } }; for (var i = 0; i < children.length; i++) { var idx; var otherChild; _loop(i); } // Now that we know which results will be displayed, we can calculate a rowSpan that will encompass // only the visible rows. // Iterate through the matched children and check if there are rowSpan modifications they need to make. Hint: we // stored all row/col combos needing a modification in rowSpanReferences var resultingChildren = Object.keys(matchedChildren).map((function (rowIndex) { var definitions = rowSpanReferences[rowIndex]; if (typeof definitions !== 'undefined') { // the child we will clone and give a new <Td> var child = matchedChildren[rowIndex]; // we'll be recreating this <Tr> with a rowSpan property carried over from the <Tr> with the rowSpan var newData = (0, _libExtend.extend)({}, child.props.data); var newProps = (0, _libExtend.extend)({}, child.props); newProps.data = newData; Object.keys(definitions).forEach(function (columnName) { var definition = definitions[columnName]; // the tr with the rowSpan property var tr = definition.component; // this child was a part of a rowSpan var rowSpanEnd = definition.startsAt + definition.rowSpan; var remainingRowSpan = rowSpanEnd - rowIndex; // if the rows that we're supposed to span did not match the filter text, we need to reduce the remainingRowSpan for (var idx = rowIndex; idx < rowSpanEnd; idx++) { if (typeof matchedChildren[idx] === 'undefined') { remainingRowSpan--; } } // clone the data for the column to avoid altering the original props (e.g. don't want to change the rowSpan on original Td) newProps.data[columnName] = (0, _libExtend.extend)({}, tr.props.data[columnName]); newProps.data[columnName].props = (0, _libExtend.extend)({}, newProps.data[columnName].props); newProps.data[columnName].props.rowSpan = remainingRowSpan; }); // new key to avoid jitters, we want a brand new component newProps.key = "cloned-" + _this.cloneIndex++; newProps.renderState = child.props.renderState; return _react['default'].cloneElement(child, newProps); } else { return matchedChildren[rowIndex]; } }).bind(this)); return resultingChildren; } }, { key: 'sortByCurrentSort', value: function sortByCurrentSort() { var _this2 = this; // Apply a sort function according to the current sort in the state. // This allows us to perform a default sort even on a non sortable column. var currentSort = this.state.currentSort; if (currentSort.column === null) { return; } // we'll be splitting each set of data into buckets, then sorting them. A 'set' is defined as rows sharing a // <Td> with a rowSpan var singles = []; // rows without any rowSpans var buckets = {}; var bucketIndex = 0; // helps us keep track of where we are in the last rowSpan we saw var currentRowSpan = null; for (var idx = 0; idx < this.data.length; idx++) { var obj = this.data[idx]; // check if rowSpan is completed if (currentRowSpan != null) { var rowSpanEnd = currentRowSpan.startsAt + currentRowSpan.rowSpan; if (rowSpanEnd <= idx) { bucketIndex++; currentRowSpan = null; } } // make sure the bucket is defined if (typeof buckets[bucketIndex] === 'undefined') { buckets[bucketIndex] = []; } if (typeof obj.data !== 'undefined') { // find the column with the next biggest rowSpan var rowSpanOfSortColumn = (0, _libDetermine_row_span.determineRowSpan)(obj.data, currentSort.column); if (rowSpanOfSortColumn !== 1) { // not supported console.warn("Cannot sort by column '" + currentSort.column + "', sorting by columns that have cells with rowSpan is currently not supported. See https://github.com/glittershark/reactable/issues/84"); return; } for (var col in obj.data) { if (col === currentSort.column) { // ignore the sort column continue; } var rowSpanCurrentCol = (0, _libDetermine_row_span.determineRowSpan)(obj.data, col); // if the rowSpan we found is less than the current debt but greater than the rowSpan of our column, // we will use that number if (rowSpanCurrentCol > rowSpanOfSortColumn && (currentRowSpan == null || currentRowSpan.rowSpan > rowSpanCurrentCol)) { currentRowSpan = { startsAt: idx, rowSpan: rowSpanCurrentCol }; } } } if (currentRowSpan == null) { singles.push(obj); } else { buckets[bucketIndex].push(obj); } } // run a sort on each bucket buckets = Object.keys(buckets).map(function (dataSet) { return buckets[dataSet].sort(_this2.sortFunction.bind(_this2)); }); buckets.push(singles.sort(this.sortFunction.bind(this))); // flatten this.data = buckets.reduce(function (a, current) { // look for row spans and put the definition of the <Td> on the top row after sort if (current.length > 0) { for (var idx = 0; idx < current.length; idx++) { var obj = current[idx]; for (var col in obj.data) { var rowSpan = (0, _libDetermine_row_span.determineRowSpan)(obj.data, col); var currentPosition = idx % rowSpan; var newRowSpanIdx = idx - currentPosition; if (idx !== newRowSpanIdx) { // need to push the rowSpan property & values to the top row current[newRowSpanIdx].data[col] = (0, _libExtend.extend)({}, obj.data[col]); delete obj.data[col]; } } } } return a.concat(current); }, []); } }, { key: 'sortFunction', value: function sortFunction(a, b) { var currentSort = this.state.currentSort; var keyA = (0, _libExtract_data_from.extractDataFrom)(a, currentSort.column); keyA = (0, _unsafe.isUnsafe)(keyA) ? keyA.toString() : keyA || ''; var keyB = (0, _libExtract_data_from.extractDataFrom)(b, currentSort.column); keyB = (0, _unsafe.isUnsafe)(keyB) ? keyB.toString() : keyB || ''; // Default sort if (typeof this._sortable[currentSort.column] === 'undefined' || this._sortable[currentSort.column] === 'default') { // Reverse direction if we're doing a reverse sort if (keyA < keyB) { return -1 * currentSort.direction; } if (keyA > keyB) { return 1 * currentSort.direction; } return 0; } else { // Reverse columns if we're doing a reverse sort if (currentSort.direction === 1) { return this._sortable[currentSort.column](keyA, keyB); } else { return this._sortable[currentSort.column](keyB, keyA); } } } }, { key: 'onSort', value: function onSort(column) { // Don't perform sort on unsortable columns if (typeof this._sortable[column] === 'undefined') { return; } var currentSort = this.state.currentSort; if (currentSort.column === column) { currentSort.direction *= -1; } else { currentSort.column = column; currentSort.direction = this.props.defaultSortDescending ? -1 : 1; } // Set the current sort and pass it to the sort function this.setState({ currentSort: currentSort }); this.sortByCurrentSort(); if (typeof this.props.onSort === 'function') { this.props.onSort(currentSort); } } }, { key: 'renderNoDataComponent', value: function renderNoDataComponent(columns) { var noDataFunc = this.props.noDataComponent; if (typeof noDataFunc === 'function') { return noDataFunc(columns); } else if (this.props.noDataText) { return _react['default'].createElement( 'tr', { className: 'reactable-no-data' }, _react['default'].createElement( 'td', { colSpan: columns.length }, this.props.noDataText ) ); } else { return null; } } }, { key: 'render', value: function render() { var _this3 = this; var children = []; var columns = undefined; var userColumnsSpecified = false; var showHeaders = typeof this.props.hideTableHeader === 'undefined'; var firstChild = null; if (this.props.children) { if (this.props.children.length > 0 && this.props.children[0] && this.props.children[0].type === _thead.Thead) { firstChild = this.props.children[0]; } else if (this.props.children.type === _thead.Thead) { firstChild = this.props.children; } } if (firstChild !== null) { columns = _thead.Thead.getColumns(firstChild); } else { columns = this.props.columns || []; } if (columns.length > 0) { userColumnsSpecified = true; columns = this.translateColumnsArray(columns); } // Build up table rows if (this.data && typeof this.data.map === 'function') { var renderState = {}; // Build up the columns array children = children.concat(this.data.map((function (rawData, i) { var data = rawData; var props = {}; if (rawData.__reactableMeta === true) { data = rawData.data; props = rawData.props; } // Loop through the keys in each data row and build a td for it for (var k in data) { if (data.hasOwnProperty(k)) { // Update the columns array with the data's keys if columns were not // already specified if (userColumnsSpecified === false) { (function () { var column = { key: k, label: k }; // Only add a new column if it doesn't already exist in the columns array if (columns.find(function (element) { return element.key === column.key; }) === undefined) { columns.push(column); } })(); } } } return _react['default'].createElement(_tr.Tr, _extends({ columns: columns, key: i, data: data }, props, { renderState: renderState })); }).bind(this))); } if (this.props.sortable === true) { for (var i = 0; i < columns.length; i++) { this._sortable[columns[i].key] = 'default'; } } // Determine if we render the filter box var filtering = false; if (this.props.filterable && Array.isArray(this.props.filterable) && this.props.filterable.length > 0 && !this.props.hideFilterInput) { filtering = true; } // Apply filters var filteredChildren = children; if (this.state.filter !== '') { filteredChildren = this.applyFilter(this.state.filter, filteredChildren); } // Determine pagination properties and which columns to display var itemsPerPage = 0; var pagination = false; var numPages = undefined; var currentPage = this.state.currentPage; var pageButtonLimit = this.props.pageButtonLimit || 10; var currentChildren = filteredChildren; if (this.props.itemsPerPage > 0) { itemsPerPage = this.props.itemsPerPage; numPages = Math.ceil(filteredChildren.length / itemsPerPage); if (currentPage > numPages - 1) { currentPage = numPages - 1; } pagination = true; currentChildren = filteredChildren.slice(currentPage * itemsPerPage, (currentPage + 1) * itemsPerPage); } // Manually transfer props var _filterPropsFrom = (0, _libFilter_props_from.filterPropsFrom)(this.props); var noDataComponent = _filterPropsFrom.noDataComponent; var props = _objectWithoutProperties(_filterPropsFrom, ['noDataComponent']); var tableHeader = null; if (columns && columns.length > 0 && showHeaders) { tableHeader = _react['default'].createElement(_thead.Thead, { columns: columns, filtering: filtering, onFilter: function (filter) { _this3.setState({ filter: filter }); if (_this3.props.onFilter) { _this3.props.onFilter(filter); } }, filterPlaceholder: this.props.filterPlaceholder, filterClassName: this.props.filterClassName, currentFilter: this.state.filter, sort: this.state.currentSort, sortableColumns: this._sortable, onSort: this.onSort.bind(this), key: 'thead' }); } return _react['default'].createElement( 'table', props, tableHeader, _react['default'].createElement( 'tbody', { className: 'reactable-data', key: 'tbody' }, currentChildren.length > 0 ? currentChildren : this.renderNoDataComponent(columns) ), pagination === true ? _react['default'].createElement(_paginator.Paginator, { colSpan: columns.length, pageButtonLimit: pageButtonLimit, numPages: numPages, currentPage: currentPage, onPageChange: function (page) { _this3.setState({ currentPage: page }); if (_this3.props.onPageChange) { _this3.props.onPageChange(page); } }, previousPageLabel: this.props.previousPageLabel, nextPageLabel: this.props.nextPageLabel, key: 'paginator' }) : null, this.tfoot ); } }]); return Table; })(_react['default'].Component); exports.Table = Table; Table.defaultProps = { sortBy: false, defaultSort: false, defaultSortDescending: false, itemsPerPage: 0, filterBy: '', hideFilterInput: false }; Table.propTypes = { sortBy: _propTypes['default'].bool, itemsPerPage: _propTypes['default'].number, // number of items to display per page filterable: _propTypes['default'].array, // columns to look at when applying the filter specified by filterBy filterBy: _propTypes['default'].string, // text to filter the results by (see filterable) hideFilterInput: _propTypes['default'].bool, // Whether the default input field for the search/filter should be hidden or not hideTableHeader: _propTypes['default'].bool, // Whether the table header should be hidden or not noDataText: _propTypes['default'].string, // Text to be displayed in the event there is no data to show noDataComponent: _propTypes['default'].func // function called to provide a component to display in the event there is no data to show (supercedes noDataText) }; }); (function (global, factory) { if (typeof define === 'function' && define.amd) { define(['exports', 'react', './reactable/table', './reactable/tr', './reactable/td', './reactable/th', './reactable/tfoot', './reactable/thead', './reactable/sort', './reactable/unsafe'], factory); } else if (typeof exports !== 'undefined') { factory(exports, require('react'), require('./reactable/table'), require('./reactable/tr'), require('./reactable/td'), require('./reactable/th'), require('./reactable/tfoot'), require('./reactable/thead'), require('./reactable/sort'), require('./reactable/unsafe')); } else { var mod = { exports: {} }; factory(mod.exports, global.React, global.table, global.tr, global.td, global.th, global.tfoot, global.thead, global.sort, global.unsafe); global.reactable = mod.exports; } })(this, function (exports, _react, _reactableTable, _reactableTr, _reactableTd, _reactableTh, _reactableTfoot, _reactableThead, _reactableSort, _reactableUnsafe) { 'use strict'; _react['default'].Children.children = function (children) { return _react['default'].Children.map(children, function (x) { return x; }) || []; }; // Array.prototype.find polyfill - see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find if (!Array.prototype.find) { Object.defineProperty(Array.prototype, 'find', { enumerable: false, configurable: true, writable: true, value: function value(predicate) { if (this === null) { throw new TypeError('Array.prototype.find called on null or undefined'); } if (typeof predicate !== 'function') { throw new TypeError('predicate must be a function'); } var list = Object(this); var length = list.length >>> 0; var thisArg = arguments[1]; var value; for (var i = 0; i < length; i++) { if (i in list) { value = list[i]; if (predicate.call(thisArg, value, i, list)) { return value; } } } return undefined; } }); } var Reactable = { Table: _reactableTable.Table, Tr: _reactableTr.Tr, Td: _reactableTd.Td, Th: _reactableTh.Th, Tfoot: _reactableTfoot.Tfoot, Thead: _reactableThead.Thead, Sort: _reactableSort.Sort, unsafe: _reactableUnsafe.unsafe }; exports['default'] = Reactable; if (typeof window !== 'undefined') { window.Reactable = Reactable; } });
cklab/reactable
build/reactable.js
JavaScript
mit
97,419
const path = require("path"); const passport = require("passport"); const logger = require("connect-logger"); const bodyParser = require("body-parser"); const favicon = require("serve-favicon"); const express = require("express"); const app = express(); const auth = require("./app/auth"); const session = require("./app/session"); const routes = require("./app/routes"); const api = require("./app/api"); if(process.env.NODE_ENV !== "production") { require("dotenv").config({ path: "config/.env" }); app.use(logger()); } app.set("view engine", "pug"); app.set("views", path.join(process.cwd(), "client")); auth.setup(); app.use(bodyParser.urlencoded({ extended: true })); app.use(bodyParser.json()); app.use(session()); app.use(passport.initialize()); app.use(passport.session()); app.use(auth.routes()); app.use(api()); app.use(favicon(path.join(process.cwd(), "build", "client", "media", "favicon.ico"))); app.use(express.static(path.join(process.cwd(), "build", "client"))); app.use(routes()); app.listen(process.env.PORT, () => { console.log("Server listening on port: ", process.env.PORT); });
MarkoN95/Pinterest-App
server.js
JavaScript
mit
1,111
QUnit.module("Test index.js functions"); QUnit.test("test pCarUpdate", function(assert) { var fixture = $("#qunit-fixture"); var projectCarousel = "project-carousel"; var pCarouselInner = "carousel-inner"; var summaryParagraph = "project-summary-text"; var done = assert.async(); // Make carousel $("<div class=\"carousel slide\" data-ride=\"carousel\"></div>"). attr('id', projectCarousel). appendTo(fixture); // Make carousel-inner $("<div class=\"carousel-inner\" role=\"listbox\"></div>"). attr('id', pCarouselInner). appendTo($('#' + projectCarousel)); // Make two items $("<div class=\"item active\"></div>"). attr('id', "child1"). appendTo($('#' + pCarouselInner)). attr('data-answer', "test1"); $("<div class=\"item\"></div>"). attr('id', "child2"). appendTo($('#' + pCarouselInner)). attr('data-answer', "test2"); // Make the answer paragraph $("<p></p>").attr('id', summaryParagraph).appendTo(fixture); // Call pCarUpdate to set event listener and set summaryParagraph // to the data-attribute of child1 TestScript.pCarUpdate('#' + projectCarousel, '#' + pCarouselInner, '#' + summaryParagraph); assert.equal($('#' + summaryParagraph).text(), "test1", "initial text loaded"); // On 'slid' event, assert text has been successfully updated: $('#' + projectCarousel).on('slid.bs.carousel', function() { // requeue assertion to assure it follows text update setTimeout(function() { assert.equal($('#' + summaryParagraph).text(), "test2", "text after slide"); done(); }, 100); }); // Trigger the event $('#' + projectCarousel).carousel('next'); });
zachsnyder1/zachsite
zachsite/qunit_tests/qunit_index.js
JavaScript
mit
1,656
var path = require('path'); var rootPath = path.normalize(__dirname + '/../../'); module.exports = { development: { rootPath: rootPath, db: 'mongodb://localhost/pricer', port: process.env.PORT || 1337 }, production: { rootPath: rootPath, db: 'mongodb://localhost/pricer', port: process.env.PORT || 80 } };
chriskjaer/pricer
server/config/config.js
JavaScript
mit
338
import config from '../utils/config' import matchNetworks from '../utils/netaddr' export default function(request, response, next) { request.identity = null let remoteAddr = request.remoteAddr if (request.identity == null && matchNetworks(config.network.teams, remoteAddr)) { request.identity = 'teams' } if (request.identity == null && matchNetworks(config.network.internal, remoteAddr)) { request.identity = 'internal' } if (request.identity == null && matchNetworks(config.network.other, remoteAddr)) { request.identity = 'other' } next() }
aspyatkin/themis-finals
stream/lib/middleware/identity.js
JavaScript
mit
609
// ==UserScript== // @name Google Services List // @namespace wsmwason.google.services.list // @description List all Google services on support page, and auto redirect to product url. // @include https://support.google.com/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js // @auther wsmwason // @version 1.1 // @license MIT // @grant none // ==/UserScript== // hide show all icon $('.show-all').hide(); // display hide container $('.all-hc-container').addClass('all-hc-container-shown'); // add link redirect param for next page $('a').each(function(){ var stid = $(this).attr('st-id'); if (typeof stid !== typeof undefined && stid !== false) { $(this).attr('href', $(this).attr('href')+'&redirect=1').attr('target', '_blank'); } }); // auto redirect to product url if (location.search.indexOf('redirect=1') > 0) { // find product-icon link var productIcon = $('a.product-icon'); if (productIcon.length == 1) { var productUrl = productIcon.attr('href'); location.href = productUrl; } }
wsmwason/google-services-list
google-services-list.user.js
JavaScript
mit
1,107
const webpack = require('webpack') const env = process.env.NODE_ENV const plugins = [ new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify(env), }), ] module.exports = { entry: './src/index', plugins, module: { rules: [ { loader: 'babel-loader', test: /\.js$/, exclude: /node_modules/, }, ], }, devtool: 'source-map', }
lttb/is-react-prop
webpack.config.js
JavaScript
mit
398
/*global define*/ define([ '../Core/BoundingSphere', '../Core/Cartesian3', '../Core/Cartesian4', '../Core/defaultValue', '../Core/defined', '../Core/defineProperties', '../Core/IntersectionTests', '../Core/PixelFormat', '../Renderer/PixelDatatype', '../Renderer/Sampler', '../Renderer/Texture', '../Renderer/TextureMagnificationFilter', '../Renderer/TextureMinificationFilter', '../Renderer/TextureWrap', './ImageryState', './QuadtreeTileLoadState', './SceneMode', './TerrainState', './TileBoundingRegion', './TileTerrain' ], function( BoundingSphere, Cartesian3, Cartesian4, defaultValue, defined, defineProperties, IntersectionTests, PixelFormat, PixelDatatype, Sampler, Texture, TextureMagnificationFilter, TextureMinificationFilter, TextureWrap, ImageryState, QuadtreeTileLoadState, SceneMode, TerrainState, TileBoundingRegion, TileTerrain) { 'use strict'; /** * Contains additional information about a {@link QuadtreeTile} of the globe's surface, and * encapsulates state transition logic for loading tiles. * * @constructor * @alias GlobeSurfaceTile * @private */ function GlobeSurfaceTile() { /** * The {@link TileImagery} attached to this tile. * @type {TileImagery[]} * @default [] */ this.imagery = []; this.waterMaskTexture = undefined; this.waterMaskTranslationAndScale = new Cartesian4(0.0, 0.0, 1.0, 1.0); this.terrainData = undefined; this.center = new Cartesian3(); this.vertexArray = undefined; this.minimumHeight = 0.0; this.maximumHeight = 0.0; this.boundingSphere3D = new BoundingSphere(); this.boundingSphere2D = new BoundingSphere(); this.orientedBoundingBox = undefined; this.tileBoundingRegion = undefined; this.occludeePointInScaledSpace = new Cartesian3(); this.loadedTerrain = undefined; this.upsampledTerrain = undefined; this.pickBoundingSphere = new BoundingSphere(); this.pickTerrain = undefined; this.surfaceShader = undefined; } defineProperties(GlobeSurfaceTile.prototype, { /** * Gets a value indicating whether or not this tile is eligible to be unloaded. * Typically, a tile is ineligible to be unloaded while an asynchronous operation, * such as a request for data, is in progress on it. A tile will never be * unloaded while it is needed for rendering, regardless of the value of this * property. * @memberof GlobeSurfaceTile.prototype * @type {Boolean} */ eligibleForUnloading : { get : function() { // Do not remove tiles that are transitioning or that have // imagery that is transitioning. var loadedTerrain = this.loadedTerrain; var loadingIsTransitioning = defined(loadedTerrain) && (loadedTerrain.state === TerrainState.RECEIVING || loadedTerrain.state === TerrainState.TRANSFORMING); var upsampledTerrain = this.upsampledTerrain; var upsamplingIsTransitioning = defined(upsampledTerrain) && (upsampledTerrain.state === TerrainState.RECEIVING || upsampledTerrain.state === TerrainState.TRANSFORMING); var shouldRemoveTile = !loadingIsTransitioning && !upsamplingIsTransitioning; var imagery = this.imagery; for (var i = 0, len = imagery.length; shouldRemoveTile && i < len; ++i) { var tileImagery = imagery[i]; shouldRemoveTile = !defined(tileImagery.loadingImagery) || tileImagery.loadingImagery.state !== ImageryState.TRANSITIONING; } return shouldRemoveTile; } } }); function getPosition(encoding, mode, projection, vertices, index, result) { encoding.decodePosition(vertices, index, result); if (defined(mode) && mode !== SceneMode.SCENE3D) { var ellipsoid = projection.ellipsoid; var positionCart = ellipsoid.cartesianToCartographic(result); projection.project(positionCart, result); Cartesian3.fromElements(result.z, result.x, result.y, result); } return result; } var scratchV0 = new Cartesian3(); var scratchV1 = new Cartesian3(); var scratchV2 = new Cartesian3(); var scratchResult = new Cartesian3(); GlobeSurfaceTile.prototype.pick = function(ray, mode, projection, cullBackFaces, result) { var terrain = this.pickTerrain; if (!defined(terrain)) { return undefined; } var mesh = terrain.mesh; if (!defined(mesh)) { return undefined; } var vertices = mesh.vertices; var indices = mesh.indices; var encoding = mesh.encoding; var length = indices.length; for (var i = 0; i < length; i += 3) { var i0 = indices[i]; var i1 = indices[i + 1]; var i2 = indices[i + 2]; var v0 = getPosition(encoding, mode, projection, vertices, i0, scratchV0); var v1 = getPosition(encoding, mode, projection, vertices, i1, scratchV1); var v2 = getPosition(encoding, mode, projection, vertices, i2, scratchV2); var intersection = IntersectionTests.rayTriangle(ray, v0, v1, v2, cullBackFaces, scratchResult); if (defined(intersection)) { return Cartesian3.clone(intersection, result); } } return undefined; }; GlobeSurfaceTile.prototype.freeResources = function() { if (defined(this.waterMaskTexture)) { --this.waterMaskTexture.referenceCount; if (this.waterMaskTexture.referenceCount === 0) { this.waterMaskTexture.destroy(); } this.waterMaskTexture = undefined; } this.terrainData = undefined; if (defined(this.loadedTerrain)) { this.loadedTerrain.freeResources(); this.loadedTerrain = undefined; } if (defined(this.upsampledTerrain)) { this.upsampledTerrain.freeResources(); this.upsampledTerrain = undefined; } if (defined(this.pickTerrain)) { this.pickTerrain.freeResources(); this.pickTerrain = undefined; } var i, len; var imageryList = this.imagery; for (i = 0, len = imageryList.length; i < len; ++i) { imageryList[i].freeResources(); } this.imagery.length = 0; this.freeVertexArray(); }; GlobeSurfaceTile.prototype.freeVertexArray = function() { var indexBuffer; if (defined(this.vertexArray)) { indexBuffer = this.vertexArray.indexBuffer; this.vertexArray = this.vertexArray.destroy(); if (!indexBuffer.isDestroyed() && defined(indexBuffer.referenceCount)) { --indexBuffer.referenceCount; if (indexBuffer.referenceCount === 0) { indexBuffer.destroy(); } } } if (defined(this.wireframeVertexArray)) { indexBuffer = this.wireframeVertexArray.indexBuffer; this.wireframeVertexArray = this.wireframeVertexArray.destroy(); if (!indexBuffer.isDestroyed() && defined(indexBuffer.referenceCount)) { --indexBuffer.referenceCount; if (indexBuffer.referenceCount === 0) { indexBuffer.destroy(); } } } }; function createTileBoundingRegion(tile) { var minimumHeight; var maximumHeight; if (defined(tile.parent) && defined(tile.parent.data)) { minimumHeight = tile.parent.data.minimumHeight; maximumHeight = tile.parent.data.maximumHeight; } return new TileBoundingRegion({ rectangle : tile.rectangle, ellipsoid : tile.tilingScheme.ellipsoid, minimumHeight : minimumHeight, maximumHeight : maximumHeight }); } GlobeSurfaceTile.processStateMachine = function(tile, frameState, terrainProvider, imageryLayerCollection, vertexArraysToDestroy) { var surfaceTile = tile.data; if (!defined(surfaceTile)) { surfaceTile = tile.data = new GlobeSurfaceTile(); // Create the TileBoundingRegion now in order to estimate the distance, which is used to prioritize the request. // Since the terrain isn't loaded yet, estimate the heights using its parent's values. surfaceTile.tileBoundingRegion = createTileBoundingRegion(tile, frameState); tile._distance = surfaceTile.tileBoundingRegion.distanceToCamera(frameState); } if (tile.state === QuadtreeTileLoadState.START) { prepareNewTile(tile, terrainProvider, imageryLayerCollection); tile.state = QuadtreeTileLoadState.LOADING; } if (tile.state === QuadtreeTileLoadState.LOADING) { processTerrainStateMachine(tile, frameState, terrainProvider, vertexArraysToDestroy); } // The terrain is renderable as soon as we have a valid vertex array. var isRenderable = defined(surfaceTile.vertexArray); // But it's not done loading until our two state machines are terminated. var isDoneLoading = !defined(surfaceTile.loadedTerrain) && !defined(surfaceTile.upsampledTerrain); // If this tile's terrain and imagery are just upsampled from its parent, mark the tile as // upsampled only. We won't refine a tile if its four children are upsampled only. var isUpsampledOnly = defined(surfaceTile.terrainData) && surfaceTile.terrainData.wasCreatedByUpsampling(); // Transition imagery states var tileImageryCollection = surfaceTile.imagery; for (var i = 0, len = tileImageryCollection.length; i < len; ++i) { var tileImagery = tileImageryCollection[i]; if (!defined(tileImagery.loadingImagery)) { isUpsampledOnly = false; continue; } if (tileImagery.loadingImagery.state === ImageryState.PLACEHOLDER) { var imageryLayer = tileImagery.loadingImagery.imageryLayer; if (imageryLayer.imageryProvider.ready) { // Remove the placeholder and add the actual skeletons (if any) // at the same position. Then continue the loop at the same index. tileImagery.freeResources(); tileImageryCollection.splice(i, 1); imageryLayer._createTileImagerySkeletons(tile, terrainProvider, i); --i; len = tileImageryCollection.length; continue; } else { isUpsampledOnly = false; } } var thisTileDoneLoading = tileImagery.processStateMachine(tile, frameState); isDoneLoading = isDoneLoading && thisTileDoneLoading; // The imagery is renderable as soon as we have any renderable imagery for this region. isRenderable = isRenderable && (thisTileDoneLoading || defined(tileImagery.readyImagery)); isUpsampledOnly = isUpsampledOnly && defined(tileImagery.loadingImagery) && (tileImagery.loadingImagery.state === ImageryState.FAILED || tileImagery.loadingImagery.state === ImageryState.INVALID); } tile.upsampledFromParent = isUpsampledOnly; // The tile becomes renderable when the terrain and all imagery data are loaded. if (i === len) { if (isRenderable) { tile.renderable = true; } if (isDoneLoading) { tile.state = QuadtreeTileLoadState.DONE; } } }; function prepareNewTile(tile, terrainProvider, imageryLayerCollection) { var surfaceTile = tile.data; var upsampleTileDetails = getUpsampleTileDetails(tile); if (defined(upsampleTileDetails)) { surfaceTile.upsampledTerrain = new TileTerrain(upsampleTileDetails); } if (isDataAvailable(tile, terrainProvider)) { surfaceTile.loadedTerrain = new TileTerrain(); } // Map imagery tiles to this terrain tile for (var i = 0, len = imageryLayerCollection.length; i < len; ++i) { var layer = imageryLayerCollection.get(i); if (layer.show) { layer._createTileImagerySkeletons(tile, terrainProvider); } } } function processTerrainStateMachine(tile, frameState, terrainProvider, vertexArraysToDestroy) { var surfaceTile = tile.data; var loaded = surfaceTile.loadedTerrain; var upsampled = surfaceTile.upsampledTerrain; var suspendUpsampling = false; if (defined(loaded)) { loaded.processLoadStateMachine(frameState, terrainProvider, tile.x, tile.y, tile.level, tile._distance); // Publish the terrain data on the tile as soon as it is available. // We'll potentially need it to upsample child tiles. if (loaded.state >= TerrainState.RECEIVED) { if (surfaceTile.terrainData !== loaded.data) { surfaceTile.terrainData = loaded.data; // If there's a water mask included in the terrain data, create a // texture for it. createWaterMaskTextureIfNeeded(frameState.context, surfaceTile); propagateNewLoadedDataToChildren(tile); } suspendUpsampling = true; } if (loaded.state === TerrainState.READY) { loaded.publishToTile(tile); if (defined(tile.data.vertexArray)) { // Free the tiles existing vertex array on next render. vertexArraysToDestroy.push(tile.data.vertexArray); } // Transfer ownership of the vertex array to the tile itself. tile.data.vertexArray = loaded.vertexArray; loaded.vertexArray = undefined; // No further loading or upsampling is necessary. surfaceTile.pickTerrain = defaultValue(surfaceTile.loadedTerrain, surfaceTile.upsampledTerrain); surfaceTile.loadedTerrain = undefined; surfaceTile.upsampledTerrain = undefined; } else if (loaded.state === TerrainState.FAILED) { // Loading failed for some reason, or data is simply not available, // so no need to continue trying to load. Any retrying will happen before we // reach this point. surfaceTile.loadedTerrain = undefined; } } if (!suspendUpsampling && defined(upsampled)) { upsampled.processUpsampleStateMachine(frameState, terrainProvider, tile.x, tile.y, tile.level); // Publish the terrain data on the tile as soon as it is available. // We'll potentially need it to upsample child tiles. // It's safe to overwrite terrainData because we won't get here after // loaded terrain data has been received. if (upsampled.state >= TerrainState.RECEIVED) { if (surfaceTile.terrainData !== upsampled.data) { surfaceTile.terrainData = upsampled.data; // If the terrain provider has a water mask, "upsample" that as well // by computing texture translation and scale. if (terrainProvider.hasWaterMask) { upsampleWaterMask(tile); } propagateNewUpsampledDataToChildren(tile); } } if (upsampled.state === TerrainState.READY) { upsampled.publishToTile(tile); if (defined(tile.data.vertexArray)) { // Free the tiles existing vertex array on next render. vertexArraysToDestroy.push(tile.data.vertexArray); } // Transfer ownership of the vertex array to the tile itself. tile.data.vertexArray = upsampled.vertexArray; upsampled.vertexArray = undefined; // No further upsampling is necessary. We need to continue loading, though. surfaceTile.pickTerrain = surfaceTile.upsampledTerrain; surfaceTile.upsampledTerrain = undefined; } else if (upsampled.state === TerrainState.FAILED) { // Upsampling failed for some reason. This is pretty much a catastrophic failure, // but maybe we'll be saved by loading. surfaceTile.upsampledTerrain = undefined; } } } function getUpsampleTileDetails(tile) { // Find the nearest ancestor with loaded terrain. var sourceTile = tile.parent; while (defined(sourceTile) && defined(sourceTile.data) && !defined(sourceTile.data.terrainData)) { sourceTile = sourceTile.parent; } if (!defined(sourceTile) || !defined(sourceTile.data)) { // No ancestors have loaded terrain - try again later. return undefined; } return { data : sourceTile.data.terrainData, x : sourceTile.x, y : sourceTile.y, level : sourceTile.level }; } function propagateNewUpsampledDataToChildren(tile) { // Now that there's new data for this tile: // - child tiles that were previously upsampled need to be re-upsampled based on the new data. // Generally this is only necessary when a child tile is upsampled, and then one // of its ancestors receives new (better) data and we want to re-upsample from the // new data. propagateNewUpsampledDataToChild(tile, tile._southwestChild); propagateNewUpsampledDataToChild(tile, tile._southeastChild); propagateNewUpsampledDataToChild(tile, tile._northwestChild); propagateNewUpsampledDataToChild(tile, tile._northeastChild); } function propagateNewUpsampledDataToChild(tile, childTile) { if (defined(childTile) && childTile.state !== QuadtreeTileLoadState.START) { var childSurfaceTile = childTile.data; if (defined(childSurfaceTile.terrainData) && !childSurfaceTile.terrainData.wasCreatedByUpsampling()) { // Data for the child tile has already been loaded. return; } // Restart the upsampling process, no matter its current state. // We create a new instance rather than just restarting the existing one // because there could be an asynchronous operation pending on the existing one. if (defined(childSurfaceTile.upsampledTerrain)) { childSurfaceTile.upsampledTerrain.freeResources(); } childSurfaceTile.upsampledTerrain = new TileTerrain({ data : tile.data.terrainData, x : tile.x, y : tile.y, level : tile.level }); childTile.state = QuadtreeTileLoadState.LOADING; } } function propagateNewLoadedDataToChildren(tile) { var surfaceTile = tile.data; // Now that there's new data for this tile: // - child tiles that were previously upsampled need to be re-upsampled based on the new data. // - child tiles that were previously deemed unavailable may now be available. propagateNewLoadedDataToChildTile(tile, surfaceTile, tile.southwestChild); propagateNewLoadedDataToChildTile(tile, surfaceTile, tile.southeastChild); propagateNewLoadedDataToChildTile(tile, surfaceTile, tile.northwestChild); propagateNewLoadedDataToChildTile(tile, surfaceTile, tile.northeastChild); } function propagateNewLoadedDataToChildTile(tile, surfaceTile, childTile) { if (childTile.state !== QuadtreeTileLoadState.START) { var childSurfaceTile = childTile.data; if (defined(childSurfaceTile.terrainData) && !childSurfaceTile.terrainData.wasCreatedByUpsampling()) { // Data for the child tile has already been loaded. return; } // Restart the upsampling process, no matter its current state. // We create a new instance rather than just restarting the existing one // because there could be an asynchronous operation pending on the existing one. if (defined(childSurfaceTile.upsampledTerrain)) { childSurfaceTile.upsampledTerrain.freeResources(); } childSurfaceTile.upsampledTerrain = new TileTerrain({ data : surfaceTile.terrainData, x : tile.x, y : tile.y, level : tile.level }); if (surfaceTile.terrainData.isChildAvailable(tile.x, tile.y, childTile.x, childTile.y)) { // Data is available for the child now. It might have been before, too. if (!defined(childSurfaceTile.loadedTerrain)) { // No load process is in progress, so start one. childSurfaceTile.loadedTerrain = new TileTerrain(); } } childTile.state = QuadtreeTileLoadState.LOADING; } } function isDataAvailable(tile, terrainProvider) { var tileDataAvailable = terrainProvider.getTileDataAvailable(tile.x, tile.y, tile.level); if (defined(tileDataAvailable)) { return tileDataAvailable; } var parent = tile.parent; if (!defined(parent)) { // Data is assumed to be available for root tiles. return true; } if (!defined(parent.data) || !defined(parent.data.terrainData)) { // Parent tile data is not yet received or upsampled, so assume (for now) that this // child tile is not available. return false; } return parent.data.terrainData.isChildAvailable(parent.x, parent.y, tile.x, tile.y); } function getContextWaterMaskData(context) { var data = context.cache.tile_waterMaskData; if (!defined(data)) { var allWaterTexture = new Texture({ context : context, pixelFormat : PixelFormat.LUMINANCE, pixelDatatype : PixelDatatype.UNSIGNED_BYTE, source : { arrayBufferView : new Uint8Array([255]), width : 1, height : 1 } }); allWaterTexture.referenceCount = 1; var sampler = new Sampler({ wrapS : TextureWrap.CLAMP_TO_EDGE, wrapT : TextureWrap.CLAMP_TO_EDGE, minificationFilter : TextureMinificationFilter.LINEAR, magnificationFilter : TextureMagnificationFilter.LINEAR }); data = { allWaterTexture : allWaterTexture, sampler : sampler, destroy : function() { this.allWaterTexture.destroy(); } }; context.cache.tile_waterMaskData = data; } return data; } function createWaterMaskTextureIfNeeded(context, surfaceTile) { var previousTexture = surfaceTile.waterMaskTexture; if (defined(previousTexture)) { --previousTexture.referenceCount; if (previousTexture.referenceCount === 0) { previousTexture.destroy(); } surfaceTile.waterMaskTexture = undefined; } var waterMask = surfaceTile.terrainData.waterMask; if (!defined(waterMask)) { return; } var waterMaskData = getContextWaterMaskData(context); var texture; var waterMaskLength = waterMask.length; if (waterMaskLength === 1) { // Length 1 means the tile is entirely land or entirely water. // A value of 0 indicates entirely land, a value of 1 indicates entirely water. if (waterMask[0] !== 0) { texture = waterMaskData.allWaterTexture; } else { // Leave the texture undefined if the tile is entirely land. return; } } else { var textureSize = Math.sqrt(waterMaskLength); texture = new Texture({ context : context, pixelFormat : PixelFormat.LUMINANCE, pixelDatatype : PixelDatatype.UNSIGNED_BYTE, source : { width : textureSize, height : textureSize, arrayBufferView : waterMask }, sampler : waterMaskData.sampler }); texture.referenceCount = 0; } ++texture.referenceCount; surfaceTile.waterMaskTexture = texture; Cartesian4.fromElements(0.0, 0.0, 1.0, 1.0, surfaceTile.waterMaskTranslationAndScale); } function upsampleWaterMask(tile) { var surfaceTile = tile.data; // Find the nearest ancestor with loaded terrain. var sourceTile = tile.parent; while (defined(sourceTile) && !defined(sourceTile.data.terrainData) || sourceTile.data.terrainData.wasCreatedByUpsampling()) { sourceTile = sourceTile.parent; } if (!defined(sourceTile) || !defined(sourceTile.data.waterMaskTexture)) { // No ancestors have a water mask texture - try again later. return; } surfaceTile.waterMaskTexture = sourceTile.data.waterMaskTexture; ++surfaceTile.waterMaskTexture.referenceCount; // Compute the water mask translation and scale var sourceTileRectangle = sourceTile.rectangle; var tileRectangle = tile.rectangle; var tileWidth = tileRectangle.width; var tileHeight = tileRectangle.height; var scaleX = tileWidth / sourceTileRectangle.width; var scaleY = tileHeight / sourceTileRectangle.height; surfaceTile.waterMaskTranslationAndScale.x = scaleX * (tileRectangle.west - sourceTileRectangle.west) / tileWidth; surfaceTile.waterMaskTranslationAndScale.y = scaleY * (tileRectangle.south - sourceTileRectangle.south) / tileHeight; surfaceTile.waterMaskTranslationAndScale.z = scaleX; surfaceTile.waterMaskTranslationAndScale.w = scaleY; } return GlobeSurfaceTile; });
coderFirework/app
js/Cesium-Tiles/Source/Scene/GlobeSurfaceTile.js
JavaScript
mit
27,467
const _ = require('lodash'); const parsers = require('../../util/parsers'); const Market = require('../../market'); const path = require('path'); const crypto = require('crypto'); const TradeClient = function (auth, publicURI = 'https://api.bitfinex.com') { const self = this; if (!auth && !(auth.secret && auth.key)) { throw new Error('Invalid or incomplete authentication credentials. You should either provide all of the secret, key and passphrase fields, or leave auth null'); } self.apiKey = auth.key; self.apiSecret = auth.secret; self.publicURI = publicURI; self._nonceIncrement = 0; self.body = (uri, args={}) => { self._nonceIncrement += 1000; return _.merge({ request: `/v1/${uri}`, nonce: (Date.now() * 1000 + self._nonceIncrement).toString(), }, args); }; self.payload = body => JSON.stringify(new Buffer(JSON.stringify(body)).toString('base64')); self.signature = body => crypto .createHmac('sha384', self.apiSecret) .update(self.payload(body)) .digest('hex'); self.headers = body => ({ 'X-BFX-APIKEY': self.apiKey, 'X-BFX-PAYLOAD': self.payload(body), 'X-BFX-SIGNATURE': self.signature(body), }); }; _.assign(TradeClient.prototype, new function () { const prototype = this; prototype.openOrders = function (cb) { const self = this; const body = self.body('orders'); return parsers.request({ method: 'POST', uri: `${self.publicURI}${body.request}`, headers: self.headers(body), json: true, transform: body => body }, cb); }; prototype.marketOrder = function (symbol, amount, side, useMargin=false, cb) { return this._placeOrder(symbol, amount, 1, side, `${useMargin ? '' : 'exchange '}market`, cb); }; prototype.limitOrder = function (symbol, amount, price, side, useMargin=false, cb) { return this._placeOrder(symbol, amount, price, side, `${useMargin ? '' : 'exchange '}limit`, cb); }; prototype.tradeHistory = function (cb) { throw new Error('Not implemented'); }; prototype.order = function (order_id, cb) { const self = this; const body = self.body('order/status', { order_id }); return parsers.request({ method: 'POST', uri: `${self.publicURI}${body.request}`, headers: self.headers(body), json: true, transform: body => body }, cb); }; prototype._placeOrder = function (symbol, amount, price = 0, side = 'buy', type = 'exchange market', cb) { const self = this; const use_all_available = amount === -1 ? 1 : 0; amount = amount.toString(); price = price.toString(); const body = self.body('order/new', { symbol, amount, use_all_available, price, type, side, exchange: 'bitfinex', }); return parsers.request({ method: 'POST', uri: `${self.publicURI}${body.request}`, headers: self.headers(body), json: true, }, cb); }; }()); module.exports = exports = TradeClient;
connorgiles/xchange-js
lib/exchanges/bitfinex/trade.js
JavaScript
mit
2,963
const mongoose = require( 'mongoose') const userSchema = require('../schema/user') const User = mongoose.model('User', userSchema) module.exports = User
RizzleCi/Library-manager
lib/module/user.js
JavaScript
mit
154
export const wrench = {"viewBox":"0 0 16 16","children":[{"name":"path","attribs":{"fill":"#000000","d":"M15.671 12.779l-7.196-6.168c0.335-0.63 0.525-1.348 0.525-2.111 0-2.485-2.015-4.5-4.5-4.5-0.455 0-0.893 0.068-1.307 0.193l2.6 2.6c0.389 0.389 0.389 1.025 0 1.414l-1.586 1.586c-0.389 0.389-1.025 0.389-1.414 0l-2.6-2.6c-0.125 0.414-0.193 0.852-0.193 1.307 0 2.485 2.015 4.5 4.5 4.5 0.763 0 1.482-0.19 2.111-0.525l6.168 7.196c0.358 0.418 0.969 0.441 1.358 0.052l1.586-1.586c0.389-0.389 0.365-1-0.052-1.358z"}}]};
wmira/react-icons-kit
src/icomoon/wrench.js
JavaScript
mit
513
// var obj = { // name: 'Jayant' // }; // var stringObj = JSON.stringify(obj); // console.log(typeof stringObj); // console.log(stringObj); // var personString = '{"name": "jayant", "age": 25}'; // var person = JSON.parse(personString); // console.log(typeof person); // console.log(person); const fs = require('fs'); var originalNote = { title: 'some title', body: 'some body' }; var originalNoteString = JSON.stringify(originalNote); fs.writeFileSync('notes.json', originalNoteString); var noteString = fs.readFileSync('notes.json'); var note = JSON.parse(noteString); console.log(typeof note); console.log(note.title);
codejayant/notes-node
playground/json.js
JavaScript
mit
631
/** * Jekyll * Run the development Jekyll build command */ // Tools var gulp = require('gulp'); var cp = require('child_process'); var browsersync = require('browser-sync'); var config = require('../../config').jekyll.development; // Task (gulp jekyll) gulp.task('jekyll', function(done) { // Send notification to BrowserSync browsersync.notify('Compiling Jekyll'); return cp.spawn('bundle', ['exec', 'jekyll', 'build', '-q', '--source=' + config.src, '--destination=' + config.dest, '--config=' + config.config], { stdio: 'inherit' }) .on('close', done); }); // Task (gulp jekyll-rebuild) gulp.task('jekyll-rebuild', ['jekyll'], function() { browsersync.reload(); });
cbracco/jekyll-cardinal
gulp/tasks/development/jekyll.js
JavaScript
mit
707
/* * Testcases for error handler behavior from Ecmascript code point of view. * Checks both Duktape.errCreate and Duktape.errThrow. */ /*=== errCreate - no errCreate error: ReferenceError: identifier 'aiee' undefined, foo: undefined, bar: undefined error: URIError: fake uri error, foo: undefined, bar: undefined - plain errCreate (sets foo and bar) error: ReferenceError: identifier 'aiee' undefined, foo: 1, bar: 2 error: URIError: fake uri error, foo: 1, bar: 2 - errCreate gets only error instances errCreate: object true foo errCreate: object true bar errCreate: object true quux errCreate: object true quux errCreate: object true baz catch: undefined catch: null catch: boolean catch: number catch: string catch: object catch: object catch: function catch: buffer catch: pointer catch: object catch: object catch: object catch: object catch: object catch: object catch: object catch: object - errCreate throws an error error: DoubleError: error in error handling, foo: undefined, bar: undefined error: ReferenceError: identifier 'zork' undefined, foo: undefined, bar: undefined - non-callable errCreate error: DoubleError: error in error handling, foo: undefined, bar: undefined error: TypeError: 123 not callable, foo: undefined, bar: undefined - "undefined" (but set) errCreate error: DoubleError: error in error handling, foo: undefined, bar: undefined error: TypeError: undefined not callable, foo: undefined, bar: undefined - delete errCreate property error: ReferenceError: identifier 'aiee' undefined, foo: undefined, bar: undefined error: URIError: fake uri error, foo: undefined, bar: undefined - errCreate as an accessor property is ignored error: ReferenceError: identifier 'aiee' undefined, foo: undefined, bar: undefined error: URIError: fake uri error, foo: undefined, bar: undefined - recursive errCreate error: RangeError: test error, foo: undefined, bar: undefined error: ReferenceError: identifier 'aiee' undefined, foo: 1, bar: 2 error: RangeError: test error, foo: undefined, bar: undefined error: URIError: fake uri error, foo: 1, bar: 2 ===*/ function errCreateTest() { delete Duktape.errThrow; delete Duktape.errCreate; function errPrint(err) { print('error: ' + String(err) + ', foo: ' + String(err.foo) + ', bar: ' + String(err.bar)); //print(err.stack); } // Error created from Duktape internals function errTest1() { // No way to create an error from Duktape internals without // throwing it. try { aiee; } catch (e) { errPrint(e); } } // Error created from Ecmascript function errTest2() { var e = new URIError('fake uri error'); errPrint(e); } // Note: error created from C code with the Duktape C API is tested // with API test cases. /* * Normal, default case: no errCreate */ print('- no errCreate'); errTest1(); errTest2(); /* * Basic errCreate. */ print('- plain errCreate (sets foo and bar)'); Duktape.errCreate = function (err) { err.foo = 1; err.bar = 2; return err; // NOTE: the error must be returned; if you don't, 'undefined' will replace the error }; errTest1(); errTest2(); /* * Errcreate callback only gets called with Error instances, * because only they are augmented by Duktape. * * Errcreate does get called even if a constructor replaces the * default constructed value for a constructor which creates * Error instances. * * Constructor2 test also illustrates a corner case: the 'quux' * Error gets errCreate processed twice: (1) when it is created * inside Constructor2, and (2) when Constructor2 returns and * the final constructed value gets checked. */ print('- errCreate gets only error instances'); Duktape.errCreate = function (err) { if (err === null) { print('errCreate:', null); } else if (typeof err === 'object') { print('errCreate:', typeof err, err instanceof Error, err.message); } else { print('errCreate:', typeof err); } return err; }; function Constructor1() { return 123; // attempt to replace with a non-object, ignored } function Constructor2() { return new Error('quux'); // replace normal object with an error } function Constructor3() { return {}; // replace Error instance with a normal object } Constructor3.prototype = Error.prototype; function Constructor4() { this.message = 'baz'; return 123; // keep constructed error } Constructor4.prototype = Error.prototype; [ undefined, null, true, 123, 'foo', [ 'foo', 'bar' ], { foo:1, bar:2 }, function () {}, Duktape.Buffer('foo'), Duktape.Pointer('dummy'), new Object(), new Array(), new Error('foo'), Error('bar'), new Constructor1(), new Constructor2(), new Constructor3(), new Constructor4() ].forEach(function (v) { try { throw v; } catch (err) { if (err === null) { print('catch:', null); } else { print('catch:', typeof err); } } }); /* * If an errCreate causes an error, that error won't be augmented. * * There is some inconsistent behavior here now. If the original error * is thrown by Duktape itself (referencing 'aiee') the second error * causes the error to be replaced with a DoubleError. However, if the * original error is thrown by Ecmascript code (throw X) the error from * errCreate will replace the original error as is (here it will be * a ReferenceError caused by referencing 'zork'). */ print('- errCreate throws an error'); Duktape.errCreate = function (err) { err.foo = 1; zork; return err; }; errTest1(); errTest2(); /* * If errCreate is set but is not callable, original error is * replaced with another error - either DoubleError or TypeError. * * The same inconsistency appears here as well: if original error * is thrown by Duktape internally, the final result is a DoubleError, * otherwise a TypeError. */ print('- non-callable errCreate'); Duktape.errCreate = 123; errTest1(); errTest2(); /* * Setting to undefined/null does *not* remove the errCreate, but * will still cause DoubleError/TypeError. */ print('- "undefined" (but set) errCreate'); Duktape.errCreate = undefined; errTest1(); errTest2(); /* * The proper way to remove an errCreate is to delete the property. */ print('- delete errCreate property'); delete Duktape.errCreate; errTest1(); errTest2(); /* * An accessor errCreate is ignored. */ print('- errCreate as an accessor property is ignored'); Object.defineProperty(Duktape, 'errCreate', { get: function () { return function(err) { err.foo = 'called'; return err; } }, set: function () { throw new Error('setter called'); }, enumerable: true, configurable: true }); errTest1(); errTest2(); delete Duktape.errCreate; /* * If an error is created within an errCreate, it won't get augmented * with errCreate. */ print('- recursive errCreate'); Duktape.errCreate = function (err) { err.foo = 1; err.bar = 2; var test = new RangeError('test error'); // won't be augmented errPrint(test); return err; }; errTest1(); errTest2(); /* * Unlike errThrow, errCreate does not have any interaction with coroutines, * so no yield/resume tests here. */ } print print('errCreate'); try { errCreateTest(); } catch (e) { print(e); } /*=== errThrow - no errThrow error: ReferenceError: identifier 'aiee' undefined, foo: undefined, bar: undefined error: URIError: fake uri error, foo: undefined, bar: undefined - plain errThrow (sets foo and bar) error: ReferenceError: identifier 'aiee' undefined, foo: 1, bar: 2 error: URIError: fake uri error, foo: 1, bar: 2 - errThrow gets all value types errThrow: undefined catch: undefined errThrow: null catch: null errThrow: boolean catch: boolean errThrow: number catch: number errThrow: string catch: string errThrow: object false undefined catch: object errThrow: object false undefined catch: object errThrow: function catch: function errThrow: buffer catch: buffer errThrow: pointer catch: pointer errThrow: object false undefined catch: object errThrow: object false undefined catch: object errThrow: object true foo catch: object errThrow: object true bar catch: object errThrow: object false undefined catch: object errThrow: object true quux catch: object errThrow: object false undefined catch: object errThrow: object true baz catch: object - errThrow throws an error error: DoubleError: error in error handling, foo: undefined, bar: undefined error: ReferenceError: identifier 'zork' undefined, foo: undefined, bar: undefined - non-callable errThrow error: DoubleError: error in error handling, foo: undefined, bar: undefined error: TypeError: 123 not callable, foo: undefined, bar: undefined - "undefined" (but set) errThrow error: DoubleError: error in error handling, foo: undefined, bar: undefined error: TypeError: undefined not callable, foo: undefined, bar: undefined - delete errThrow property error: ReferenceError: identifier 'aiee' undefined, foo: undefined, bar: undefined error: URIError: fake uri error, foo: undefined, bar: undefined - errThrow as an accessor property is ignored error: ReferenceError: identifier 'aiee' undefined, foo: undefined, bar: undefined error: URIError: fake uri error, foo: undefined, bar: undefined - plain errThrow, follows into resumed thread error: ReferenceError: identifier 'aiee' undefined, foo: bar, bar: quux error: URIError: fake uri error, foo: bar, bar: quux error: ReferenceError: identifier 'aiee' undefined, foo: bar, bar: quux error: URIError: fake uri error, foo: bar, bar: quux - plain errThrow, called in yield/resume when isError is true caught in resume error: URIError: fake uri error (resume), foo: bar, bar: quux caught yield error: URIError: fake uri error (yield), foo: bar, bar: quux ===*/ function errThrowTest() { var thr; delete Duktape.errThrow; delete Duktape.errCreate; function errPrint(err) { print('error: ' + String(err) + ', foo: ' + String(err.foo) + ', bar: ' + String(err.bar)); //print(err.stack); } // Error thrown from Duktape internals function errTest1() { try { aiee; } catch (e) { errPrint(e); } } // Error thrown from Ecmascript function errTest2() { try { throw new URIError('fake uri error'); } catch (e) { errPrint(e); } } // Note: error thrown from C code with the Duktape C API is tested // with API test cases. /* * Normal, default case: no errThrow */ print('- no errThrow'); errTest1(); errTest2(); /* * Basic errThrow. */ print('- plain errThrow (sets foo and bar)'); Duktape.errThrow = function (err) { if (!(err instanceof Error)) { return err; } err.foo = 1; err.bar = 2; return err; }; errTest1(); errTest2(); /* * An errThrow handler gets whatever values are thrown and must deal * with them properly. */ print('- errThrow gets all value types'); Duktape.errThrow = function (err) { if (err === null) { print('errThrow:', null); } else if (typeof err === 'object') { print('errThrow:', typeof err, err instanceof Error, err.message); } else { print('errThrow:', typeof err); } return err; }; function Constructor1() { return 123; // attempt to replace with a non-object, ignored } function Constructor2() { return new Error('quux'); // replace normal object with an error } function Constructor3() { return {}; // replace Error instance with a normal object } Constructor3.prototype = Error.prototype; function Constructor4() { this.message = 'baz'; return 123; // keep constructed error } Constructor4.prototype = Error.prototype; [ undefined, null, true, 123, 'foo', [ 'foo', 'bar' ], { foo:1, bar:2 }, function () {}, Duktape.Buffer('foo'), Duktape.Pointer('dummy'), new Object(), new Array(), new Error('foo'), Error('bar'), new Constructor1(), new Constructor2(), new Constructor3(), new Constructor4() ].forEach(function (v) { try { throw v; } catch (err) { if (err === null) { print('catch:', null); } else { print('catch:', typeof err); } } }); /* * If an errThrow causes an error, that error won't be augmented. * * There is some inconsistent behavior here now. If the original error * is thrown by Duktape itself (referencing 'aiee') the second error * causes the error to be replaced with a DoubleError. However, if the * original error is thrown by Ecmascript code (throw X) the error from * errThrow will replace the original error as is (here it will be * a ReferenceError caused by referencing 'zork'). */ print('- errThrow throws an error'); Duktape.errThrow = function (err) { if (!(err instanceof Error)) { return err; } err.foo = 1; zork; return err; }; errTest1(); errTest2(); /* * If errThrow is set but is not callable, original error is * replaced with another error - either DoubleError or TypeError. * * The same inconsistency appears here as well: if original error * is thrown by Duktape internally, the final result is a DoubleError, * otherwise a TypeError. */ print('- non-callable errThrow'); Duktape.errThrow = 123; errTest1(); errTest2(); /* * Setting to undefined/null does *not* remove the errThrow, but * will still cause DoubleError/TypeError. */ print('- "undefined" (but set) errThrow'); Duktape.errThrow = undefined; errTest1(); errTest2(); /* * The proper way to remove an errThrow is to delete the property. */ print('- delete errThrow property'); delete Duktape.errThrow; errTest1(); errTest2(); /* * An accessor errThrow is ignored. */ print('- errThrow as an accessor property is ignored'); Object.defineProperty(Duktape, 'errThrow', { get: function () { return function(err) { if (!(err instanceof Error)) { return err; } err.foo = 'called'; return err; } }, set: function () { throw new Error('setter called'); }, enumerable: true, configurable: true }); errTest1(); errTest2(); delete Duktape.errThrow; /* * An errThrow follows into a resumed thread. */ print('- plain errThrow, follows into resumed thread') Duktape.errThrow = function (err) { if (!(err instanceof Error)) { return err; } err.foo = 'bar'; err.bar = 'quux'; return err; }; thr = new Duktape.Thread(function () { // run test inside called thread errTest1(); errTest2(); }); Duktape.Thread.resume(thr); thr = new Duktape.Thread(function () { // throw the error from inside the thread and catch in the resumer aiee; }); try { Duktape.Thread.resume(thr); } catch (e) { errPrint(e); } thr = new Duktape.Thread(function () { // throw the error from inside the thread and catch in the resumer throw new URIError('fake uri error'); }); try { Duktape.Thread.resume(thr); } catch (e) { errPrint(e); } /* * In addition to Duktape internal errors and explicit Ecmascript * throws, coroutine yield() / resume() errors are processed with * the errThrow. */ print('- plain errThrow, called in yield/resume when isError is true'); Duktape.errThrow = function (err) { if (!(err instanceof Error)) { return err; } err.foo = 'bar'; err.bar = 'quux'; return err; }; thr = new Duktape.Thread(function () { try { Duktape.Thread.yield(); } catch (e) { print('caught in resume'); errPrint(e); } }); Duktape.Thread.resume(thr); // until yield() Duktape.Thread.resume(thr, new URIError('fake uri error (resume)'), true); // true=isError thr = new Duktape.Thread(function () { Duktape.Thread.yield(new URIError('fake uri error (yield)'), true); // true=isError }); try { Duktape.Thread.resume(thr); } catch (e) { print('caught yield'); errPrint(e); } } print('errThrow'); try { errThrowTest(); } catch (e) { print(e); } /*=== errCreate + errThrow enter errCreate: Error: initial error undefined undefined error: URIError: fake error (in errCreate), foo: undefined, bar: undefined error: ReferenceError: identifier 'zork' undefined, foo: undefined, bar: undefined e1 tracedata existence matches: true e2 tracedata existence matches: true exit errCreate: Error: initial error added-by-errCreate undefined enter errThrow Error: initial error added-by-errCreate undefined error: URIError: fake error (in errThrow), foo: undefined, bar: undefined error: ReferenceError: identifier 'aiee' undefined, foo: undefined, bar: undefined e1 tracedata existence matches: true e2 tracedata existence matches: true exit errThrow: Error: initial error added-by-errCreate added-by-errThrow in catch error: Error: initial error, foo: added-by-errCreate, bar: added-by-errThrow ===*/ /* When errCreate is running, errors created and thrown inside the handler * will not trigger further errCreate/errThrow calls. Similarly, when * errThrow is running, recursive errCreate/errThrow calls are not made. * * The built-in error augmentation (tracedata) still happens. */ function errCreateAndErrThrowTest() { delete Duktape.errThrow; delete Duktape.errCreate; function errPrint(err) { print('error: ' + String(err) + ', foo: ' + String(err.foo) + ', bar: ' + String(err.bar)); //print(err.stack); } Duktape.errThrow = function (err) { print('enter errThrow', err, err.foo, err.bar); err.bar = 'added-by-errThrow'; var e1 = new URIError('fake error (in errThrow)'); try { aiee; } catch (e) { e2 = e; } errPrint(e1); errPrint(e2); print('e1 tracedata existence matches:', ('tracedata' in err === 'tracedata' in e1)); print('e2 tracedata existence matches:', ('tracedata' in err === 'tracedata' in e2)); print('exit errThrow:', err, err.foo, err.bar); return err; } Duktape.errCreate = function (err) { print('enter errCreate:', err, err.foo, err.bar); err.foo = 'added-by-errCreate'; var e1 = new URIError('fake error (in errCreate)'); try { zork; } catch (e) { e2 = e; } errPrint(e1); errPrint(e2); print('e1 tracedata existence matches:', ('tracedata' in err === 'tracedata' in e1)); print('e2 tracedata existence matches:', ('tracedata' in err === 'tracedata' in e2)); print('exit errCreate:', err, err.foo, err.bar); return err; } try { throw new Error('initial error'); } catch (e) { print('in catch'); errPrint(e); } } print('errCreate + errThrow'); try { errCreateAndErrThrowTest(); } catch (e) { print(e); }
tassmjau/duktape
tests/ecmascript/test-bi-duktape-errhandler.js
JavaScript
mit
20,173
import { module } from 'angular'; export default module('app.directives.compare-to', []) .directive('compareTo', () => ({ // http://odetocode.com/blogs/scott/archive/2014/10/13/confirm-password-validation-in-angularjs.aspx require: 'ngModel', scope: { otherModelValue: '=compareTo', }, link: (scope, element, attributes, ngModel) => { ngModel.$validators.compareTo = modelValue => modelValue === scope.otherModelValue; scope.$watch('otherModelValue', () => ngModel.$validate()); }, }));
freifunk-berlin/firmware-wizard-frontend
src/directives/compare-to.js
JavaScript
mit
543
import { expect } from 'chai'; import { PropTypes } from 'react'; import getPhrasePropTypes from '../../src/utils/getPhrasePropTypes'; const PhraseObject = { foo: 'x', bar: 'y', baz: 'z', }; describe('#getPhrasePropTypes', () => { it('contains each key from the original object', () => { const propTypes = getPhrasePropTypes(PhraseObject); Object.keys(PhraseObject).forEach((key) => { expect(Object.keys(propTypes).filter(type => type === key).length).to.not.equal(0); }); }); it('each value is equal to PropTypes.node', () => { const propTypes = getPhrasePropTypes(PhraseObject); Object.values(propTypes).forEach((value) => { expect(value).to.equal(PropTypes.node); }); }); });
acp31/react-dates
test/utils/getPhrasePropTypes_spec.js
JavaScript
mit
733
'use strict'; var algoliaSearch = require('algoliasearch'); var algoliasearchHelper = require('../../../index'); var fakeClient = {}; test('Numeric filters: numeric filters from constructor', function(done) { var client = algoliaSearch('dsf', 'dsfdf'); client.search = function(queries) { var ps = queries[0].params; expect(ps.numericFilters).toEqual([ 'attribute1>3', 'attribute1<=100', 'attribute2=42', 'attribute2=25', 'attribute2=58', ['attribute2=27', 'attribute2=70'] ]); done(); return new Promise(function() {}); }; var helper = algoliasearchHelper(client, 'index', { numericRefinements: { attribute1: { '>': [3], '<=': [100] }, attribute2: { '=': [42, 25, 58, [27, 70]] } } }); helper.search(); }); test('Numeric filters: numeric filters from setters', function(done) { var client = algoliaSearch('dsf', 'dsfdf'); client.search = function(queries) { var ps = queries[0].params; expect(ps.numericFilters).toEqual([ 'attribute1>3', 'attribute1<=100', 'attribute2=42', 'attribute2=25', 'attribute2=58', ['attribute2=27', 'attribute2=70'] ]); done(); return new Promise(function() {}); }; var helper = algoliasearchHelper(client, 'index'); helper.addNumericRefinement('attribute1', '>', 3); helper.addNumericRefinement('attribute1', '<=', 100); helper.addNumericRefinement('attribute2', '=', 42); helper.addNumericRefinement('attribute2', '=', 25); helper.addNumericRefinement('attribute2', '=', 58); helper.addNumericRefinement('attribute2', '=', [27, 70]); helper.search(); }); test('Should be able to remove values one by one even 0s', function() { var helper = algoliasearchHelper(fakeClient, null, null); helper.addNumericRefinement('attribute', '>', 0); helper.addNumericRefinement('attribute', '>', 4); expect(helper.state.numericRefinements.attribute['>']).toEqual([0, 4]); helper.removeNumericRefinement('attribute', '>', 0); expect(helper.state.numericRefinements.attribute['>']).toEqual([4]); helper.removeNumericRefinement('attribute', '>', 4); expect(helper.state.numericRefinements.attribute['>']).toEqual([]); }); test( 'Should remove all the numeric values for a single operator if remove is called with two arguments', function() { var helper = algoliasearchHelper(fakeClient, null, null); helper.addNumericRefinement('attribute', '>', 0); helper.addNumericRefinement('attribute', '>', 4); helper.addNumericRefinement('attribute', '<', 4); expect(helper.state.numericRefinements.attribute).toEqual({'>': [0, 4], '<': [4]}); helper.removeNumericRefinement('attribute', '>'); expect(helper.state.numericRefinements.attribute['>']).toEqual([]); expect(helper.state.numericRefinements.attribute['<']).toEqual([4]); expect(helper.getRefinements('attribute')).toEqual([ {type: 'numeric', operator: '>', value: []}, {type: 'numeric', operator: '<', value: [4]} ]); } ); test( 'Should remove all the numeric values for an attribute if remove is called with one argument', function() { var helper = algoliasearchHelper(fakeClient, null, null); helper.addNumericRefinement('attribute', '>', 0); helper.addNumericRefinement('attribute', '>', 4); helper.addNumericRefinement('attribute', '<', 4); expect(helper.state.numericRefinements.attribute).toEqual({'>': [0, 4], '<': [4]}); helper.removeNumericRefinement('attribute'); expect(helper.state.numericRefinements.attribute).toEqual({'>': [], '<': []}); expect(helper.getRefinements('attribute')).toEqual([ { operator: '>', type: 'numeric', value: [] }, { operator: '<', type: 'numeric', value: [] } ]); } ); test('Should be able to get if an attribute has numeric filter with hasRefinements', function() { var helper = algoliasearchHelper(fakeClient, null, null); expect(helper.hasRefinements('attribute')).toBeFalsy(); helper.addNumericRefinement('attribute', '=', 42); expect(helper.hasRefinements('attribute')).toBeTruthy(); }); test('Should be able to remove the value even if it was a string used as a number', function() { var attributeName = 'attr'; var n = '42'; var helper = algoliasearchHelper(fakeClient, 'index', {}); // add string - removes string helper.addNumericRefinement(attributeName, '=', n); expect(helper.state.isNumericRefined(attributeName, '=', n)).toBeTruthy(); helper.removeNumericRefinement(attributeName, '=', n); expect(helper.state.isNumericRefined(attributeName, '=', n)).toBeFalsy(); // add number - removes string helper.addNumericRefinement(attributeName, '=', 42); expect(helper.state.isNumericRefined(attributeName, '=', 42)).toBeTruthy(); helper.removeNumericRefinement(attributeName, '=', n); expect(helper.state.isNumericRefined(attributeName, '=', 42)).toBeFalsy(); // add string - removes number helper.addNumericRefinement(attributeName, '=', n); expect(helper.state.isNumericRefined(attributeName, '=', n)).toBeTruthy(); helper.removeNumericRefinement(attributeName, '=', 42); expect(helper.state.isNumericRefined(attributeName, '=', n)).toBeFalsy(); });
algolia/algoliasearch-helper-js
test/spec/algoliasearch.helper/numericFilters.js
JavaScript
mit
5,327
var gulp = require('gulp'); var decompress = require('gulp-decompress'); var download = require('gulp-download'); var del = require('del'); var fs = require('fs'); var join = require('path').join; gulp.task('omnisharp:clean', function () { return del('bin'); }); gulp.task('omnisharp:fetch', ['omnisharp:clean'], function () { var release = 'https://github.com/OmniSharp/omnisharp-roslyn/releases/download/v1.5.6/omnisharp.tar.gz'; return download(release) .pipe(decompress({strip: 1})) .pipe(gulp.dest('bin')) }); gulp.task('omnisharp:fixscripts', ['omnisharp:fetch'], function () { var _fixes = Object.create(null); _fixes['./bin/omnisharp.cmd'] = '@"%~dp0packages\\dnx-clr-win-x86.1.0.0-beta4\\bin\\dnx.exe" "%~dp0packages\\OmniSharp\\1.0.0\\root" run %*'; _fixes['./bin/omnisharp'] = '#!/bin/bash\n\ SOURCE="${BASH_SOURCE[0]}"\n\ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink\n\ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"\n\ SOURCE="$(readlink "$SOURCE")"\n\ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located\n\ done\n\ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"\n\ export SET DNX_APPBASE="$DIR/packages/OmniSharp/1.0.0/root"\n\ export PATH=/usr/local/bin:/Library/Frameworks/Mono.framework/Commands:$PATH # this is required for the users of the Homebrew Mono package\n\ exec "$DIR/packages/dnx-mono.1.0.0-beta4/bin/dnx" "$DNX_APPBASE" run "$@"\n\ \n'; var promises = Object.keys(_fixes).map(function (key) { return new Promise(function(resolve, reject) { fs.writeFile(join(__dirname, key), _fixes[key], function (err) { if (err) { reject(err); } else { resolve(); } }) }); }); return Promise.all(promises) }); gulp.task('omnisharp', ['omnisharp:fixscripts']);
i-csharp/vscode
extensions/csharp-o/gulpfile.js
JavaScript
mit
1,885
import React, { Component, PropTypes } from 'react'; // https://github.com/MaxwellRebo/react-packery-draggabilly import Packery from 'packery'; import imagesloaded from 'imagesloaded'; import Draggabilly from 'draggabilly'; const refName = 'packeryContainer'; class PackeryComponent extends Component{ constructor(props) { super(props); this.packery = false; this.domChildren = []; this.displayName = 'PackeryComponent'; //bind this to all non-react functions //if not familiar, see https://github.com/goatslacker/alt/issues/283 this.initializePackery = this.initializePackery.bind(this); this.makeEachDraggable = this.makeEachDraggable.bind(this); this.imagesLoaded = this.imagesLoaded.bind(this); this.performLayout = this.performLayout.bind(this); } initializePackery = (force) => { this.packery = new Packery( this.refs[refName], this.props.options ); this.packery.getItemElements().forEach( this.makeEachDraggable ); this.domChildren = this.getNewDomChildren(); } getNewDomChildren = () => { const node = this.refs[refName]; const children = this.props.options.itemSelector ? node.querySelectorAll(this.props.options.itemSelector) : node.children; return Array.prototype.slice.call(children); } makeEachDraggable( itemElem ) { // make element draggable with Draggabilly const draggie = new Draggabilly( itemElem ); // bind Draggabilly events to Packery this.packery.bindDraggabillyEvents( draggie ); } diffDomChildren = () => { const oldChildren = this.domChildren.filter((element) => { /* * take only elements attached to DOM * (aka the parent is the packery container, not null) */ return !!element.parentNode }); const newChildren = this.getNewDomChildren(); const removed = oldChildren.filter((oldChild) => { return !~newChildren.indexOf(oldChild); }) const domDiff = newChildren.filter((newChild) => { return !~oldChildren.indexOf(newChild); }) let beginningIndex = 0; // get everything added to the beginning of the DOMNode list const prepended = domDiff.filter((newChild, i) => { const prepend = (beginningIndex === newChildren.indexOf(newChild)); if (prepend) { // increase the index beginningIndex++; } return prepend; }) // we assume that everything else is appended const appended = domDiff.filter((el) => { return prepended.indexOf(el) === -1; }); this.domChildren = newChildren; return { old: oldChildren, new: newChildren, removed: removed, appended: appended, prepended: prepended }; } performLayout = () => { const diff = this.diffDomChildren(); if (diff.removed.length > 0) { this.packery.remove(diff.removed); } if (diff.appended.length > 0) { this.packery.appended(diff.appended); diff.appended.forEach( this.makeEachDraggable ); } if (diff.prepended.length > 0) { this.packery.prepended(diff.prepended); diff.prepended.forEach( this.makeEachDraggable ); } this.packery.reloadItems(); this.packery.layout(); } imagesLoaded = () => { if (this.props.disableImagesLoaded) return; imagesloaded( this.refs[refName], (instance) => { this.packery.layout(); } ); } componentDidMount = () => { this.initializePackery(); this.imagesLoaded(); } componentDidUpdate = () => { this.performLayout(); this.imagesLoaded(); } componentWillReceiveProps = () => { this._timer = setTimeout(() => { this.packery.reloadItems(); this.packery.layout(); }); } componentWillUnmount = () => { clearTimeout(this._timer); } render = () => { return React.createElement(this.props.elementType, { className: this.props.className, ref: refName }, this.props.children); } } PackeryComponent.propTypes = { disableImagesLoaded: React.PropTypes.bool, options: React.PropTypes.object }; PackeryComponent.defaultProps = { disableImagesLoaded: false, options: {}, className: '', elementType: 'div' }; module.exports = PackeryComponent;
MaxwellRebo/react-packery-draggabilly
src/index.js
JavaScript
mit
4,337
window.onload = function () { document.forms["diffAccept"].onsubmit = function(){ alert("Pull request accepted."); } };
PolicyStat/gitlit
mockups/workflow mockups/pullrequestdiff.js
JavaScript
mit
122
import { h } from 'omi'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon(h("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 14H9V8h2v8zm4 0h-2V8h2v8z" }), 'PauseCircleFilled');
AlloyTeam/Nuclear
components/icon/esm/pause-circle-filled.js
JavaScript
mit
245
/* * Copyright 2010 by Dan Fabulich. * * Dan Fabulich licenses this file to you under the * ChoiceScript License, Version 1.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.choiceofgames.com/LICENSE-1.0.txt * * See the License for the specific language governing * permissions and limitations under the License. * * 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. */ // usage: randomtest num=10000 game=mygame seed=0 delay=false trial=false var projectPath = ""; var outFileStream; var outFilePath; var isRhino = false; var iterations = 10; var gameName = "mygame"; var randomSeed = 0; var delay = false; var showCoverage = true; var isTrial = null; var showText = false; var highlightGenderPronouns = false; var showChoices = true; var avoidUsedOptions = true; var recordBalance = false; var slurps = {} function parseArgs(args) { for (var i = 0; i < args.length; i++) { var parts = args[i].split("="); if (parts.length !== 2) throw new Error("Couldn't parse argument " + (i+1) + ": " + args[i]); var name = parts[0]; var value = parts[1]; if (name === "num") { iterations = value; } else if (name === "game") { gameName = value; } else if (name === "project") { projectPath = value; } else if (name === "output") { outFilePath = value; } else if (name === "seed") { randomSeed = value; } else if (name === "delay") { delay = (value !== "false"); } else if (name === "trial") { isTrial = (value !== "false"); } else if (name === "showText") { showText = (value !== "false"); } else if (name === "avoidUsedOptions") { avoidUsedOptions = (value !== "false"); } else if (name === "showChoices") { showChoices = (value !== "false"); } else if (name === "showCoverage") { showCoverage = (value !== "false"); } else if (name === "recordBalance") { recordBalance = (value !== "false"); } } if (isTrial === null) { isTrial = !!process.env.TRIAL; } if (showText) showCoverage = false; if (recordBalance) { showText = false; showChoices = false; showCoverage = false; avoidUsedOptions = false; } } var wordCount = 0; function countWords(msg) { if (!msg.split) msg = ""+msg; var words = msg.split(/\s+/); for (var i = 0; i < words.length; i++) { if (words[i].trim()) wordCount++; } } if (typeof console != "undefined") { var oldLog = console.log; console.log = function(msg) { if (outFileStream) outFileStream.write(msg + '\n', 'utf8'); else oldLog(msg); countWords(msg); }; } if (typeof importScripts != "undefined") { console = { log: function(msg) { if (typeof msg == "string") { postMessage({msg:msg.replace(/\n/g, '[n/]')}); countWords(msg); } else if (msg.stack && msg.message) { postMessage({msg:msg.message, stack:msg.stack}); } else { postMessage({msg:JSON.stringify(msg)}); } } }; if (typeof Scene === 'undefined') { importScripts("web/scene.js", "web/navigator.js", "web/util.js", "web/mygame/mygame.js", "seedrandom.js"); } _global = this; slurpFile = function slurpFile(url) { url = "file://" + url; // CJW: necessary to force latest versions of nwjs to treat/load as file xhr = new XMLHttpRequest(); xhr.open("GET", url, false); try { xhr.send(); if (xhr.status && xhr.status != 200) { throw new Error("Couldn't open " + url + " with status " + xhr.status); } doneLoading(); return xhr.responseText; } catch (x) { doneLoading(); console.log("RANDOMTEST FAILED"); console.log("ERROR: couldn't open " + url); if (typeof window != "undefined" && window.location.protocol == "file:" && /Chrome/.test(navigator.userAgent)) { console.log("We're sorry, Google Chrome has blocked ChoiceScript from functioning. (\"file:\" URLs cannot "+ "load files in Chrome.) ChoiceScript works just fine in Chrome, but only on a published website like "+ "choiceofgames.com. For the time being, please try another browser like Mozilla Firefox."); } throw new Error("Couldn't open " + url); } }; slurpFileLines = function slurpFileLines(url) { return slurpFile(url).split(/\r?\n/); }; doneLoading = function doneLoading() {}; changeTitle = function changeTitle() {}; printFooter = function() {}; printShareLinks = function() {}; printLink = function() {}; showPassword = function() {}; isRegistered = function() {return false;}; isRegisterAllowed = function() {return false;}; isRestorePurchasesSupported = function() {return false;}; isFullScreenAdvertisingSupported = function() {return false;}; areSaveSlotsSupported = function() {return false;}; initStore = function initStore() { return false; }; nav.setStartingStatsClone(stats); delay = true; onmessage = function(event) { if (projectPath == "") projectPath = event.data.projectPath; iterations = event.data.iterations; randomSeed = event.data.randomSeed; showCoverage = event.data.showCoverage; showText = event.data.showText; showChoices = event.data.showChoices; highlightGenderPronouns = event.data.highlightGenderPronouns; avoidUsedOptions = event.data.avoidUsedOptions; recordBalance = event.data.recordBalance; if (event.data.sceneContent) { for (scene in event.data.sceneContent) { slurps[projectPath+scene] = event.data.sceneContent[scene]; } } if (event.data.showText) { var lineBuffer = []; printx = function printx(msg) { lineBuffer.push(msg); }; println = function println(msg) { lineBuffer.push(msg); console.log(lineBuffer.join("")); lineBuffer = []; }; printParagraph = function printParagraph(msg) { if (msg === null || msg === undefined || msg === "") return; println(msg); console.log(""); }; } randomtest(); }; } else if (typeof java == "undefined" && typeof args == "undefined") { args = process.argv; args.shift(); args.shift(); if (!args.length) { delay = true; var readline = require('readline').createInterface({input: process.stdin, output: process.stdout}); var question = function(prompt, defaultAnswer) { return new Promise(function (resolve) { readline.question(prompt + " [" + defaultAnswer + "] ", function (answer) { if (answer === "") answer = defaultAnswer; resolve(answer) }) }); } var booleanQuestion = function(prompt, defaultAnswer) { return question(prompt + " (y/n)", defaultAnswer ? "y" : "n").then(function (answer) { var normalized = String(answer).toLowerCase(); if (!/[yn]/.test(normalized)) { console.log('Please type "y" for yes or "n" for no.'); return booleanQuestion(prompt, defaultAnswer); } else { return normalized === "y"; } }); } question("How many times would you like to run randomtest?", 10).then(function(answer) { iterations = answer; return question("Starting seed number?", 0); }).then(function (answer) { randomSeed = answer; return booleanQuestion("Avoid used options? It's less random, but it finds bugs faster.", true); }).then(function (answer) { avoidUsedOptions = answer; return booleanQuestion("Show full text?", false); }).then(function (answer) { showText = answer; if (showText) return true; return booleanQuestion("Show selected choices?", true); }).then(function (answer) { showChoices = answer; if (showText) return false; return booleanQuestion("After the test, show how many times each line was used?", false); }).then(function (answer) { showCoverage = answer; return booleanQuestion("Write output to a file (randomtest-output.txt)?", false); }).then(function (answer) { if (answer) { var fs = require('fs'); var output = fs.openSync('randomtest-output.txt', 'w'); console.log = function(msg) { countWords(msg); fs.writeSync(output, msg + '\n'); } var oldError = console.error; console.error = function(msg) { oldError(msg); fs.writeSync(output, msg + '\n'); } } readline.close(); randomtest(); }); } parseArgs(args); fs = require('fs'); path = require('path'); vm = require('vm'); if (outFilePath) { if (fs.existsSync(outFilePath)) { throw new Error("Specified output file already exists."); process.exit(1); } outFileStream = fs.createWriteStream(outFilePath, {encoding: 'utf8'}); outFileStream.write("TESTING PROJECT AT:\n\t"+projectPath+"\n\nWRITING TO LOG FILE AT:\n\t"+outFilePath + '\n\nTEST OUTPUT FOLLOWS:\n', 'utf8'); } load = function(file) { vm.runInThisContext(fs.readFileSync(file), file); }; load("web/scene.js"); load("web/navigator.js"); load("web/util.js"); load("headless.js"); load("seedrandom.js"); load("web/"+gameName+"/"+"mygame.js"); } else if (typeof args == "undefined") { isRhino = true; args = arguments; parseArgs(args); load("web/scene.js"); load("web/navigator.js"); load("web/util.js"); load("headless.js"); load("seedrandom.js"); load("web/"+gameName+"/"+"mygame.js"); if (typeof console == "undefined") { console = { log: function(msg) { print(msg);} }; } } printImage = function printImage(source, alignment, alt, invert) { console.log('[IMAGE: ' + (alt || source) + ']'); } clearScreen = function clearScreen(code) { timeout = code; }; saveCookie = function(callback) { if (callback) timeout = callback; }; choiceUseCounts = {}; function chooseIndex(options, choiceLine, sceneName) { function choiceKey(i) { return "o:" + options[i].ultimateOption.line + ",c:" + choiceLine + ",s:" + sceneName; } if (avoidUsedOptions) { var len = options.length; var minUses = choiceUseCounts[choiceKey(0)] || 0; var selectableOptions = []; var result = 0; for (var i = 0; i < len; i++) { var choiceUseCount = choiceUseCounts[choiceKey(i)] || 0; if (choiceUseCount < minUses) { selectableOptions = [i]; minUses = choiceUseCount; } else if (choiceUseCount == minUses) { selectableOptions.push(i); } } var result = selectableOptions[Math.floor(Math.random()*(selectableOptions.length))]; choiceUseCounts[choiceKey(result)] = minUses + 1; return result; } else { return Math.floor(Math.random()*(options.length)); } } var printed = []; printx = println = printParagraph = function printx(msg, parent) { //printed.push(msg); } function slurpFileCached(name) { if (!slurps[name]) slurps[name] = slurpFile(name); return slurps[name]; } function debughelp() { debugger; } function noop() {} Scene.prototype.page_break = function randomtest_page_break(buttonText) { this.paragraph(); buttonText = this.replaceVariables(buttonText); println("*page_break " + buttonText); println(""); this.resetCheckedPurchases(); }; function configureShowText() { if (showText) { var lineBuffer = []; printx = function printx(msg) { lineBuffer.push(msg); }; println = function println(msg) { lineBuffer.push(msg); var logMsg = lineBuffer.join(""); console.log(logMsg); lineBuffer = []; }; printParagraph = function printParagraph(msg) { if (msg === null || msg === undefined || msg === "") return; msg = String(msg) .replace(/\[n\/\]/g, '\n') .replace(/\[c\/\]/g, ''); println(msg); console.log(""); }; } else { oldPrintLine = Scene.prototype.printLine; Scene.prototype.printLine = function randomtest_printLine(line) { if (!line) return null; line = this.replaceVariables(line); } } } var oldGoto = Scene.prototype["goto"]; Scene.prototype["goto"] = function scene_goto(data) { oldGoto.call(this, data); if (!this.localCoverage) this.localCoverage = {}; if (this.localCoverage[this.lineNum]) { this.localCoverage[this.lineNum]++; if (this.looplimit_count && this.localCoverage[this.lineNum] > this.looplimit_count) { throw new Error(this.lineMsg() + "visited this line too many times (" + this.looplimit_count + ")"); } } else { this.localCoverage[this.lineNum] = 1; } } Scene.prototype.subscribe = noop; Scene.prototype.save = noop; Scene.prototype.stat_chart = function() { this.parseStatChart(); } Scene.prototype.check_purchase = function scene_checkPurchase(data) { var products = data.split(/ /); for (var i = 0; i < products.length; i++) { this.temps["choice_purchased_"+products[i]] = !isTrial; } this.temps.choice_purchase_supported = !!isTrial; this.temps.choice_purchased_everything = !isTrial; } Scene.prototype.randomLog = function randomLog(msg) { console.log(this.name + " " + msg); } Scene.prototype.randomtest = true; var balanceValues = {}; function findBalancedValue(values, percentage) { var targetPosition = values.length * percentage / 100; values.sort(); var prevValue = values[0]; var prevPrevValue = values[0]; for (var i = 1; i < values.length; i++) { if (values[i] == prevValue) continue; if (i >= targetPosition) { return (prevValue + values[i]) / 2; } prevPrevValue = prevValue; prevValue = values[i]; } return (prevPrevValue + prevValue) / 2; } Scene.prototype.recordBalance = function(value, operator, rate, id) { if (!recordBalance) return 50; if (!balanceValues[this.name]) balanceValues[this.name] = {}; if (balanceValues[this.name][id] && balanceValues[this.name][id].length > 999) { if (operator == ">" || operator == ">=") rate = 100 - rate; var statName = 'auto' + '_' + this.name + '_' + id; var result = findBalancedValue(balanceValues[this.name][id], rate); this.nav.startingStats[statName] = this.stats[statName] = result; return result; } if (!balanceValues[this.name][id]) balanceValues[this.name][id] = []; balanceValues[this.name][id].push(num(value, this.line)); throw new Error("skip run"); } Scene.prototype.abort = function randomtest_abort(param) { this.paragraph(); this.finished = true; if (param === 'skip') { throw new Error("skip run"); } }; Scene.prototype.save_game = noop; Scene.prototype.restore_game = function(data) { this.parseRestoreGame(false/*alreadyFinished*/); if (data) { var result = /^cancel=(\S+)$/.exec(data); if (!result) throw new Error(this.lineMsg() + "invalid restore_game line: " + data); cancel = result[1]; this["goto"](cancel); } }; Scene.prototype.delay_break = function randomtest_delayBreak(durationInSeconds) { if (isNaN(durationInSeconds * 1)) throw new Error(this.lineMsg() + "invalid duration"); } Scene.prototype.delay_ending = function test_delayEnding(data) { var args = data.split(/ /); var durationInSeconds = args[0]; var price = args[1]; if (isNaN(durationInSeconds * 1)) throw new Error(this.lineMsg() + "invalid duration"); if (!/^\$/.test(price)) throw new Error(this.lineMsg() + "invalid price"); this.paragraph(); this.finished = true; } crc32 = noop; parsedLines = {}; Scene.prototype.oldLoadLines = Scene.prototype.loadLines; Scene.prototype.loadLines = function cached_loadLines(str) { var parsed = parsedLines[str]; if (parsed) { this.labels = parsed.labels; this.lines = parsed.lines; return; } else { this.oldLoadLines(str); parsedLines[str] = {labels: this.labels, lines: this.lines}; } } cachedNonBlankLines = {}; Scene.prototype.oldNextNonBlankLine = Scene.prototype.nextNonBlankLine; Scene.prototype.nextNonBlankLine = function cached_nextNonBlankLine(includingThisOne) { var key = this.name+" "+this.lineNum +""+ !!includingThisOne; var cached = cachedNonBlankLines[key]; if (cached) { return cached; } cached = this.oldNextNonBlankLine(includingThisOne); cachedNonBlankLines[key] = cached; return cached; } cachedTokenizedExpressions = {}; Scene.prototype.oldTokenizeExpr = Scene.prototype.tokenizeExpr; Scene.prototype.tokenizeExpr = function cached_tokenizeExpr(str) { var cached; if (cachedTokenizedExpressions.hasOwnProperty(str)) { cached = cachedTokenizedExpressions[str]; } if (cached) return cloneStack(cached); cached = this.oldTokenizeExpr(str); cachedTokenizedExpressions[str] = cloneStack(cached); return cached; function cloneStack(stack) { var twin = new Array(stack.length); var i = stack.length; while (i--) { twin[i] = stack[i]; } return twin; } } // TODO bring back this performance optimization; make parseOptions return all options // Scene.prototype.oldParseOptions = Scene.prototype.parseOptions; // parsedOptions = {}; // Scene.prototype.parseOptions = function cached_parseOptions(indent, groups, expectedSuboptions) { // if (expectedSuboptions) return this.oldParseOptions(indent, groups, expectedSuboptions); // var key = this.name + this.lineNum; // var parsed = parsedOptions[key]; // if (parsed) { // this.lineNum = parsed.lineNum; // this.indent = parsed.indent; // return parsed.result; // } // var result = this.oldParseOptions(indent, groups, expectedSuboptions); // parsedOptions[key] = {lineNum:this.lineNum, indent:this.indent, result:result}; // return result; // } Scene.prototype.ending = function () { this.paragraph(); this.reset(); this.finished = true; } Scene.prototype.restart = Scene.prototype.ending; Scene.prototype.input_text = function(line) { var parsed = this.parseInputText(line); var input = "blah blah"; if (parsed.inputOptions.allow_blank) { if (!Math.floor(Math.random() * 4)) { input = ""; } this.randomLog("*input_text " + (this.lineNum + 1) + " " + input); } this.set(parsed.variable + " \""+input+"\""); } Scene.prototype.input_number = function(data) { this.rand(data); } Scene.prototype.finish = Scene.prototype.autofinish = function random_finish(buttonText) { var nextSceneName = this.nav && nav.nextSceneName(this.name); if (isTrial && typeof purchases != "undefined" && purchases[nextSceneName]) { throw new Error(this.lineMsg() + "Trying to go to scene " + nextSceneName + " but that scene requires purchase"); } this.finished = true; this.paragraph(); // if there are no more scenes, then just halt if (!nextSceneName) { return; } var scene = new Scene(nextSceneName, this.stats, this.nav, this.debugMode); if (buttonText === undefined || buttonText === "") buttonText = "Next Chapter"; buttonText = this.replaceVariables(buttonText); println("*finish " + buttonText); println(""); scene.resetPage(); } Scene.prototype.oldGotoScene = Scene.prototype.goto_scene; Scene.prototype.goto_scene = function random_goto_scene(data) { var result = this.parseGotoScene(data); var name = result.sceneName; if (isTrial && typeof purchases != "undefined" && purchases[name]) { throw new Error(this.lineMsg() + "Trying to go to scene " + name + " but that scene requires purchase"); } this.oldGotoScene.apply(this, arguments); } Scene.prototype.buyButton = function random_buyButton(product, priceGuess, label, title) { println('[Buy '+title+' Now for '+priceGuess+']'); println(""); }; Scene.prototype.choice = function choice(data) { var groups = ["choice"]; if (data) groups = data.split(/ /); var choiceLine = this.lineNum; var options = this.parseOptions(this.indent, groups); var flattenedOptions = []; flattenOptions(flattenedOptions, options); var index = chooseIndex(flattenedOptions, choiceLine, this.name); var item = flattenedOptions[index]; if (!this.temps._choiceEnds) { this.temps._choiceEnds = {}; } for (var i = 0; i < options.length; i++) { this.temps._choiceEnds[options[i].line-1] = this.lineNum; } this.paragraph(); if (showChoices) { if (showText) { this.randomLog("*choice " + (choiceLine+1)+'#'+(index+1)+' (line '+item.ultimateOption.line+')'); // it would be nice to handle choice groups here for (var i = 0; i < flattenedOptions.length; i++) { if (i > 0) { this.printLine("[n/]"); } else { this.printLine(" "); } this.printLine("\u2022 " + (i === index ? "\u2605 " : "") + flattenedOptions[i].ultimateOption.name); } this.paragraph(); } else { var optionName = this.replaceVariables(item.ultimateOption.name); this.randomLog("*choice " + (choiceLine+1)+'#'+(index+1)+' (line '+item.ultimateOption.line+') #' + optionName); } } var self = this; timeout = function() {println("");self.standardResolution(item.ultimateOption);} this.finished = true; function flattenOptions(list, options, flattenedOption) { if (!flattenedOption) flattenedOption = {}; for (var i = 0; i < options.length; i++) { var option = options[i]; flattenedOption[option.group] = i; if (option.suboptions) { flattenOptions(list, option.suboptions, flattenedOption); } else { flattenedOption.ultimateOption = option; if (!option.unselectable) list.push(dojoClone(flattenedOption)); } } } function dojoClone(/*anything*/ o){ // summary: // Clones objects (including DOM nodes) and all children. // Warning: do not clone cyclic structures. if(!o){ return o; } if(o instanceof Array || typeof o == "array"){ var r = []; for(var i = 0; i < o.length; ++i){ r.push(dojoClone(o[i])); } return r; // Array } if(typeof o != "object" && typeof o != "function"){ return o; /*anything*/ } if(o.nodeType && o.cloneNode){ // isNode return o.cloneNode(true); // Node } if(o instanceof Date){ return new Date(o.getTime()); // Date } // Generic objects r = new o.constructor(); // specific to dojo.declare()'d classes! for(i in o){ if(!(i in r) || r[i] != o[i]){ r[i] = dojoClone(o[i]); } } return r; // Object } } Scene.prototype.loadScene = function loadScene() { var file = slurpFileCached(projectPath+this.name+'.txt'); this.loadLines(file); this.loaded = true; if (this.executing) { this.execute(); } } var coverage = {}; var sceneNames = []; Scene.prototype.rollbackLineCoverage = function(lineNum) { if (!lineNum) lineNum = this.lineNum; coverage[this.name][lineNum]--; } try { Scene.prototype.__defineGetter__("lineNum", function() { return this._lineNum; }); Scene.prototype.__defineSetter__("lineNum", function(val) { var sceneCoverage; if (!coverage[this.name]) { sceneNames.push(this.name); coverage[this.name] = []; } sceneCoverage = coverage[this.name]; if (sceneCoverage[val]) { sceneCoverage[val]++; } else { sceneCoverage[val] = 1; } this._lineNum = val; }); } catch (e) { // IE doesn't support getters/setters; no coverage for you! } nav.setStartingStatsClone(stats); var processExit = false; var start; function randomtestAsync(i, showCoverage) { configureShowText(); if (i==0) start = new Date().getTime(); function runTimeout(fn) { timeout = null; setTimeout(function() { try { fn(); } catch (e) { return fail(e); } if (timeout) { runTimeout(timeout); } else { if (i < iterations) { randomtestAsync(i+1, showCoverage); } } }, 0); } function fail(e) { console.log("RANDOMTEST FAILED\n"); console.log(e); if (isRhino) { java.lang.System.exit(1); } else if (typeof process != "undefined" && process.exit) { process.exit(1); } else { processExit = true; } } if (i >= iterations && !processExit) { if (showCoverage) { for (i = 0; i < sceneNames.length; i++) { var sceneName = sceneNames[i]; var sceneLines = slurpFileLines(projectPath+sceneName+'.txt'); var sceneCoverage = coverage[sceneName]; for (var j = 0; j < sceneCoverage.length; j++) { console.log(sceneName + " "+ (sceneCoverage[j] || 0) + ": " + sceneLines[j]); } } } console.log("RANDOMTEST PASSED"); var end = new Date().getTime(); var duration = (end - start)/1000; console.log("Time: " + duration + "s") return; } console.log("*****Seed " + (i+randomSeed)); timeout = null; nav.resetStats(stats); Math.seedrandom(i+randomSeed); var scene = new Scene(nav.getStartupScene(), stats, nav, false); try { scene.execute(); if (timeout) return runTimeout(timeout); } catch (e) { return fail(e); } } function randomtest() { configureShowText(); var start = new Date().getTime(); randomSeed *= 1; var percentage = iterations / 100; for (var i = 0; i < iterations; i++) { if (typeof process != "undefined") if (typeof process.send != "undefined") process.send({type: "progress", data: i / percentage}); console.log("*****Seed " + (i+randomSeed)); nav.resetStats(stats); timeout = null; Math.seedrandom(i+randomSeed); var scene = new Scene(nav.getStartupScene(), stats, nav, false); try { scene.execute(); while (timeout) { var fn = timeout; timeout = null; fn(); } println(); // flush buffer } catch (e) { if (e.message == "skip run") { println("SKIPPED RUN " + i); iterations++; continue; } console.log("RANDOMTEST FAILED: " + e); process.exitCode = 1; processExit = true; break; } } if (!processExit) { if (showText) console.log("Word count: " + wordCount); if (showCoverage) { for (var i = 0; i < sceneNames.length; i++) { var sceneName = sceneNames[i]; var sceneLines = slurpFileLines(projectPath+sceneName+'.txt'); var sceneCoverage = coverage[sceneName]; for (var j = 0; j < sceneCoverage.length; j++) { console.log(sceneName + " "+ (sceneCoverage[j] || 0) + ": " + sceneLines[j]); } } } console.log("RANDOMTEST PASSED"); var duration = (new Date().getTime() - start)/1000; console.log("Time: " + duration + "s") if (recordBalance) { (function() { for (var sceneName in balanceValues) { for (var id in balanceValues[sceneName]) { var values = balanceValues[sceneName][id].sort(); var histogram = [{value:values[0], count:1}]; for (var i = 1; i < values.length; i++) { if (values[i] == histogram[histogram.length-1].value) { histogram[histogram.length-1].count++; } else { histogram.push({value:values[i], count:1}); } } console.log(sceneName + " " + id + " observed values ("+values.length+")"); for (i = 0; i < histogram.length; i++) { if (histogram[i].count > 1) { console.log(" " + histogram[i].value + " x" + histogram[i].count); } else { console.log(" " + histogram[i].value); } } } } for (var statName in stats) { if (/^auto_.+?_.+$/.test(statName)) { console.log("*create " + statName + " " + stats[statName]); } } })(); } } if (process.disconnect) process.disconnect(); // Close IPC channel, so we can exit. } if (!delay) randomtest();
ChoicescriptIDE/choicescriptide.github.io
cslib/node_modules/cside-choicescript/randomtest.js
JavaScript
mit
29,225
'use strict'; module.exports = function(app) { var users = require('../../app/controllers/users'); var spends = require('../../app/controllers/spends'); // Spends Routes app.route('/spends') .get(spends.list) .post(users.requiresLogin, spends.create); app.route('/spends/:spendId') .get(spends.read) .put(users.requiresLogin, spends.hasAuthorization, spends.update) .delete(users.requiresLogin, spends.hasAuthorization, spends.delete); // Finish by binding the Spend middleware app.param('spendId', spends.spendByID); };
blackbunny/suxse
app/routes/spends.server.routes.js
JavaScript
mit
541
'use strict'; import d3 from 'd3' import React from 'react' export default React.createClass({ handleChangeNumber: function(e) { this.props.handleChangeNumber(e.target.value) }, render: function() { return ( <div className='mdl-textfield mdl-js-textfield mdl-textfield--floating-label'> <input id='number' className='mdl-textfield__input' type='number' value={this.props.number.current} min={this.props.number.min} max={this.props.number.max} onChange={this.handleChangeNumber} /> <label className='mdl-textfield__label' htmlFor='number'>Кол-во точек</label> </div> ) } })
voodee/funny_points
src/javascripts/component/NumberPicker.js
JavaScript
mit
635
// Copyright (c) 2021, Oracle and/or its affiliates. 'use strict'; const mysql = require('../../../index.js'); const Command = require('../../../lib/commands/command.js'); const Packets = require('../../../lib/packets/index.js'); const assert = require('assert'); class TestChangeUserMultiFactor extends Command { constructor(args) { super(); this.args = args; this.authFactor = 0; } start(_, connection) { const serverHelloPacket = new Packets.Handshake({ // "required" properties serverVersion: 'node.js rocks', // the server should announce support for the // "MULTI_FACTOR_AUTHENTICATION" capability capabilityFlags: 0xdfffffff }); this.serverHello = serverHelloPacket; serverHelloPacket.setScrambleData(() => { connection.writePacket(serverHelloPacket.toPacket(0)); }); return TestChangeUserMultiFactor.prototype.acceptConnection; } acceptConnection(_, connection) { connection.writeOk(); return TestChangeUserMultiFactor.prototype.readChangeUser; } readChangeUser(_, connection) { const asr = new Packets.AuthSwitchRequest(this.args[this.authFactor]); connection.writePacket(asr.toPacket()); return TestChangeUserMultiFactor.prototype.sendAuthNextFactor; } sendAuthNextFactor(_, connection) { console.log('this.authFactor:', this.authFactor); // const asr = Packets.AuthSwitchResponse.fromPacket(packet); // assert.deepStrictEqual(asr.data.toString(), this.args[this.authFactor].pluginName); if (this.authFactor === 1) { // send OK_Packet after the 3rd authentication factor connection.writeOk(); return TestChangeUserMultiFactor.prototype.dispatchCommands; } this.authFactor += 1; const anf = new Packets.AuthNextFactor(this.args[this.authFactor]); connection.writePacket(anf.toPacket(connection.serverConfig.encoding)); return TestChangeUserMultiFactor.prototype.sendAuthNextFactor; } dispatchCommands(_, connection) { connection.end(); return TestChangeUserMultiFactor.prototype.dispatchCommands; } } const server = mysql.createServer(conn => { conn.serverConfig = {}; conn.serverConfig.encoding = 'cesu8'; conn.addCommand( new TestChangeUserMultiFactor([{ // already covered by test-auth-switch pluginName: 'auth_test_plugin1', pluginData: Buffer.from('foo') }, { // 2nd factor auth plugin pluginName: 'auth_test_plugin2', pluginData: Buffer.from('bar') }]) ); }); const completed = []; const password1 = 'secret1'; const password2 = 'secret2'; const portfinder = require('portfinder'); portfinder.getPort((_, port) => { server.listen(port); const conn = mysql.createConnection({ port: port, authPlugins: { auth_test_plugin1 (options) { return () => { if (options.connection.config.password !== password1) { return assert.fail('Incorrect authentication factor password.'); } const pluginName = 'auth_test_plugin1'; completed.push(pluginName); return Buffer.from(pluginName); } }, auth_test_plugin2 (options) { return () => { if (options.connection.config.password !== password2) { return assert.fail('Incorrect authentication factor password.'); } const pluginName = 'auth_test_plugin2'; completed.push(pluginName); return Buffer.from(pluginName); } } } }); conn.on('connect', () => { conn.changeUser({password1, password2}, () => { assert.deepStrictEqual(completed, [ 'auth_test_plugin1', 'auth_test_plugin2' ]); conn.end(); server.close(); }) }); });
sidorares/node-mysql2
test/integration/connection/test-change-user-multi-factor.js
JavaScript
mit
3,765
var path = require('path'); var dynamicPathParser = require('../../utilities/dynamic-path-parser'); const stringUtils = require('ember-cli-string-utils'); const astUtils = require('../../utilities/ast-utils'); const findParentModule = require('../../utilities/find-parent-module').default; module.exports = { description: '', availableOptions: [ { name: 'flat', type: Boolean, default: true } ], beforeInstall: function() { try { this.pathToModule = findParentModule(this.project, this.dynamicPath.dir); } catch(e) { throw `Error locating module for declaration\n\t${e}`; } }, normalizeEntityName: function (entityName) { var parsedPath = dynamicPathParser(this.project, entityName); this.dynamicPath = parsedPath; return parsedPath.name; }, locals: function (options) { return { dynamicPath: this.dynamicPath.dir, flat: options.flat }; }, fileMapTokens: function (options) { // Return custom template variables here. return { __path__: () => { var dir = this.dynamicPath.dir; if (!options.locals.flat) { dir += path.sep + options.dasherizedModuleName; } this.generatePath = dir; return dir; } }; }, afterInstall: function(options) { if (options.dryRun) { return; } const returns = []; const className = stringUtils.classify(`${options.entity.name}Pipe`); const fileName = stringUtils.dasherize(`${options.entity.name}.pipe`); const componentDir = path.relative(this.dynamicPath.appRoot, this.generatePath); const importPath = componentDir ? `./${componentDir}/${fileName}` : `./${fileName}`; if (!options['skip-import']) { returns.push( astUtils.addDeclarationToModule(this.pathToModule, className, importPath) .then(change => change.apply())); } return Promise.all(returns); } };
UAB-CS499-Back-Stabbers-Team/CS499-Back-Stabber-Project
BackStabberProject/node_modules/angular-cli/blueprints/pipe/index.js
JavaScript
mit
1,923
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("React")); else if(typeof define === 'function' && define.amd) define("PotionUtil", ["React"], factory); else if(typeof exports === 'object') exports["PotionUtil"] = factory(require("React")); else root["PotionUtil"] = factory(root["React"]); })(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_5__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 4); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ function makeEmptyFunction(arg) { return function () { return arg; }; } /** * This function accepts and discards inputs; it has no side effects. This is * primarily useful idiomatically for overridable function endpoints which * always need to be callable, since JS lacks a null-call idiom ala Cocoa. */ var emptyFunction = function emptyFunction() {}; emptyFunction.thatReturns = makeEmptyFunction; emptyFunction.thatReturnsFalse = makeEmptyFunction(false); emptyFunction.thatReturnsTrue = makeEmptyFunction(true); emptyFunction.thatReturnsNull = makeEmptyFunction(null); emptyFunction.thatReturnsThis = function () { return this; }; emptyFunction.thatReturnsArgument = function (arg) { return arg; }; module.exports = emptyFunction; /***/ }), /* 1 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ /** * Use invariant() to assert state which your program assumes to be true. * * Provide sprintf-style format (only %s is supported) and arguments * to provide information about what broke and what you were * expecting. * * The invariant message will be stripped in production, but the invariant * will remain to ensure logic does not differ in production. */ var validateFormat = function validateFormat(format) {}; if (true) { validateFormat = function validateFormat(format) { if (format === undefined) { throw new Error('invariant requires an error message argument'); } }; } function invariant(condition, format, a, b, c, d, e, f) { validateFormat(format); if (!condition) { var error; if (format === undefined) { error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); } else { var args = [a, b, c, d, e, f]; var argIndex = 0; error = new Error(format.replace(/%s/g, function () { return args[argIndex++]; })); error.name = 'Invariant Violation'; } error.framesToPop = 1; // we don't care about invariant's own frame throw error; } } module.exports = invariant; /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2014-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ var emptyFunction = __webpack_require__(0); /** * Similar to invariant but only logs a warning if the condition is not met. * This can be used to log issues in development environments in critical * paths. Removing the logging code for production environments will keep the * same logic and follow the same code paths. */ var warning = emptyFunction; if (true) { var printWarning = function printWarning(format) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } var argIndex = 0; var message = 'Warning: ' + format.replace(/%s/g, function () { return args[argIndex++]; }); if (typeof console !== 'undefined') { console.error(message); } try { // --- Welcome to debugging React --- // This error was thrown as a convenience so that you can use this stack // to find the callsite that caused this warning to fire. throw new Error(message); } catch (x) {} }; warning = function warning(condition, format) { if (format === undefined) { throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); } if (format.indexOf('Failed Composite propType: ') === 0) { return; // Ignore CompositeComponent proptype check. } if (!condition) { for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { args[_key2 - 2] = arguments[_key2]; } printWarning.apply(undefined, [format].concat(args)); } }; } module.exports = warning; /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; module.exports = ReactPropTypesSecret; /***/ }), /* 4 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.wrapIfOutdated = exports.getRNSvgTransformations = exports.getRNSvgTransformationsFromObject = exports.getRNSvgTransformationsFromArray = exports.getTransformations = exports.getTransformationsFromObject = exports.getTransformationsFromArray = exports.omit = exports.pick = exports.isObject = exports.isFunction = exports.isNumber = exports.isString = exports.isArray = exports.defaultProps = exports.types = exports.constants = undefined; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; exports.cap = cap; exports.mapObject = mapObject; exports.flattenHierarchy = flattenHierarchy; exports.radiansToDegrees = radiansToDegrees; exports.bindMouseEvents = bindMouseEvents; var _react = __webpack_require__(5); var _react2 = _interopRequireDefault(_react); var _itsSet = __webpack_require__(6); var _itsSet2 = _interopRequireDefault(_itsSet); var _intersect = __webpack_require__(9); var _intersect2 = _interopRequireDefault(_intersect); var _constants = __webpack_require__(10); var _types = __webpack_require__(11); var _defaultProps = __webpack_require__(16); var _defaultProps2 = _interopRequireDefault(_defaultProps); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var constants = exports.constants = { MOUSE_EVENTS: _constants.MOUSE_EVENTS }; var types = exports.types = { components: _types.components }; exports.defaultProps = _defaultProps2.default; // convert first letter of word to uppercase function cap(word) { return word.charAt(0).toUpperCase() + word.slice(1); } var isArray = exports.isArray = function isArray(val) { return Array.isArray(val); }; function mapObject(object, iterator) { return (isArray(object) ? object : Object.keys(object)).reduce(function (acc, key) { return Object.assign({}, acc, _defineProperty({}, key, iterator(object[key], key))); }, {}); } function flattenHierarchy(object) { var result = [object]; if ((0, _itsSet2.default)(object.children)) { result = result.concat(object.children.reduce(function (acc, child) { return acc.concat(flattenHierarchy(child)); }, [])); } return result; } // export function mapHierarchy(object, mapper, isRoot = true) { // const result = isRoot ? { ...object } : { // ...object, // ...mapper(object), // }; // if (object.children) { // result.children = object.children.map(child => mapHierarchy(child, mapper, false)); // } // return result; // } function radiansToDegrees(radians) { return radians * 180 / Math.PI; } function bindMouseEvents(props) { var setProps = (0, _intersect2.default)(Object.keys(props), _constants.MOUSE_EVENTS); return setProps.reduce(function (acc, key) { return Object.assign({}, acc, _defineProperty({}, key, function () { return props[key](props); })); }, {}); } var isString = exports.isString = function isString(val) { return typeof val === 'string'; }; var isNumber = exports.isNumber = function isNumber(val) { return typeof val === 'number'; }; var isFunction = exports.isFunction = function isFunction(val) { return typeof val === 'function'; }; var isObject = exports.isObject = function isObject(val) { return (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object' && val !== null; }; var pick = exports.pick = function pick(obj, keys) { var result = {}; keys.forEach(function (k) { result[k] = obj[k]; }); return result; }; var omit = exports.omit = function omit(obj, keys) { var result = Object.assign({}, obj); keys.forEach(function (key) { return delete result[key]; }); return result; }; var getTranformation = function getTranformation(meta) { return { matrix: function matrix(_ref) { var _ref2 = _slicedToArray(_ref, 6), a = _ref2[0], b = _ref2[1], c = _ref2[2], d = _ref2[3], e = _ref2[4], f = _ref2[5]; return 'matrix(' + a + ', ' + b + ', ' + c + ', ' + d + ', ' + e + ', ' + f + ')'; }, translate: function translate(_ref3) { var _ref4 = _slicedToArray(_ref3, 2), x = _ref4[0], y = _ref4[1]; return 'translate(' + x + (y ? ', ' + y : '') + ')'; }, scale: function scale(_ref5) { var _ref6 = _slicedToArray(_ref5, 2), x = _ref6[0], y = _ref6[1]; return 'scale(' + x + (y ? ', ' + y : '') + ')'; }, rotate: function rotate(_ref7) { var _ref8 = _slicedToArray(_ref7, 3), a = _ref8[0], x = _ref8[1], y = _ref8[2]; return 'rotate(' + a + (x ? ', ' + x : '') + (y ? ', ' + y : '') + ')'; }, skewX: function skewX(_ref9) { var _ref10 = _slicedToArray(_ref9, 1), a = _ref10[0]; return 'skewX(' + a + ')'; }, skewY: function skewY(_ref11) { var _ref12 = _slicedToArray(_ref11, 1), a = _ref12[0]; return 'skewY(' + a + ')'; } }[meta.type](meta.value); }; var getTransformationsFromArray = exports.getTransformationsFromArray = function getTransformationsFromArray(arr) { return arr.reduce(function (acc, meta) { return acc + ' ' + getTranformation(meta); }, ''); }; var getTransformationsFromObject = exports.getTransformationsFromObject = function getTransformationsFromObject(obj) { return Object.keys(obj).reduce(function (acc, type) { return acc + ' ' + getTranformation({ type: type, value: obj[type] }); }, ''); }; var getTransformations = exports.getTransformations = function getTransformations(transform) { return isArray(transform) ? getTransformationsFromArray(transform) : getTransformationsFromObject(transform); }; var getRNSvgTranformation = function getRNSvgTranformation(meta) { return { translate: function translate(_ref13) { var _ref14 = _slicedToArray(_ref13, 2), x = _ref14[0], y = _ref14[1]; return { x: x, y: y }; }, scale: function scale(_ref15) { var _ref16 = _slicedToArray(_ref15, 2), x = _ref16[0], y = _ref16[1]; return y ? { scaleX: x, scaleY: y } : { scale: x }; }, rotate: function rotate(_ref17) { var _ref18 = _slicedToArray(_ref17, 3), a = _ref18[0], x = _ref18[1], y = _ref18[2]; return { rotation: a, originX: x, originY: y }; } }[meta.type](meta.value); }; var getRNSvgTransformationsFromArray = exports.getRNSvgTransformationsFromArray = function getRNSvgTransformationsFromArray(arr) { return arr.reduce(function (acc, meta) { return _extends({}, acc, getRNSvgTranformation(meta)); }, {}); }; var getRNSvgTransformationsFromObject = exports.getRNSvgTransformationsFromObject = function getRNSvgTransformationsFromObject(obj) { return Object.keys(obj).reduce(function (acc, type) { return _extends({}, acc, getRNSvgTranformation({ type: type, value: obj[type] })); }, {}); }; var getRNSvgTransformations = exports.getRNSvgTransformations = function getRNSvgTransformations(transform) { return isArray(transform) ? getRNSvgTransformationsFromArray(transform) : getRNSvgTransformationsFromObject(transform); }; var wrapIfOutdated = exports.wrapIfOutdated = function wrapIfOutdated(inner, outer) { var the = { outer: outer }; return _react.version < 16 ? _react2.default.createElement(the.outer, { children: inner }) : inner; }; exports.default = { cap: cap, mapObject: mapObject, flattenHierarchy: flattenHierarchy, radiansToDegrees: radiansToDegrees }; /***/ }), /* 5 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_5__; /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.itsSet = itsSet; var _lodash = __webpack_require__(7); var _lodash2 = _interopRequireDefault(_lodash); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function itsSet(val) { var checkVal = function checkVal(v) { return typeof v !== 'undefined' && v !== null; }; if (!checkVal(val)) return false; if (val.constructor === Array) { return val.every(function (v) { return checkVal(v); }); } else if (arguments.length === 2) { return checkVal((0, _lodash2.default)(arguments[0], arguments[1])); } return true; } exports.default = itsSet; /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {/** * lodash (Custom Build) <https://lodash.com/> * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors <https://jquery.org/> * Released under MIT license <https://lodash.com/license> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; /** `Object#toString` result references. */ var funcTag = '[object Function]', genTag = '[object GeneratorFunction]', symbolTag = '[object Symbol]'; /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, reLeadingDot = /^\./, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = freeGlobal || freeSelf || Function('return this')(); /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function getValue(object, key) { return object == null ? undefined : object[key]; } /** * Checks if `value` is a host object in IE < 9. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a host object, else `false`. */ function isHostObject(value) { // Many host objects are `Object` objects that can coerce to strings // despite having improperly defined `toString` methods. var result = false; if (value != null && typeof value.toString != 'function') { try { result = !!(value + ''); } catch (e) {} } return result; } /** Used for built-in method references. */ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype; /** Used to detect overreaching core-js shims. */ var coreJsData = root['__core-js_shared__']; /** Used to detect methods masquerading as native. */ var maskSrcKey = (function() { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); return uid ? ('Symbol(src)_1.' + uid) : ''; }()); /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); /** Built-in value references. */ var Symbol = root.Symbol, splice = arrayProto.splice; /* Built-in method references that are verified to be native. */ var Map = getNative(root, 'Map'), nativeCreate = getNative(Object, 'create'); /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, symbolToString = symbolProto ? symbolProto.toString : undefined; /** * Creates a hash object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Hash(entries) { var index = -1, length = entries ? entries.length : 0; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the hash. * * @private * @name clear * @memberOf Hash */ function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; } /** * Removes `key` and its value from the hash. * * @private * @name delete * @memberOf Hash * @param {Object} hash The hash to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function hashDelete(key) { return this.has(key) && delete this.__data__[key]; } /** * Gets the hash value for `key`. * * @private * @name get * @memberOf Hash * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function hashGet(key) { var data = this.__data__; if (nativeCreate) { var result = data[key]; return result === HASH_UNDEFINED ? undefined : result; } return hasOwnProperty.call(data, key) ? data[key] : undefined; } /** * Checks if a hash value for `key` exists. * * @private * @name has * @memberOf Hash * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function hashHas(key) { var data = this.__data__; return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); } /** * Sets the hash `key` to `value`. * * @private * @name set * @memberOf Hash * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the hash instance. */ function hashSet(key, value) { var data = this.__data__; data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; return this; } // Add methods to `Hash`. Hash.prototype.clear = hashClear; Hash.prototype['delete'] = hashDelete; Hash.prototype.get = hashGet; Hash.prototype.has = hashHas; Hash.prototype.set = hashSet; /** * Creates an list cache object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function ListCache(entries) { var index = -1, length = entries ? entries.length : 0; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the list cache. * * @private * @name clear * @memberOf ListCache */ function listCacheClear() { this.__data__ = []; } /** * Removes `key` and its value from the list cache. * * @private * @name delete * @memberOf ListCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function listCacheDelete(key) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { return false; } var lastIndex = data.length - 1; if (index == lastIndex) { data.pop(); } else { splice.call(data, index, 1); } return true; } /** * Gets the list cache value for `key`. * * @private * @name get * @memberOf ListCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function listCacheGet(key) { var data = this.__data__, index = assocIndexOf(data, key); return index < 0 ? undefined : data[index][1]; } /** * Checks if a list cache value for `key` exists. * * @private * @name has * @memberOf ListCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } /** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */ function listCacheSet(key, value) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { data.push([key, value]); } else { data[index][1] = value; } return this; } // Add methods to `ListCache`. ListCache.prototype.clear = listCacheClear; ListCache.prototype['delete'] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; /** * Creates a map cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function MapCache(entries) { var index = -1, length = entries ? entries.length : 0; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the map. * * @private * @name clear * @memberOf MapCache */ function mapCacheClear() { this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), 'string': new Hash }; } /** * Removes `key` and its value from the map. * * @private * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { return getMapData(this, key)['delete'](key); } /** * Gets the map value for `key`. * * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function mapCacheGet(key) { return getMapData(this, key).get(key); } /** * Checks if a map value for `key` exists. * * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function mapCacheHas(key) { return getMapData(this, key).has(key); } /** * Sets the map `key` to `value`. * * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { getMapData(this, key).set(key, value); return this; } // Add methods to `MapCache`. MapCache.prototype.clear = mapCacheClear; MapCache.prototype['delete'] = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; /** * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq(array[length][0], key)) { return length; } } return -1; } /** * The base implementation of `_.get` without support for default values. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @returns {*} Returns the resolved value. */ function baseGet(object, path) { path = isKey(path, object) ? [path] : castPath(path); var index = 0, length = path.length; while (object != null && index < length) { object = object[toKey(path[index++])]; } return (index && index == length) ? object : undefined; } /** * The base implementation of `_.isNative` without bad shim checks. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. */ function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } /** * The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * * @private * @param {*} value The value to process. * @returns {string} Returns the string. */ function baseToString(value) { // Exit early for strings to avoid a performance hit in some environments. if (typeof value == 'string') { return value; } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ''; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** * Casts `value` to a path array if it's not one. * * @private * @param {*} value The value to inspect. * @returns {Array} Returns the cast property path array. */ function castPath(value) { return isArray(value) ? value : stringToPath(value); } /** * Gets the data for `map`. * * @private * @param {Object} map The map to query. * @param {string} key The reference key. * @returns {*} Returns the map data. */ function getMapData(map, key) { var data = map.__data__; return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; } /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : undefined; } /** * Checks if `value` is a property name and not a property path. * * @private * @param {*} value The value to check. * @param {Object} [object] The object to query keys on. * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ function isKey(value, object) { if (isArray(value)) { return false; } var type = typeof value; if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) { return true; } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || (object != null && value in Object(object)); } /** * Checks if `value` is suitable for use as unique object key. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ function isKeyable(value) { var type = typeof value; return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') ? (value !== '__proto__') : (value === null); } /** * Checks if `func` has its source masked. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ function isMasked(func) { return !!maskSrcKey && (maskSrcKey in func); } /** * Converts `string` to a property path array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ var stringToPath = memoize(function(string) { string = toString(string); var result = []; if (reLeadingDot.test(string)) { result.push(''); } string.replace(rePropName, function(match, number, quote, string) { result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); }); return result; }); /** * Converts `value` to a string key if it's not a string or symbol. * * @private * @param {*} value The value to inspect. * @returns {string|symbol} Returns the key. */ function toKey(value) { if (typeof value == 'string' || isSymbol(value)) { return value; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** * Converts `func` to its source code. * * @private * @param {Function} func The function to process. * @returns {string} Returns the source code. */ function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) {} try { return (func + ''); } catch (e) {} } return ''; } /** * Creates a function that memoizes the result of `func`. If `resolver` is * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func` * is invoked with the `this` binding of the memoized function. * * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` * constructor with one whose instances implement the * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) * method interface of `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to have its output memoized. * @param {Function} [resolver] The function to resolve the cache key. * @returns {Function} Returns the new memoized function. * @example * * var object = { 'a': 1, 'b': 2 }; * var other = { 'c': 3, 'd': 4 }; * * var values = _.memoize(_.values); * values(object); * // => [1, 2] * * values(other); * // => [3, 4] * * object.a = 2; * values(object); * // => [1, 2] * * // Modify the result cache. * values.cache.set(object, ['a', 'b']); * values(object); * // => ['a', 'b'] * * // Replace `_.memoize.Cache`. * _.memoize.Cache = WeakMap; */ function memoize(func, resolver) { if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { throw new TypeError(FUNC_ERROR_TEXT); } var memoized = function() { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; if (cache.has(key)) { return cache.get(key); } var result = func.apply(this, args); memoized.cache = cache.set(key, result); return result; }; memoized.cache = new (memoize.Cache || MapCache); return memoized; } // Assign cache to `_.memoize`. memoize.Cache = MapCache; /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function eq(value, other) { return value === other || (value !== value && other !== other); } /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 8-9 which returns 'object' for typed array and other constructors. var tag = isObject(value) ? objectToString.call(value) : ''; return tag == funcTag || tag == genTag; } /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return !!value && (type == 'object' || type == 'function'); } /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return !!value && typeof value == 'object'; } /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function isSymbol(value) { return typeof value == 'symbol' || (isObjectLike(value) && objectToString.call(value) == symbolTag); } /** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {string} Returns the string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */ function toString(value) { return value == null ? '' : baseToString(value); } /** * Gets the value at `path` of `object`. If the resolved value is * `undefined`, the `defaultValue` is returned in its place. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.get(object, 'a[0].b.c'); * // => 3 * * _.get(object, ['a', '0', 'b', 'c']); * // => 3 * * _.get(object, 'a.b.c', 'default'); * // => 'default' */ function get(object, path, defaultValue) { var result = object == null ? undefined : baseGet(object, path); return result === undefined ? defaultValue : result; } module.exports = get; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8))) /***/ }), /* 8 */ /***/ (function(module, exports) { var g; // This works in non-strict mode g = (function() { return this; })(); try { // This works if eval is allowed (see CSP) g = g || Function("return this")() || (1,eval)("this"); } catch(e) { // This works if the window reference is available if(typeof window === "object") g = window; } // g can still be undefined, but nothing to do about it... // We return undefined, instead of nothing here, so it's // easier to handle this case. if(!global) { ...} module.exports = g; /***/ }), /* 9 */ /***/ (function(module, exports) { module.exports = intersect; function many (sets) { var o = {}; var l = sets.length - 1; var first = sets[0]; var last = sets[l]; for(var i in first) o[first[i]] = 0; for(var i = 1; i <= l; i++) { var row = sets[i]; for(var j in row) { var key = row[j]; if(o[key] === i - 1) o[key] = i; } } var a = []; for(var i in last) { var key = last[i]; if(o[key] === l) a.push(key); } return a; } function intersect (a, b) { if (!b) return many(a); var res = []; for (var i = 0; i < a.length; i++) { if (indexOf(b, a[i]) > -1) res.push(a[i]); } return res; } intersect.big = function(a, b) { if (!b) return many(a); var ret = []; var temp = {}; for (var i = 0; i < b.length; i++) { temp[b[i]] = true; } for (var i = 0; i < a.length; i++) { if (temp[a[i]]) ret.push(a[i]); } return ret; } function indexOf(arr, el) { for (var i = 0; i < arr.length; i++) { if (arr[i] === el) return i; } return -1; } /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var MOUSE_EVENTS = exports.MOUSE_EVENTS = ['onClick', 'onContextMenu', 'onDoubleClick', 'onDrag', 'onDragEnd', 'onDragEnter', 'onDragExit', 'onDragLeave', 'onDragOver', 'onDragStart', 'onDrop', 'onMouseDown', 'onMouseEnter', 'onMouseLeave', 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp']; // export const TWEENABLE_SVG_PRESENTATION_ATTRS = [ // // 'alignmentBaseline', // // 'baselineShift', // // 'clip', // // 'clipPath', // // 'clipRule', // 'color', // // 'colorInterpolation', // // 'colorInterpolationFilters', // // 'colorProfile', // // 'colorRendering', // // 'cursor', // // 'direction', // // 'display', // // 'dominantBaseline', // // 'enableBackground', // 'fill', // 'fillOpacity', // // 'fillRule', // // 'filter', // 'floodColor', // 'floodOpacity', // // 'fontFamily', // 'fontSize', // 'fontSizeAdjust', // 'fontStretch', // // 'fontStyle', // // 'fontVariant', // // 'fontWeight', // // 'glyphOrientationHorizontal', // // 'glyphOrientationVertical', // // 'imageRendering', // 'kerning', // 'letterSpacing', // 'lightingColor', // // 'markerEnd', // // 'markerMid', // // 'markerStart', // // 'mask', // 'opacity', // // 'overflow', // // 'pointerEvents', // // 'shapeRendering', // 'stopColor', // 'stopOpacity', // 'stroke', // // 'strokeDasharray', // 'strokeDashoffset', // // 'strokeLinecap', // // 'strokeLinejoin', // 'strokeMiterlimit', // 'strokeOpacity', // 'strokeWidth', // // 'textAnchor', // // 'textDecoration', // // 'textRendering', // // 'unicodeBidi', // // 'visibility', // 'wordSpacing', // // 'writingMode', // ]; /***/ }), /* 11 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.components = undefined; var _propTypes = __webpack_require__(12); var _propTypes2 = _interopRequireDefault(_propTypes); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var components = exports.components = _propTypes2.default.shape({ svg: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), circle: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), ellipse: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), g: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), linearGradient: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), radialGradient: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), line: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), path: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), polygon: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), polyline: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), rect: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), symbol: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), text: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), use: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), defs: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), stop: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]) }); /***/ }), /* 12 */ /***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ if (true) { var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && Symbol.for && Symbol.for('react.element')) || 0xeac7; var isValidElement = function(object) { return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; }; // By explicitly using `prop-types` you are opting into new development behavior. // http://fb.me/prop-types-in-prod var throwOnDirectAccess = true; module.exports = __webpack_require__(13)(isValidElement, throwOnDirectAccess); } else { // By explicitly using `prop-types` you are opting into new production behavior. // http://fb.me/prop-types-in-prod module.exports = require('./factoryWithThrowingShims')(); } /***/ }), /* 13 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var emptyFunction = __webpack_require__(0); var invariant = __webpack_require__(1); var warning = __webpack_require__(2); var assign = __webpack_require__(14); var ReactPropTypesSecret = __webpack_require__(3); var checkPropTypes = __webpack_require__(15); module.exports = function(isValidElement, throwOnDirectAccess) { /* global Symbol */ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. /** * Returns the iterator method function contained on the iterable object. * * Be sure to invoke the function with the iterable as context: * * var iteratorFn = getIteratorFn(myIterable); * if (iteratorFn) { * var iterator = iteratorFn.call(myIterable); * ... * } * * @param {?object} maybeIterable * @return {?function} */ function getIteratorFn(maybeIterable) { var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); if (typeof iteratorFn === 'function') { return iteratorFn; } } /** * Collection of methods that allow declaration and validation of props that are * supplied to React components. Example usage: * * var Props = require('ReactPropTypes'); * var MyArticle = React.createClass({ * propTypes: { * // An optional string prop named "description". * description: Props.string, * * // A required enum prop named "category". * category: Props.oneOf(['News','Photos']).isRequired, * * // A prop named "dialog" that requires an instance of Dialog. * dialog: Props.instanceOf(Dialog).isRequired * }, * render: function() { ... } * }); * * A more formal specification of how these methods are used: * * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) * decl := ReactPropTypes.{type}(.isRequired)? * * Each and every declaration produces a function with the same signature. This * allows the creation of custom validation functions. For example: * * var MyLink = React.createClass({ * propTypes: { * // An optional string or URI prop named "href". * href: function(props, propName, componentName) { * var propValue = props[propName]; * if (propValue != null && typeof propValue !== 'string' && * !(propValue instanceof URI)) { * return new Error( * 'Expected a string or an URI for ' + propName + ' in ' + * componentName * ); * } * } * }, * render: function() {...} * }); * * @internal */ var ANONYMOUS = '<<anonymous>>'; // Important! // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. var ReactPropTypes = { array: createPrimitiveTypeChecker('array'), bool: createPrimitiveTypeChecker('boolean'), func: createPrimitiveTypeChecker('function'), number: createPrimitiveTypeChecker('number'), object: createPrimitiveTypeChecker('object'), string: createPrimitiveTypeChecker('string'), symbol: createPrimitiveTypeChecker('symbol'), any: createAnyTypeChecker(), arrayOf: createArrayOfTypeChecker, element: createElementTypeChecker(), instanceOf: createInstanceTypeChecker, node: createNodeChecker(), objectOf: createObjectOfTypeChecker, oneOf: createEnumTypeChecker, oneOfType: createUnionTypeChecker, shape: createShapeTypeChecker, exact: createStrictShapeTypeChecker, }; /** * inlined Object.is polyfill to avoid requiring consumers ship their own * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is */ /*eslint-disable no-self-compare*/ function is(x, y) { // SameValue algorithm if (x === y) { // Steps 1-5, 7-10 // Steps 6.b-6.e: +0 != -0 return x !== 0 || 1 / x === 1 / y; } else { // Step 6.a: NaN == NaN return x !== x && y !== y; } } /*eslint-enable no-self-compare*/ /** * We use an Error-like object for backward compatibility as people may call * PropTypes directly and inspect their output. However, we don't use real * Errors anymore. We don't inspect their stack anyway, and creating them * is prohibitively expensive if they are created too often, such as what * happens in oneOfType() for any type before the one that matched. */ function PropTypeError(message) { this.message = message; this.stack = ''; } // Make `instanceof Error` still work for returned errors. PropTypeError.prototype = Error.prototype; function createChainableTypeChecker(validate) { if (true) { var manualPropTypeCallCache = {}; var manualPropTypeWarningCount = 0; } function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { componentName = componentName || ANONYMOUS; propFullName = propFullName || propName; if (secret !== ReactPropTypesSecret) { if (throwOnDirectAccess) { // New behavior only for users of `prop-types` package invariant( false, 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types' ); } else if ("development" !== 'production' && typeof console !== 'undefined') { // Old behavior for people using React.PropTypes var cacheKey = componentName + ':' + propName; if ( !manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors manualPropTypeWarningCount < 3 ) { warning( false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName ); manualPropTypeCallCache[cacheKey] = true; manualPropTypeWarningCount++; } } } if (props[propName] == null) { if (isRequired) { if (props[propName] === null) { return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); } return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); } return null; } else { return validate(props, propName, componentName, location, propFullName); } } var chainedCheckType = checkType.bind(null, false); chainedCheckType.isRequired = checkType.bind(null, true); return chainedCheckType; } function createPrimitiveTypeChecker(expectedType) { function validate(props, propName, componentName, location, propFullName, secret) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== expectedType) { // `propValue` being instance of, say, date/regexp, pass the 'object' // check, but we can offer a more precise error message here rather than // 'of type `object`'. var preciseType = getPreciseType(propValue); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); } return null; } return createChainableTypeChecker(validate); } function createAnyTypeChecker() { return createChainableTypeChecker(emptyFunction.thatReturnsNull); } function createArrayOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== 'function') { return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); } var propValue = props[propName]; if (!Array.isArray(propValue)) { var propType = getPropType(propValue); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); } for (var i = 0; i < propValue.length; i++) { var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); if (error instanceof Error) { return error; } } return null; } return createChainableTypeChecker(validate); } function createElementTypeChecker() { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; if (!isValidElement(propValue)) { var propType = getPropType(propValue); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); } return null; } return createChainableTypeChecker(validate); } function createInstanceTypeChecker(expectedClass) { function validate(props, propName, componentName, location, propFullName) { if (!(props[propName] instanceof expectedClass)) { var expectedClassName = expectedClass.name || ANONYMOUS; var actualClassName = getClassName(props[propName]); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); } return null; } return createChainableTypeChecker(validate); } function createEnumTypeChecker(expectedValues) { if (!Array.isArray(expectedValues)) { true ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0; return emptyFunction.thatReturnsNull; } function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; for (var i = 0; i < expectedValues.length; i++) { if (is(propValue, expectedValues[i])) { return null; } } var valuesString = JSON.stringify(expectedValues); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); } return createChainableTypeChecker(validate); } function createObjectOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== 'function') { return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); } var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== 'object') { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); } for (var key in propValue) { if (propValue.hasOwnProperty(key)) { var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); if (error instanceof Error) { return error; } } } return null; } return createChainableTypeChecker(validate); } function createUnionTypeChecker(arrayOfTypeCheckers) { if (!Array.isArray(arrayOfTypeCheckers)) { true ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; return emptyFunction.thatReturnsNull; } for (var i = 0; i < arrayOfTypeCheckers.length; i++) { var checker = arrayOfTypeCheckers[i]; if (typeof checker !== 'function') { warning( false, 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received %s at index %s.', getPostfixForTypeWarning(checker), i ); return emptyFunction.thatReturnsNull; } } function validate(props, propName, componentName, location, propFullName) { for (var i = 0; i < arrayOfTypeCheckers.length; i++) { var checker = arrayOfTypeCheckers[i]; if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { return null; } } return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); } return createChainableTypeChecker(validate); } function createNodeChecker() { function validate(props, propName, componentName, location, propFullName) { if (!isNode(props[propName])) { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); } return null; } return createChainableTypeChecker(validate); } function createShapeTypeChecker(shapeTypes) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== 'object') { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); } for (var key in shapeTypes) { var checker = shapeTypes[key]; if (!checker) { continue; } var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); if (error) { return error; } } return null; } return createChainableTypeChecker(validate); } function createStrictShapeTypeChecker(shapeTypes) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== 'object') { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); } // We need to check all keys in case some are required but missing from // props. var allKeys = assign({}, props[propName], shapeTypes); for (var key in allKeys) { var checker = shapeTypes[key]; if (!checker) { return new PropTypeError( 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') ); } var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); if (error) { return error; } } return null; } return createChainableTypeChecker(validate); } function isNode(propValue) { switch (typeof propValue) { case 'number': case 'string': case 'undefined': return true; case 'boolean': return !propValue; case 'object': if (Array.isArray(propValue)) { return propValue.every(isNode); } if (propValue === null || isValidElement(propValue)) { return true; } var iteratorFn = getIteratorFn(propValue); if (iteratorFn) { var iterator = iteratorFn.call(propValue); var step; if (iteratorFn !== propValue.entries) { while (!(step = iterator.next()).done) { if (!isNode(step.value)) { return false; } } } else { // Iterator will provide entry [k,v] tuples rather than values. while (!(step = iterator.next()).done) { var entry = step.value; if (entry) { if (!isNode(entry[1])) { return false; } } } } } else { return false; } return true; default: return false; } } function isSymbol(propType, propValue) { // Native Symbol. if (propType === 'symbol') { return true; } // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' if (propValue['@@toStringTag'] === 'Symbol') { return true; } // Fallback for non-spec compliant Symbols which are polyfilled. if (typeof Symbol === 'function' && propValue instanceof Symbol) { return true; } return false; } // Equivalent of `typeof` but with special handling for array and regexp. function getPropType(propValue) { var propType = typeof propValue; if (Array.isArray(propValue)) { return 'array'; } if (propValue instanceof RegExp) { // Old webkits (at least until Android 4.0) return 'function' rather than // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ // passes PropTypes.object. return 'object'; } if (isSymbol(propType, propValue)) { return 'symbol'; } return propType; } // This handles more types than `getPropType`. Only used for error messages. // See `createPrimitiveTypeChecker`. function getPreciseType(propValue) { if (typeof propValue === 'undefined' || propValue === null) { return '' + propValue; } var propType = getPropType(propValue); if (propType === 'object') { if (propValue instanceof Date) { return 'date'; } else if (propValue instanceof RegExp) { return 'regexp'; } } return propType; } // Returns a string that is postfixed to a warning about an invalid type. // For example, "undefined" or "of type array" function getPostfixForTypeWarning(value) { var type = getPreciseType(value); switch (type) { case 'array': case 'object': return 'an ' + type; case 'boolean': case 'date': case 'regexp': return 'a ' + type; default: return type; } } // Returns class name of the object, if any. function getClassName(propValue) { if (!propValue.constructor || !propValue.constructor.name) { return ANONYMOUS; } return propValue.constructor.name; } ReactPropTypes.checkPropTypes = checkPropTypes; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; }; /***/ }), /* 14 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* object-assign (c) Sindre Sorhus @license MIT */ /* eslint-disable no-unused-vars */ var getOwnPropertySymbols = Object.getOwnPropertySymbols; var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(val) { if (val === null || val === undefined) { throw new TypeError('Object.assign cannot be called with null or undefined'); } return Object(val); } function shouldUseNative() { try { if (!Object.assign) { return false; } // Detect buggy property enumeration order in older V8 versions. // https://bugs.chromium.org/p/v8/issues/detail?id=4118 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers test1[5] = 'de'; if (Object.getOwnPropertyNames(test1)[0] === '5') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test2 = {}; for (var i = 0; i < 10; i++) { test2['_' + String.fromCharCode(i)] = i; } var order2 = Object.getOwnPropertyNames(test2).map(function (n) { return test2[n]; }); if (order2.join('') !== '0123456789') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test3 = {}; 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { test3[letter] = letter; }); if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { return false; } return true; } catch (err) { // We don't expect any of the above to throw, but better to be safe. return false; } } module.exports = shouldUseNative() ? Object.assign : function (target, source) { var from; var to = toObject(target); var symbols; for (var s = 1; s < arguments.length; s++) { from = Object(arguments[s]); for (var key in from) { if (hasOwnProperty.call(from, key)) { to[key] = from[key]; } } if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) { if (propIsEnumerable.call(from, symbols[i])) { to[symbols[i]] = from[symbols[i]]; } } } } return to; }; /***/ }), /* 15 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ if (true) { var invariant = __webpack_require__(1); var warning = __webpack_require__(2); var ReactPropTypesSecret = __webpack_require__(3); var loggedTypeFailures = {}; } /** * Assert that the values match with the type specs. * Error messages are memorized and will only be shown once. * * @param {object} typeSpecs Map of name to a ReactPropType * @param {object} values Runtime values that need to be type-checked * @param {string} location e.g. "prop", "context", "child context" * @param {string} componentName Name of the component for error messages. * @param {?Function} getStack Returns the component stack. * @private */ function checkPropTypes(typeSpecs, values, location, componentName, getStack) { if (true) { for (var typeSpecName in typeSpecs) { if (typeSpecs.hasOwnProperty(typeSpecName)) { var error; // Prop type validation may throw. In case they do, we don't want to // fail the render phase where it didn't fail before. So we log it. // After these have been cleaned up, we'll let them throw. try { // This is intentionally an invariant that gets caught. It's the same // behavior as without this statement except with a better message. invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]); error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); } catch (ex) { error = ex; } warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error); if (error instanceof Error && !(error.message in loggedTypeFailures)) { // Only monitor this failure once because there tends to be a lot of the // same error. loggedTypeFailures[error.message] = true; var stack = getStack ? getStack() : ''; warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : ''); } } } } } module.exports = checkPropTypes; /***/ }), /* 16 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = { components: { svg: 'svg', circle: 'circle', ellipse: 'ellipse', g: 'g', linearGradient: 'linearGradient', radialGradient: 'radialGradient', line: 'line', pattern: 'pattern', path: 'path', polygon: 'polygon', polyline: 'polyline', rect: 'rect', symbol: 'symbol', text: 'text', use: 'use', defs: 'defs', stop: 'stop' } }; /***/ }) /******/ ]); }); //# sourceMappingURL=potion-util.js.map
finnfiddle/number-picture
packages/util/umd/potion-util.js
JavaScript
mit
73,241
{"filter":false,"title":"core.server.routes.js","tooltip":"/app/routes/core.server.routes.js","ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":0,"column":0},"end":{"row":0,"column":0},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"hash":"ed2de6084f68dedc2c0b68cdeda71273533fde2d","undoManager":{"mark":0,"position":-1,"stack":[]},"timestamp":1421144056766}
bloksma/node1
.c9/metadata/workspace/app/routes/core.server.routes.js
JavaScript
mit
447
'use strict'; angular.module('dockit') .config(function ($routeProvider) { $routeProvider .when('/board', { templateUrl: 'views/board/board.html', controller: 'BoardCtrl', controllerAs: 'vm' }) .otherwise({ redirectTo: '/' }); });
b33rTiger/dockit
client/views/board/board.js
JavaScript
mit
296
export const u1F1EA = {"viewBox":"0 0 2600 2760.837","children":[{"name":"path","attribs":{"d":"M1111 866v346h615q17 0 28.5 11.5t11.5 28.5v293q0 17-11.5 28.5T1726 1585h-615v386h800q17 0 28.5 11.5t11.5 26.5v294q0 17-11.5 28t-28.5 11H688q-17 0-28.5-11t-11.5-28V535q0-17 11.5-28t28.5-11h1223q17 0 28.5 11t11.5 28v291q0 17-11.5 28.5T1911 866h-800z"},"children":[]}]};
wmira/react-icons-kit
src/noto_emoji_regular/u1F1EA.js
JavaScript
mit
363
angular.module('app.layout', ['app.core']);
johnpapa/pluralsight-ng-testing
src/client/app/layout/layout.module.js
JavaScript
mit
44
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } import { array, tree } from "@bosket/tools"; var singleSelect = function singleSelect(item, selection, neighbours, ancestors) { return array(selection).contains(item) ? [] : [item]; }; var multiSelect = function multiSelect(item, selection, neighbours, ancestors) { var alreadySelected = false; var newSelection = selection.filter(function (i) { // Mark if the item was already selected if (!alreadySelected) alreadySelected = i === item; // Deselect all ancestors return i !== item && ancestors.indexOf(i) < 0; }); // Categories : deselect all children if (!alreadySelected && item[this.inputs.get().category] && item[this.inputs.get().category] instanceof Array) { tree(item[this.inputs.get().category], this.inputs.get().category).visit(function (children) { newSelection = array(newSelection).notIn(children); }); } if (!alreadySelected) newSelection.push(item); return newSelection; }; // Selection strategies are triggered when the selection is updated. export var selectionStrategies = { // The single strategy allows only one selected item at the same time (usually the last item clicked). single: singleSelect, // The multiple strategy allows any number of selected items and will add the last item clicked to the selection list. multiple: multiSelect, /* The modifiers strategy is the way most file explorers behave. Without keyboard modifiers, only one selected item is allowed. While pressing the shift key, all items between the two last selected siblings are added to the selection array. While pressing the ctrl (or cmd for mac users) key, the item is added to the selection list. */ modifiers: function modifiers(item, selection, neighbours, ancestors) { var _this = this; if (this.modifiers.control || this.modifiers.meta) { this.lastSelection = item; delete this.lastIndex; delete this.lastPivot; return multiSelect.bind(this)(item, selection, neighbours, ancestors); } else if (this.modifiers.shift) { if (!this.lastSelection) return selection; var originIndex = neighbours.indexOf(this.lastSelection); if (originIndex < 0) return selection; var newSelection = selection.slice(); var endIndex = neighbours.indexOf(item); if (originIndex >= 0) { var _newSelection; if (this.lastPivot) { var lastIndex = neighbours.indexOf(this.lastPivot); var _ref = originIndex > lastIndex ? [lastIndex, originIndex] : [originIndex, lastIndex], _ref2 = _slicedToArray(_ref, 2), _smaller = _ref2[0], _higher = _ref2[1]; var deletions = neighbours.slice(_smaller, _higher + 1); newSelection = array(newSelection).notIn(deletions); } this.lastPivot = item; var _ref3 = originIndex > endIndex ? [endIndex, originIndex] : [originIndex, endIndex], _ref4 = _slicedToArray(_ref3, 2), smaller = _ref4[0], higher = _ref4[1]; var additions = !this.inputs.get().disabled ? neighbours.slice(smaller, higher + 1) : neighbours.slice(smaller, higher + 1).filter(function (i) { return !_this.inputs.get().disabled(i); }); newSelection = array(newSelection).notIn(additions); (_newSelection = newSelection).push.apply(_newSelection, _toConsumableArray(additions)); } return newSelection; } else { this.lastSelection = item; delete this.lastIndex; delete this.lastPivot; return singleSelect.bind(this)(item, selection.length > 1 ? [] : selection, neighbours, ancestors); } }, // Selects an item and its ancestors. ancestors: function (_ancestors) { function ancestors(_x, _x2, _x3, _x4) { return _ancestors.apply(this, arguments); } ancestors.toString = function () { return _ancestors.toString(); }; return ancestors; }(function (item, selection, neighbours, ancestors) { return selection.length === 0 ? [item] : array(selection).contains(item) ? [].concat(_toConsumableArray(ancestors)) : [].concat(_toConsumableArray(ancestors), [item]); }) // Click strategies are triggered on item click };export var clickStrategies = { // Selects on click select: function select(item) { this.inputs.get().onSelect(item, this.inputs.get().ancestors, this.inputs.get().model); }, // Unfold an item when selecting it. Pair it with the "opener-control" fold strategy. "unfold-on-selection": function unfoldOnSelection(item) { if (!this.isSelected(item)) { var newUnfolded = this.state.get().unfolded.filter(function (i) { return i !== item; }); newUnfolded.push(item); this.state.set({ unfolded: newUnfolded }); } }, // Toggle fold/unfold. Pair it with the "opener-control" fold strategy. "toggle-fold": function toggleFold(item) { var newUnfolded = this.state.get().unfolded.filter(function (i) { return i !== item; }); if (newUnfolded.length === this.state.get().unfolded.length) { newUnfolded.push(item); } this.state.set({ unfolded: newUnfolded }); } // Fold strategies determine if an item will be folded or not, meaning if its children are hidden. };export var foldStrategies = { // Allow the opener (usually an arrow-like element) to control the fold state. "opener-control": function openerControl(item) { return !array(this.state.get().unfolded).contains(item); }, // Fold when not selected. "not-selected": function notSelected(item) { return !this.isSelected(item); }, // Unfold as long as there is at least one child selected. "no-child-selection": function noChildSelection(item) { var _this2 = this; // naive algorithm ... var recurseCheck = function recurseCheck(node) { return _this2.isSelected(node) || node[_this2.inputs.get().category] && node[_this2.inputs.get().category] instanceof Array && node[_this2.inputs.get().category].some(recurseCheck); }; return !recurseCheck(item); }, // Fold every item deeper than then "max-depth" component property. "max-depth": function maxDepth() { return this.inputs.get().maxDepth && !isNaN(parseInt(this.inputs.get().maxDepth, 10)) ? this.inputs.get().depth >= parseInt(this.inputs.get().maxDepth, 10) : false; } }; //# sourceMappingURL=strategies.js.map
elbywan/bosket
build/core/strategies.js
JavaScript
mit
7,823
exports.openWin = function(navGroup, winName, params) { var windowParams = params || {}; Ti.API.info('windowParams: ' + windowParams); var w = Alloy.createController(winName, windowParams).getView(); if (OS_ANDROID) { w.addEventListener('open', function(e) { if ( ! w.getActivity() ) { Ti.API.error("Can't access action bar on a lightweight window."); } else { actionBar = w.activity.actionBar; if ( actionBar ) { var appSection = 'food'; //winName.match(/\w*(?=\/)/); // e.g. matches 'food' in food/diary var barImage = '/images/turk-bg.png'; // default is Me sectino colour switch (appSection) { case 'profile': barImage = '/images/turk-bg.png'; break; case 'food': barImage = '/images/green-bg.jpg'; break; case 'fitness': barImage = '/images/orange-bg.jpg'; break; case 'wellbeing': barImage = '/images/blue-light-bg.jpg'; break; case 'progress': barImage = '/images/blue-dark-bg.jpg'; break; case 'settings': barImage = '/images/purple-bg.jpg'; break; default: Ti.API.info('default: ' + appSection); break; } actionBar.displayHomeAsUp = true; actionBar.backgroundImage = barImage; actionBar.icon = '/images/appicon.png'; actionBar.onHomeIconItemSelected = function() { w.close(); }; } w.activity.invalidateOptionsMenu(); } }); w.open(); w.orientationModes = [Ti.UI.PORTRAIT]; Ti.API.info('window is open'); } else { Ti.API.info('navGroup: ' + navGroup); navGroup.openWindow(w,{animated:true}); } };
erictvalverde/SlideMenu
app/lib/xpng.js
JavaScript
mit
2,020
import _ from 'lodash'; import React, { Component, PropTypes } from 'react'; import { TodoPropType } from '../../../lib/prop-types'; class TodoListToggle extends Component { allTodosCompleted() { const { todos } = this.props; const incompleteTodos = _.reject(todos, todo => todo.completed); return (incompleteTodos.length === 0); } handleChange() { const { completeAllTodos, uncompleteAllTodos } = this.props; const allTodosCompleted = this.allTodosCompleted(); if (allTodosCompleted) { uncompleteAllTodos(); } else { completeAllTodos(); } } render() { const allTodosCompleted = this.allTodosCompleted(); const handleChange = this.handleChange.bind(this); return ( <div> <input className="toggle-all" type="checkbox" checked={allTodosCompleted} onChange={handleChange} /> <label htmlFor="toggle-all">Mark all as complete</label> </div> ); } } TodoListToggle.propTypes = { completeAllTodos: PropTypes.func.isRequired, todos: PropTypes.arrayOf(TodoPropType).isRequired, uncompleteAllTodos: PropTypes.func.isRequired, }; export default TodoListToggle;
bgoldman/todomvc-react
src/components/todos/partials/toggle.js
JavaScript
mit
1,227
var airbnb = require('airapi') airbnb.search({ location: "Seattle, WA", checkin: "05/05/2017", checkout: "05/06/2017" }).then(function(searchResults) { console.log(searchResults["results_json"]["search_results"][0]); });
srilman/MetroHack2017
something.js
JavaScript
mit
238
function mapcar(fun) { var arrs = []; for (var i1 = 0; i1 < arguments.length - 1; i1 += 1) { arrs[i1] = arguments[i1 + 1]; }; var resultArray = new Array(); if (1 === arrs.length) { for (var element = null, _js_arrvar3 = arrs[0], _js_idx2 = 0; _js_idx2 < _js_arrvar3.length; _js_idx2 += 1) { element = _js_arrvar3[_js_idx2]; resultArray.push(fun(element)); }; } else { for (var i = 0; i < arrs[0].length; i += 1) { with ({ i : i }) { var argsArray = mapcar(function (a) { return a[i]; }, arrs); resultArray.push(fun.apply(fun, argsArray)); }; }; }; return resultArray; }; /** Call FN on each element in ARR, replace element with the return value. */ function mapInto(fn, arr) { var idx = 0; for (var el = null, _js_idx4 = 0; _js_idx4 < arr.length; _js_idx4 += 1) { el = arr[_js_idx4]; arr[idx] = fn(el); idx += 1; }; return arr; }; /** Call FN on each element in ARR and return the returned values in a new array. */ function map(fn, arr) { var idx = 0; var result = []; for (var el = null, _js_idx5 = 0; _js_idx5 < arr.length; _js_idx5 += 1) { el = arr[_js_idx5]; result[idx] = fn(el); idx += 1; }; return result; }; /** Check if ITEM is a member of ARR. */ function member(item, arr) { for (var el = null, _js_idx6 = 0; _js_idx6 < arr.length; _js_idx6 += 1) { el = arr[_js_idx6]; if (el === item) { return true; }; }; return false; }; /** Return a new array with only those elements in ARR that are not in ARR-TO-SUB. */ function setDifference(arr, arrToSub) { var idx = 0; var result = []; for (var el = null, _js_idx7 = 0; _js_idx7 < arr.length; _js_idx7 += 1) { el = arr[_js_idx7]; if (!member(el, arrToSub)) { result[idx] = el; idx += 1; }; }; return result; }; function reduce(func, list, init) { var acc = null; for (var i = init ? -1 : 0, acc = init ? init : list[0]; i < list.length - 1; i += 1, acc = func(acc, list[i])) { }; return acc; }; function nconc(arr) { var arrs = []; for (var i8 = 0; i8 < arguments.length - 1; i8 += 1) { arrs[i8] = arguments[i8 + 1]; }; if (arr && arr.length > 0) { var _js10 = arrs.length; for (var _js9 = 0; _js9 < _js10; _js9 += 1) { var other = arrs[_js9]; if (other && other.length > 0) { arr['splice']['apply'](arr, [arr.length, other.length].concat(other)); }; }; }; return arr; }; window.Backend = function (frontend) { this.frontend = frontend; var _js11 = this.availableBackends; var _js13 = _js11.length; for (var _js12 = 0; _js12 < _js13; _js12 += 1) { var availableBackend = _js11[_js12]; new availableBackend(this); }; }; window.Backend.prototype = { commandQueue : [], availableBackends : [(function () { var WebSocketsBackend = function (backendInstance) { this.backendInstance = backendInstance; var self = this; var setupSocket = function () { self.socket = new WebSocket('ws://test-airplane.rhcloud.com:8443/gamesocket'); self.socket.onmessage = function (msg) { if (msg.data === 'test-response') { backendInstance.activateBackend(self); return self.socket.onmessage = function (msg) { return backendInstance.runFunctions(JSON.parse(msg.data)); }; }; }; self.socket.onclose = function () { backendInstance.deactivateBackend(); return setupSocket(); }; return self.socket.onopen = function () { return self.socket.send('test-request'); }; }; setupSocket(); return null; }; WebSocketsBackend.prototype = { send : function (msg) { return this.socket.send(msg); } }; return WebSocketsBackend; })()], sendCommand : function (commandForm) { if (this.activeBackend) { var commandFormString = JSON.stringify(commandForm); return this.activeBackend.send(commandFormString); } else { return nconc(this.commandQueue, [commandForm]); }; }, runFunctions : function (functionForm) { for (var fun in functionForm) { var arguments = functionForm[fun]; this.clientFunctions[fun](this, arguments); }; }, activateBackend : function (backend) { if (this.availableBackends.indexOf(this.activeBackend) <= this.availableBackends.indexOf(backend)) { this.activeBackend = backend; this.initConnection(); while (this.commandQueue.length !== 0) { this.sendCommand(this.commandQueue.pop()); }; }; }, deactivateBackend : function () { return this.activeBackend = null; }, initConnection : function () { return this.id ? this.resume(this.id) : this.init(); }, clientFunctions : { 'loadPlanes' : function (g1068, g1069) { return (function (id, nickname, model, posX, posY, posZ) { return this.frontend.loadPlanes(id, nickname, model, posX, posY, posZ); }).call(g1068, g1069.id, g1069.nickname, g1069.model, g1069.posX, g1069.posY, g1069.posZ); }, 'dropPlayer' : function (g1070, g1071) { return (function (id) { return this.frontend.dropPlayer(id); }).call(g1070, g1071.id); }, 'setPlaneProperties' : function (g1072, g1073) { return (function (id, time, acceleration, velocity, position) { return this.frontend.setPlaneProperties(id, time, acceleration, velocity, position); }).call(g1072, g1073.id, g1073.time, g1073.acceleration, g1073.velocity, g1073.position); }, 'setId' : function (g1074, g1075) { return (function (id) { return this.id = id; }).call(g1074, g1075.id); }, 'handleError' : function (g1076, g1077) { return (function (message) { return console.log('Server-side error: ' + message); }).call(g1076, g1077.message); } } }; window.Backend.prototype['joinGame'] = function (nickname) { return this.sendCommand({ 'joinGame' : { 'nickname' : nickname } }); }; window.Backend.prototype['disconnect'] = function () { return this.sendCommand({ 'disconnect' : { } }); }; window.Backend.prototype['moveEvent'] = function (angle) { return this.sendCommand({ 'moveEvent' : { 'angle' : angle } }); }; window.Backend.prototype['init'] = function () { return this.sendCommand({ 'init' : { } }); }; window.Backend.prototype['resume'] = function (id) { return this.sendCommand({ 'resume' : { 'id' : id } }); };
50Wliu/airplane-simulator
js/backend.js
JavaScript
mit
5,741
import React from 'react'; import { HashRouter, Switch, Route } from 'react-router-dom'; import { createBrowserHistory } from 'history'; import { Provider } from 'react-redux'; import App from '../components/Layout'; import Auth from '../components/auth'; import Documents from '../components/Documents'; import Document from '../components/Document'; import pageNotFound from '../components/pageNotFound'; import CreateDocument from '../components/CreateDocument'; import Profile from '../components/Profile'; import manageUsers from '../components/ManageUsers'; import configureStore from '../store/configureStore'; import { requireAuth, isAdmin } from '../helper'; const store = configureStore(); const history = createBrowserHistory(); const routes = () => ( <Provider store={store}> <HashRouter history={history}> <Switch> <Route exact path="/" component={Auth} /> <Route exact path="/notfound" component={pageNotFound} /> <App onEnter={requireAuth}> <Route exact path="/dashboard" component={Documents} /> <Route path="/document/:documentId" component={Document} /> <Route exact path="/document" component={Document} /> <Route path="/createDocument/:documentId" component={CreateDocument} /> <Route exact path="/createDocument" component={CreateDocument} /> <Route exact path="/profile" component={Profile} /> <Route path="/manageUsers" render={() => ( isAdmin() ? ( <Route component={manageUsers} />) : (<Route component={pageNotFound} />) )} /> </App> <Route component={pageNotFound} /> </Switch> </HashRouter> </Provider> ); export default routes;
andela-ookoro/DocumentMGT
client/routes/index.js
JavaScript
mit
1,806
// @flow import React, { Component } from 'react'; import Helmet from 'react-helmet'; import { connect } from 'react-redux'; import type { Connector } from 'react-redux'; import { fetchPosts, fetchPostsIfNeeded } from '../../state/modules/posts'; import Post from '../../components/Post'; import type { PostsReducer, Dispatch, Reducer } from '../../types'; // $FlowIssue import styles from './style.scss'; type Props = { posts: PostsReducer, fetchPostsIfNeeded: () => void, }; export class Home extends Component<Props, *> { static displayName = 'Home'; static fetchData({ store }) { return store.dispatch(fetchPosts()); } componentDidMount() { this.props.fetchPostsIfNeeded(); } render() { return ( <div> <Helmet title="Home" /> <div className="row"> <div className="column"> <div className={styles.hero}> <h1>React Universal Boiler</h1> <p>A server rendering React project.</p> </div> </div> </div> <div className="posts-list"> {this.props.posts.list.map(p => ( <div className="column column-30" key={p.id}> <Post title={p.title} body={p.body} /> </div> ))} </div> </div> ); } } const connector: Connector<{}, Props> = connect( ({ posts }: Reducer) => ({ posts }), (dispatch: Dispatch) => ({ fetchPostsIfNeeded: () => dispatch(fetchPostsIfNeeded()), }), ); export default connector(Home);
strues/react-universal-boiler
src/scenes/Home/Home.js
JavaScript
mit
1,525
/* ======================================================================== * Bootstrap: tab.js v3.1.1-1.0.17 * http://getbootstrap.com/javascript/#tabs * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +function ($) { 'use strict'; // TAB CLASS DEFINITION // ==================== var Tab = function (element) { this.element = $(element) } Tab.prototype.show = function () { var $this = this.element var $ul = $this.closest('ul:not(.dropdown-menu)') var selector = $this.data('target') if (!selector) { selector = $this.attr('href') selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 } if ($this.parent('li').hasClass('active')) return var previous = $ul.find('.active:last a')[0] var e = $.Event('show.bs.tab', { relatedTarget: previous }) $this.trigger(e) if (e.isDefaultPrevented()) return var $target = $(selector) this.activate($this.parent('li'), $ul) this.activate($target, $target.parent(), function () { $this.trigger({ type: 'shown.bs.tab', relatedTarget: previous }) }) } Tab.prototype.activate = function (element, container, callback) { var $active = container.find('> .active') var transition = callback && $.support.transition && $active.hasClass('fade') function next() { $active .removeClass('active') .find('> .dropdown-menu > .active') .removeClass('active') element.addClass('active') if (transition) { element[0].offsetWidth // reflow for transition element.addClass('in') } else { element.removeClass('fade') } if (element.parent('.dropdown-menu')) { element.closest('li.dropdown').addClass('active') } callback && callback() } transition ? $active .one($.support.transition.end, next) .emulateTransitionEnd(150) : next() $active.removeClass('in') } // TAB PLUGIN DEFINITION // ===================== var old = $.fn.tab $.fn.tab = function ( option ) { return this.each(function () { var $this = $(this) var data = $this.data('bs.tab') if (!data) $this.data('bs.tab', (data = new Tab(this))) if (typeof option == 'string') data[option]() }) } $.fn.tab.Constructor = Tab // TAB NO CONFLICT // =============== $.fn.tab.noConflict = function () { $.fn.tab = old return this } // TAB DATA-API // ============ $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) { e.preventDefault() $(this).tab('show') }) }(jQuery);
mantacode/bootstrap
js/tab.js
JavaScript
mit
2,952
export default { decode } export function decode(html) { // todo? return html }
rigor789/nativescript-vue
platform/nativescript/util/entity-decoder.js
JavaScript
mit
87
import React from 'react' import PropTypes from 'prop-types' import SVGDeviconInline from '../../_base/SVGDeviconInline' import iconSVG from './RedhatPlain.svg' /** RedhatPlain */ function RedhatPlain({ width, height, className }) { return ( <SVGDeviconInline className={'RedhatPlain' + ' ' + className} iconSVG={iconSVG} width={width} height={height} /> ) } RedhatPlain.propTypes = { className: PropTypes.string, width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), } export default RedhatPlain
fpoumian/react-devicon
src/components/redhat/plain/RedhatPlain.js
JavaScript
mit
622
/* Copyright 2010, KISSY UI Library v1.1.7dev MIT Licensed build time: ${build.time} */ KISSY.add("dom",function(a,x){function p(g,q){return g&&g.nodeType===q}a.DOM={_isElementNode:function(g){return p(g,1)},_isKSNode:function(g){return a.Node&&p(g,a.Node.TYPE)},_getWin:function(g){return g&&"scrollTo"in g&&g.document?g:p(g,9)?g.defaultView||g.parentWindow:g===x?window:false},_nodeTypeIs:p}}); KISSY.add("selector",function(a,x){function p(e,f){var c,b,d=[],m;f=g(f);if(a.isString(e)){e=a.trim(e);if(w.test(e)){if(b=q(e.slice(1),f))d=[b]}else if(c=n.exec(e)){b=c[1];m=c[2];c=c[3];if(f=b?q(b,f):f)if(c)if(!b||e.indexOf(k)!==-1)d=h(c,m,f);else{if((b=q(b,f))&&v.hasClass(b,c))d=[b]}else if(m)d=z(m,f)}else if(a.ExternalSelector)return a.ExternalSelector(e,f);else j(e)}else if(e&&(e[r]||e[s]))d=e[r]?[e[r]()]:e[s]();else if(e&&(a.isArray(e)||e&&!e.nodeType&&e.item&&!e.setTimeout))d=e;else if(e)d=[e]; if(d&&!d.nodeType&&d.item&&!d.setTimeout)d=a.makeArray(d);d.each=function(y,i){return a.each(d,y,i)};return d}function g(e){if(e===x)e=l;else if(a.isString(e)&&w.test(e))e=q(e.slice(1),l);else if(e&&e.nodeType!==1&&e.nodeType!==9)e=null;return e}function q(e,f){if(f.nodeType!==9)f=f.ownerDocument;return f.getElementById(e)}function z(e,f){return f.getElementsByTagName(e)}function h(e,f,c){c=e=c.getElementsByClassName(e);var b=0,d=0,m=e.length,y;if(f&&f!==o){c=[];for(f=f.toUpperCase();b<m;++b){y=e[b]; if(y.tagName===f)c[d++]=y}}return c}function j(e){a.error("Unsupported selector: "+e)}var l=document,v=a.DOM,k=" ",o="*",r="getDOMNode",s=r+"s",w=/^#[\w-]+$/,n=/^(?:#([\w-]+))?\s*([\w-]+|\*)?\.?([\w-]+)?$/;(function(){var e=l.createElement("div");e.appendChild(l.createComment(""));if(e.getElementsByTagName(o).length>0)z=function(f,c){var b=c.getElementsByTagName(f);if(f===o){for(var d=[],m=0,y=0,i;i=b[m++];)if(i.nodeType===1)d[y++]=i;b=d}return b}})();l.getElementsByClassName||(h=l.querySelectorAll? function(e,f,c){return c.querySelectorAll((f?f:"")+"."+e)}:function(e,f,c){f=c.getElementsByTagName(f||o);c=[];var b=0,d=0,m=f.length,y,i;for(e=k+e+k;b<m;++b){y=f[b];if((i=y.className)&&(k+i+k).indexOf(e)>-1)c[d++]=y}return c});a.query=p;a.get=function(e,f){return p(e,f)[0]||null};a.mix(v,{query:p,get:a.get,filter:function(e,f){var c=p(e),b,d,m,y=[];if(a.isString(f)&&(b=n.exec(f))&&!b[1]){d=b[2];m=b[3];f=function(i){return!(d&&i.tagName!==d.toUpperCase()||m&&!v.hasClass(i,m))}}if(a.isFunction(f))y= a.filter(c,f);else if(f&&a.ExternalSelector)y=a.ExternalSelector._filter(e,f+"");else j(f);return y},test:function(e,f){var c=p(e);return c.length&&v.filter(c,f).length===c.length}})}); KISSY.add("dom-data",function(a,x){var p=window,g=a.DOM,q="_ks_data_"+a.now(),z={},h={},j={EMBED:1,OBJECT:1,APPLET:1};a.mix(g,{data:function(l,v,k){if(a.isPlainObject(v))for(var o in v)g.data(l,o,v[o]);else if(k===x){l=a.get(l);var r;if(!(!l||j[l.nodeName])){if(l==p)l=h;r=(o=l&&l.nodeType)?z:l;l=r[o?l[q]:q];if(a.isString(v)&&l)return l[v];return l}}else a.query(l).each(function(s){if(!(!s||j[s.nodeName])){if(s==p)s=h;var w=z,n;if(s&&s.nodeType){if(!(n=s[q]))n=s[q]=a.guid()}else{n=q;w=s}if(v&&k!== x){w[n]||(w[n]={});w[n][v]=k}}})},removeData:function(l,v){a.query(l).each(function(k){if(k){if(k==p)k=h;var o,r=z,s,w=k&&k.nodeType;if(w)o=k[q];else{r=k;o=q}if(o){s=r[o];if(v){if(s){delete s[v];a.isEmptyObject(s)&&g.removeData(k)}}else{if(w)k.removeAttribute&&k.removeAttribute(q);else try{delete k[q]}catch(n){}w&&delete r[o]}}}})}})}); KISSY.add("dom-class",function(a,x){function p(h,j,l,v){if(!(j=a.trim(j)))return v?false:x;h=a.query(h);var k=0,o=h.length;j=j.split(q);for(var r;k<o;k++){r=h[k];if(g._isElementNode(r)){r=l(r,j,j.length);if(r!==x)return r}}if(v)return false}var g=a.DOM,q=/[\.\s]\s*\.?/,z=/[\n\t]/g;a.mix(g,{hasClass:function(h,j){return p(h,j,function(l,v,k){if(l=l.className){l=" "+l+" ";for(var o=0,r=true;o<k;o++)if(l.indexOf(" "+v[o]+" ")<0){r=false;break}if(r)return true}},true)},addClass:function(h,j){p(h,j,function(l, v,k){var o=l.className;if(o){var r=" "+o+" ";o=o;for(var s=0;s<k;s++)if(r.indexOf(" "+v[s]+" ")<0)o+=" "+v[s];l.className=a.trim(o)}else l.className=j})},removeClass:function(h,j){p(h,j,function(l,v,k){var o=l.className;if(o)if(k){o=(" "+o+" ").replace(z," ");for(var r=0,s;r<k;r++)for(s=" "+v[r]+" ";o.indexOf(s)>=0;)o=o.replace(s," ");l.className=a.trim(o)}else l.className=""})},replaceClass:function(h,j,l){g.removeClass(h,j);g.addClass(h,l)},toggleClass:function(h,j,l){var v=a.isBoolean(l),k;p(h, j,function(o,r,s){for(var w=0,n;w<s;w++){n=r[w];k=v?!l:g.hasClass(o,n);g[k?"removeClass":"addClass"](o,n)}})}})}); KISSY.add("dom-attr",function(a,x){var p=a.UA,g=document.documentElement,q=!g.hasAttribute,z=g.textContent!==x?"textContent":"innerText",h=a.DOM,j=h._isElementNode,l=/^(?:href|src|style)/,v=/^(?:href|src|colspan|rowspan)/,k=/\r/g,o=/^(?:radio|checkbox)/,r={readonly:"readOnly"},s={val:1,css:1,html:1,text:1,data:1,width:1,height:1,offset:1};q&&a.mix(r,{"for":"htmlFor","class":"className"});a.mix(h,{attr:function(w,n,e,f){if(a.isPlainObject(n)){f=e;for(var c in n)h.attr(w,c,n[c],f)}else if(n=a.trim(n)){n= n.toLowerCase();if(f&&s[n])return h[n](w,e);n=r[n]||n;if(e===x){w=a.get(w);if(!j(w))return x;var b;l.test(n)||(b=w[n]);if(b===x)b=w.getAttribute(n);if(q)if(v.test(n))b=w.getAttribute(n,2);else if(n==="style")b=w.style.cssText;return b===null?x:b}a.each(a.query(w),function(d){if(j(d))if(n==="style")d.style.cssText=e;else{if(n==="checked")d[n]=!!e;d.setAttribute(n,""+e)}})}},removeAttr:function(w,n){a.each(a.query(w),function(e){if(j(e)){h.attr(e,n,"");e.removeAttribute(n)}})},val:function(w,n){if(n=== x){var e=a.get(w);if(!j(e))return x;if(e&&e.nodeName.toUpperCase()==="option".toUpperCase())return(e.attributes.value||{}).specified?e.value:e.text;if(e&&e.nodeName.toUpperCase()==="select".toUpperCase()){var f=e.selectedIndex,c=e.options;if(f<0)return null;else if(e.type==="select-one")return h.val(c[f]);e=[];for(var b=0,d=c.length;b<d;++b)c[b].selected&&e.push(h.val(c[b]));return e}if(p.webkit&&o.test(e.type))return e.getAttribute("value")===null?"on":e.value;return(e.value||"").replace(k,"")}a.each(a.query(w), function(m){if(m&&m.nodeName.toUpperCase()==="select".toUpperCase()){if(a.isNumber(n))n+="";var y=a.makeArray(n),i=m.options,t;b=0;for(d=i.length;b<d;++b){t=i[b];t.selected=a.inArray(h.val(t),y)}if(!y.length)m.selectedIndex=-1}else if(j(m))m.value=n})},text:function(w,n){if(n===x){var e=a.get(w);if(j(e))return e[z]||"";else if(h._nodeTypeIs(e,3))return e.nodeValue}else a.each(a.query(w),function(f){if(j(f))f[z]=n;else if(h._nodeTypeIs(f,3))f.nodeValue=n})}})}); KISSY.add("dom-style",function(a,x){function p(f,c){var b=a.get(f),d=c===l?b.offsetWidth:b.offsetHeight;a.each(c===l?["Left","Right"]:["Top","Bottom"],function(m){d-=parseFloat(q._getComputedStyle(b,"padding"+m))||0;d-=parseFloat(q._getComputedStyle(b,"border"+m+"Width"))||0});return d}function g(f,c,b){var d=b;if(b===v&&o.test(c)){d=0;if(a.inArray(q.css(f,"position"),["absolute","fixed"])){b=f[c==="left"?"offsetLeft":"offsetTop"];if(z.ie===8||z.opera)b-=k(q.css(f.offsetParent,"border-"+c+"-width"))|| 0;d=b-(k(q.css(f,"margin-"+c))||0)}}return d}var q=a.DOM,z=a.UA,h=document,j=h.documentElement,l="width",v="auto",k=parseInt,o=/^(?:left|top)/,r=/^(?:width|height|top|left|right|bottom|margin|padding)/i,s=/-([a-z])/ig,w=function(f,c){return c.toUpperCase()},n={},e={};a.mix(q,{_CUSTOM_STYLES:n,_getComputedStyle:function(f,c){var b="",d=f.ownerDocument;if(f.style)b=d.defaultView.getComputedStyle(f,null)[c];return b},css:function(f,c,b){if(a.isPlainObject(c))for(var d in c)q.css(f,d,c[d]);else{if(c.indexOf("-")> 0)c=c.replace(s,w);c=n[c]||c;if(b===x){f=a.get(f);d="";if(f&&f.style){d=c.get?c.get(f):f.style[c];if(d===""&&!c.get)d=g(f,c,q._getComputedStyle(f,c))}return d===x?"":d}else{if(b===null||b==="")b="";else if(!isNaN(new Number(b))&&r.test(c))b+="px";(c===l||c==="height")&&parseFloat(b)<0||a.each(a.query(f),function(m){if(m&&m.style){c.set?c.set(m,b):m.style[c]=b;if(b==="")m.style.cssText||m.removeAttribute("style")}})}}},width:function(f,c){if(c===x)return p(f,l);else q.css(f,l,c)},height:function(f, c){if(c===x)return p(f,"height");else q.css(f,"height",c)},show:function(f){a.query(f).each(function(c){if(c){c.style.display=q.data(c,"display")||"";if(q.css(c,"display")==="none"){var b=c.tagName,d=e[b],m;if(!d){m=h.createElement(b);h.body.appendChild(m);d=q.css(m,"display");q.remove(m);e[b]=d}q.data(c,"display",d);c.style.display=d}}})},hide:function(f){a.query(f).each(function(c){if(c){var b=c.style,d=b.display;if(d!=="none"){d&&q.data(c,"display",d);b.display="none"}}})},toggle:function(f){a.query(f).each(function(c){if(c)c.style.display=== "none"?q.show(c):q.hide(c)})},addStyleSheet:function(f,c){var b;if(c&&(c=c.replace("#","")))b=a.get("#"+c);if(!b){b=q.create("<style>",{id:c});a.get("head").appendChild(b);if(b.styleSheet)b.styleSheet.cssText=f;else b.appendChild(h.createTextNode(f))}}});if(j.style.cssFloat!==x)n["float"]="cssFloat";else if(j.style.styleFloat!==x)n["float"]="styleFloat"}); KISSY.add("dom-style-ie",function(a,x){if(a.UA.ie){var p=a.DOM,g=document,q=g.documentElement,z=p._CUSTOM_STYLES,h=/^-?\d+(?:px)?$/i,j=/^-?\d/,l=/^(?:width|height)$/;try{if(q.style.opacity===x&&q.filters)z.opacity={get:function(k){var o=100;try{o=k.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(r){try{o=k.filters("alpha").opacity}catch(s){}}return o/100+""},set:function(k,o){var r=k.style,s=(k.currentStyle||0).filter||"";r.zoom=1;if(s)if(s=s.replace(/alpha\(opacity=.+\)/ig,""))s+=", "; r.filter=s+"alpha(opacity="+o*100+")"}}}catch(v){}if(!(g.defaultView||{}).getComputedStyle&&q.currentStyle)p._getComputedStyle=function(k,o){var r=k.style,s=k.currentStyle[o];if(l.test(o))s=p[o](k)+"px";else if(!h.test(s)&&j.test(s)){var w=r.left,n=k.runtimeStyle.left;k.runtimeStyle.left=k.currentStyle.left;r.left=o==="fontSize"?"1em":s||0;s=r.pixelLeft+"px";r.left=w;k.runtimeStyle.left=n}return s}}}); KISSY.add("dom-offset",function(a,x){function p(b){var d=0,m=0,y=v(b[s]);if(b[c]){b=b[c]();d=b[w];m=b[n];if(q.mobile!=="apple"){d+=g[e](y);m+=g[f](y)}}return{left:d,top:m}}var g=a.DOM,q=a.UA,z=window,h=document,j=g._isElementNode,l=g._nodeTypeIs,v=g._getWin,k=h.compatMode==="CSS1Compat",o=Math.max,r=parseInt,s="ownerDocument",w="left",n="top",e="scrollLeft",f="scrollTop",c="getBoundingClientRect";a.mix(g,{offset:function(b,d){if(!(b=a.get(b))||!b[s])return null;if(d===x)return p(b);var m=b;if(g.css(m, "position")==="static")m.style.position="relative";var y=p(m),i={},t,u;for(u in d){t=r(g.css(m,u),10)||0;i[u]=t+d[u]-y[u]}g.css(m,i)},scrollIntoView:function(b,d,m,y){if((b=a.get(b))&&b[s]){y=y===x?true:!!y;m=m===x?true:!!m;if(!d||d===z)return b.scrollIntoView(m);d=a.get(d);if(l(d,9))d=v(d);var i=d&&"scrollTo"in d&&d.document,t=g.offset(b),u=i?{left:g.scrollLeft(d),top:g.scrollTop(d)}:g.offset(d),A={left:t[w]-u[w],top:t[n]-u[n]};t=i?g.viewportHeight(d):d.clientHeight;u=i?g.viewportWidth(d):d.clientWidth; var C=g[e](d),F=g[f](d),B=C+u,D=F+t,H=b.offsetHeight;b=b.offsetWidth;var G=A.left+C-(r(g.css(d,"borderLeftWidth"))||0);A=A.top+F-(r(g.css(d,"borderTopWidth"))||0);var I=G+b,K=A+H,E,J;if(H>t||A<F||m)E=A;else if(K>D)E=K-t;if(y)if(b>u||G<C||m)J=G;else if(I>B)J=I-u;if(i){if(E!==x||J!==x)d.scrollTo(J,E)}else{if(E!==x)d[f]=E;if(J!==x)d[e]=J}}}});a.each(["Left","Top"],function(b,d){var m="scroll"+b;g[m]=function(y){var i=0,t=v(y),u;if(t&&(u=t.document))i=t[d?"pageYOffset":"pageXOffset"]||u.documentElement[m]|| u.body[m];else if(j(y=a.get(y)))i=y[m];return i}});a.each(["Width","Height"],function(b){g["doc"+b]=function(d){d=d||h;return o(k?d.documentElement["scroll"+b]:d.body["scroll"+b],g["viewport"+b](d))};g["viewport"+b]=function(d){var m="inner"+b;d=v(d);var y=d.document;return m in d?d[m]:k?y.documentElement["client"+b]:y.body["client"+b]}})}); KISSY.add("dom-traversal",function(a,x){function p(h,j,l,v){if(!(h=a.get(h)))return null;if(j===x)j=1;var k=null,o,r;if(a.isNumber(j)&&j>=0){if(j===0)return h;o=0;r=j;j=function(){return++o===r}}for(;h=h[l];)if(z(h)&&(!j||q.test(h,j))&&(!v||v(h))){k=h;break}return k}function g(h,j,l){var v=[];var k=h=a.get(h);if(h&&l)k=h.parentNode;if(k){l=0;for(k=k.firstChild;k;k=k.nextSibling)if(z(k)&&k!==h&&(!j||q.test(k,j)))v[l++]=k}return v}var q=a.DOM,z=q._isElementNode;a.mix(q,{parent:function(h,j){return p(h, j,"parentNode",function(l){return l.nodeType!=11})},next:function(h,j){return p(h,j,"nextSibling")},prev:function(h,j){return p(h,j,"previousSibling")},siblings:function(h,j){return g(h,j,true)},children:function(h,j){return g(h,j)},contains:function(h,j){var l=false;if((h=a.get(h))&&(j=a.get(j)))if(h.contains){if(j.nodeType===3){j=j.parentNode;if(j===h)return true}if(j)return h.contains(j)}else if(h.compareDocumentPosition)return!!(h.compareDocumentPosition(j)&16);else for(;!l&&(j=j.parentNode);)l= j==h;return l}})}); KISSY.add("dom-create",function(a,x){function p(i){var t=i.cloneNode(true);if(j.ie<8)t.innerHTML=i.innerHTML;return t}function g(i,t,u,A){if(u){var C=a.guid("ks-tmp-"),F=RegExp(w);t+='<span id="'+C+'"></span>';a.available(C,function(){var B=a.get("head"),D,H,G,I,K,E;for(F.lastIndex=0;D=F.exec(t);)if((G=(H=D[1])?H.match(e):false)&&G[2]){D=z.createElement("script");D.src=G[2];if((I=H.match(f))&&I[2])D.charset=I[2];D.async=true;B.appendChild(D)}else if((E=D[2])&&E.length>0)a.globalEval(E);(K=z.getElementById(C))&& h.remove(K);a.isFunction(A)&&A()});q(i,t)}else{q(i,t);a.isFunction(A)&&A()}}function q(i,t){t=(t+"").replace(w,"");try{i.innerHTML=t}catch(u){for(;i.firstChild;)i.removeChild(i.firstChild);t&&i.appendChild(h.create(t))}}var z=document,h=a.DOM,j=a.UA,l=j.ie,v=h._nodeTypeIs,k=h._isElementNode,o=h._isKSNode,r=z.createElement("div"),s=/<(\w+)/,w=/<script([^>]*)>([^<]*(?:(?!<\/script>)<[^<]*)*)<\/script>/ig,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,e=/\ssrc=(['"])(.*?)\1/i,f=/\scharset=(['"])(.*?)\1/i;a.mix(h,{create:function(i, t,u){if(v(i,1)||v(i,3))return p(i);if(o(i))return p(i[0]);if(!(i=a.trim(i)))return null;var A=null;A=h._creators;var C,F="div",B;if(C=n.exec(i))A=(u||z).createElement(C[1]);else{if((C=s.exec(i))&&(B=C[1])&&a.isFunction(A[B=B.toLowerCase()]))F=B;i=A[F](i,u).childNodes;if(i.length===1)u=i[0].parentNode.removeChild(i[0]);else{i=i;B=u||z;u=null;if(i&&(i.push||i.item)&&i[0]){B=B||i[0].ownerDocument;u=B.createDocumentFragment();if(i.item)i=a.makeArray(i);B=0;for(A=i.length;B<A;B++)u.appendChild(i[B])}u= u}A=u}u=A;k(u)&&a.isPlainObject(t)&&h.attr(u,t,true);return u},_creators:{div:function(i,t){var u=t?t.createElement("div"):r;u.innerHTML=i;return u}},html:function(i,t,u,A){if(t===x){i=a.get(i);if(k(i))return i.innerHTML}else a.each(a.query(i),function(C){k(C)&&g(C,t,u,A)})},remove:function(i){a.each(a.query(i),function(t){k(t)&&t.parentNode&&t.parentNode.removeChild(t)})}});if(l||j.gecko||j.webkit){var c=h._creators,b=h.create,d=/(?:\/(?:thead|tfoot|caption|col|colgroup)>)+\s*<tbody/,m={option:"select", td:"tr",tr:"tbody",tbody:"table",col:"colgroup",legend:"fieldset"},y;for(y in m)(function(i){c[y]=function(t,u){return b("<"+i+">"+t+"</"+i+">",null,u)}})(m[y]);if(l){c.script=function(i,t){var u=t?t.createElement("div"):r;u.innerHTML="-"+i;u.removeChild(u.firstChild);return u};if(l<8)c.tbody=function(i,t){var u=b("<table>"+i+"</table>",null,t),A=u.children.tags("tbody")[0];u.children.length>1&&A&&!d.test(i)&&A.parentNode.removeChild(A);return u}}a.mix(c,{optgroup:c.option,th:c.td,thead:c.tbody,tfoot:c.tbody, caption:c.tbody,colgroup:c.tbody})}}); KISSY.add("dom-insertion",function(a){var x=a.DOM;a.mix(x,{insertBefore:function(p,g){if((p=a.get(p))&&(g=a.get(g))&&g.parentNode)g.parentNode.insertBefore(p,g);return p},insertAfter:function(p,g){if((p=a.get(p))&&(g=a.get(g))&&g.parentNode)g.nextSibling?g.parentNode.insertBefore(p,g.nextSibling):g.parentNode.appendChild(p);return p},append:function(p,g){if((p=a.get(p))&&(g=a.get(g)))g.appendChild&&g.appendChild(p)},prepend:function(p,g){if((p=a.get(p))&&(g=a.get(g)))g.firstChild?x.insertBefore(p, g.firstChild):g.appendChild(p)}})});
google-code-export/kissy
build/dom/dom-pkg-min.js
JavaScript
mit
15,960
/* * The reducer takes care of our data. * Using actions, we can change our application state. * To add a new action, add it to the switch statement in the homeReducer function * * Example: * case YOUR_ACTION_CONSTANT: * return { * ...state, * stateVariable: action.var * }; * * To add a new reducer, add a file like this to the reducers folder, and * add it in root.js. */ import { INCREMENT_COUNTER, DECREMENT_COUNTER } from '../constants'; const initialState = { counter: 0 }; function homeReducer(state = initialState, action) { Object.freeze(state); // Don't mutate state directly, always use object spreading switch (action.type) { case INCREMENT_COUNTER: return { ...state, counter: state.counter + 1 }; case DECREMENT_COUNTER: return { ...state, counter: state.counter - 1 }; default: return state; } } export default homeReducer;
Vispercept/timeline
app/reducers/home.js
JavaScript
mit
953
import initialState from '../store/initialState'; import { GET_PAGE_DETAILS } from '../actions/actionTypes'; const pageInfo = (state = initialState.recipes, action) => { switch (action.type) { case GET_PAGE_DETAILS: return { ...state, currentPage: action.details.currentPage, limit: action.details.limit, pages: action.details.pages, numberOfItems: action.details.numberOfItems }; default: return state; } }; export default pageInfo;
Noblemajesty/more-recipe
client/js/reducers/pageInfo.js
JavaScript
mit
507
import { Mongo } from 'meteor/mongo'; export const events = new Mongo.Collection('events'); events.allow({ insert:() => true, update:() => true, remove:() => true });
pj-infest/Pizza_Day
imports/api/events/events-collection.js
JavaScript
mit
180
(function(){ var KEYS = { down : 40, up : 38, enter : 13, escape : 27 }; function extendObj(){ var baseObj = arguments[0]; for (var i=1; i<arguments.length; i++) { for (var x in arguments[i]) { baseObj[x] = arguments[i][x]; } } return baseObj; } function IslandBlock (opts) { this.options = {}; extendObj(this.options, /*this._defaultOpts,*/ opts || {}); if (!this.options.fullPattern) { throw "fullPattern must be set in the options" } } IslandBlock.prototype = { /** Triggered by the framework when extension is initialized * @param {Element} The editor instance */ init : function (editor) { editor.subscribe("editableKeypress", this._handleKeyPress.bind(this)); editor.subscribe("editableKeydown", this._handleKeyDown.bind(this)); }, _lastTextNode : null, /** Triggered by the editableKeyup event, listens to key presses and gets the current text users has entered and initializes the checks for pattern matching * @param {Event} DOM Keypress event * @param {Element} The editor instance */ _handleKeyPress : function (evt, editor) { var keyCode = evt.keyCode; var charTyped = String.fromCharCode(keyCode); var sel, word = ""; if (window.getSelection && (sel = window.getSelection()).modify) { var selectedRange = sel.getRangeAt(0); sel.collapseToStart(); //sel.modify("move", "backward", "word"); sel.modify("move", "backward", "line"); sel.modify("extend", "forward", "line"); this._lastTextNode = sel.toString() + charTyped; // Restore selection sel.removeAllRanges(); sel.addRange(selectedRange); } if (this._lastTextNode) { this._checkForMatches(); } }, /** */ _handleKeyDown : function (evt, editor) { var keyCode = evt.keyCode; if (this._isMenuOpen && keyCode===KEYS.enter) { evt.preventDefault(); evt.stopPropagation(); this._selectMenuSelectionWithEnter(); } else if (this._isMenuOpen && (keyCode===KEYS.up || keyCode===KEYS.down)){ evt.preventDefault(); this._moveMenuSelection(keyCode===KEYS.up); } else if (this._isMenuOpen && keyCode===KEYS.escape){ evt.preventDefault(); this._lastTextNode = null; this._hideMenu(); } }, /** Looks at the text entered by the user and sees if it matches either the full or partial pattern. * @param {element} The parent element that contains the cursor. */ _checkForMatches : function (editor) { var parElement = this.base.getSelectedParentElement(), partialMatch, txt = this._lastTextNode; if (this.options.fullPattern.exec(txt)) { this._wrap(parElement); this._hideMenu(); } else if (this.options.startPattern && (partialMatch = this.options.startPattern.exec(txt))) { this._showHintMenu(parElement, partialMatch); } else { this._hideMenu(); } }, /* This function takes the phrase that matches the regular expression pattern and replaces it with the wrapper element * @param {Element} The parent element that the cursor is in. * @param {Boolean} Flag that says that we should use the start regular expression to find a match instead of the full pattern. (Used by selection menu) * @param {String} When partial match is given, this value is used to replace the text in the partial match so we have full text. This requires isPartial to be set. */ _wrap : function (elem, isPartial, full_txt) { var childNodes = elem.childNodes; for (var i=0; i<childNodes.length; i++) { var child = childNodes[i]; var pattern = isPartial ? this.options.startPattern : this.options.fullPattern; var match = pattern.exec(child.nodeValue); if (child.nodeType === 3 && match){ if (isPartial) { child.nodeValue = child.nodeValue.replace(this.options.startPattern, "[" + full_txt + "]"); } else if (this.options.replacements && this.options.replacements.indexOf(match[1].toLowerCase())===-1){ return; } txt = child.nodeValue.replace(this.options.fullPattern, this.options.replacementTemplate); var tempDiv = document.createElement("div"); tempDiv.innerHTML = txt; var tempDivChildren = tempDiv.childNodes; while (tempDivChildren.length) { //live node set so when you append to different element it is removed from this one elem.insertBefore(tempDivChildren[0], child); } elem.removeChild(child); break; } } }, /** Triggered when the selection menu needs to be added to the page. Calls methods to get position, create menu, and sets the location. */ _showHintMenu: function(elem, partialMatch) { var partialText = partialMatch[1]; this.base.saveSelection(); var curPos = this.getXYPosition(); /* TODO Right now I am just destroying and recreating it - this is bad */ if(this.menu){ this._hideMenu(); } this._createMenu(partialText); if (this.menu) { this.menu.style.display = "block"; this.menu.style.top = (curPos.y + curPos.h) + "px"; this.menu.style.left = curPos.x + "px"; this._isMenuOpen = true; } this._lastElem = elem; }, /** Generates the Selection menu with the options the user can choose from. */ _createMenu : function (partialText) { var menuWrapper = document.createElement("div"); menuWrapper.classList.add("data-island-menu"); var menu = document.createElement("ul"); var hasMatches = false; //hard coding this for now, will need to be set in opts or Ajax call var dItems = this.options.replacements; dItems.forEach( function(cv) { if (cv.indexOf(partialText)>-1) { var li = document.createElement("li"); li.innerHTML = "<a>" + cv + "</a>"; li.setAttribute("data-text", cv); menu.appendChild(li); hasMatches = true; } }); if (hasMatches) { menuWrapper.appendChild(menu); document.body.appendChild(menuWrapper); this.menu = menuWrapper; menuWrapper.addEventListener("click", this._handleSectionMenuClick.bind(this) ); } }, /** Handles the clicks on the Selection menu. Detects what is clicked and calls the wrap method with the option picked */ _handleSectionMenuClick : function (evt) { var target = evt.target; if (target.nodeName==="A") { var txt = target.parentNode.getAttribute("data-text"); this._wrap(this._lastElem, true, txt); } this._hideMenu(); this.base.restoreSelection(); }, /** Hides menu and removes it from the DOM */ _hideMenu : function () { this._isMenuOpen = false; if(this.menu) { this.menu.style.display = "none"; this.menu.parentNode.removeChild(this.menu); this.menu = null; } }, /** */ _moveMenuSelection : function (isUp) { var selectedElem = this.menu.getElementsByClassName("active"); var nextElem; if (selectedElem.length){ nextElem = isUp ? selectedElem[0].previousSibling : selectedElem[0].nextSibling; selectedElem[0].classList.remove("active"); } else { nextElem = this.menu.getElementsByTagName("li")[0]; } if(!nextElem) { var lis = this.menu.getElementsByTagName("li"); nextElem = lis[isUp?lis.length-1:0]; } nextElem.classList.add("active"); }, /** */ _selectMenuSelectionWithEnter : function () { var selectedElem = this.menu.getElementsByClassName("active"); if (!selectedElem.length){ selectedElem = this.menu.getElementsByTagName("li"); } selectedElem[0].childNodes[0].click(); }, /** Calculates and returns the x,y position and the height of cursor in the contenteditable element * @return { {x:Number, y:Number, h: Number}} */ getXYPosition : function () { var win = window; var doc = win.document; var sel = doc.selection, range, rects, rect; var x = 0, y = 0; if (sel) { if (sel.type != "Control") { range = sel.createRange(); range.collapse(true); x = range.boundingLeft; y = range.boundingTop; } } else if (win.getSelection) { sel = win.getSelection(); if (sel.rangeCount) { range = sel.getRangeAt(0).cloneRange(); if (range.getClientRects) { range.collapse(true); rects = range.getClientRects(); if (rects.length > 0) { rect = range.getClientRects()[0]; } x = rect ? rect.left : 0; y = rect ? rect.top : 0; } // Fall back to inserting a temporary element if (x == 0 && y == 0) { var span = doc.createElement("span"); if (span.getClientRects) { // Ensure span has dimensions and position by // adding a zero-width space character span.appendChild( doc.createTextNode("\u200b") ); range.insertNode(span); rect = span.getClientRects()[0]; x = rect.left; y = rect.top; var spanParent = span.parentNode; spanParent.removeChild(span); // Glue any broken text nodes back together spanParent.normalize(); } } } } return { x: x, y: y, h : rect.height || 0 }; } }; window.IslandBlock = IslandBlock; }());
epascarello/merge-fields-plugin-for-medium-editor
dist/js/mergefields.js
JavaScript
mit
12,019
const wordscramble = require('../'); const tape = require('tape'); const range = require('range').range; const samples = { array: range(1, 100), string: 'I must not fear. Fear is the mind-killer.', number: 10191, boolean: true, object: { harkonnens: ['vladimir', 'feyd'], corrino: ['Shaddam', 'Irulan'], choam: 'Combine Honnete Ober Advancer Mercantile', sandwormsRule: true, year: 10191 } }; /** * Wordscramble.scramble() */ tape('Wordscramble.scramble()', assert => { assert.plan(3); const victims = samples; assert.equal(typeof wordscramble, 'object'); assert.notEqual(wordscramble.scramble(victims), victims); assert.deepEquals(victims, samples); }); /** * Wordscramble.string() */ tape('Wordscramble.string()', assert => { assert.plan(3); const victims = samples; assert.equal(typeof wordscramble.string, 'function'); assert.notEqual(wordscramble.string(victims.string), victims.string); assert.deepEquals(victims.string, samples.string); }); /** * Wordscramble.array() */ tape('Wordscramble.array()', assert => { assert.plan(3); const victims = samples; assert.equal(typeof wordscramble.array, 'function'); assert.notEqual(wordscramble.array(victims.array), victims.array); assert.deepEquals(victims.array, samples.array); }); /** * Wordscramble.boolean() */ tape('Wordscramble.boolean()', assert => { assert.plan(3); const victims = samples; assert.equal(typeof wordscramble.boolean, 'function'); assert.notEqual(wordscramble.boolean(victims.boolean), victims.boolean); assert.deepEquals(victims.boolean, samples.boolean); }); /** * Wordscramble.number() */ tape('Wordscramble.number()', assert => { assert.plan(3); const victims = samples; assert.equal(typeof wordscramble.number, 'function'); assert.notEqual(wordscramble.number(victims.number), victims.number); assert.deepEquals(victims.number, samples.number); }); /** * Wordscramble.object() */ tape('Wordscramble.object()', assert => { assert.plan(3); const victims = samples; assert.equal(typeof wordscramble.object, 'function'); assert.notEqual(wordscramble.object(victims.object), victims.object); assert.deepEquals(victims.object, samples.object); });
bhalash/wordscramble
test/test.js
JavaScript
mit
2,335