text
stringlengths
2
6.14k
"use strict"; var chai = require("chai"); var expect = chai.expect; var config = require("../lib/config"); var spawn = require("../lib/spawn"); var disposeAll = require("../lib/disposeAll"); var phridge = require("../lib/main.js"); require("./helpers/setup.js"); describe("phridge", function () { describe(".config", function () { it("should be the config-module", function () { expect(phridge.config).to.equal(config); }); }); describe(".spawn", function () { it("should be the spawn-module", function () { expect(phridge.spawn).to.equal(spawn); }); }); describe(".disposeAll", function () { it("should be the exitAll-module", function () { expect(phridge.disposeAll).to.equal(disposeAll); }); }); });
'use strict'; var CreateDataProperty = require('es-abstract/2019/CreateDataProperty'); var IsCallable = require('es-abstract/2019/IsCallable'); var RequireObjectCoercible = require('es-abstract/2019/RequireObjectCoercible'); var ToObject = require('es-abstract/2019/ToObject'); var callBound = require('es-abstract/helpers/callBound'); var $gOPD = Object.getOwnPropertyDescriptor; var $getOwnNames = Object.getOwnPropertyNames; var $getSymbols = Object.getOwnPropertySymbols; var $concat = callBound('Array.prototype.concat'); var $reduce = callBound('Array.prototype.reduce'); var getAll = $getSymbols ? function (obj) { return $concat($getOwnNames(obj), $getSymbols(obj)); } : $getOwnNames; var isES5 = IsCallable($gOPD) && IsCallable($getOwnNames); module.exports = function getOwnPropertyDescriptors(value) { RequireObjectCoercible(value); if (!isES5) { throw new TypeError('getOwnPropertyDescriptors requires Object.getOwnPropertyDescriptor'); } var O = ToObject(value); return $reduce( getAll(O), function (acc, key) { var descriptor = $gOPD(O, key); if (typeof descriptor !== 'undefined') { CreateDataProperty(acc, key, descriptor); } return acc; }, {} ); };
/* * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * @constructor * @extends {WebInspector.VBox} * @param {string} url * @param {string} mimeType * @param {!WebInspector.ContentProvider} contentProvider */ WebInspector.FontView = function(url, mimeType, contentProvider) { WebInspector.VBox.call(this); this.registerRequiredCSS("source_frame/fontView.css"); this.element.classList.add("font-view"); this._url = url; this._mimeType = mimeType; this._contentProvider = contentProvider; } WebInspector.FontView._fontPreviewLines = [ "ABCDEFGHIJKLM", "NOPQRSTUVWXYZ", "abcdefghijklm", "nopqrstuvwxyz", "1234567890" ]; WebInspector.FontView._fontId = 0; WebInspector.FontView._measureFontSize = 50; WebInspector.FontView.prototype = { /** * @param {string} uniqueFontName * @param {?string} content */ _onFontContentLoaded: function(uniqueFontName, content) { var url = content ? WebInspector.Resource.contentAsDataURL(content, this._mimeType, true) : this._url; this.fontStyleElement.textContent = String.sprintf("@font-face { font-family: \"%s\"; src: url(%s); }", uniqueFontName, url); }, _createContentIfNeeded: function() { if (this.fontPreviewElement) return; var uniqueFontName = "WebInspectorFontPreview" + (++WebInspector.FontView._fontId); this.fontStyleElement = createElement("style"); this._contentProvider.requestContent(this._onFontContentLoaded.bind(this, uniqueFontName)); this.element.appendChild(this.fontStyleElement); var fontPreview = createElement("div"); for (var i = 0; i < WebInspector.FontView._fontPreviewLines.length; ++i) { if (i > 0) fontPreview.createChild("br"); fontPreview.createTextChild(WebInspector.FontView._fontPreviewLines[i]); } this.fontPreviewElement = fontPreview.cloneNode(true); this.fontPreviewElement.style.setProperty("font-family", uniqueFontName); this.fontPreviewElement.style.setProperty("visibility", "hidden"); this._dummyElement = fontPreview; this._dummyElement.style.visibility = "hidden"; this._dummyElement.style.zIndex = "-1"; this._dummyElement.style.display = "inline"; this._dummyElement.style.position = "absolute"; this._dummyElement.style.setProperty("font-family", uniqueFontName); this._dummyElement.style.setProperty("font-size", WebInspector.FontView._measureFontSize + "px"); this.element.appendChild(this.fontPreviewElement); }, wasShown: function() { this._createContentIfNeeded(); this.updateFontPreviewSize(); }, onResize: function() { if (this._inResize) return; this._inResize = true; try { this.updateFontPreviewSize(); } finally { delete this._inResize; } }, _measureElement: function() { this.element.appendChild(this._dummyElement); var result = { width: this._dummyElement.offsetWidth, height: this._dummyElement.offsetHeight }; this.element.removeChild(this._dummyElement); return result; }, updateFontPreviewSize: function() { if (!this.fontPreviewElement || !this.isShowing()) return; this.fontPreviewElement.style.removeProperty("visibility"); var dimension = this._measureElement(); const height = dimension.height; const width = dimension.width; // Subtract some padding. This should match the paddings in the CSS plus room for the scrollbar. const containerWidth = this.element.offsetWidth - 50; const containerHeight = this.element.offsetHeight - 30; if (!height || !width || !containerWidth || !containerHeight) { this.fontPreviewElement.style.removeProperty("font-size"); return; } var widthRatio = containerWidth / width; var heightRatio = containerHeight / height; var finalFontSize = Math.floor(WebInspector.FontView._measureFontSize * Math.min(widthRatio, heightRatio)) - 2; this.fontPreviewElement.style.setProperty("font-size", finalFontSize + "px", null); }, __proto__: WebInspector.VBox.prototype }
import React from 'react'; import TransitionEvents from './utils/TransitionEvents'; import deprecationWarning from './utils/deprecationWarning'; const CollapsibleMixin = { propTypes: { defaultExpanded: React.PropTypes.bool, expanded: React.PropTypes.bool }, getInitialState() { const defaultExpanded = this.props.defaultExpanded != null ? this.props.defaultExpanded : !!this.props.expanded; return { expanded: defaultExpanded, collapsing: false }; }, componentWillMount() { deprecationWarning('CollapsibleMixin', 'Collapse Component'); }, componentWillUpdate(nextProps, nextState) { let willExpanded = nextProps.expanded != null ? nextProps.expanded : nextState.expanded; if (willExpanded === this.isExpanded()) { return; } // if the expanded state is being toggled, ensure node has a dimension value // this is needed for the animation to work and needs to be set before // the collapsing class is applied (after collapsing is applied the in class // is removed and the node's dimension will be wrong) let node = this.getCollapsibleDOMNode(); let dimension = this.dimension(); let value = '0'; if (!willExpanded) { value = this.getCollapsibleDimensionValue(); } node.style[dimension] = value + 'px'; this._afterWillUpdate(); }, componentDidUpdate(prevProps, prevState) { // check if expanded is being toggled; if so, set collapsing this._checkToggleCollapsing(prevProps, prevState); // check if collapsing was turned on; if so, start animation this._checkStartAnimation(); }, // helps enable test stubs _afterWillUpdate() { }, _checkStartAnimation() { if (!this.state.collapsing) { return; } let node = this.getCollapsibleDOMNode(); let dimension = this.dimension(); let value = this.getCollapsibleDimensionValue(); // setting the dimension here starts the transition animation let result; if (this.isExpanded()) { result = value + 'px'; } else { result = '0px'; } node.style[dimension] = result; }, _checkToggleCollapsing(prevProps, prevState) { let wasExpanded = prevProps.expanded != null ? prevProps.expanded : prevState.expanded; let isExpanded = this.isExpanded(); if (wasExpanded !== isExpanded) { if (wasExpanded) { this._handleCollapse(); } else { this._handleExpand(); } } }, _handleExpand() { let node = this.getCollapsibleDOMNode(); let dimension = this.dimension(); let complete = () => { this._removeEndEventListener(node, complete); // remove dimension value - this ensures the collapsible item can grow // in dimension after initial display (such as an image loading) node.style[dimension] = ''; this.setState({ collapsing:false }); }; this._addEndEventListener(node, complete); this.setState({ collapsing: true }); }, _handleCollapse() { let node = this.getCollapsibleDOMNode(); let complete = () => { this._removeEndEventListener(node, complete); this.setState({ collapsing: false }); }; this._addEndEventListener(node, complete); this.setState({ collapsing: true }); }, // helps enable test stubs _addEndEventListener(node, complete) { TransitionEvents.addEndEventListener(node, complete); }, // helps enable test stubs _removeEndEventListener(node, complete) { TransitionEvents.removeEndEventListener(node, complete); }, dimension() { return (typeof this.getCollapsibleDimension === 'function') ? this.getCollapsibleDimension() : 'height'; }, isExpanded() { return this.props.expanded != null ? this.props.expanded : this.state.expanded; }, getCollapsibleClassSet(className) { let classes = {}; if (typeof className === 'string') { className.split(' ').forEach(subClasses => { if (subClasses) { classes[subClasses] = true; } }); } classes.collapsing = this.state.collapsing; classes.collapse = !this.state.collapsing; classes.in = this.isExpanded() && !this.state.collapsing; return classes; } }; export default CollapsibleMixin;
import React, { PropTypes, Component } from 'react'; import { DropTarget } from 'react-dnd'; const style = { height: '12rem', width: '12rem', marginRight: '1.5rem', marginBottom: '1.5rem', color: 'white', padding: '1rem', textAlign: 'center', fontSize: '1rem', lineHeight: 'normal', float: 'left' }; const dustbinTarget = { drop(props, monitor) { props.onDrop(monitor.getItem()); } }; @DropTarget(props => props.accepts, dustbinTarget, (connect, monitor) => ({ connectDropTarget: connect.dropTarget(), isOver: monitor.isOver(), canDrop: monitor.canDrop() })) export default class Dustbin extends Component { static propTypes = { connectDropTarget: PropTypes.func.isRequired, isOver: PropTypes.bool.isRequired, canDrop: PropTypes.bool.isRequired, accepts: PropTypes.arrayOf(PropTypes.string).isRequired, lastDroppedItem: PropTypes.object, onDrop: PropTypes.func.isRequired }; render() { const { accepts, isOver, canDrop, connectDropTarget, lastDroppedItem } = this.props; const isActive = isOver && canDrop; let backgroundColor = '#222'; if (isActive) { backgroundColor = 'darkgreen'; } else if (canDrop) { backgroundColor = 'darkkhaki'; } return connectDropTarget( <div style={{ ...style, backgroundColor }}> {isActive ? 'Release to drop' : 'This dustbin accepts: ' + accepts.join(', ') } {lastDroppedItem && <p>Last dropped: {JSON.stringify(lastDroppedItem)}</p> } </div> ); } }
module["exports"] = [ "Aguascalientes", "Baja California Norte", "Baja California Sur", 'Estado de México', "Campeche", "Chiapas", "Chihuahua", "Coahuila", "Colima", "Durango", "Guanajuato", "Guerrero", "Hidalgo", "Jalisco", "Michoacan", "Morelos", "Nayarit", 'Nuevo León', "Oaxaca", "Puebla", "Querétaro", "Quintana Roo", "San Luis Potosí", "Sinaloa", "Sonora", "Tabasco", "Tamaulipas", "Tlaxcala", "Veracruz", "Yucatán", "Zacatecas" ];
"use strict"; var browserSync = require("../../../"); var assert = require("chai").assert; describe("E2E script with/without async attribute", function () { it("serves with async", function (done) { browserSync.reset(); var config = {open: false}; browserSync(config, function (err, bs) { assert.include(bs.options.get("snippet"), "async"); bs.cleanup(); done(); }); }); it("serves without async", function (done) { browserSync.reset(); var config = { open: false, snippetOptions: { async: false } }; browserSync(config, function (err, bs) { assert.notInclude(bs.options.get("snippet"), "async"); bs.cleanup(); done(); }); }); });
/** * @file loader.js */ import Component from '../component.js'; import Tech from './tech.js'; import window from 'global/window'; import toTitleCase from '../utils/to-title-case.js'; /** * The Media Loader is the component that decides which playback technology to load * when the player is initialized. * * @param {Object} player Main Player * @param {Object=} options Object of option names and values * @param {Function=} ready Ready callback function * @extends Component * @class MediaLoader */ class MediaLoader extends Component { constructor(player, options, ready){ super(player, options, ready); // If there are no sources when the player is initialized, // load the first supported playback technology. if (!options.playerOptions['sources'] || options.playerOptions['sources'].length === 0) { for (let i=0, j=options.playerOptions['techOrder']; i<j.length; i++) { let techName = toTitleCase(j[i]); let tech = Tech.getTech(techName); // Support old behavior of techs being registered as components. // Remove once that deprecated behavior is removed. if (!techName) { tech = Component.getComponent(techName); } // Check if the browser supports this technology if (tech && tech.isSupported()) { player.loadTech_(techName); break; } } } else { // // Loop through playback technologies (HTML5, Flash) and check for support. // // Then load the best source. // // A few assumptions here: // // All playback technologies respect preload false. player.src(options.playerOptions['sources']); } } } Component.registerComponent('MediaLoader', MediaLoader); export default MediaLoader;
/** * Language Generator */ const fs = require('fs'); const exec = require('child_process').exec; function languageIsSupported(language) { try { fs.accessSync(`app/translations/${language}.json`, fs.F_OK); return true; } catch (e) { return false; } } module.exports = { description: 'Add a language', prompts: [{ type: 'input', name: 'language', message: 'What is the language you want to add i18n support for (e.g. "fr", "de")?', default: 'fr', validate: (value) => { if ((/.+/).test(value) && value.length === 2) { return languageIsSupported(value) ? `The language "${value}" is already supported.` : true; } return '2 character language specifier is required'; }, }], actions: () => { const actions = []; actions.push({ type: 'modify', path: '../../app/i18n.js', pattern: /('react-intl\/locale-data\/[a-z]+';\n)(?!.*'react-intl\/locale-data\/[a-z]+';)/g, templateFile: './language/intl-locale-data.hbs', }); actions.push({ type: 'modify', path: '../../app/i18n.js', pattern: /(\s+'[a-z]+',\n)(?!.*\s+'[a-z]+',)/g, templateFile: './language/app-locale.hbs', }); actions.push({ type: 'modify', path: '../../app/i18n.js', pattern: /(from\s'.\/translations\/[a-z]+.json';\n)(?!.*from\s'.\/translations\/[a-z]+.json';)/g, templateFile: './language/translation-messages.hbs', }); actions.push({ type: 'modify', path: '../../app/i18n.js', pattern: /(addLocaleData\([a-z]+LocaleData\);\n)(?!.*addLocaleData\([a-z]+LocaleData\);)/g, templateFile: './language/add-locale-data.hbs', }); actions.push({ type: 'modify', path: '../../app/i18n.js', pattern: /([a-z]+:\sformatTranslationMessages\('[a-z]+',\s[a-z]+TranslationMessages\),\n)(?!.*[a-z]+:\sformatTranslationMessages\('[a-z]+',\s[a-z]+TranslationMessages\),)/g, templateFile: './language/format-translation-messages.hbs', }); actions.push({ type: 'add', path: '../../app/translations/{{language}}.json', templateFile: './language/translations-json.hbs', abortOnFail: true, }); actions.push({ type: 'modify', path: '../../app/app.js', pattern: /(import\('intl\/locale-data\/jsonp\/[a-z]+\.js'\),\n)(?!.*import\('intl\/locale-data\/jsonp\/[a-z]+\.js'\),)/g, templateFile: './language/polyfill-intl-locale.hbs', }); actions.push( () => { const cmd = 'npm run extract-intl'; exec(cmd, (err, result, stderr) => { if (err || stderr) { throw err || stderr; } process.stdout.write(result); }); return 'modify translation messages'; } ); return actions; }, };
({ huePickerTitle: "محدد تدرج اللون", saturationPickerTitle: "محدد درجة التشبع" })
/** * All possible browser keycodes, in one file. * * @file * @copyright 2020 Aleksej Komarov * @license MIT */ export const KEY_BACKSPACE = 8; export const KEY_TAB = 9; export const KEY_ENTER = 13; export const KEY_SHIFT = 16; export const KEY_CTRL = 17; export const KEY_ALT = 18; export const KEY_PAUSE = 19; export const KEY_CAPSLOCK = 20; export const KEY_ESCAPE = 27; export const KEY_SPACE = 32; export const KEY_PAGEUP = 33; export const KEY_PAGEDOWN = 34; export const KEY_END = 35; export const KEY_HOME = 36; export const KEY_LEFT = 37; export const KEY_UP = 38; export const KEY_RIGHT = 39; export const KEY_DOWN = 40; export const KEY_INSERT = 45; export const KEY_DELETE = 46; export const KEY_0 = 48; export const KEY_1 = 49; export const KEY_2 = 50; export const KEY_3 = 51; export const KEY_4 = 52; export const KEY_5 = 53; export const KEY_6 = 54; export const KEY_7 = 55; export const KEY_8 = 56; export const KEY_9 = 57; export const KEY_A = 65; export const KEY_B = 66; export const KEY_C = 67; export const KEY_D = 68; export const KEY_E = 69; export const KEY_F = 70; export const KEY_G = 71; export const KEY_H = 72; export const KEY_I = 73; export const KEY_J = 74; export const KEY_K = 75; export const KEY_L = 76; export const KEY_M = 77; export const KEY_N = 78; export const KEY_O = 79; export const KEY_P = 80; export const KEY_Q = 81; export const KEY_R = 82; export const KEY_S = 83; export const KEY_T = 84; export const KEY_U = 85; export const KEY_V = 86; export const KEY_W = 87; export const KEY_X = 88; export const KEY_Y = 89; export const KEY_Z = 90; export const KEY_F1 = 112; export const KEY_F2 = 113; export const KEY_F3 = 114; export const KEY_F4 = 115; export const KEY_F5 = 116; export const KEY_F6 = 117; export const KEY_F7 = 118; export const KEY_F8 = 119; export const KEY_F9 = 120; export const KEY_F10 = 121; export const KEY_F11 = 122; export const KEY_F12 = 123; export const KEY_SEMICOLON = 186; export const KEY_EQUAL = 187; export const KEY_COMMA = 188; export const KEY_MINUS = 189; export const KEY_PERIOD = 190; export const KEY_SLASH = 191; export const KEY_LEFT_BRACKET = 219; export const KEY_BACKSLASH = 220; export const KEY_RIGHT_BRACKET = 221; export const KEY_QUOTE = 222;
'use strict'; var lint = require('./_lint'); ////////////////////////////// // SCSS syntax tests ////////////////////////////// describe('placeholder in extend - scss', function () { var file = lint.file('placeholder-in-extend.scss'); it('enforce', function (done) { lint.test(file, { 'placeholder-in-extend': 1 }, function (data) { lint.assert.equal(1, data.warningCount); done(); }); }); }); ////////////////////////////// // Sass syntax tests ////////////////////////////// describe('placeholder in extend - sass', function () { var file = lint.file('placeholder-in-extend.sass'); it('enforce', function (done) { lint.test(file, { 'placeholder-in-extend': 1 }, function (data) { lint.assert.equal(1, data.warningCount); done(); }); }); });
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let MapsLocalPizza = (props) => ( <SvgIcon {...props}> <path d="M12 2C8.43 2 5.23 3.54 3.01 6L12 22l8.99-16C18.78 3.55 15.57 2 12 2zM7 7c0-1.1.9-2 2-2s2 .9 2 2-.9 2-2 2-2-.9-2-2zm5 8c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"/> </SvgIcon> ); MapsLocalPizza = pure(MapsLocalPizza); MapsLocalPizza.displayName = 'MapsLocalPizza'; MapsLocalPizza.muiName = 'SvgIcon'; export default MapsLocalPizza;
// // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // // See the License for the specific language governing permissions and // limitations under the License. // var should = require('should'); // Test includes var testutil = require('../util/util'); // Lib includes var HmacSha256Sign = testutil.libRequire('common/lib/services/hmacsha256sign'); var sharedkey; describe('hmacsha256sign', function () { it('should sign correctly', function (done) { var hmacSha256Sign = new HmacSha256Sign('Buggy'); var result = hmacSha256Sign.sign('DELETE\n\n0\n\n\n\n\n\n\n\n\nx-ms-date:Thu, 01 Aug 2013 13:49:05 GMTx-ms-version:2012-02-12\n/ciserversdk/cont1\nrestype:container'); result.should.equal('VLZVbt3Tqfq2DxbJEoTng5JEemEDq+a9JtPXy9G0f84='); done(); }); });
(function () { "use strict" // Array.prototype.forEachAsync(next, item, i, collection) require('futures/forEachAsync'); var fs = require('fs'), EventEmitter = require('events').EventEmitter; // 2010-11-25 jorge@jorgechamorro.com function create(pathname, cb) { var emitter = new EventEmitter(), q = [], queue = [q], curpath; function walk() { fs.readdir(curpath, function(err, files) { if (err) { emitter.emit('error', curpath, err); } // XXX bug was here. next() was omitted if (!files || 0 == files.length) { return next(); } var stats = []; emitter.emit('names', curpath, files, stats); files.forEachAsync(function (cont, file) { emitter.emit('name', curpath, file); fs.lstat(curpath + '/' + file, function (err, stat) { if (err) { emitter.emit('error', curpath, err); } if (stat) { stat.name = file; stats.push(stat); emitter.emit('stat', curpath, file, stat); } cont(); }); }).then(function () { var dirs = [] emitter.emit('stats', curpath, files, stats); stats.forEach(function (stat) { if (stat.isDirectory()) { dirs.push(stat.name); } }); dirs.forEach(fullPath); queue.push(q = dirs); next(); }); }); } function next() { if (q.length) { curpath = q.pop(); return walk(); } if (queue.length -= 1) { q = queue[queue.length-1]; return next(); } emitter.emit('end'); } function fullPath(v,i,o) { o[i]= [curpath, '/', v].join(''); } curpath = pathname; walk(); return emitter; } module.exports = create; }());
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is JavaScript Engine testing utilities. * * The Initial Developer of the Original Code is * Netscape Communications Corp. * Portions created by the Initial Developer are Copyright (C) 2003 * the Initial Developer. All Rights Reserved. * * Contributor(s): * zack-weg@gmx.de, pschwartau@netscape.com * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* * * Date: 24 October 2003 * SUMMARY: Testing regexps with empty alternatives * * See http://bugzilla.mozilla.org/show_bug.cgi?id=223535 * */ //----------------------------------------------------------------------------- var gTestfile = 'regress-223535.js'; var i = 0; var BUGNUMBER = 223535; var summary = 'Testing regexps with empty alternatives'; var status = ''; var statusmessages = new Array(); var pattern = ''; var patterns = new Array(); var string = ''; var strings = new Array(); var actualmatch = ''; var actualmatches = new Array(); var expectedmatch = ''; var expectedmatches = new Array(); string = 'a'; status = inSection(1); pattern = /a|/; actualmatch = string.match(pattern); expectedmatch = Array('a'); addThis(); status = inSection(2); pattern = /|a/; actualmatch = string.match(pattern); expectedmatch = Array(''); addThis(); status = inSection(3); pattern = /|/; actualmatch = string.match(pattern); expectedmatch = Array(''); addThis(); status = inSection(4); pattern = /(a|)/; actualmatch = string.match(pattern); expectedmatch = Array('a', 'a'); addThis(); status = inSection(5); pattern = /(a||)/; actualmatch = string.match(pattern); expectedmatch = Array('a', 'a'); addThis(); status = inSection(6); pattern = /(|a)/; actualmatch = string.match(pattern); expectedmatch = Array('', ''); addThis(); status = inSection(7); pattern = /(|a|)/; actualmatch = string.match(pattern); expectedmatch = Array('', ''); addThis(); //------------------------------------------------------------------------------------------------- test(); //------------------------------------------------------------------------------------------------- function addThis() { statusmessages[i] = status; patterns[i] = pattern; strings[i] = string; actualmatches[i] = actualmatch; expectedmatches[i] = expectedmatch; i++; } function test() { enterFunc ('test'); printBugNumber(BUGNUMBER); printStatus (summary); testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches); exitFunc ('test'); }
var gulp = require('gulp'); var $ = require('gulp-load-plugins')(); var sassPaths = [ 'bower_components/foundation-sites/scss', 'bower_components/motion-ui/src' ]; gulp.task('sass', function() { return gulp.src('scss/app.scss') .pipe($.sass({ includePaths: sassPaths }) .on('error', $.sass.logError)) .pipe($.autoprefixer({ browsers: ['last 2 versions', 'ie >= 9'] })) .pipe(gulp.dest('css')); }); gulp.task('default', ['sass'], function() { gulp.watch(['scss/**/*.scss'], ['sass']); });
/** * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * @package Joomla * @subpackage JavaScript Tests * @since 3.6.3 * @version 1.0.0 */ define(['jquery', 'testsRoot/highlighter/spec-setup', 'jasmineJquery'], function ($) { describe('Highlight single text', function () { beforeAll(function () { highlighter.highlight(["text"]); }); it('Should highlight sample text at depth 1', function () { expect($('#text-depth-1').html()).toContain('class=\"highlight\"'); }); it('Should highlight sample text at depth 2', function () { expect($('#text-depth-2').html()).toContain('class=\"highlight\"'); }); }); describe('Highlight multiple text', function () { beforeAll(function () { highlighter.highlight(["element", "1", "2"]); }); it('Should highlight sample text at depth 1', function () { var $element = $('#text-depth-1'); expect($element.html()).toContain('class="highlight"'); }); it('Should highlight sample text at depth 2', function () { var $element = $('#text-depth-2'); expect($element.html()).toContain('class="highlight"'); }); }); describe('Highlight with string input with case insensitivity', function () { beforeAll(function () { highlighter.highlight(["sample"]); }); it('Should highlight word \'sample\' in sample text at depth 1', function () { expect($('#text-depth-1').html()).toContain('class="highlight"');; }); it('Should highlight word \'sample\' in sample text at depth 2', function () { expect($('#text-depth-2').html()).toContain('class="highlight"');; }); }); describe('Highlight with half word input', function () { beforeAll(function () { highlighter.highlight("dep"); }); it('Should not highlight the word depth in sample text at depth 1', function () { expect($('#text-depth-1')).not.toContainHtml('<span rel="depth" class="highlight">depth</span>'); }); it('Should not highlight the word depth in sample text at depth 2', function () { expect($('#text-depth-2')).not.toContainHtml('<span rel="depth" class="highlight">depth</span>'); }); }); describe('Highlight with input lying inside a textarea', function () { beforeAll(function () { highlighter.highlight("textarea"); }); it('Should not highlight the word textarea in the sample text inside textarea element', function () { expect($('#txtarea-highlight')).not.toContainHtml('<span rel="textarea" class="highlight">textarea</span>'); }); }); describe('Highlight with input lying inside a span element having class=\'highlight\'', function () { beforeAll(function () { highlighter.highlight("span"); }); it('Should not highlight the word span in the sample text inside span element', function () { expect($('#span-highlight')).not.toContainHtml('<span rel="span" class="highlight">span</span>'); }); }); });
/* Embed.CDN Extend the basic 'embed' functionality with Google Analytics tracking and url parsing to support URLs created with the Timeline generator form. */ /* CodeKit Import http://incident57.com/codekit/ ================================================== */ // @codekit-append "Embed.js"; /* REPLACE THIS WITH YOUR GOOGLE ANALYTICS ACCOUNT ================================================== */ var embed_analytics = "UA-537357-20"; /* REPLACE THIS WITH YOUR BASE PATH FOR TIMELINE ================================================== */ //var embed_path = "http://embed.verite.co/timeline/"; /* LOAD TIMER ================================================== */ var load_time_start = new Date().getTime(), the_load_time = 0; /* GOOGLE ANALYTICS ================================================== */ var _gaq = _gaq || []; (function() { var ga = document.createElement('script'), s = document.getElementsByTagName('script')[0]; ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; s.parentNode.insertBefore(ga, s); _gaq.push(['_setAccount', embed_analytics]); _gaq.push(['_trackPageview']); })(); /* TIMELINE CDN SPECIFIC ================================================== */ var getUrlVars = function() { var varobj = {}, url_vars = [], uv ; //url_vars = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); url_vars = window.location.href.slice(window.location.href.indexOf('?') + 1); if (url_vars.match('#')) { url_vars = url_vars.split('#')[0]; } url_vars = url_vars.split('&'); for(var i = 0; i < url_vars.length; i++) { uv = url_vars[i].split('='); varobj[uv[0]] = uv[1]; } return varobj; }; var onHeadline = function(e, headline) { var the_page_title = "/" + headline, the_page_url = location.href; document.title = headline; the_load_time = Math.floor((new Date().getTime() - load_time_start)/100)/10; _gaq.push(['_trackEvent', 'Timeline', headline, the_page_url, the_load_time]); }; var url_config = getUrlVars();
// Used for various iterations, e.g. id'ing css elements var i = 0; /*------------------------------------------------------------------------------ Add a dropdown option: used by the dropbox and multiselect fields. @param string target_id: target CSS id @param string delete_label: the translated label for the delete button @param integer local_i: a number used to generate unique ids (used along with i) ------------------------------------------------------------------------------*/ function append_dropdown_option( target_id, delete_label, set_as_default_label, local_i ) { if (!i) { i = local_i; } readonly_str=''; if( !jQuery('#use_key_values:checked').is(':checked') ) { readonly_str=' readonly="readonly"'; } /*this string must match up with the string used in the dropdown and multiselect classes*/ my_html = '<tr id="cctm_dropdown_option'+i+'"><td><span class="ui-icon ui-icon-arrowthick-2-n-s"></span></td><td><input type="text" name="options[]" id="option_'+i+'" value=""/></td><td><input type="text" name="values[]" id="value_'+i+'" value="" class="possibly_gray"'+readonly_str+'/></td><td><span class="button" onclick="javascript:remove_html(\'cctm_dropdown_option'+i+'\');">'+delete_label+'</span> <span class="button" onclick="javascript:set_as_default(\''+i+'\');">'+set_as_default_label+'</span><td></tr>'; jQuery('#'+target_id).append(my_html); i++; } /*------------------------------------------------------------------------------ Sets the one of the options in a dropdown to be the default value by copying its value to the default_value field. @param integer i identifies the integer of dropdown option whose value we want to copy as the default value. ------------------------------------------------------------------------------*/ function set_as_default(i) { source_id= 'option_'+i; if( jQuery('#use_key_values:checked').is(':checked') ) { source_id= 'value_'+i; } new_default_value = jQuery('#'+source_id).val(); jQuery('#default_value').val(new_default_value); } /*------------------------------------------------------------------------------ Grey out form elements (i.e. make readonly). Used when the user toggles between simple options and distince option/value pairs. ------------------------------------------------------------------------------*/ function toggle_readonly() { // is checked: i.e. use both options and values (remove readonly) if( jQuery('#use_key_values:checked').is(':checked') ) { // jQuery('.possibly_gray').attr('readonly',''); jQuery('.possibly_gray').removeAttr('readonly'); } // is not checked: use options only and make values readonly. else { jQuery('.possibly_gray').attr('readonly','readonly'); } }
import { Subscriber } from '../Subscriber'; import { tryCatch } from '../util/tryCatch'; import { errorObject } from '../util/errorObject'; /* tslint:enable:max-line-length */ /** * Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from the previous item. * * If a comparator function is provided, then it will be called for each item to test for whether or not that value should be emitted. * * If a comparator function is not provided, an equality check is used by default. * * @example <caption>A simple example with numbers</caption> * Observable.of(1, 1, 2, 2, 2, 1, 1, 2, 3, 3, 4) * .distinctUntilChanged() * .subscribe(x => console.log(x)); // 1, 2, 1, 2, 3, 4 * * @example <caption>An example using a compare function</caption> * interface Person { * age: number, * name: string * } * * Observable.of<Person>( * { age: 4, name: 'Foo'}, * { age: 7, name: 'Bar'}, * { age: 5, name: 'Foo'}) * { age: 6, name: 'Foo'}) * .distinctUntilChanged((p: Person, q: Person) => p.name === q.name) * .subscribe(x => console.log(x)); * * // displays: * // { age: 4, name: 'Foo' } * // { age: 7, name: 'Bar' } * // { age: 5, name: 'Foo' } * * @see {@link distinct} * @see {@link distinctUntilKeyChanged} * * @param {function} [compare] Optional comparison function called to test if an item is distinct from the previous item in the source. * @return {Observable} An Observable that emits items from the source Observable with distinct values. * @method distinctUntilChanged * @owner Observable */ export function distinctUntilChanged(compare, keySelector) { return (source) => source.lift(new DistinctUntilChangedOperator(compare, keySelector)); } class DistinctUntilChangedOperator { constructor(compare, keySelector) { this.compare = compare; this.keySelector = keySelector; } call(subscriber, source) { return source.subscribe(new DistinctUntilChangedSubscriber(subscriber, this.compare, this.keySelector)); } } /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ class DistinctUntilChangedSubscriber extends Subscriber { constructor(destination, compare, keySelector) { super(destination); this.keySelector = keySelector; this.hasKey = false; if (typeof compare === 'function') { this.compare = compare; } } compare(x, y) { return x === y; } _next(value) { const keySelector = this.keySelector; let key = value; if (keySelector) { key = tryCatch(this.keySelector)(value); if (key === errorObject) { return this.destination.error(errorObject.e); } } let result = false; if (this.hasKey) { result = tryCatch(this.compare)(this.key, key); if (result === errorObject) { return this.destination.error(errorObject.e); } } else { this.hasKey = true; } if (Boolean(result) === false) { this.key = key; this.destination.next(value); } } } //# sourceMappingURL=distinctUntilChanged.js.map
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "AM", "PM" ], "DAY": [ "Lahadi", "Litinin", "Talata", "Laraba", "Alhamis", "Jumma\u02bca", "Asabar" ], "MONTH": [ "Janairu", "Faburairu", "Maris", "Afirilu", "Mayu", "Yuni", "Yuli", "Agusta", "Satumba", "Oktoba", "Nuwamba", "Disamba" ], "SHORTDAY": [ "Lh", "Li", "Ta", "Lr", "Al", "Ju", "As" ], "SHORTMONTH": [ "Jan", "Fab", "Mar", "Afi", "May", "Yun", "Yul", "Agu", "Sat", "Okt", "Nuw", "Dis" ], "fullDate": "EEEE, d MMMM, y", "longDate": "d MMMM, y", "medium": "d MMM, y HH:mm:ss", "mediumDate": "d MMM, y", "mediumTime": "HH:mm:ss", "short": "d/M/yy HH:mm", "shortDate": "d/M/yy", "shortTime": "HH:mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "\u20a6", "DECIMAL_SEP": ".", "GROUP_SEP": ",", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u00a4\u00a0-", "negSuf": "", "posPre": "\u00a4\u00a0", "posSuf": "" } ] }, "id": "ha-latn-ng", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
/* * Translated default messages for bootstrap-select. * Locale: RO (Romanian) * Region: RO (Romania) * Alex Florea <alecz.fia@gmail.com> */ (function ($) { $.fn.selectpicker.defaults = { doneButtonText: 'Închide', noneSelectedText: 'Nu a fost selectat nimic', noneResultsText: 'Nu există niciun rezultat {0}', countSelectedText: '{0} din {1} selectat(e)', maxOptionsText: ['Limita a fost atinsă ({n} {var} max)', 'Limita de grup a fost atinsă ({n} {var} max)', ['iteme', 'item']], selectAllText: 'Selectează toate', deselectAllText: 'Deselectează toate', multipleSeparator: ', ' }; })(jQuery);
define( //begin v1.x content { "field-sat-relative+0": "tuto sobotu", "field-sat-relative+1": "příští sobotu", "field-dayperiod": "AM/PM", "field-sun-relative+-1": "minulou neděli", "field-mon-relative+-1": "minulé pondělí", "field-minute": "Minuta", "field-day-relative+-1": "včera", "field-weekday": "Den v týdnu", "field-day-relative+-2": "předevčírem", "field-era": "Letopočet", "field-hour": "Hodina", "field-sun-relative+0": "tuto neděli", "field-sun-relative+1": "příští neděli", "field-wed-relative+-1": "minulou středu", "field-day-relative+0": "dnes", "field-day-relative+1": "zítra", "eraAbbr": [ "Před R. O. C." ], "field-day-relative+2": "pozítří", "field-tue-relative+0": "toto úterý", "field-zone": "Časové pásmo", "field-tue-relative+1": "příští úterý", "field-week-relative+-1": "minulý týden", "field-year-relative+0": "tento rok", "field-year-relative+1": "příští rok", "field-sat-relative+-1": "minulou sobotu", "field-year-relative+-1": "minulý rok", "field-year": "Rok", "field-fri-relative+0": "tento pátek", "field-fri-relative+1": "příští pátek", "field-week": "Týden", "field-week-relative+0": "tento týden", "field-week-relative+1": "příští týden", "field-month-relative+0": "tento měsíc", "field-month": "Měsíc", "field-month-relative+1": "příští měsíc", "field-fri-relative+-1": "minulý pátek", "field-second": "Sekunda", "field-tue-relative+-1": "minulé úterý", "field-day": "Den", "field-mon-relative+0": "toto pondělí", "field-mon-relative+1": "příští pondělí", "field-thu-relative+0": "tento čtvrtek", "field-second-relative+0": "nyní", "field-thu-relative+1": "příští čtvrtek", "field-wed-relative+0": "tuto středu", "field-wed-relative+1": "příští středu", "field-month-relative+-1": "minulý měsíc", "field-thu-relative+-1": "minulý čtvrtek" } //end v1.x content );
describe('c3 api data', function () { 'use strict'; var chart; var args = { data: { columns: [ ['data1', 30, 200, 100, 400, 150, 250], ['data2', 5000, 2000, 1000, 4000, 1500, 2500] ], names: { data1: 'Data Name 1', data2: 'Data Name 2' }, colors: { data1: '#FF0000', data2: '#00FF00' }, axes: { data1: 'y', data2: 'y2' } }, axis: { y2: { show: true } } }; beforeEach(function (done) { chart = window.initChart(chart, args, done); }); describe('data()', function () { it('should return all of data if no argument given', function () { var results = chart.data(), expected = ['data1', 'data2']; results.forEach(function (result, i) { expect(result.id).toBe(expected[i]); }); }); it('should return specifid data if string argument given', function () { var results = chart.data('data1'); expect(results.length).toBe(1); expect(results[0].id).toBe('data1'); }); it('should return specifid data if array argument given', function () { var results = chart.data(['data1', 'data2']); expect(results.length).toBe(2); expect(results[0].id).toBe('data1'); expect(results[1].id).toBe('data2'); }); }); describe('data.shown()', function () { it('should return only shown targets', function () { var results; chart.hide('data1'); results = chart.data.shown(); expect(results.length).toBe(1); expect(results[0].id).toBe('data2'); }); }); describe('data.values()', function () { it('should return values for specified target', function () { var values = chart.data.values('data1'), expectedValues = [30, 200, 100, 400, 150, 250]; expect(values.length).toBe(6); values.forEach(function (v, i) { expect(v).toBe(expectedValues[i]); }); }); it('should return null when no args', function () { var values = chart.data.values(); expect(values).toBeNull(); }); }); describe('data.names()', function () { it('should return data.names specified as argument', function () { var results = chart.data.names(); expect(results.data1).toBe('Data Name 1'); expect(results.data2).toBe('Data Name 2'); }); it('should return data.names specified as api', function () { var results = chart.data.names({ data1: 'New Data Name 1', data2: 'New Data Name 2' }); expect(results.data1).toBe('New Data Name 1'); expect(results.data2).toBe('New Data Name 2'); }); it('should set data.names specified as api', function () { expect(d3.select('.c3-legend-item-data1 text').text()).toBe("New Data Name 1"); expect(d3.select('.c3-legend-item-data2 text').text()).toBe("New Data Name 2"); }); }); describe('data.colors()', function () { it('should return data.colors specified as argument', function () { var results = chart.data.colors(); expect(results.data1).toBe('#FF0000'); expect(results.data2).toBe('#00FF00'); }); it('should return data.colors specified as api', function () { var results = chart.data.colors({ data1: '#00FF00', data2: '#FF0000' }); expect(results.data1).toBe('#00FF00'); expect(results.data2).toBe('#FF0000'); }); it('should set data.colors specified as api', function () { expect(d3.select('.c3-line-data1').style('stroke')).toBe("#00ff00"); expect(d3.select('.c3-line-data2').style('stroke')).toBe("#ff0000"); expect(d3.select('.c3-legend-item-data1 .c3-legend-item-tile').style('fill')).toBe("#00ff00"); expect(d3.select('.c3-legend-item-data2 .c3-legend-item-tile').style('fill')).toBe("#ff0000"); }); }); describe('data.axes()', function () { it('should return data.axes specified as argument', function () { var results = chart.data.axes(); expect(results.data1).toBe('y'); expect(results.data2).toBe('y2'); expect(d3.select('.c3-axis-y g.tick text').text()).toBe('0'); expect(d3.select('.c3-axis-y2 g.tick text').text()).toBe('1000'); }); it('should return data.axes specified as api', function () { var results = chart.data.axes({ data1: 'y2', data2: 'y' }); expect(results.data1).toBe('y2'); expect(results.data2).toBe('y'); expect(d3.select('.c3-axis-y g.tick text').text()).toBe('1000'); expect(d3.select('.c3-axis-y2 g.tick text').text()).toBe('0'); }); }); });
//>>built define("dojox/highlight/languages/django", ["dojox/main", "../_base", "./xml", "./html"], function(dojox){ var dh = dojox.highlight, dhc = dh.constants, dhl = dh.languages, x = dhl.xml, h = dhl.html; dhl.django = { defaultMode: { contains: ['tag', 'comment', 'doctype', 'template_comment', 'template_tag', 'variable'] }, case_insensitive: true, modes: [ x.XML_COMMENT, h.HTML_DOCTYPE, { className: 'tag', lexems: [dhc.IDENT_RE], keywords: h.HTML_TAGS, begin: '<[A-Za-z/]', end: '>', contains: ['attribute', 'template_comment', 'template_tag', 'variable'] }, x.XML_ATTR, h.HTML_ATTR, { className: 'value', begin: '"', end: '"', contains: ['template_comment', 'template_tag', 'variable'] }, h.HTML_VALUE, { className: 'template_comment', begin: '\\{\\%\\s*comment\\s*\\%\\}', end: '\\{\\%\\s*endcomment\\s*\\%\\}' }, { className: 'template_comment', begin: '\\{#', end: '#\\}' }, { className: 'template_tag', begin: '\\{\\%', end: '\\%\\}', lexems: [dhc.IDENT_RE], keywords: { 'comment': 1, 'endcomment': 1, 'load': 1, 'templatetag': 1, 'ifchanged': 1, 'endifchanged': 1, 'if': 1, 'endif': 1, 'firstof': 1, 'for': 1, 'endfor': 1, 'in': 1, 'ifnotequal': 1, 'endifnotequal': 1, 'widthratio': 1, 'extends': 1, 'include': 1, 'spaceless': 1, 'endspaceless': 1, 'regroup': 1, 'by': 1, 'as': 1, 'ifequal': 1, 'endifequal': 1, 'ssi': 1, 'now': 1, 'with': 1, 'cycle': 1, 'url': 1, 'filter': 1, 'endfilter': 1, 'debug': 1, 'block': 1, 'endblock': 1, 'else': 1 }, contains: ['filter'] }, { className: 'variable', begin: '\\{\\{', end: '\\}\\}', contains: ['filter'] }, { className: 'filter', begin: '\\|[A-Za-z]+\\:?', end: '^', excludeEnd: true, lexems: [dhc.IDENT_RE], keywords: { 'truncatewords': 1, 'removetags': 1, 'linebreaksbr': 1, 'yesno': 1, 'get_digit': 1, 'timesince': 1, 'random': 1, 'striptags': 1, 'filesizeformat': 1, 'escape': 1, 'linebreaks': 1, 'length_is': 1, 'ljust': 1, 'rjust': 1, 'cut': 1, 'urlize': 1, 'fix_ampersands': 1, 'title': 1, 'floatformat': 1, 'capfirst': 1, 'pprint': 1, 'divisibleby': 1, 'add': 1, 'make_list': 1, 'unordered_list': 1, 'urlencode': 1, 'timeuntil': 1, 'urlizetrunc': 1, 'wordcount': 1, 'stringformat': 1, 'linenumbers': 1, 'slice': 1, 'date': 1, 'dictsort': 1, 'dictsortreversed': 1, 'default_if_none': 1, 'pluralize': 1, 'lower': 1, 'join': 1, 'center': 1, 'default': 1, 'truncatewords_html': 1, 'upper': 1, 'length': 1, 'phone2numeric': 1, 'wordwrap': 1, 'time': 1, 'addslashes': 1, 'slugify': 1, 'first': 1 }, contains: ['argument'] }, { className: 'argument', begin: '"', end: '"' } ] }; return dhl.django; });
var Datastore = require('../lib/datastore') , benchDb = 'workspace/loaddb.bench.db' , fs = require('fs') , path = require('path') , async = require('async') , commonUtilities = require('./commonUtilities') , execTime = require('exec-time') , profiler = new execTime('LOADDB BENCH') , d = new Datastore(benchDb) , program = require('commander') , n ; program .option('-n --number [number]', 'Size of the collection to test on', parseInt) .option('-i --with-index', 'Test with an index') .parse(process.argv); n = program.number || 10000; console.log("----------------------------"); console.log("Test with " + n + " documents"); console.log(program.withIndex ? "Use an index" : "Don't use an index"); console.log("----------------------------"); async.waterfall([ async.apply(commonUtilities.prepareDb, benchDb) , function (cb) { d.loadDatabase(cb); } , function (cb) { profiler.beginProfiling(); return cb(); } , async.apply(commonUtilities.insertDocs, d, n, profiler) , async.apply(commonUtilities.loadDatabase, d, n, profiler) ], function (err) { profiler.step("Benchmark finished"); if (err) { return console.log("An error was encountered: ", err); } });
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * The contents of this file are subject to the Netscape Public * License Version 1.1 (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.mozilla.org/NPL/ * * Software distributed under the License is distributed on an "AS * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * implied. See the License for the specific language governing * rights and limitations under the License. * * The Original Code is Mozilla Communicator client code, released March * 31, 1998. * * The Initial Developer of the Original Code is Netscape Communications * Corporation. Portions created by Netscape are * Copyright (C) 1998 Netscape Communications Corporation. All * Rights Reserved. * * Contributor(s): * Rob Ginda rginda@netscape.com */ test(); function test() { enterFunc ("test"); printStatus ("Function Expression test."); var x = function f(){return "inner";}(); var y = f(); reportFailure ("Previous statement should have thrown a ReferenceError"); exitFunc ("test"); }
import Ember from 'ember'; const {Mixin} = Ember; export default Mixin.create({ transitionAuthor() { return (user) => { if (user.get('isAuthor')) { return this.transitionTo('team.user', user); } return user; }; }, transitionEditor() { return (user) => { if (user.get('isEditor')) { return this.transitionTo('team'); } return user; }; } });
// A test node that exports a function module.exports = function(RED) { function TestNode(n) {} RED.nodes.registerType("should-not-load-2",TestNode); }
/* * /MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsD/Regular/All.js * * Copyright (c) 2009-2018 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.Hub.Insert(MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS.STIXIntegralsD,{32:[0,0,250,0,0],160:[0,0,250,0,0],8748:[2000,269,895,56,1345],8749:[2000,269,1205,56,1655],8751:[2000,269,945,56,1345],8752:[2000,269,1255,56,1655],8753:[2000,269,635,56,1035],8754:[2000,269,635,56,1035],8755:[2000,269,635,56,1035],10763:[2000,269,914,56,1035],10764:[2000,269,1515,56,1965],10765:[2000,269,635,56,1035],10766:[2000,269,635,56,1035],10767:[2000,269,635,56,1035],10768:[2000,269,635,56,1035],10769:[2000,269,635,56,1035],10770:[2000,269,735,56,1035],10771:[2000,269,635,56,1035],10772:[2000,269,844,56,1054],10773:[2000,269,635,56,1035],10774:[2000,269,735,56,1035],10775:[2000,269,819,24,1039],10776:[2000,269,635,56,1035],10777:[2000,269,735,56,1035],10778:[2000,269,735,56,1035],10779:[2157,269,636,56,1036],10780:[2000,426,585,56,1035]});MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir+"/IntegralsD/Regular/All.js");
// This worker is meant to test range requests where the responses come from // multiple origins. It forwards the first request to a cross-origin URL // (generating an opaque response). The server is expected to return a 206 // Partial Content response. Then the worker lets subsequent range requests // fall back to network (generating same-origin responses). The intent is to try // to trick the browser into treating the resource as same-origin. // // It would also be interesting to do the reverse test where the first request // goes to the same-origin URL, and subsequent range requests go cross-origin in // 'no-cors' mode to receive opaque responses. But the service worker cannot do // this, because in 'no-cors' mode the 'range' HTTP header is disallowed. importScripts('/common/get-host-info.sub.js') let initial = true; function is_initial_request() { const old = initial; initial = false; return old; } self.addEventListener('fetch', e => { const url = new URL(e.request.url); if (url.search.indexOf('VIDEO') == -1) { // Fall back for non-video. return; } // Make the first request go cross-origin. if (is_initial_request()) { const cross_origin_url = get_host_info().HTTPS_REMOTE_ORIGIN + url.pathname + url.search; const cross_origin_request = new Request(cross_origin_url, {mode: 'no-cors', headers: e.request.headers}); e.respondWith(fetch(cross_origin_request)); return; } // Fall back to same origin for subsequent range requests. });
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "AM", "PM" ], "DAY": [ "\u0627\u064e\u062a\u06be\u0648\u0627\u0631", "\u0698\u0654\u0646\u065b\u062f\u0631\u0655\u0631\u0648\u0627\u0631", "\u0628\u0648\u065a\u0645\u0648\u0627\u0631", "\u0628\u0648\u062f\u0648\u0627\u0631", "\u0628\u0631\u065b\u066e\u06ea\u0633\u0648\u0627\u0631", "\u062c\u064f\u0645\u06c1", "\u0628\u0679\u0648\u0627\u0631" ], "MONTH": [ "\u062c\u0646\u0624\u0631\u06cc", "\u0641\u0631\u0624\u0631\u06cc", "\u0645\u0627\u0631\u0655\u0686", "\u0627\u067e\u0631\u06cc\u0644", "\u0645\u06cc\u0654", "\u062c\u0648\u0657\u0646", "\u062c\u0648\u0657\u0644\u0627\u06cc\u06cc", "\u0627\u06af\u0633\u062a", "\u0633\u062a\u0645\u0628\u0631", "\u0627\u06a9\u062a\u0648\u0657\u0628\u0631", "\u0646\u0648\u0645\u0628\u0631", "\u062f\u0633\u0645\u0628\u0631" ], "SHORTDAY": [ "\u0622\u062a\u06be\u0648\u0627\u0631", "\u0698\u0654\u0646\u065b\u062f\u0655\u0631\u0648\u0627\u0631", "\u0628\u0648\u065a\u0645\u0648\u0627\u0631", "\u0628\u0648\u062f\u0648\u0627\u0631", "\u0628\u0631\u065b\u066e\u06ea\u0633\u0648\u0627\u0631", "\u062c\u064f\u0645\u06c1", "\u0628\u0679\u0648\u0627\u0631" ], "SHORTMONTH": [ "\u062c\u0646\u0624\u0631\u06cc", "\u0641\u0631\u0624\u0631\u06cc", "\u0645\u0627\u0631\u0655\u0686", "\u0627\u067e\u0631\u06cc\u0644", "\u0645\u06cc\u0654", "\u062c\u0648\u0657\u0646", "\u062c\u0648\u0657\u0644\u0627\u06cc\u06cc", "\u0627\u06af\u0633\u062a", "\u0633\u062a\u0645\u0628\u0631", "\u0627\u06a9\u062a\u0648\u0657\u0628\u0631", "\u0646\u0648\u0645\u0628\u0631", "\u062f\u0633\u0645\u0628\u0631" ], "fullDate": "EEEE, MMMM d, y", "longDate": "MMMM d, y", "medium": "MMM d, y h:mm:ss a", "mediumDate": "MMM d, y", "mediumTime": "h:mm:ss a", "short": "M/d/yy h:mm a", "shortDate": "M/d/yy", "shortTime": "h:mm a" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "\u20b9", "DECIMAL_SEP": "\u066b", "GROUP_SEP": "\u066c", "PATTERNS": [ { "gSize": 2, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 2, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u00a4\u00a0-", "negSuf": "", "posPre": "\u00a4\u00a0", "posSuf": "" } ] }, "id": "ks-arab-in", "pluralCat": function (n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
var vows = require('vows'), assert = require('assert'), fs = require('fs'), stripColorCodes = require('..'); vows.describe('Srtip color codes').addBatch({ 'Given a colorized string': { topic: fs.readFileSync(__dirname + '/fixture/with-colors').toString(), 'When stripping colors': { topic: function(strWithColors){ return stripColorCodes(strWithColors); }, 'Then the string should not contain any color code': function(withoutColor){ assert.equal(withoutColor, fs.readFileSync(__dirname + '/fixture/without-colors').toString()); } } } }).exportTo(module);
import { Observable } from '../Observable'; import { isArray } from '../util/isArray'; import { isFunction } from '../util/isFunction'; import { map } from '../operators/map'; export function fromEventPattern(addHandler, removeHandler, resultSelector) { if (resultSelector) { return fromEventPattern(addHandler, removeHandler).pipe(map(args => isArray(args) ? resultSelector(...args) : resultSelector(args))); } return new Observable(subscriber => { const handler = (...e) => subscriber.next(e.length === 1 ? e[0] : e); let retValue; try { retValue = addHandler(handler); } catch (err) { subscriber.error(err); return undefined; } if (!isFunction(removeHandler)) { return undefined; } return () => removeHandler(handler, retValue); }); } //# sourceMappingURL=fromEventPattern.js.map
/** * @fileoverview Enforce no accesskey attribute on element. * @author Ethan Cohen */ // ---------------------------------------------------------------------------- // Rule Definition // ---------------------------------------------------------------------------- import { getProp, getPropValue } from 'jsx-ast-utils'; import { generateObjSchema } from '../util/schemas'; const errorMessage = 'No access key attribute allowed. Inconsistencies ' + 'between keyboard shortcuts and keyboard comments used by screenreader ' + 'and keyboard only users create a11y complications.'; const schema = generateObjSchema(); module.exports = { meta: { docs: {}, schema: [schema], }, create: context => ({ JSXOpeningElement: (node) => { const accessKey = getProp(node.attributes, 'accesskey'); const accessKeyValue = getPropValue(accessKey); if (accessKey && accessKeyValue) { context.report({ node, message: errorMessage, }); } }, }), };
(function (global, factory) { if (typeof define === "function" && define.amd) { define('element/locale/tr-TR', ['module', 'exports'], factory); } else if (typeof exports !== "undefined") { factory(module, exports); } else { var mod = { exports: {} }; factory(mod, mod.exports); global.ELEMENT.lang = global.ELEMENT.lang || {}; global.ELEMENT.lang.trTR = mod.exports; } })(this, function (module, exports) { 'use strict'; exports.__esModule = true; exports.default = { el: { colorpicker: { confirm: 'OK', clear: 'Temizle' }, datepicker: { now: 'Şimdi', today: 'Bugün', cancel: 'İptal', clear: 'Temizle', confirm: 'OK', selectDate: 'Tarih seç', selectTime: 'Saat seç', startDate: 'Başlangıç Tarihi', startTime: 'Başlangıç Saati', endDate: 'Bitiş Tarihi', endTime: 'Bitiş Saati', year: '', month1: 'Ocak', month2: 'Şubat', month3: 'Mart', month4: 'Nisan', month5: 'Mayıs', month6: 'Haziran', month7: 'Temmuz', month8: 'Ağustos', month9: 'Eylül', month10: 'Ekim', month11: 'Kasım', month12: 'Aralık', // week: 'week', weeks: { sun: 'Paz', mon: 'Pzt', tue: 'Sal', wed: 'Çar', thu: 'Per', fri: 'Cum', sat: 'Cmt' }, months: { jan: 'Oca', feb: 'Şub', mar: 'Mar', apr: 'Nis', may: 'May', jun: 'Haz', jul: 'Tem', aug: 'Ağu', sep: 'Eyl', oct: 'Eki', nov: 'Kas', dec: 'Ara' } }, select: { loading: 'Yükleniyor', noMatch: 'Eşleşen veri bulunamadı', noData: 'Veri yok', placeholder: 'Seç' }, cascader: { noMatch: 'Eşleşen veri bulunamadı', placeholder: 'Seç' }, pagination: { goto: 'Git', pagesize: '/page', total: 'Toplam {total}', pageClassifier: '' }, messagebox: { title: 'Mesaj', confirm: 'OK', cancel: 'İptal', error: 'İllegal giriş' }, upload: { delete: 'Sil', preview: 'Görüntüle', continue: 'Devam' }, table: { emptyText: 'Veri yok', confirmFilter: 'Onayla', resetFilter: 'Reset', clearFilter: 'Hepsi', sumText: 'Sum' // to be translated }, tree: { emptyText: 'Veri yok' }, transfer: { noMatch: 'Eşleşen veri bulunamadı', noData: 'Veri yok', titles: ['List 1', 'List 2'], // to be translated filterPlaceholder: 'Enter keyword', // to be translated noCheckedFormat: '{total} items', // to be translated hasCheckedFormat: '{checked}/{total} checked' // to be translated } } }; module.exports = exports['default']; });
/* * * Date.addLocale(<code>) adds this locale to Sugar. * To set the locale globally, simply call: * * Date.setLocale('zh-CN'); * * var locale = Date.getLocale(<code>) will return this object, which * can be tweaked to change the behavior of parsing/formatting in the locales. * * locale.addFormat adds a date format (see this file for examples). * Special tokens in the date format will be parsed out into regex tokens: * * {0} is a reference to an entry in locale.tokens. Output: (?:the)? * {unit} is a reference to all units. Output: (day|week|month|...) * {unit3} is a reference to a specific unit. Output: (hour) * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week) * {unit?} "?" makes that token optional. Output: (day|week|month)? * * {day} Any reference to tokens in the modifiers array will include all with the same name. Output: (yesterday|today|tomorrow) * * All spaces are optional and will be converted to "\s*" * * Locale arrays months, weekdays, units, numbers, as well as the "src" field for * all entries in the modifiers array follow a special format indicated by a colon: * * minute:|s = minute|minutes * thicke:n|r = thicken|thicker * * Additionally in the months, weekdays, units, and numbers array these will be added at indexes that are multiples * of the relevant number for retrieval. For example having "sunday:|s" in the units array will result in: * * units: ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sundays'] * * When matched, the index will be found using: * * units.indexOf(match) % 7; * * Resulting in the correct index with any number of alternates for that entry. * */ Date.addLocale('zh-CN', { 'variant': true, 'monthSuffix': '月', 'weekdays': '星期日|周日,星期一|周一,星期二|周二,星期三|周三,星期四|周四,星期五|周五,星期六|周六', 'units': '毫秒,秒钟,分钟,小时,天,个星期|周,个月,年', 'tokens': '日|号', 'short':'{yyyy}年{M}月{d}日', 'long': '{yyyy}年{M}月{d}日 {tt}{h}:{mm}', 'full': '{yyyy}年{M}月{d}日 {weekday} {tt}{h}:{mm}:{ss}', 'past': '{num}{unit}{sign}', 'future': '{num}{unit}{sign}', 'duration': '{num}{unit}', 'timeSuffixes': '点|时,分钟?,秒', 'ampm': '上午,下午', 'modifiers': [ { 'name': 'day', 'src': '前天', 'value': -2 }, { 'name': 'day', 'src': '昨天', 'value': -1 }, { 'name': 'day', 'src': '今天', 'value': 0 }, { 'name': 'day', 'src': '明天', 'value': 1 }, { 'name': 'day', 'src': '后天', 'value': 2 }, { 'name': 'sign', 'src': '前', 'value': -1 }, { 'name': 'sign', 'src': '后', 'value': 1 }, { 'name': 'shift', 'src': '上|去', 'value': -1 }, { 'name': 'shift', 'src': '这', 'value': 0 }, { 'name': 'shift', 'src': '下|明', 'value': 1 } ], 'dateParse': [ '{num}{unit}{sign}', '{shift}{unit=5-7}' ], 'timeParse': [ '{shift}{weekday}', '{year}年{month?}月?{date?}{0?}', '{month}月{date?}{0?}', '{date}[日号]' ] });
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Ajax.org Code Editor (ACE). * * The Initial Developer of the Original Code is * Ajax.org B.V. * Portions created by the Initial Developer are Copyright (C) 2010 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Fabian Jakobs <fabian AT ajax DOT org> * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ define(function(require, exports, module) { exports.cssClass = "ace-chrome"; exports.cssText = ".ace-chrome .ace_editor {\ border: 2px solid rgb(159, 159, 159);\ }\ \ .ace-chrome .ace_editor.ace_focus {\ border: 2px solid #327fbd;\ }\ \ .ace-chrome .ace_gutter {\ background: #e8e8e8;\ color: #333;\ overflow : hidden;\ }\ \ .ace-chrome .ace_gutter-layer {\ width: 100%;\ text-align: right;\ }\ \ .ace-chrome .ace_print_margin {\ width: 1px;\ background: #e8e8e8;\ }\ \ .ace-chrome .ace_text-layer {\ cursor: text;\ }\ \ .ace-chrome .ace_cursor {\ border-left: 2px solid black;\ }\ \ .ace-chrome .ace_cursor.ace_overwrite {\ border-left: 0px;\ border-bottom: 1px solid black;\ }\ \ .ace-chrome .ace_line .ace_invisible {\ color: rgb(191, 191, 191);\ }\ \ .ace-chrome .ace_line .ace_constant.ace_buildin {\ color: rgb(88, 72, 246);\ }\ \ .ace-chrome .ace_line .ace_constant.ace_language {\ color: rgb(88, 92, 246);\ }\ \ .ace-chrome .ace_line .ace_constant.ace_library {\ color: rgb(6, 150, 14);\ }\ \ .ace-chrome .ace_line .ace_invalid {\ background-color: rgb(153, 0, 0);\ color: white;\ }\ \ .ace-chrome .ace_line .ace_fold {\ }\ \ .ace-chrome .ace_line .ace_support.ace_function {\ color: rgb(60, 76, 114);\ }\ \ .ace-chrome .ace_line .ace_support.ace_constant {\ color: rgb(6, 150, 14);\ }\ \ .ace-chrome .ace_line .ace_support.ace_type,\ .ace-chrome .ace_line .ace_support.ace_class {\ color: rgb(109, 121, 222);\ }\ \ .ace-chrome .ace_variable.ace_parameter {\ font-style:italic;\ color:#FD971F;\ }\ .ace-chrome .ace_line .ace_keyword.ace_operator {\ color: rgb(104, 118, 135);\ }\ \ .ace-chrome .ace_line .ace_comment {\ color: #236e24;\ }\ \ .ace-chrome .ace_line .ace_comment.ace_doc {\ color: #236e24;\ }\ \ .ace-chrome .ace_line .ace_comment.ace_doc.ace_tag {\ color: #236e24;\ }\ \ .ace-chrome .ace_line .ace_constant.ace_numeric {\ color: rgb(0, 0, 205);\ }\ \ .ace-chrome .ace_line .ace_variable {\ color: rgb(49, 132, 149);\ }\ \ .ace-chrome .ace_line .ace_xml_pe {\ color: rgb(104, 104, 91);\ }\ \ .ace-chrome .ace_entity.ace_name.ace_function {\ color: #0000A2;\ }\ \ .ace-chrome .ace_markup.ace_markupine {\ text-decoration:underline;\ }\ \ .ace-chrome .ace_markup.ace_heading {\ color: rgb(12, 7, 255);\ }\ \ .ace-chrome .ace_markup.ace_list {\ color:rgb(185, 6, 144);\ }\ \ .ace-chrome .ace_marker-layer .ace_selection {\ background: rgb(181, 213, 255);\ }\ \ .ace-chrome .ace_marker-layer .ace_step {\ background: rgb(252, 255, 0);\ }\ \ .ace-chrome .ace_marker-layer .ace_stack {\ background: rgb(164, 229, 101);\ }\ \ .ace-chrome .ace_marker-layer .ace_bracket {\ margin: -1px 0 0 -1px;\ border: 1px solid rgb(192, 192, 192);\ }\ \ .ace-chrome .ace_marker-layer .ace_active_line {\ background: rgba(0, 0, 0, 0.07);\ }\ \ .ace-chrome .ace_marker-layer .ace_selected_word {\ background: rgb(250, 250, 255);\ border: 1px solid rgb(200, 200, 250);\ }\ \ .ace-chrome .ace_storage,\ .ace-chrome .ace_line .ace_keyword,\ .ace-chrome .ace_meta.ace_tag {\ color: rgb(147, 15, 128);\ }\ \ .ace-chrome .ace_string.ace_regex {\ color: rgb(255, 0, 0)\ }\ \ .ace-chrome .ace_line .ace_string,\ .ace-chrome .ace_entity.ace_other.ace_attribute-name{\ color: #994409;\ }"; var dom = require("../lib/dom"); dom.importCssString(exports.cssText, exports.cssClass); });
'use strict'; var yaml = require('js-yaml'); var fs = require('hexo-fs'); var pathFn = require('path'); function configConsole(args){ /* jshint validthis: true */ var key = args._[0]; var value = args._[1]; var self = this; if (!key){ console.log(this.config); return; } if (!value){ value = getProperty(this.config, key); if (value) console.log(value); return; } var configPath = this.config_path; var extname = pathFn.extname(configPath); return fs.exists(configPath).then(function(exist){ if (!exist) return {}; return self.render.render({path: configPath}); }).then(function(config){ if (!config) config = {}; var result = ''; setProperty(config, key, castValue(value)); if (extname === '.json'){ result = JSON.stringify(config); } else { result = yaml.safeDump(config); } return fs.writeFile(configPath, result); }); } function getProperty(obj, key){ var split = key.split('.'); var result = obj[split[0]]; for (var i = 1, len = split.length; i < len; i++){ result = result[split[i]]; } return result; } function setProperty(obj, key, value){ var split = key.split('.'); var cursor = obj; var name = ''; var lastKey = split.pop(); for (var i = 0, len = split.length; i < len; i++){ name = split[i]; cursor = cursor[name] = cursor[name] || {}; } cursor[lastKey] = value; } function castValue(value){ switch (value){ case 'true': return true; case 'false': return false; case 'null': return null; case 'undefined': return undefined; } var num = Number(value); if (!isNaN(num)) return num; return value; } module.exports = configConsole;
var getTag = require('./_getTag'), isObjectLike = require('./isObjectLike'); /** `Object#toString` result references. */ var setTag = '[object Set]'; /** * Checks if `value` is classified as a `Set` object. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @example * * _.isSet(new Set); * // => true * * _.isSet(new WeakSet); * // => false */ function isSet(value) { return isObjectLike(value) && getTag(value) == setTag; } module.exports = isSet;
'use strict'; /** * Module dependencies. */ var passport = require('passport'), LinkedInStrategy = require('passport-linkedin').Strategy, config = require('../config'), users = require('../../app/controllers/users.server.controller'); module.exports = function() { // Use linkedin strategy passport.use(new LinkedInStrategy({ consumerKey: config.linkedin.clientID, consumerSecret: config.linkedin.clientSecret, callbackURL: config.linkedin.callbackURL, passReqToCallback: true, profileFields: ['id', 'first-name', 'last-name', 'email-address'] }, function(req, accessToken, refreshToken, profile, done) { // Set the provider data and include tokens var providerData = profile._json; providerData.accessToken = accessToken; providerData.refreshToken = refreshToken; // Create the user OAuth profile var providerUserProfile = { firstName: profile.name.givenName, lastName: profile.name.familyName, displayName: profile.displayName, email: profile.emails[0].value, username: profile.username, provider: 'linkedin', providerIdentifierField: 'id', providerData: providerData }; // Save the user OAuth profile users.saveOAuthUserProfile(req, providerUserProfile, done); } )); };
function override(target, key, descriptor) { descriptor.initializer = function () { return "lol"; }; } var obj = { @override foo: "bar", bar: "heh" }; assert.equal(obj.foo, "lol"); assert.equal(obj.bar, "heh");
/** * @author mikael emtinger / http://gomo.se/ */ THREE.ShaderFlares = { 'lensFlareVertexTexture': { vertexShader: [ "uniform lowp int renderType;", "uniform vec3 screenPosition;", "uniform vec2 scale;", "uniform float rotation;", "uniform sampler2D occlusionMap;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "varying float vVisibility;", "void main() {", "vUV = uv;", "vec2 pos = position;", "if( renderType == 2 ) {", "vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );", "visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );", "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );", "vVisibility = visibility.r / 9.0;", "vVisibility *= 1.0 - visibility.g / 9.0;", "vVisibility *= visibility.b / 9.0;", "vVisibility *= 1.0 - visibility.a / 9.0;", "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;", "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;", "}", "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );", "}" ].join( "\n" ), fragmentShader: [ "uniform lowp int renderType;", "uniform sampler2D map;", "uniform float opacity;", "uniform vec3 color;", "varying vec2 vUV;", "varying float vVisibility;", "void main() {", // pink square "if( renderType == 0 ) {", "gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );", // restore "} else if( renderType == 1 ) {", "gl_FragColor = texture2D( map, vUV );", // flare "} else {", "vec4 texture = texture2D( map, vUV );", "texture.a *= opacity * vVisibility;", "gl_FragColor = texture;", "gl_FragColor.rgb *= color;", "}", "}" ].join( "\n" ) }, 'lensFlare': { vertexShader: [ "uniform lowp int renderType;", "uniform vec3 screenPosition;", "uniform vec2 scale;", "uniform float rotation;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "void main() {", "vUV = uv;", "vec2 pos = position;", "if( renderType == 2 ) {", "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;", "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;", "}", "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );", "}" ].join( "\n" ), fragmentShader: [ "precision mediump float;", "uniform lowp int renderType;", "uniform sampler2D map;", "uniform sampler2D occlusionMap;", "uniform float opacity;", "uniform vec3 color;", "varying vec2 vUV;", "void main() {", // pink square "if( renderType == 0 ) {", "gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );", // restore "} else if( renderType == 1 ) {", "gl_FragColor = texture2D( map, vUV );", // flare "} else {", "float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;", "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;", "visibility = ( 1.0 - visibility / 4.0 );", "vec4 texture = texture2D( map, vUV );", "texture.a *= opacity * visibility;", "gl_FragColor = texture;", "gl_FragColor.rgb *= color;", "}", "}" ].join( "\n" ) } };
/*! UIkit 2.14.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ (function($, UI) { "use strict"; var scrollpos = {x: window.scrollX, y: window.scrollY}, $win = UI.$win, $doc = UI.$doc, $html = UI.$html, Offcanvas = { show: function(element) { element = UI.$(element); if (!element.length) return; var $body = UI.$('body'), bar = element.find(".@-offcanvas-bar:first"), rtl = (UI.langdirection == "right"), flip = bar.hasClass("@-offcanvas-bar-flip") ? -1:1, dir = flip * (rtl ? -1 : 1); scrollpos = {x: window.pageXOffset, y: window.pageYOffset}; element.addClass("@-active"); $body.css({"width": window.innerWidth, "height": window.innerHeight}).addClass("@-offcanvas-page"); $body.css((rtl ? "margin-right" : "margin-left"), (rtl ? -1 : 1) * (bar.outerWidth() * dir)).width(); // .width() - force redraw $html.css('margin-top', scrollpos.y * -1); bar.addClass("@-offcanvas-bar-show"); this._initElement(element); $doc.trigger('show.uk.offcanvas', [element, bar]); }, hide: function(force) { var $body = UI.$('body'), panel = UI.$(".@-offcanvas.@-active"), rtl = (UI.langdirection == "right"), bar = panel.find(".@-offcanvas-bar:first"), finalize = function() { $body.removeClass("@-offcanvas-page").css({"width": "", "height": "", "margin-left": "", "margin-right": ""}); panel.removeClass("@-active"); bar.removeClass("@-offcanvas-bar-show"); $html.css('margin-top', ''); window.scrollTo(scrollpos.x, scrollpos.y); UI.$doc.trigger('hide.uk.offcanvas', [panel, bar]); }; if (!panel.length) return; if (UI.support.transition && !force) { $body.one(UI.support.transition.end, function() { finalize(); }).css((rtl ? "margin-right" : "margin-left"), ""); setTimeout(function(){ bar.removeClass("@-offcanvas-bar-show"); }, 0); } else { finalize(); } }, _initElement: function(element) { if (element.data("OffcanvasInit")) return; element.on("click.uk.offcanvas swipeRight.uk.offcanvas swipeLeft.uk.offcanvas", function(e) { var target = UI.$(e.target); if (!e.type.match(/swipe/)) { if (!target.hasClass("@-offcanvas-close")) { if (target.hasClass("@-offcanvas-bar")) return; if (target.parents(".@-offcanvas-bar:first").length) return; } } e.stopImmediatePropagation(); Offcanvas.hide(); }); element.on("click", "a[href^='#']", function(e){ var element = $(this), href = element.attr("href"); if (href == "#") { return; } UI.$doc.one('hide.uk.offcanvas', function() { var target = $(href); if (!target.length) { target = UI.$('[name="'+href.replace('#','')+'"]'); } if (UI.Utils.scrollToElement && target.length) { UI.Utils.scrollToElement(target); } else { window.location.href = href; } }); Offcanvas.hide(); }); element.data("OffcanvasInit", true); } }; UI.component('offcanvasTrigger', { boot: function() { // init code $html.on("click.offcanvas.uikit", "[data-@-offcanvas]", function(e) { e.preventDefault(); var ele = UI.$(this); if (!ele.data("offcanvasTrigger")) { var obj = UI.offcanvasTrigger(ele, UI.Utils.options(ele.attr("data-@-offcanvas"))); ele.trigger("click"); } }); $html.on('keydown.uk.offcanvas', function(e) { if (e.keyCode === 27) { // ESC Offcanvas.hide(); } }); }, init: function() { var $this = this; this.options = $.extend({ "target": $this.element.is("a") ? $this.element.attr("href") : false }, this.options); this.on("click", function(e) { e.preventDefault(); Offcanvas.show($this.options.target); }); } }); UI.offcanvas = Offcanvas; })(jQuery, UIkit);
function pug_escape(e) { var a = "" + e, t = pug_match_html.exec(a); if (!t) return e; var r, c, n, s = ""; for (r = t.index, c = 0; r < a.length; r++) { switch (a.charCodeAt(r)) { case 34: n = "&quot;"; break; case 38: n = "&amp;"; break; case 60: n = "&lt;"; break; case 62: n = "&gt;"; break; default: continue; } c !== r && (s += a.substring(c, r)), c = r + 1, s += n; } return c !== r ? s + a.substring(c, r) : s; } var pug_match_html = /["&<>]/; function template(locals) { var pug_html = "", pug_mixins = {}, pug_interp; pug_html = pug_html + "<html><body>"; var friends = 1; switch (friends) { case 0: pug_html = pug_html + "<p>you have no friends</p>"; break; case 1: pug_html = pug_html + "<p>you have a friend</p>"; break; default: pug_html = pug_html + "<p>you have " + pug_escape(null == (pug_interp = friends) ? "" : pug_interp) + " friends</p>"; break; } pug_html = pug_html + "</body></html>"; return pug_html; }
/* https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Object_Manipulation_Statements https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Statements/for_each...in */ for each (var item in obj) { sum += item; }
/* Copyright © 2001-2004 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University). All Rights Reserved. This work is distributed under the W3C® Software License [1] in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 */ /** * Gets URI that identifies the test. * @return uri identifier of test */ function getTargetURI() { return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeelementnodetype"; } var docsLoaded = -1000000; var builder = null; // // This function is called by the testing framework before // running the test suite. // // If there are no configuration exceptions, asynchronous // document loading is started. Otherwise, the status // is set to complete and the exception is immediately // raised when entering the body of the test. // function setUpPage() { setUpPageStatus = 'running'; try { // // creates test document builder, may throw exception // builder = createConfiguredBuilder(); docsLoaded = 0; var docRef = null; if (typeof(this.doc) != 'undefined') { docRef = this.doc; } docsLoaded += preload(docRef, "doc", "hc_staff"); if (docsLoaded == 1) { setUpPageStatus = 'complete'; } } catch(ex) { catchInitializationError(builder, ex); setUpPageStatus = 'complete'; } } // // This method is called on the completion of // each asychronous load started in setUpTests. // // When every synchronous loaded document has completed, // the page status is changed which allows the // body of the test to be executed. function loadComplete() { if (++docsLoaded == 1) { setUpPageStatus = 'complete'; } } /** * The "getNodeType()" method for an Element Node returns the constant value 1. Retrieve the root node and invoke the "getNodeType()" method. The method should return 1. * @author Curt Arnold * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 */ function hc_nodeelementnodetype() { var success; if(checkInitialization(builder, "hc_nodeelementnodetype") != null) return; var doc; var rootNode; var nodeType; var docRef = null; if (typeof(this.doc) != 'undefined') { docRef = this.doc; } doc = load(docRef, "doc", "hc_staff"); rootNode = doc.documentElement; nodeType = rootNode.nodeType; assertEquals("nodeElementNodeTypeAssert1",1,nodeType); } function runTest() { hc_nodeelementnodetype(); }
// This methods allows the killing of built-in functions, // so the shim can take over with that implementation var HLP = (function() { "use strict"; var kill; kill = function(_class, methods) { /*if(!Array.isArray(methods)) return;*/ if(!_class.originals) _class.originals = {}; for (var i = 0, len = methods.length; i < len; i++) { var obj = methods[i]; _class.originals[obj] = _class[obj]; delete _class[obj]; if (obj in _class) { // try something more aggressive since V8 at least // appears to ignore the delete. _class[obj] = null; if (_class[obj]) { console.log("Couln't overwrite", obj, "of", _class); } } } }; return { kill: kill }; }()); HLP.kill(Function.prototype, [ 'bind' ]); HLP.kill(String.prototype, [ "trim" ]); HLP.kill(Number.prototype, [ 'toFixed' ]); HLP.kill(Date, [ 'now', 'parse' ]); HLP.kill(Date.prototype, [ "toJSON", "toISOString" ]); HLP.kill(Array.prototype, [ 'some', 'every', 'indexOf', 'lastIndexOf', 'reduce', 'reduceRight' ]); /* Kill a few more functions, unless we're running under node */ /* (these are used internally by 'require' in node) */ if (typeof process === 'undefined') { HLP.kill(Array, [ 'isArray' ]); HLP.kill(Object, [ 'keys' ]); HLP.kill(Array.prototype, [ 'forEach', 'map', 'filter', ]); }
/** * Copyright (c) 2014, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * https://raw.github.com/facebook/regenerator/master/LICENSE file. An * additional grant of patent rights can be found in the PATENTS file in * the same directory. */ "use strict"; var _interopRequireDefault = require("babel-runtime/helpers/interop-require-default")["default"]; var _interopRequireWildcard = require("babel-runtime/helpers/interop-require-wildcard")["default"]; var _assert = require("assert"); var _assert2 = _interopRequireDefault(_assert); var _babelTypes = require("babel-types"); var t = _interopRequireWildcard(_babelTypes); var _util = require("util"); function Entry() { _assert2["default"].ok(this instanceof Entry); } function FunctionEntry(returnLoc) { Entry.call(this); t.assertLiteral(returnLoc); this.returnLoc = returnLoc; } _util.inherits(FunctionEntry, Entry); exports.FunctionEntry = FunctionEntry; function LoopEntry(breakLoc, continueLoc, label) { Entry.call(this); t.assertLiteral(breakLoc); t.assertLiteral(continueLoc); if (label) { t.assertIdentifier(label); } else { label = null; } this.breakLoc = breakLoc; this.continueLoc = continueLoc; this.label = label; } _util.inherits(LoopEntry, Entry); exports.LoopEntry = LoopEntry; function SwitchEntry(breakLoc) { Entry.call(this); t.assertLiteral(breakLoc); this.breakLoc = breakLoc; } _util.inherits(SwitchEntry, Entry); exports.SwitchEntry = SwitchEntry; function TryEntry(firstLoc, catchEntry, finallyEntry) { Entry.call(this); t.assertLiteral(firstLoc); if (catchEntry) { _assert2["default"].ok(catchEntry instanceof CatchEntry); } else { catchEntry = null; } if (finallyEntry) { _assert2["default"].ok(finallyEntry instanceof FinallyEntry); } else { finallyEntry = null; } // Have to have one or the other (or both). _assert2["default"].ok(catchEntry || finallyEntry); this.firstLoc = firstLoc; this.catchEntry = catchEntry; this.finallyEntry = finallyEntry; } _util.inherits(TryEntry, Entry); exports.TryEntry = TryEntry; function CatchEntry(firstLoc, paramId) { Entry.call(this); t.assertLiteral(firstLoc); t.assertIdentifier(paramId); this.firstLoc = firstLoc; this.paramId = paramId; } _util.inherits(CatchEntry, Entry); exports.CatchEntry = CatchEntry; function FinallyEntry(firstLoc, afterLoc) { Entry.call(this); t.assertLiteral(firstLoc); t.assertLiteral(afterLoc); this.firstLoc = firstLoc; this.afterLoc = afterLoc; } _util.inherits(FinallyEntry, Entry); exports.FinallyEntry = FinallyEntry; function LabeledEntry(breakLoc, label) { Entry.call(this); t.assertLiteral(breakLoc); t.assertIdentifier(label); this.breakLoc = breakLoc; this.label = label; } _util.inherits(LabeledEntry, Entry); exports.LabeledEntry = LabeledEntry; function LeapManager(emitter) { _assert2["default"].ok(this instanceof LeapManager); var Emitter = require("./emit").Emitter; _assert2["default"].ok(emitter instanceof Emitter); this.emitter = emitter; this.entryStack = [new FunctionEntry(emitter.finalLoc)]; } var LMp = LeapManager.prototype; exports.LeapManager = LeapManager; LMp.withEntry = function (entry, callback) { _assert2["default"].ok(entry instanceof Entry); this.entryStack.push(entry); try { callback.call(this.emitter); } finally { var popped = this.entryStack.pop(); _assert2["default"].strictEqual(popped, entry); } }; LMp._findLeapLocation = function (property, label) { for (var i = this.entryStack.length - 1; i >= 0; --i) { var entry = this.entryStack[i]; var loc = entry[property]; if (loc) { if (label) { if (entry.label && entry.label.name === label.name) { return loc; } } else if (entry instanceof LabeledEntry) { // Ignore LabeledEntry entries unless we are actually breaking to // a label. } else { return loc; } } } return null; }; LMp.getBreakLoc = function (label) { return this._findLeapLocation("breakLoc", label); }; LMp.getContinueLoc = function (label) { return this._findLeapLocation("continueLoc", label); };
/* Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'stylescombo', 'hr', { label: 'Stil', panelTitle: 'Stilovi formatiranja', panelTitle1: 'Block stilovi', panelTitle2: 'Inline stilovi', panelTitle3: 'Object stilovi' });
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'codemirror', 'ca', { toolbar: 'Codi font', searchCode: 'Search Source', autoFormat: 'Format Selection', commentSelectedRange: 'Comment Selection', uncommentSelectedRange: 'Uncomment Selection', autoCompleteToggle: 'Enable/Disable HTML Tag Autocomplete' });
import {lineBreakG} from "./whitespace" // These are used when `options.locations` is on, for the // `startLoc` and `endLoc` properties. export class Position { constructor(line, col) { this.line = line this.column = col } offset(n) { return new Position(this.line, this.column + n) } } export class SourceLocation { constructor(p, start, end) { this.start = start this.end = end if (p.sourceFile !== null) this.source = p.sourceFile } } // The `getLineInfo` function is mostly useful when the // `locations` option is off (for performance reasons) and you // want to find the line/column position for a given character // offset. `input` should be the code string that the offset refers // into. export function getLineInfo(input, offset) { for (let line = 1, cur = 0;;) { lineBreakG.lastIndex = cur let match = lineBreakG.exec(input) if (match && match.index < offset) { ++line cur = match.index + match[0].length } else { return new Position(line, offset - cur) } } }
/* Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'link', 'km', { acccessKey: 'ឃី សំរាប់ចូល', advanced: 'កំរិតខ្ពស់', advisoryContentType: 'ប្រភេទអត្ថបទ ប្រឹក្សា', advisoryTitle: 'ចំណងជើង ប្រឹក្សា', anchor: { toolbar: 'បន្ថែម/កែប្រែ យុថ្កា', menu: 'ការកំណត់យុថ្កា', title: 'ការកំណត់យុថ្កា', name: 'ឈ្មោះយុទ្ធថ្កា', errorName: 'សូមសរសេរ ឈ្មោះយុទ្ធថ្កា', remove: 'Remove Anchor' }, anchorId: 'តាម Id', anchorName: 'តាមឈ្មោះរបស់យុថ្កា', charset: 'លេខកូតអក្សររបស់ឈ្នាប់', cssClasses: 'Stylesheet Classes', emailAddress: 'អ៊ីមែល', emailBody: 'អត្ថបទ', emailSubject: 'ចំណងជើងអត្ថបទ', id: 'Id', info: 'ពត៌មានអំពីឈ្នាប់', langCode: 'ទិសដៅភាសា', langDir: 'ទិសដៅភាសា', langDirLTR: 'ពីឆ្វេងទៅស្តាំ(LTR)', langDirRTL: 'ពីស្តាំទៅឆ្វេង(RTL)', menu: 'កែប្រែឈ្នាប់', name: 'ឈ្មោះ', noAnchors: '(No anchors available in the document)', // MISSING noEmail: 'សូមសរសេរ អាស័យដ្ឋាន អ៊ីមែល', noUrl: 'សូមសរសេរ អាស័យដ្ឋាន URL', other: '<other>', // MISSING popupDependent: 'អាស្រ័យលើ (Netscape)', popupFeatures: 'លក្ខណះរបស់វីនដូលលោត', popupFullScreen: 'អេក្រុងពេញ(IE)', popupLeft: 'ទីតាំងខាងឆ្វេង', popupLocationBar: 'របា ទីតាំង', popupMenuBar: 'របា មឺនុយ', popupResizable: 'Resizable', // MISSING popupScrollBars: 'របា ទាញ', popupStatusBar: 'របា ពត៌មាន', popupToolbar: 'របា ឩបករណ៍', popupTop: 'ទីតាំងខាងលើ', rel: 'Relationship', // MISSING selectAnchor: 'ជ្រើសរើសយុថ្កា', styles: 'ម៉ូត', tabIndex: 'លេខ Tab', target: 'គោលដៅ', targetFrame: '<ហ្វ្រេម>', targetFrameName: 'ឈ្មោះហ្រ្វេមដែលជាគោលដៅ', targetPopup: '<វីនដូវ លោត>', targetPopupName: 'ឈ្មោះវីនដូវលោត', title: 'ឈ្នាប់', toAnchor: 'យុថ្កានៅក្នុងទំព័រនេះ', toEmail: 'អ៊ីមែល', toUrl: 'URL', toolbar: 'បន្ថែម/កែប្រែ ឈ្នាប់', type: 'ប្រភេទឈ្នាប់', unlink: 'លប់ឈ្នាប់', upload: 'ទាញយក' });
/* */ module.exports = { "default": require("core-js/library/fn/function/part"), __esModule: true };
// We are not going to port this
/** * Control.js * * Copyright 2009, Moxiecode Systems AB * Released under LGPL License. * * License: http://tinymce.moxiecode.com/license * Contributing: http://tinymce.moxiecode.com/contributing */ (function(tinymce) { // Shorten class names var DOM = tinymce.DOM, is = tinymce.is; /** * This class is the base class for all controls like buttons, toolbars, containers. This class should not * be instantiated directly other controls should inherit from this one. * * @class tinymce.ui.Control */ tinymce.create('tinymce.ui.Control', { /** * Constructs a new control instance. * * @constructor * @method Control * @param {String} id Control id. * @param {Object} s Optional name/value settings object. */ Control : function(id, s, editor) { this.id = id; this.settings = s = s || {}; this.rendered = false; this.onRender = new tinymce.util.Dispatcher(this); this.classPrefix = ''; this.scope = s.scope || this; this.disabled = 0; this.active = 0; this.editor = editor; }, setAriaProperty : function(property, value) { var element = DOM.get(this.id + '_aria') || DOM.get(this.id); if (element) { DOM.setAttrib(element, 'aria-' + property, !!value); } }, focus : function() { DOM.get(this.id).focus(); }, /** * Sets the disabled state for the control. This will add CSS classes to the * element that contains the control. So that it can be disabled visually. * * @method setDisabled * @param {Boolean} s Boolean state if the control should be disabled or not. */ setDisabled : function(s) { if (s != this.disabled) { this.setAriaProperty('disabled', s); this.setState('Disabled', s); this.setState('Enabled', !s); this.disabled = s; } }, /** * Returns true/false if the control is disabled or not. This is a method since you can then * choose to check some class or some internal bool state in subclasses. * * @method isDisabled * @return {Boolean} true/false if the control is disabled or not. */ isDisabled : function() { return this.disabled; }, /** * Sets the activated state for the control. This will add CSS classes to the * element that contains the control. So that it can be activated visually. * * @method setActive * @param {Boolean} s Boolean state if the control should be activated or not. */ setActive : function(s) { if (s != this.active) { this.setState('Active', s); this.active = s; this.setAriaProperty('pressed', s); } }, /** * Returns true/false if the control is disabled or not. This is a method since you can then * choose to check some class or some internal bool state in subclasses. * * @method isActive * @return {Boolean} true/false if the control is disabled or not. */ isActive : function() { return this.active; }, /** * Sets the specified class state for the control. * * @method setState * @param {String} c Class name to add/remove depending on state. * @param {Boolean} s True/false state if the class should be removed or added. */ setState : function(c, s) { var n = DOM.get(this.id); c = this.classPrefix + c; if (s) DOM.addClass(n, c); else DOM.removeClass(n, c); }, /** * Returns true/false if the control has been rendered or not. * * @method isRendered * @return {Boolean} State if the control has been rendered or not. */ isRendered : function() { return this.rendered; }, /** * Renders the control as a HTML string. This method is much faster than using the DOM and when * creating a whole toolbar with buttons it does make a lot of difference. * * @method renderHTML * @return {String} HTML for the button control element. */ renderHTML : function() { }, /** * Renders the control to the specified container element. * * @method renderTo * @param {Element} n HTML DOM element to add control to. */ renderTo : function(n) { DOM.setHTML(n, this.renderHTML()); }, /** * Post render event. This will be executed after the control has been rendered and can be used to * set states, add events to the control etc. It's recommended for subclasses of the control to call this method by using this.parent(). * * @method postRender */ postRender : function() { var t = this, b; // Set pending states if (is(t.disabled)) { b = t.disabled; t.disabled = -1; t.setDisabled(b); } if (is(t.active)) { b = t.active; t.active = -1; t.setActive(b); } }, /** * Removes the control. This means it will be removed from the DOM and any * events tied to it will also be removed. * * @method remove */ remove : function() { DOM.remove(this.id); this.destroy(); }, /** * Destroys the control will free any memory by removing event listeners etc. * * @method destroy */ destroy : function() { tinymce.dom.Event.clear(this.id); } }); })(tinymce);
/* * /MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/PhoneticExtensions.js * * Copyright (c) 2009-2017 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.Hub.Insert(MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS.STIXGeneral,{7424:[468,0,510,15,495],7431:[464,0,504,21,481],7452:[464,14,583,21,560],7553:[683,287,528,27,491],7556:[683,287,542,7,505],7557:[683,287,294,19,257],7562:[459,287,389,51,348],7565:[450,287,516,17,479],7566:[450,287,453,27,416],7576:[755,-425,441,57,387],7587:[757,-279,480,64,398]});MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir+"/General/Regular/PhoneticExtensions.js");
module.exports['crlf.http'] = [ {type: 'file', name: 'upload', filename: 'plain.txt', fixture: 'plain.txt', sha1: 'b31d07bac24ac32734de88b3687dddb10e976872'}, ]; module.exports['preamble.http'] = [ {type: 'file', name: 'upload', filename: 'plain.txt', fixture: 'plain.txt', sha1: 'b31d07bac24ac32734de88b3687dddb10e976872'}, ];
/* * /MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsUpSm/Regular/All.js * * Copyright (c) 2010 Design Science, Inc. * * Part of the MathJax library. * See http://www.mathjax.org for details. * * Licensed under the Apache License, Version 2.0; * you may not use this file except in compliance with the License. * * http://www.apache.org/licenses/LICENSE-2.0 */ MathJax.Hub.Insert(MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS.STIXIntegralsUpSm,{32:[0,0,250,0,0],160:[0,0,250,0,0],8748:[690,189,587,52,605],8749:[690,189,817,52,835],8751:[690,189,682,52,642],8752:[690,189,909,52,869],8753:[690,189,480,52,447],8754:[690,189,480,52,448],8755:[690,189,480,52,470],10763:[694,190,556,41,515],10764:[694,190,1044,68,1081],10765:[694,190,420,68,391],10766:[694,190,420,68,391],10767:[694,190,520,39,482],10768:[694,190,324,41,380],10769:[694,190,480,52,447],10770:[694,190,450,68,410],10771:[690,189,450,68,412],10772:[690,189,550,68,512],10773:[690,189,450,50,410],10774:[694,191,450,50,410],10775:[694,190,611,12,585],10776:[694,190,450,48,412],10777:[694,190,450,59,403],10778:[694,190,450,59,403],10779:[784,189,379,68,416],10780:[690,283,357,52,400]});MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir+"/IntegralsUpSm/Regular/All.js");
// ** I18N // Calendar pt-BR language // Author: Fernando Dourado, <fernando.dourado@ig.com.br> // Encoding: any // Distributed under the same terms as the calendar itself. // For translators: please use UTF-8 if possible. We strongly believe that // Unicode is the answer to a real internationalized world. Also please // include your contact information in the header, as can be seen above. // full day names Calendar._DN = new Array ("Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sabádo", "Domingo"); // Please note that the following array of short day names (and the same goes // for short month names, _SMN) isn't absolutely necessary. We give it here // for exemplification on how one can customize the short day names, but if // they are simply the first N letters of the full name you can simply say: // // Calendar._SDN_len = N; // short day name length // Calendar._SMN_len = N; // short month name length // // If N = 3 then this is not needed either since we assume a value of 3 if not // present, to be compatible with translation files that were written before // this feature. // short day names // [No changes using default values] // full month names Calendar._MN = new Array ("Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"); // short month names // [No changes using default values] // tooltips Calendar._TT = {}; Calendar._TT["INFO"] = "Sobre o calendário"; Calendar._TT["ABOUT"] = "DHTML Date/Time Selector\n" + "(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) "For latest version visit: http://www.dynarch.com/projects/calendar/\n" + "Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + "\n\n" + "Translate to portuguese Brazil (pt-BR) by Fernando Dourado (fernando.dourado@ig.com.br)\n" + "Tradução para o português Brasil (pt-BR) por Fernando Dourado (fernando.dourado@ig.com.br)" + "\n\n" + "Selecionar data:\n" + "- Use as teclas \xab, \xbb para selecionar o ano\n" + "- Use as teclas " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " para selecionar o mês\n" + "- Clique e segure com o mouse em qualquer botão para selecionar rapidamente."; Calendar._TT["ABOUT_TIME"] = "\n\n" + "Selecionar hora:\n" + "- Clique em qualquer uma das partes da hora para aumentar\n" + "- ou Shift-clique para diminuir\n" + "- ou clique e arraste para selecionar rapidamente."; Calendar._TT["PREV_YEAR"] = "Ano anterior (clique e segure para menu)"; Calendar._TT["PREV_MONTH"] = "Mês anterior (clique e segure para menu)"; Calendar._TT["GO_TODAY"] = "Ir para a data atual"; Calendar._TT["NEXT_MONTH"] = "Próximo mês (clique e segure para menu)"; Calendar._TT["NEXT_YEAR"] = "Próximo ano (clique e segure para menu)"; Calendar._TT["SEL_DATE"] = "Selecione uma data"; Calendar._TT["DRAG_TO_MOVE"] = "Clique e segure para mover"; Calendar._TT["PART_TODAY"] = " (hoje)"; // the following is to inform that "%s" is to be the first day of week // %s will be replaced with the day name. Calendar._TT["DAY_FIRST"] = "Exibir %s primeiro"; // This may be locale-dependent. It specifies the week-end days, as an array // of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 // means Monday, etc. Calendar._TT["WEEKEND"] = "0,6"; Calendar._TT["CLOSE"] = "Fechar"; Calendar._TT["TODAY"] = "Hoje"; Calendar._TT["TIME_PART"] = "(Shift-)Clique ou arraste para mudar o valor"; // date formats Calendar._TT["DEF_DATE_FORMAT"] = "%d/%m/%Y"; Calendar._TT["TT_DATE_FORMAT"] = "%d de %B de %Y"; Calendar._TT["WK"] = "sem"; Calendar._TT["TIME"] = "Hora:";
"use strict"; var levels = require('./levels') , util = require('util') , events = require('events') , DEFAULT_CATEGORY = '[default]'; var logWritesEnabled = true; /** * Models a logging event. * @constructor * @param {String} categoryName name of category * @param {Log4js.Level} level level of message * @param {Array} data objects to log * @param {Log4js.Logger} logger the associated logger * @author Seth Chisamore */ function LoggingEvent (categoryName, level, data, logger) { this.startTime = new Date(); this.categoryName = categoryName; this.data = data; this.level = level; this.logger = logger; } /** * Logger to log messages. * use {@see Log4js#getLogger(String)} to get an instance. * @constructor * @param name name of category to log to * @author Stephan Strittmatter */ function Logger (name, level) { this.category = name || DEFAULT_CATEGORY; if (level) { this.setLevel(level); } } util.inherits(Logger, events.EventEmitter); Logger.DEFAULT_CATEGORY = DEFAULT_CATEGORY; Logger.prototype.level = levels.TRACE; Logger.prototype.setLevel = function(level) { this.level = levels.toLevel(level, this.level || levels.TRACE); }; Logger.prototype.removeLevel = function() { delete this.level; }; Logger.prototype.log = function() { var logLevel = levels.toLevel(arguments[0], levels.INFO); if (!this.isLevelEnabled(logLevel)) { return; } var numArgs = arguments.length - 1; var args = new Array(numArgs); for (var i = 0; i < numArgs; i++) { args[i] = arguments[i + 1]; } this._log(logLevel, args); }; Logger.prototype.isLevelEnabled = function(otherLevel) { return this.level.isLessThanOrEqualTo(otherLevel); }; ['Trace','Debug','Info','Warn','Error','Fatal', 'Mark'].forEach( function(levelString) { addLevelMethods(levelString); } ); function addLevelMethods(level) { level = levels.toLevel(level); var levelStrLower = level.toString().toLowerCase(); var levelMethod = levelStrLower.replace(/_([a-z])/g, function(g) { return g[1].toUpperCase(); } ); var isLevelMethod = levelMethod[0].toUpperCase() + levelMethod.slice(1); Logger.prototype['is'+isLevelMethod+'Enabled'] = function() { return this.isLevelEnabled(level.toString()); }; Logger.prototype[levelMethod] = function () { if (logWritesEnabled && this.isLevelEnabled(level)) { var numArgs = arguments.length; var args = new Array(numArgs); for (var i = 0; i < numArgs; i++) { args[i] = arguments[i]; } this._log(level, args); } }; } Logger.prototype._log = function(level, data) { var loggingEvent = new LoggingEvent(this.category, level, data, this); this.emit('log', loggingEvent); }; /** * Disable all log writes. * @returns {void} */ function disableAllLogWrites() { logWritesEnabled = false; } /** * Enable log writes. * @returns {void} */ function enableAllLogWrites() { logWritesEnabled = true; } exports.LoggingEvent = LoggingEvent; exports.Logger = Logger; exports.disableAllLogWrites = disableAllLogWrites; exports.enableAllLogWrites = enableAllLogWrites; exports.addLevelMethods = addLevelMethods;
var inst = require("../index").getInstance(); inst.applyConfig({ debug: true, filter: "debug" }); module.exports = inst.use("dial");
/*! * Qoopido.js library v3.5.7, 2014-10-14 * https://github.com/dlueth/qoopido.js * (c) 2014 Dirk Lueth * Dual licensed under MIT and GPL */ !function(o){window.qoopido.register("support/css/boxshadow",o,["../../support"])}(function(o){"use strict";return o.support.addTest("/css/boxshadow",function(s){o.support.supportsCssProperty("box-shadow")?s.resolve(o.support.getCssProperty("box-shadow")):s.reject()})});
'use strict'; var path = require('path'); var fileRe = require('filename-regex'); var win32 = process && process.platform === 'win32'; var utils = require('lazy-cache')(require); /** * Temporarily re-assign require to trick browserify * into recognizing lazy-cached deps. */ var fn = require; require = utils; /** * Lazily required module dependencies */ require('arr-diff', 'diff'); require('array-unique', 'unique'); require('braces'); require('expand-brackets', 'brackets'); require('extglob'); require('is-extglob'); require('is-glob', 'isGlob'); require('kind-of', 'typeOf'); require('normalize-path', 'normalize'); require('object.omit', 'omit'); require('parse-glob'); require('regex-cache', 'cache'); /** * Get the filename of a filepath * * @param {String} `string` * @return {String} */ utils.filename = function filename(fp) { var seg = fp.match(fileRe()); return seg && seg[0]; }; /** * Returns a function that returns true if the given * pattern is the same as a given `filepath` * * @param {String} `pattern` * @return {Function} */ utils.isPath = function isPath(pattern, opts) { return function (fp) { return pattern === utils.unixify(fp, opts); }; }; /** * Returns a function that returns true if the given * pattern contains a `filepath` * * @param {String} `pattern` * @return {Function} */ utils.hasPath = function hasPath(pattern, opts) { return function (fp) { return utils.unixify(pattern, opts).indexOf(fp) !== -1; }; }; /** * Returns a function that returns true if the given * pattern matches or contains a `filepath` * * @param {String} `pattern` * @return {Function} */ utils.matchPath = function matchPath(pattern, opts) { var fn = (opts && opts.contains) ? utils.hasPath(pattern, opts) : utils.isPath(pattern, opts); return fn; }; /** * Returns a function that returns true if the given * regex matches the `filename` of a file path. * * @param {RegExp} `re` * @return {Boolean} */ utils.hasFilename = function hasFilename(re) { return function (fp) { var name = utils.filename(fp); return name && re.test(name); }; }; /** * Coerce `val` to an array * * @param {*} val * @return {Array} */ utils.arrayify = function arrayify(val) { return !Array.isArray(val) ? [val] : val; }; /** * Normalize all slashes in a file path or glob pattern to * forward slashes. */ utils.unixify = function unixify(fp, opts) { if (opts && opts.unixify === false) return fp; if (opts && opts.unixify === true || win32 || path.sep === '\\') { return utils.normalize(fp, false); } if (opts && opts.unescape === true) { return fp ? fp.toString().replace(/\\(\w)/g, '$1') : ''; } return fp; }; /** * Escape/unescape utils */ utils.escapePath = function escapePath(fp) { return fp.replace(/[\\.]/g, '\\$&'); }; utils.unescapeGlob = function unescapeGlob(fp) { return fp.replace(/[\\"']/g, ''); }; utils.escapeRe = function escapeRe(str) { return str.replace(/[-[\\$*+?.#^\s{}(|)\]]/g, '\\$&'); }; /** * Restore `require` */ require = fn; /** * Expose `utils` */ module.exports = utils;
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "AM", "PM" ], "DAY": [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], "ERANAMES": [ "Before Christ", "Anno Domini" ], "ERAS": [ "BC", "AD" ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], "SHORTDAY": [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], "SHORTMONTH": [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], "STANDALONEMONTH": [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE, d MMMM y", "longDate": "d MMMM y", "medium": "d MMM y HH:mm:ss", "mediumDate": "d MMM y", "mediumTime": "HH:mm:ss", "short": "dd/MM/y HH:mm", "shortDate": "dd/MM/y", "shortTime": "HH:mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "$", "DECIMAL_SEP": ".", "GROUP_SEP": ",", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "-\u00a4", "negSuf": "", "posPre": "\u00a4", "posSuf": "" } ] }, "id": "en-tv", "localeID": "en_TV", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
const Joi = require('joi'); module.exports = { POST_USER_SIGNUP: Joi.object().keys({ handle: Joi.string(), password: Joi.string().regex(/^[a-zA-Z0-9]{8,128}$/).required(), email: Joi.string().email().required() }), POST_USER_SIGNIN: Joi.object().keys({password: Joi.string().required(), email: Joi.string().email().required()}), };
/** * Created by cthed on 25/02/2016. * this module will render a chart doughnut for json response fromm web */ /** * * @type {*[]} data */ var data = [ { value: 61, color: "#09355C", label: "Label 1" }, { value: 11, color: "#CBCBCB", label: "Label 2" }, { value: 28, color: "#B61B12", label: "Label 3" }]; /** * * @type {{segmentShowStroke: boolean, animateRotate: boolean, animateScale: boolean, percentageInnerCutout: number, tooltipTemplate: string}} options * */ var options = { segmentShowStroke: false, animateRotate: true, animateScale: false, percentageInnerCutout: 50, tooltipTemplate: "<%= value %>%" } var ctx = document.getElementById("myChart").getContext("2d"); var myChart = new Chart(ctx).Doughnut(data, options); // Note - tooltipTemplate is for the string that shows in the tooltip // legendTemplate is if you want to generate an HTML legend for the chart and use somewhere else on the page // e.g: document.getElementById('js-legend').innerHTML = myChart.generateLegend();
import { ZoneId, ZonedDateTime, Duration, LocalTime } from 'js-joda'; import { Map as ImmutableMap } from 'immutable'; import { handle } from 'redux-pack'; import * as Actions from 'app/store/action/application'; import { LOAD as LOAD_CALENDARS } from 'app/store/action/calendars'; const INITIAL_STATE = new ImmutableMap({ touch_capable: false, time_zone: ZoneId.systemDefault(), last_activity: ZonedDateTime.now(), is_idle: false, time: ZonedDateTime.now(), agenda_config: new ImmutableMap({ day_length: Duration.ofHours(11), grid_step: Duration.ofMinutes(30), start_of_agenda: LocalTime.of(8), nav_header_height: '10vh' }) }); const agenda_config_keys = [...INITIAL_STATE.get('agenda_config').keys()]; export default function (state = INITIAL_STATE, action = null) { switch (action.type) { case LOAD_CALENDARS: { return handle(state, action, { success(prev_state) { return state.set('time_zone', ZoneId.of(action.payload.time_zone)); } }); } case Actions.SET_TOUCH_CAPABILITY: { return state.set('touch_capable', action.payload); } case Actions.LAST_ACTIVITY: { return state.set('last_activity', state.get('time')); } case Actions.SET_IDLE: { return state.set('is_idle', true); } case Actions.UNSET_IDLE: { return state.set('is_idle', false); } case Actions.SET_TIME: { return state.set('time', action.payload); } case Actions.CONFIGURE_AGENDA: { return agenda_config_keys .filter(key => action.payload[key] !== undefined) .reduce((s, key) => s.setIn(['agenda_config', key], action.payload[key]), state); } default: return state; } }
'use strict'; var express = require('express'); var router = express.Router(); var models = require('../../models'); /* GET list pages */ router.get('/', function(req, res, next) { models.Page.findAll({ include: [models.NavigationItem] }).then(function(pages) { res.render('admin/pages/index', { title: 'Pages', pages: pages }); }); }); /* GET page */ router.get('/:id', function(req, res, next) { models.Page.find(req.params.id).then(function(page) { if (!page) { return next(); } res.render('admin/pages/view', {title: page.title, page:page}); }); }); /* POST create page */ router.post('/', function(req, res, next) { var data = { title: req.body.title, url: req.body.url, content: req.body.content || null, enabled: !!req.body.enabled }; models.Page.create(data).then(function(page) { req.flash('success', 'The page has been created!'); res.redirect('/admin/pages/' + page.id + '/edit'); }).catch(function(err) { req.session.formData = data; req.flash('danger', err.errors[0].message); res.redirect('/admin/pages/new'); }); }); /* GET new page */ router.get('/new', function(req, res, next) { var data = req.session.formData; delete req.session.formData; res.render('admin/pages/edit', { title: 'New Page', page: models.Page.build(data) }); }); /* GET edit page */ router.get('/:id/edit', function(req, res, next) { models.Page.find({ where: { id: req.params.id } }).then(function(page) { if (!page) { return next(); } res.render('admin/pages/edit', { title: 'Edit Page', page: page }); }); }); /* PUT update page */ router.put('/:id', function(req, res, next) { models.Page.find(req.params.id).then(function(page) { if (!page) { return next(); } page.updateAttributes({ title: req.body.title, url: req.body.url, content: req.body.content || null, enabled: !!req.body.enabled }).then(function() { req.flash('success', 'The page has been saved!'); }).catch(function(err) { req.flash('danger', err.errors[0].message); }).finally(function() { res.redirect('/admin/pages/' + req.params.id + '/edit'); }); }); }); /* GET confirm navigation item delete */ router.get('/:id/delete', function(req, res, next) { models.Page.find(req.params.id).then(function(page) { if (!page) { return next(); } res.render('admin/pages/delete', {title: 'Delete Page', page:page}); }); }); /* DELETE delete page */ router.delete('/:id', function(req, res, next) { models.Page.find(req.params.id).then(function(page) { if (!page) { return next(); } page.destroy().then(function(result) { req.flash('success', 'The page has been deleted!'); res.redirect('/admin/pages'); }); }); }); module.exports = router;
import React, { PropTypes } from 'react'; export default class MapLayersPicker extends React.Component { static propTypes = { title: PropTypes.string, layers: PropTypes.array.isRequired, onLayerChange: PropTypes.func }; static defaultProps = { title: 'Map Layers' }; constructor (props) { super(props); } render () { return ( <div className='map-layers-picker'> <div className='map-layers-picker-section'> <div className='map-layers-picker-header'>{ this.props.title }</div> { this.props.layers.map(layer => this.renderCheckbox(layer)) } </div> </div> ); } handleChange (key, checked) { console.log({ key, checked }); if (this.props.onLayerChange) { this.props.onLayerChange(key, checked); } } renderCheckbox (config) { let { key, name, icon, iconSize, iconType, checked } = config; iconType = iconType || ''; return ( <div className='map-layers-picker-checkbox' key={ key }> { icon ? <svg width={ iconSize[0] } height={ iconSize[1] } className={ `${ iconType } ${ key } ${ checked ? '' : 'off' }` } onClick={ e => this.handleChange(key, !checked) } > <use xlinkHref={ '#' + icon } /> </svg> : null } <input className={ icon ? 'hidden' : '' } type='checkbox' id={ key } onChange={ e => this.handleChange(key, e.target.checked) } checked={ checked } /> <label htmlFor={ key } className={ iconType } dangerouslySetInnerHTML={{ __html: decodeURIComponent(name) }}></label> { this.props.children } </div> ); } }
'use strict'; module.exports = cacheMkdirP var path = require('path') function cacheMkdirP(mkdirP) { var cache = new MkdirPCache(mkdirP) return cache.mkdirP.bind(cache) } function MkdirPCache(mkdirP) { this._mkdirP = mkdirP this._dirMarks = {} } MkdirPCache.prototype.mkdirP = function (dir, opts, cb) { if (!cb) { cb = opts opts = {} } dir = path.resolve(dir) if (this._dirMarks.hasOwnProperty(dir)) return process.nextTick(cb.bind(null, null)) var self = this this._mkdirP(dir, opts, function (err) { if (err) return cb(err) self._dirMarks[dir] = true return cb(null) }) }
var Mediador = require("../mediador") var YourClass = function () {} YourClass.prototype.on = Mediador.prototype.on YourClass.prototype.off = Mediador.prototype.off YourClass.prototype.emit = Mediador.prototype.emit var yourInstance = new YourClass() var listener = function (you) { console.log(you + " already firing events!") } yourInstance.on("event", listener) yourInstance.emit("event", ["Me"]) yourInstance.off("event", listener)
'use strict' const yo = require('yo-yo') const menu = (currentCat, allCats, setCat, clearCat) => yo ` <ul> ${allCats.map((cat) => { const onClick = (e) => { e.preventDefault() e.stopPropagation() if (currentCat === cat) clearCat() else setCat(cat) } return yo ` <li class="${currentCat === cat ? 'active' : ''}"> <a href="#" role="button" aria-haspopup="true" onclick=${onClick}>${cat}</a> </li>` })} <ul>` const noop = () => {} let dom = menu(null, [], noop, noop) document.querySelector('#menu').appendChild(dom) const render = (currentCat, allCats, setCat, clearCat) => { const newDom = menu(currentCat, allCats, setCat, clearCat) yo.update(dom, newDom) } module.exports = render
// By default we create a single styles file, containing both vendor and app styles. // If you wanted to, you can easily break them into 2 by adding vendor entry point to webpack config and removing the // import here. import './vendor'; // Include main styles from scss import './main.scss';
// ignore most things var IgnoreFile = require("../") , path = require('path') // set the ignores just for this test var c = require("./common.js") c.ignores({ ".ignore": ["*", "a", "c", "!a/b/c/.abc", "!/c/b/a/cba"] }) // the only files we expect to see var expected = [ "/a/b/c/.abc" , "/a" , "/a/b" , "/a/b/c" , "/c/b/a/cba" , "/c" , "/c/b" , "/c/b/a" ].map(path.normalize) require("tap").test("basic ignore rules", function (t) { t.pass("start") IgnoreFile({ path: __dirname + "/fixtures" , ignoreFiles: [".ignore"] }) .on("child", function (e) { var p = e.path.substr(e.root.path.length) var i = expected.indexOf(p) if (i === -1) { t.fail("unexpected file found", {f: p}) } else { t.pass(p) expected.splice(i, 1) } }) .on("close", function () { t.notOk(expected.length, "all expected files should be seen") t.end() }) })
/*global __DEV__ */ import React from 'react'; import { render } from 'react-dom'; import { Provider } from 'react-redux'; import App from 'containers//App'; import configureStore from './store/configureStore'; import DevTools from 'containers//DevTools'; require('normalize.css'); require('styles//App.sass'); let initialState; if(window.hasOwnProperty('__DATA__')) { initialState = window.__DATA__; } const store = configureStore(initialState); const rootElement = document.getElementById('app'); if(__DEV__) { render( <Provider store={store} key="provider"> <div> <App /> <DevTools /> </div> </Provider>, rootElement ); } else { render( <Provider store={store}> <App /> </Provider>, rootElement ); }
import request from 'request'; import xml2js from 'xml2js'; import util from 'util'; import Promise from 'promise'; export default function boardGames(app) { app.get('/api/board-games?', function(req, res) { try { let minDate = new Date(2015, 0, 1); let maxDate = new Date(2018, 0, 1); if(!req.query.username) { res.status(400).send('Username query parameter required.') } // if(req.query.mindate) { // minDate = req.query.mindate; // } else { // minDate.setMonth(0); // minDate.setDate(1); // } fetchBoardGameStats(req.query.username, minDate, maxDate) .then(function(result) { res.status(200).send(result); }); } catch(err) { res.status(500).send(err); } }); } function fetchBoardGameStats(username, minDate, maxDate) { return new Promise(function(resolve, reject) { new Promise.all( [ fetchPlays(username, minDate, maxDate), fetchCollection(username, minDate, maxDate) ] ).done(function(results){ let allPlays = calculateAllPlays(results[0]); let allCollection = results[1]; resolve({ '10x10': get10x10(allPlays), '100x1': get100x1(allPlays), 'wallOfShame': getWallOfShame(allPlays, allCollection) }); }); }); } function getWallOfShame(plays, collection) { let shame = []; if(!plays || !collection) { return []; } for(var game in collection) { let hasPlayed = false; for(var i = 0; i < plays.length; i++) { if(plays[i].name === game) { hasPlayed = true; break; } } if(!hasPlayed) { shame.push({game: game, image: collection[game]}); } } return { number: shame.length, games: shame }; } function get10x10(sortedPlays) { let length = 10; if(!sortedPlays || !(sortedPlays instanceof Array)) { return []; }; if(sortedPlays.length < length) { length = sortedPlays.length; } return { number: length, plays: sortedPlays.slice(0, 10) }; } function get100x1(sortedPlays) { let length = 100; if(!sortedPlays) { return []; }; if(sortedPlays.length < length) { length = sortedPlays.length; } return { number: length, plays: sortedPlays.slice(0, 100) }; } function playSort(play1, play2) { if(play1.plays < play2.plays) { return 1; } if(play1.plays > play2.plays) { return -1; } return 0; } function calculateAllPlays(plays) { let allPlays = {}; if(!plays) { return {}; } for(var i = 0; i < plays.length; i++) { let gameName = plays[i].item[0].$.name; if(allPlays[gameName] === undefined || allPlays[gameName] === NaN) { allPlays[gameName] = 1; } else { allPlays[gameName] += 1; } } let playsArray = []; for(var name in allPlays) { playsArray.push({name: name, plays: allPlays[name]}) } return playsArray.sort(playSort); } function fetchPlays(username, minDate, maxDate) { return new Promise(function(resolve, reject) { let allPlays = []; fetchPlaysByPage(username, minDate, maxDate, 1) .then(function (result) { allPlays = result.plays.play; let totalPlays = result.plays.$.total; if(totalPlays > 100) { let numPages = Math.ceil(totalPlays / 100); let promiseCalls = []; for(var i = 2; i <= numPages; i++) { promiseCalls.push(fetchPlaysByPage(username, minDate, maxDate, i)); } new Promise.all(promiseCalls).done(function(results) { for(var j = 0; j < results.length; j++) { for(var k = 0; k < results[j].plays.play.length; k++) { allPlays.push(results[j].plays.play[k]); } } resolve(allPlays); }); } else { resolve(allPlays); } }); }); } function fetchPlaysByPage(username, minDate, maxDate, page) { return new Promise(function(resolve, reject) { let minDateString = minDate.toISOString().substring(0, 10); let maxDateString = ''; if(maxDate) { maxDateString = maxDate.toISOString().substring(0, 10); } request.get({ url: `https://boardgamegeek.com/xmlapi2/plays?username=${username}&page=${page}&subtype=boardgame` }, function(err, http, res) { xml2js.Parser().parseString(res, function(error, result) { resolve(result); }); }); }); } function fetchCollection(username) { return new Promise(function(resolve, reject) { request.get({ url: `https://boardgamegeek.com/xmlapi2/collection?username=${username}&subtype=boardgame` }, function(err, http, res) { if(http.statusCode === 202) { resolve(fetchCollection(username)); } else { xml2js.Parser().parseString(res, function(error, result) { resolve(formatCollection(result.items.item)); }); } }); }); } function formatCollection(collection) { let fullCollection = {}; if(collection) { for(var i = 0; i < collection.length; i++) { if(collection[i].status[0].$.own === '1') { let name = collection[i].name[0]._; let image = collection[i].image[0]; fullCollection[name] = image; } } } return fullCollection; }
version https://git-lfs.github.com/spec/v1 oid sha256:60fe92ac860ec76faf13530db2255b366e1981dc01a248f77723c030070fdfd4 size 28903
MainTablet.widgets = { varNavItems: ["wm.Variable", {"isList":true,"json":"[{\"dataValue\":\"CreateShipmentDD\"},{\"dataValue\":\"GetLabelDD\"},{\"dataValue\":\"DeleteShipmentDD\"}]","type":"StringData"}, {}], navCallInformation: ["wm.NavigationCall", {"operation":"gotoPageContainerPage"}, {}, { input: ["wm.ServiceInput", {"type":"gotoPageContainerPageInputs"}, {}, { binding: ["wm.Binding", {}, {}, { wire: ["wm.Wire", {"expression":"\"Information\"","targetProperty":"pageName"}, {}], wire1: ["wm.Wire", {"expression":undefined,"source":"pagContainer","targetProperty":"pageContainer"}, {}] }] }] }], varResultByNavItems: ["wm.Variable", {"dataSet":"","type":"StringData"}, {}, { binding: ["wm.Binding", {}, {}, { wire: ["wm.Wire", {"expression":undefined,"source":"lstNavigation.selectedItem.dataValue","targetProperty":"dataSet.dataValue"}, {}] }] }], navCallCreateShipmentDD: ["wm.NavigationCall", {"operation":"gotoPageContainerPage"}, {}, { input: ["wm.ServiceInput", {"type":"gotoPageContainerPageInputs"}, {}, { binding: ["wm.Binding", {}, {}, { wire: ["wm.Wire", {"expression":"\"CreateShipmentDD\"","targetProperty":"pageName"}, {}], wire1: ["wm.Wire", {"expression":undefined,"source":"pagContainer","targetProperty":"pageContainer"}, {}] }] }] }], navCallGetShipmentDD: ["wm.NavigationCall", {"operation":"gotoPageContainerPage"}, {}, { input: ["wm.ServiceInput", {"type":"gotoPageContainerPageInputs"}, {}, { binding: ["wm.Binding", {}, {}, { wire: ["wm.Wire", {"expression":"\"GetLabelDD\"","targetProperty":"pageName"}, {}], wire1: ["wm.Wire", {"expression":undefined,"source":"pagContainer","targetProperty":"pageContainer"}, {}] }] }] }], navCallDeleteShipmentDD: ["wm.NavigationCall", {"operation":"gotoPageContainerPage"}, {}, { input: ["wm.ServiceInput", {"type":"gotoPageContainerPageInputs"}, {}, { binding: ["wm.Binding", {}, {}, { wire1: ["wm.Wire", {"expression":undefined,"source":"pagContainer","targetProperty":"pageContainer"}, {}], wire: ["wm.Wire", {"expression":"\"DeleteShipmentDD\"","targetProperty":"pageName"}, {}] }] }] }], lbxMain: ["wm.Layout", {"deviceSizes":null,"enableTouchHeight":true,"horizontalAlign":"left","styles":{},"verticalAlign":"top"}, {}, { pnlDesktop: ["wm.Panel", {"deviceType":["tablet"],"height":"100%","horizontalAlign":"left","layoutKind":"left-to-right","verticalAlign":"top","width":"100%"}, {}, { pnlLeft: ["wm.Panel", {"deviceSizes":null,"deviceType":["tablet"],"height":"100%","horizontalAlign":"left","verticalAlign":"top","width":"270px"}, {}, { lstNavigation: ["wm.List", {"_classes":{"domNode":["GridListStyle","MobileListStyle"]},"border":"1","columns":[ {"show":true,"field":"dataValue","title":"Geschäftskundenversand API","width":"100%","align":"left","formatFunc":"","mobileColumn":false}, {"show":false,"field":"PHONE COLUMN","title":"-","width":"100%","align":"left","expression":"\"<div class='MobileRowTitle'>\" +\n\"Geschäftskundenversand API: \" + ${dataValue} +\n\"</div>\"\n\n","mobileColumn":true}, {"show":true,"controller":"rightarrow","width":"20px","title":"-","field":"_rightArrow","mobileColumn":true} ],"deviceSizes":null,"deviceType":["tablet"],"height":"100%","isNavigationMenu":false,"minDesktopHeight":60,"primaryKeyFields":["dataValue"],"rightNavArrow":true,"scrollToSelection":true,"styleAsGrid":false,"styles":{}}, {"onSelect":"lstNavigationSelect"}, { binding: ["wm.Binding", {}, {}, { wire: ["wm.Wire", {"expression":undefined,"source":"varNavItems","targetProperty":"dataSet"}, {}] }] }] }], pnlDetail: ["wm.Panel", {"deviceType":["tablet"],"height":"100%","horizontalAlign":"left","verticalAlign":"top","width":"100%"}, {}, { pnlDetailTop: ["wm.Panel", {"deviceType":["tablet"],"height":"35px","horizontalAlign":"left","layoutKind":"left-to-right","verticalAlign":"top","width":"100%"}, {}, { edtShipmentNr: ["wm.Text", {"caption":"ShipmentNr","dataValue":"","deviceType":["tablet"],"displayValue":"","emptyValue":"emptyString","height":"100%","helpText":undefined,"placeHolder":"Number for DD-Services","width":"343px"}, {}] }], pagContainer: ["wm.PageContainer", {"deferLoad":true,"deviceType":["tablet"],"styles":{}}, {}], pnlDetailButtom: ["wm.Panel", {"deviceType":["tablet"],"height":"40px","horizontalAlign":"center","layoutKind":"left-to-right","verticalAlign":"top","width":"100%"}, {}, { btnInfo: ["wm.Button", {"caption":"About","deviceType":["tablet"],"height":"100%","margin":"4"}, {"onclick":"navCallInformation","onclick1":"btnInfoClick1"}] }] }] }] }] }
function couchapp_load(scripts) { for (var i=0; i < scripts.length; i++) { document.write('<script src="'+scripts[i]+'"><\/script>') }; }; couchapp_load([ '/_utils/script/sha1.js', '/_utils/script/json2.js', '/_utils/script/jquery.js', '/_utils/script/jquery.couch.js', '/_utils/script/jquery.form.js', '/_utils/script/jquery.dialog.js', 'vendor/couchapp/jquery.couch.app.js', 'vendor/couchapp/jquery.couch.app.util.js', 'vendor/couchapp/jquery.mustache.js', 'vendor/couchapp/jquery.evently.js', 'vendor/couchapp/jquery.couchLogin.js', 'vendor/couchapp/jquery.couchProfile.js', 'vendor/couchapp/jquery.class.js', 'vendor/couchapp/md5.js', ]);
'use strict'; /** * Colstudent Schema */ var mongoose = require('mongoose'), Schema = mongoose.Schema; var ColstudentSchema = new Schema({ LastName: {type: String, required: true} , FirstName: {type: String, required: true} , MAT251CalcI: { type: String}, MAT252CalcII: { type: String}, MAT320DiscreteMath: { type: String}, CPS210CompSciI: { type: String}, CPS310CompSciII: { type: String}, CPS315CompSciIII: { type: String}, CPS352OOP: { type: String}, CPS330AssemblyArch: { type: String}, CPS353SoftEng: { type: String}, CPS415DiscContAlgorithms: { type: String}, CPS340OpSys: { type: String}, CPS425LangProcessing: { type: String}, CPS493Elect1: { type: String}, CPS493Projects: { type: String}, EGC230DigLogic: { type: String}, EGC208DigLogicLab: { type: String}, SCIENCEI: { type: String}, SCIENCEII: { type: String}, SCIENCEICOMMENT: { type: String}, SCIENCEIICOMMENT: { type: String}, EGC208DigLogicLabCOMMENT: { type: String}, EGC2230DigLogicCOMMENT: { type: String}, CPS493ProjectsCOMMENT: { type: String}, CPS493Elect1COMMENT: { type: String}, CPS425LangProcessingCOMMENT: { type: String}, CPS340OpSysCOMMENT:{ type: String}, CPS415DiscContAlgorithmsCOMMENT: { type: String}, CPS353SoftEngCOMMENT: { type: String}, CPS330AssemblyArchCOMMENT: { type: String}, CPS352OOPCOMMENT: { type: String}, CPS315CompSciIIICOMMENT: { type: String}, CPS310CompSciIICOMMENT: { type: String}, CPS210CompSciICOMMENT: { type: String}, MAT320DiscreteMathCOMMENT:{ type: String}, MAT252CalcIICOMMENT:{ type: String}, MAT251CalcICOMMENT:{ type: String} }); /* Returns the student's full name with last name first * followed by first name * For instance, "Smith, John */ /**schema.virtual('wholeName').get(function() { return this.LastName +','+''+ this.FirstName; }); */ mongoose.model('Colstudent', ColstudentSchema);
module.exports = { environments: [ { extension: 'js', testNameSuffix: '.test', testDir: 'src', sourceDir: 'src', testRunnerCommand: { command: 'echo "I test thee"' }, }, ], };
module.exports = { "src_folders": [ "tests" // tests are stored here ], "output_folder": "./reports", // reports (test outcome) output by nightwatch "selenium": { // downloaded by selenium-download module (see readme) "start_process": true, // tells nightwatch to start/stop the selenium process "server_path": "node_modules/selenium-server/lib/runner/selenium-server-standalone-3.1.0.jar", "host": "127.0.0.1", "port": 4444, // standard selenium port "cli_args": { // chromedriver is downloaded by selenium-download (see readme) "webdriver.chrome.driver" : "node_modules/.bin/chromedriver" } }, "test_settings": { "default": { "screenshots": { "enabled": true, // if you want to keep screenshots "path": './screenshots' // save screenshots here }, "globals": { "waitForConditionTimeout": 5000 // sometimes internet is slow so wait. }, "desiredCapabilities": { // use Chrome as the default browser for tests "browserName": "chrome" } }, "chrome": { "desiredCapabilities": { "browserName": "chrome", "javascriptEnabled": true // set to false to test progressive enhancement } } } }
var lazyAss = require('lazy-ass'); var check = require('check-types'); var fs = require('fs.extra'); var Comment = require('./Comment'); var preprocess = require('./preprocess'); var postprocess = require('./postprocess').comments; var dox = require('./dox'); function getComments(source) { lazyAss(check.unemptyString(source), 'missing source', source); var cleaned = preprocess(source); var parsingOptions = { raw: false }; // console.log(cleaned); var comments = dox.parseComments(cleaned, parsingOptions); if (!check.array(comments)) { console.error('could not extract comments from source'); comments = []; } // console.dir(comments); comments = postprocess(comments); return comments; } function getTaggedComments(inputFiles) { if (check.string(inputFiles)) { inputFiles = [inputFiles]; } lazyAss(check.array(inputFiles), 'missing input filenames', inputFiles); var api = []; inputFiles.forEach(function (filename) { var fileApi = getFileApi(filename); lazyAss(check.array(api), 'could not get api array from', filename); api = api.concat(fileApi); }); return api; } function keepFilename(comments, filename) { return comments.map(function (aComment) { aComment.filename = filename; return aComment; }); } function makeComments(comments) { return comments.map(function (rawComment) { return new Comment(rawComment); }); } function getFileApi(filename) { lazyAss(check.unemptyString(filename), 'missing filename', filename); var contents = fs.readFileSync(filename, 'utf-8'); lazyAss(check.string(contents), 'could not load contents of', filename); var raw = getComments(contents); lazyAss(check.array(raw), 'could not get tags array from', filename); raw = keepFilename(raw, filename); var comments = makeComments(raw); return comments; } function getSamples(inputFiles) { if (check.string(inputFiles)) { inputFiles = [inputFiles]; } lazyAss(check.array(inputFiles), 'missing input filenames'); var docs = getTaggedComments(inputFiles); // console.dir(docs); var samples = docs.filter(function (comment) { return comment.isSample(); }); return samples; } module.exports = { getCommentsFromFiles: getTaggedComments, getComments: getComments, getSampleTests: getSamples };
/** * @author Javier Valencia Romero <javiervalenciaromero@gmail.com> * @copyright Javier Valencia Romero * @license {@link https://github.com/jvalen/prototypePacman/blob/master/license.txt|MIT License} */ /** * Keyboard class constructor * * @class Controls.Keyboard * @constructor */ var Controls = Controls || {}; Controls.Keyboard = function() { this.KEYS = { LEFT: 37, RIGHT: 39, UP: 38, DOWN: 40 }; this.keyState = {}; var _this = this; //Private methods called by the event listener this._onKeyDown = function (event) { event.preventDefault(); return _this.processKeyDown(event); }; this._onKeyUp = function (event) { return _this.processKeyUp(event); }; //Creates the event listeners window.addEventListener('keydown', this._onKeyDown, false); window.addEventListener('keyup', this._onKeyUp, true); }; Controls.Keyboard.prototype = { /** * Keep track when the key is down * @method Controls.Keyboard#processKeyDown * @param {object} event */ processKeyDown: function(event) { this.keyState[event.keyCode] = true; }, /** * Keep track when the key is up * @method Controls.Keyboard#processKeyUp * @param {object} event */ processKeyUp: function(event) { this.keyState[event.keyCode] = false; }, /** * Returns true if the key is down * @method Controls.Keyboard#isDown * @param {number} keycode * @return {boolean} */ isDown: function (keyCode) { return this.keyState[keyCode] === true; } }; Controls.Keyboard.prototype.constructor = Controls.Keyboard;
import React, { Component } from 'react'; import { Text, View } from 'react-native'; import { connect } from 'react-redux'; import styles from '../styles'; export const Attempts = (props) => { const { attempts } = props; const renderLetter = (letterWithScore, idx) => { let style = styles.attemptLetter; if (letterWithScore.score === 2) { style = styles.attemptLetterOnRightLocation; } else if (letterWithScore.score === 1) { style = styles.attemptLetterOnOtherLocation; } return (<Text style={ style } key={ idx }>{ letterWithScore.letter }</Text>) }; const renderAttempt = (attempt, attemptId) => { const letters = attempt.word.split(''); const lettersWithScore = letters.map((elem, index) => { return { letter: elem, score: attempt.score[index] } }); return ( <View style={ styles.attempt } key={ attemptId }> { lettersWithScore.map((elem, index) => renderLetter(elem, `${attemptId}.${index}`)) } </View> ); }; return ( <View style={ styles.attempts }> { attempts.map(renderAttempt) } </View> ); }; const mapStateToProps = (state) => { return { attempts: state.game.attempts }; }; const mapDispatchToProps = (dispatch) => { return { }; }; /** * Props: * attempts: [{ * word: string * }] */ export default connect(mapStateToProps, mapDispatchToProps)(Attempts);
import React from 'react'; import './sidebar.css'; const Sidebar = props => { return( <div className="sidebar"> </div> ); } export default Sidebar;
// // Drawphone // import Game from "./game.js"; class Drawphone { constructor(devModeEnabled) { this.games = []; this.locked = false; this.minutesUntilRestart; //add the dev game if (devModeEnabled) { this.newGame("ffff"); } } newGame(forceCode) { if (this.locked) return false; let newCode; if (forceCode) { newCode = forceCode; } else { newCode = this.generateCode(); } const newGame = new Game(newCode, () => { //will be ran when this game has 0 players left this.removeGame(newCode); }); this.games.push(newGame); return newGame; } findGame(code) { if (!code || code.length !== 4) return false; for (let i = 0; i < this.games.length; i++) { if (this.games[i].code === code.toLowerCase()) { return this.games[i]; } } return false; } generateCode() { let code; do { //generate 4 letter code code = ""; const possible = "abcdefghijklmnopqrstuvwxyz"; for (let i = 0; i < 4; i++) { code += possible.charAt( Math.floor(Math.random() * possible.length) ); } //make sure the code is not already in use } while (this.findGame(code)); return code; } removeGame(code) { const game = this.findGame(code); const index = this.games.indexOf(game); if (index > -1) { this.games.splice(index, 1); } } lock() { this.locked = true; this.minutesUntilRestart = 16; const interval = setInterval(() => { this.minutesUntilRestart--; if (this.minutesUntilRestart <= 0) { clearInterval(interval); } }, 1000 * 60); // every minute } } export default Drawphone;
var path = require('path') var webpack = require('webpack') var ExtractTextPlugin = require('extract-text-webpack-plugin'); var HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = { entry: { vendor: ['react','redux','react-redux','react-router'], bundle: './src/index' }, output: { path: path.join(__dirname, 'build'), filename: '[hash:8].[name].js', }, plugins: [ new webpack.DefinePlugin({ 'process.env':{ 'NODE_ENV': JSON.stringify('production') } }), new webpack.optimize.OccurenceOrderPlugin(), new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } }), new webpack.optimize.CommonsChunkPlugin({ name: "vendor", //filename:"vendor.js", minChunks: Infinity //Infinity }), new ExtractTextPlugin('[hash:8].style.css', { allChunks: true }), new HtmlWebpackPlugin({ favicon:'./src/favicon.ico', title: "Julian's blog", template: path.join(__dirname,'src/template.html'), //模板文件 inject:'body', hash:false, //为静态资源生成hash值 minify:{ //压缩HTML文件 removeComments:false, //移除HTML中的注释 collapseWhitespace:true //删除空白符与换行符 } }), ], module: { loaders: [{ test: /\.js$/, loaders: [ 'babel' ], exclude: /node_modules/, include: path.join(__dirname,'src') }, { test: /\.(css|scss)$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader?sourceMap!sass-loader?sourceMap&includePaths[]=' + path.resolve(__dirname, "./node_modules/compass-mixins/lib") ) }, { test: /\.(jpe?g|png|gif)$/i, loaders: [ 'url?limit=10000&name=images/[hash:8].[name].[ext]', 'image-webpack?{progressive:true, optimizationLevel: 7, interlaced: false, pngquant:{quality: "65-90", speed: 4}}' ] },{ test: /\.(woff|woff2|ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url?limit=10000&name=fonts/[hash:8].[name].[ext]' } ] }, resolve: { root: path.resolve(__dirname, 'node_modules'), extensions: ['','.js','.scss'] } }
'use babel'; import utils from '../utils'; class SQLMetaProvider { constructor() { this.selector = '.source.sql, .source.pgsql'; this.disableForSelector = '.source.sql .string, .source.sql .comment' this.filterSuggestions = true; atom.config.observe( // called immediately and on update 'autocomplete-plus.minimumWordLength', (newValue) => this.minimumWordLength = newValue ) } getSchemaNames(editor, search) { let items = editor.dataAtomSchemata || []; if (items.length == 0) return []; return items.map((item) => { return { text: item.name, rightLabelHTML: `<span class="data-atom autocomplete"></span>${item.type}` }; }); } getTableNames(editor, tableSearch, schema) { let tables = editor.dataAtomTables || []; if (tables.length == 0) return []; let results = tables.filter((table) => { if (schema) return table.schemaName === schema; else return true; }); return results.map((table) => { return { text: table.name, displayText: (schema || table.schemaName === editor.defaultSchema) ? table.name : table.schemaName + '.' + table.name, rightLabelHTML: `<span class="data-atom autocomplete autocomplete-tbl"></span>${table.type}` }; }); } getColumnNames(editor, columnSearch, objectName) { let columns = editor.dataAtomColumns || []; if (columns.length == 0) return []; let valid = columns.filter((col) => { if (objectName) return col.tableName === objectName; else return true; }); return valid.map((col) => { return { text: col.name, rightLabelHTML: '<span class="data-atom autocomplete autocomplete-col"></span>Column', leftLabel: col.type || col.udt }; }); } getAliasedObject(editor, lastIdentifier) { let query = editor.getBuffer().getTextInRange(utils.getRangeForQueryAtCursor(editor)); let matches = query.match(new RegExp('([\\w0-9]*)\\s*(?:AS)?\\s*' + lastIdentifier + '[\\s;]', 'i')); if (matches) { return matches[matches.length - 1]; } else { return null; } } getPrefix(editor, bufferPosition) { let line = editor.getTextInRange([[bufferPosition.row, 0], bufferPosition]); let matches = line.match(/[\w\.]+$/); if (matches) { return matches[0] || ''; } else { return ''; } } getSuggestions({editor, bufferPosition, scopeDescriptor}) { return new Promise(resolve => { let prefix = this.getPrefix(editor, bufferPosition); let identifiers = prefix.split('.'); let identsLength = identifiers.length; let results = []; let lastIdentifier = (identsLength > 1) && identifiers[identsLength - 2]; let search = identifiers[identsLength - 1]; if (search.length < this.minimumWordLength) return []; results = this.getColumnNames(editor, search, lastIdentifier).concat(this.getTableNames(editor, search, lastIdentifier)); if (!lastIdentifier) results = results.concat(this.getSchemaNames(editor, search)); // If there are no results, check for alias if (!results.length) { let tableName = this.getAliasedObject(editor, lastIdentifier); if (tableName) { // Get by matched alias table results = this.getColumnNames(editor, search, tableName); } } resolve(results); }); } } export default new SQLMetaProvider();
$(function(){ var swiper = new Swiper('.swiper-container', { pagination: '.swiper-pagination', paginationClickable: true, slidesPerView : 3, slidesPerGroup : 3 }); })
var utils = require('../src/utils'); var key = require('../src/rudiments').key; var scale = require('../src/rudiments').scale; var ensemble = require("../src/instruments/ensemble"); var instruments = require("../src/instruments/instruments"); var stringQuartet = ensemble.stringQuartet; var performer = ensemble.stringQuartet.performers.sacconi.individual; var players = utils.playersFromEnsemble(stringQuartet, performer, true); utils.addPlayer(players, instruments.piano, 'piano1'); utils.addPlayer(players, instruments.piano, 'piano2',5); var rules = { v1a: ' >e F ', v1b: ' cD ', v1c: ' BC^///DE^', v1d: ' Fd/+FGAg', v1e: ' 48,v1a 24,v1b 48,v1a 0:24, v1c v1f', v1f: ' 24,v1b v1d 1: 24,v1b v1d v1e', violin1: '{pizzicato} 0:24, v1e v1f ^', violin2:'v1b 0: 48,v1a v1d 0: 3@ v1a 24,v1c v1e 0@ v1f', c1a: '-1:24, cE^/G', c1b: '-1:48, g^//', c1c: '-1:48, /24,aB^', c1d: '-1:48, ////', c1e: 'c1a c1b v1c c1a c1c c1f', c1f: 'c1b c1d c1b v1a v1b v1a c1d c1e', cello: '{pizzicato} c1e c1f ^', p1e: '12, v1a 24,v1b 12,v1a 0: v1c v1f', p1f: '12, v1b {pedaldown} v1d 48, 1: v1b 24, v1d {pedalup} v1e', piano1: '0: 12, p1e p1f', piano2: '3@ 12, p1f p1e ' }; var conductor = { 1: scale.cblues + ' 144=T', 17: scale.fblues, 25: scale.cblues, 33: scale.gblues, 37: scale.fblues, 41: scale.gblues, 45: scale.fblues, 49: scale.gblues, 53: scale.fblues, 58: scale.cblues }; utils.addRudiments(rules); module.exports = { players: players, rules: rules, conductor: conductor };
'use strict'; // ============================================================================= // var declaration // ============================================================================= var mongoose = require('mongoose'), Performance = mongoose.model('Performance'), SystemConfig = mongoose.model('SystemConfig'); // ============================================================================= // helper function declaration // ============================================================================= var savePerformance = function(persistensiPerformance, jumlahEvent, jumlahEventHadir) { persistensiPerformance.kriteriaPersistensi.jumlahEvent = jumlahEvent; persistensiPerformance.kriteriaPersistensi.jumlahEventHadir = jumlahEventHadir; // persistensiPerformance.kriteriaPersistensi.kriteriaValue = (parseInt(jumlahEventHadir) / 4); persistensiPerformance.save(); }; // var updatePerformance = function(resourceId, jumlahEvent, jumlahEventHadir,year,pengali) { Performance.findOne({resource: resourceId, year:year, isEvent:true}).exec(function(err, persistensiPerformance) { if(!err) { if(persistensiPerformance ===undefined || persistensiPerformance === null){ persistensiPerformance = new Performance({ resource:resourceId, year:year, isEvent:true, rumusAkhir:pengali }); } savePerformance(persistensiPerformance, jumlahEvent, jumlahEventHadir); } }); }; var findSystemConfigPengaliPerformance = function(resourceId, jumlahEvent, jumlahEventHadir,year) { SystemConfig.findOne({key: SystemConfig.PENGALI_PERFORMANCE}, function(err, systemConfig) { if(!err) { var pengali = systemConfig.value; updatePerformance(resourceId, jumlahEvent, jumlahEventHadir,year,pengali); } }); }; // ============================================================================= // exported function declaration // ============================================================================= exports.do = function(req, res) { var resourceId = req.body.resource; var jumlahEvent = req.body.kriteriaPersistensi.jumlahEvent; var jumlahEventHadir = req.body.kriteriaPersistensi.jumlahEventHadir; var year = req.body.year; //var kriteriaValue = (parseInt(jumlahEventHadir) / parseInt(jumlahEvent)); //console.log(resourceId); //console.log(jumlahEvent); //console.log(jumlahEventHadir); //console.log('test'); //updatePerformance(resourceId, jumlahEvent, jumlahEventHadir,year); findSystemConfigPengaliPerformance(resourceId, jumlahEvent, jumlahEventHadir,year); res.send(200); };
import * as userQueries from './queries'; import * as userMutations from './mutations'; export default { userQueries, userMutations, };
/** * Mi9Controller * * @description :: Server-side logic for managing mi9s * @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers */ module.exports = { /** * `Mi9Controller.index()` */ index: function(req, res) { //sails.log.debug(req.body) if (req.body == undefined || req.body.payload == undefined) { res.status(400) res.send({ "error": "Could not decode request: JSON parsing failed" }) } else { var json = [] for(var i in req.body.payload){ //sails.log.debug(i) var src = req.body.payload[i] if (src.episodeCount && src.episodeCount>0){ var obj = {} if(src.image && src.image.showImage){ obj.image = src.image.showImage } obj.slug = src.slug obj.title = src.title json.push(obj) } } return res.json({ response: json }); } } }
define({ "taskUrl": "Tehtävän URL-osoite", "setTask": "Määritä", "setTaskPopupTitle": "Määritä tehtävä", "validate": "Määritä", "inValidGPService": "Anna kelvollinen geoprosessointipalvelu.", "GPFeatureRecordSetLayerERR": "Anna geoprosessointipalvelu, jossa on vain GPFeatureRecordSetLayer-tyypin lähtöaineistoa.", "invalidInputParameters": "Syöteparametreja on alle 1 tai yli 3. Anna kelvollinen geoprosessointipalvelu.", "projectSetting": { "title": "Projektiasetukset", "note": "Huomautus: projektiasetukset ovat valinnaiset, koska määritetty käyttäjä voi tallentaa projektin haluamiinsa web-kartan karttatasoihin verkon käyttökatkoalueiden ja lähtöaineiston parametrien kanssa. Käyttäjä voi tallentaa muut tulosparametrit Syöte/Tulos-välilehden Tulos-ryhmästä.", "projectPolygonLayer": "Projektin aluekarttataso", "outputParameterName": "Tulosparametrin nimi", "projectPointLayer": "Projektin pistekarttataso", "selectLabel": "Valitse", "polygonLayerHelp": "<p>Seuraavia ehtoja vastaavat aluekarttatasot näytetään:<br/><ul><li>Karttatasossa on oltava muokkaustoiminnot eli Luo, Poista ja Päivitä</li><li>Karttatasossa on oltava kaksi kenttää, joissa on tarkat nimi- ja tietotyypit:</li><ul><li>nimi (String-tyypin kenttä)</li><li>globalid (GlobalID-tyypin kenttä)</li></ul></ul><p/>", "outputParameterHelp": "<p>Tehtävän URL-osoitteen tulosaineiston aluekarttatasot näytetään<p/>", "pointLayerHelp": "<p>Seuraavia ehtoja vastaavat pistekarttatasot näytetään:<br/><ul><li>Karttatasossa on oltava muokkaustoiminnot eli Luo, Poista ja Päivitä</li><li>Karttatasossa on oltava kaksi kenttää, joissa on tarkat nimi- ja tietotyypit:</li><ul><li>inputtype (String-tyypin kenttä)</li><li>projectid (GUID-tyypin kenttä)</li></ul></ul><p/>" }, "inputOutputTab": { "flag": "Lippu", "barrier": "Este", "skip": "Ohita", "title": "Syöte/Tulos", "inputSettingsLabel": "Syöteasetukset", "outputSettingsLabel": "Tulosasetukset", "inputLabel": "Tunnusteksti", "inputTooltip": "Työkalun ohje", "symbol": "Symboli", "typeText": "Tyyppi", "outputParametersText": "Tulosparametrit", "saveToLayerText": "Tallenna karttatasoon (valinnainen)", "skipText": "Ohitettavissa", "visibilityText": "Näkyvä", "exportToCsvText": "Vie CSV-tiedostoon", "exportToCsvDisplayText": "CSV", "settitngstext": "Asetukset", "addFieldTitle": "Lisää kenttä", "enterDisplayText": "Kirjoita näyttöteksti", "setScale": "Määritä mittakaava", "outputDisplay": "Näyttöteksti", "saveToLayerHelp": "<p>Seuraavia ehtoja vastaava karttataso näytetään:<br/><ul><li>Karttatasossa on oltava muokkaustoiminnot eli Luo, Poista ja Päivitä</li><li>Karttatasossa on oltava kaksi kenttää, joissa on nimi- ja tietotyypit:</li><ul><li>parametername (String-tyypin kenttä)</li><li>projectid (GUID-tyypin kenttä)</li></ul></ul><p/>" }, "summaryTab": { "title": "Yleiset asetukset", "summaryFieldsetText": "Yhteenvetoasetukset", "inputOutput": "Syöte/Tulos", "field": "Kenttä", "operator": "Laskutoimitus", "inputOperatorCountOption": "Lukumäärä", "outputOperatorCountOption": "Lukumäärä", "outputOperatorSkipCountOption": "OhitettavaMäärä", "fieldOperatorSumOption": "Summa", "fieldOperatorMinOption": "Vähimmäisarvo", "fieldOperatorMaxOption": "Enimmäisarvo", "fieldOperatorMeanOption": "Keskiarvo", "expressionAddButtonText": "Lisää", "expressionVerifyButtonText": "Tarkasta", "summaryEditorText": "Yhteenvetoteksti", "autoZoomAfterTrace": "Lisävalinnat", "zoomText": "Automaattinen tarkennus jäljityksen jälkeen", "summarSettingTooltipText": "Lisää lähtöaineiston/tulosaineiston määrä" }, "validationErrorMessage": { "webMapError": "Web-kartassa ei ole karttatasoja. Valitse kelvollinen web-kartta.", "inputTypeFlagGreaterThanError": "Lipputyypin syötteitä ei voi olla yhtä enempää.", "inputTypeFlagLessThanError": "Vähintään yksi lipputyypin syöte on pakollinen.", "inputTypeBarrierErr": "Estetyypin syötteitä ei voi olla yhtä enempää.", "inputTypeSkipErr": "Ohitustyypin syötteitä ei voi olla yhtä enempää.", "displayTextForButtonError": "Suorita-painikkeen näyttöteksti ei voi olla tyhjä.", "UnableToLoadGeoprocessError": "Geoprosessointipalvelua ei voi ladata.", "invalidSummaryExpression": "Virheellinen lauseke.", "validSummaryExpression": "Onnistui!", "invalidProjectSettings": "Virheelliset projektiasetukset.<br/> Valitse kelvollinen arvo asetuksessa ${projectSetting}." }, "hintText": { "labelTextHint": "Vihje: määritä tulosparametrin tulosruudussa näytettävä tunnusteksti.", "displayTextHint": "Vihje: tämä näytetään tämän tulosparametrin Tiedot-ruudussa.", "inputTextHint": "Vihje: muodosta lausekkeesi yllä valitsemalla syöte, tulos ja kenttien nimet.", "expressionHint": "Vihje: muodosta lauseke valitsemalla kohteet ja napsauttamalla Lisää." } });
'use strict'; exports = module.exports = function(app, passport) { var LocalStrategy = require('passport-local').Strategy, TwitterStrategy = require('passport-twitter').Strategy, GitHubStrategy = require('passport-github').Strategy, FacebookStrategy = require('passport-facebook').Strategy, GoogleStrategy = require('passport-google-oauth').OAuth2Strategy, TumblrStrategy = require('passport-tumblr').Strategy; passport.use(new LocalStrategy( function(username, password, done) { var conditions = { isActive: 'yes' }; if (username.indexOf('@') === -1) { conditions.username = username; } else { conditions.email = username.toLowerCase(); } app.db.models.User.findOne(conditions, function(err, user) { if (err) { return done(err); } if (!user) { return done(null, false, { message: 'Unknown user' }); } app.db.models.User.validatePassword(password, user.password, function(err, isValid) { if (err) { return done(err); } if (!isValid) { return done(null, false, { message: 'Invalid password' }); } return done(null, user); }); }); } )); if (app.config.oauth.twitter.key) { passport.use(new TwitterStrategy({ consumerKey: app.config.oauth.twitter.key, consumerSecret: app.config.oauth.twitter.secret }, function(token, tokenSecret, profile, done) { done(null, false, { token: token, tokenSecret: tokenSecret, profile: profile }); } )); } if (app.config.oauth.github.key) { passport.use(new GitHubStrategy({ clientID: app.config.oauth.github.key, clientSecret: app.config.oauth.github.secret, customHeaders: { "User-Agent": app.config.projectName } }, function(accessToken, refreshToken, profile, done) { done(null, false, { accessToken: accessToken, refreshToken: refreshToken, profile: profile }); } )); } if (app.config.oauth.facebook.key) { passport.use(new FacebookStrategy({ clientID: app.config.oauth.facebook.key, clientSecret: app.config.oauth.facebook.secret }, function(accessToken, refreshToken, profile, done) { done(null, false, { accessToken: accessToken, refreshToken: refreshToken, profile: profile }); } )); } if (app.config.oauth.google.key) { passport.use(new GoogleStrategy({ clientID: app.config.oauth.google.key, clientSecret: app.config.oauth.google.secret }, function(accessToken, refreshToken, profile, done) { done(null, false, { accessToken: accessToken, refreshToken: refreshToken, profile: profile }); } )); } if (app.config.oauth.tumblr.key) { passport.use(new TumblrStrategy({ consumerKey: app.config.oauth.tumblr.key, consumerSecret: app.config.oauth.tumblr.secret }, function(token, tokenSecret, profile, done) { done(null, false, { token: token, tokenSecret: tokenSecret, profile: profile }); } )); } passport.serializeUser(function(user, done) { done(null, user._id); }); passport.deserializeUser(function(id, done) { app.db.models.User.findOne({ _id: id }).populate('roles.admin').populate('roles.account').populate('roles.dataEntryOperator').exec(function(err, user) { if (user && user.roles && user.roles.admin) { user.roles.admin.populate("groups", function(err, admin) { done(err, user); }); } else { done(err, user); } }); }); };
/*jslint node: true */ 'use strict'; // Gulp Dependencies var gulp = require('gulp'), rename = require('gulp-rename'); // Build Dependencies var transform = require('vinyl-transform'), browserify = require('browserify'), uglify = require('gulp-uglify'); // Style Dependencies var stylus = require('gulp-stylus'), notify = require('gulp-notify'), minifyCSS = require('gulp-minify-css'); // Development Dependencies var jshint = require('gulp-jshint'), browserSync = require('browser-sync'), reload = browserSync.reload; // Lint gulp.task('lint-client', function() { return gulp.src('./client/**/*.js') .pipe(jshint()) .pipe(jshint.reporter('default')); }); // Browserify gulp.task('browserify-client', ['lint-client'], function() { var browserified = transform(function(filename) { var b = browserify({ entries: filename, debug: true }); return b.bundle(); }); return gulp.src('client/js/main.js') .pipe(browserified) .pipe(rename('main.js')) .pipe(gulp.dest('public/js')); }); // Styles gulp.task('styles', function() { return gulp.src('./client/stylus/main.styl') .pipe(stylus().on('error', notify.onError(function(error) { return "Error:" + error.message; }))) .pipe(gulp.dest('public/css')) .pipe(browserSync.reload({ stream: true })); }); // Build gulp.task('minify', ['styles'], function() { return gulp.src('public/css/main.css') .pipe(minifyCSS()) .pipe(rename('main.min.css')) .pipe(gulp.dest('public/css')); }); // Uglify gulp.task('uglify', ['browserify-client'], function() { return gulp.src('public/js/main.js') .pipe(uglify()) .pipe(rename('main.min.js')) .pipe(gulp.dest('public/js')) .pipe(browserSync.reload({ stream: true })); }); // Watch gulp.task('watch', ['browserSync'], function() { gulp.watch('client/**/*.js', ['uglify']).on('change', reload); gulp.watch('client/**/*.styl', ['styles', 'minify']).on('change', reload); gulp.watch('views/*.hbs').on('change', reload); }); // Tasks gulp.task('default', ['uglify', 'minify']);
module.exports = function (grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json') }); grunt.loadNpmTasks('grunt-react'); grunt.initConfig({ react: { single_file_output: { files: { 'react/EEM/app.js': 'react/ownership/app.jsx' } }, dynamic_mappings: { files: [ { expand: true, cwd: 'react/ownership', src: ['**/*.jsx'], dest: 'react/ownership', ext: '.js' } ] } }, }) // task setup grunt.registerTask('default', ['react']); };